2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.aai.util.genxsd;
22 import static org.hamcrest.CoreMatchers.is;
24 import static org.junit.Assert.*;
26 import java.io.BufferedWriter;
28 import java.io.FileWriter;
29 import java.io.IOException;
30 import java.nio.charset.Charset;
31 import java.nio.file.Files;
32 import java.nio.file.Path;
33 import java.nio.file.Paths;
35 import org.junit.Before;
36 import org.junit.BeforeClass;
37 import org.junit.Test;
38 import org.onap.aai.AAISetup;
39 import org.onap.aai.config.SwaggerGenerationConfiguration;
40 import org.onap.aai.setup.SchemaVersion;
41 import org.onap.aai.setup.SchemaVersions;
42 import org.junit.runner.RunWith;
43 import org.onap.aai.edges.EdgeIngestor;
44 import org.onap.aai.nodes.NodeIngestor;
45 import org.onap.aai.setup.SchemaLocationsBean;
46 import org.onap.aai.testutils.TestUtilConfigTranslatorforEdges;
47 import org.slf4j.Logger;
48 import org.slf4j.LoggerFactory;
49 import org.springframework.beans.factory.annotation.Autowired;
50 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
51 import org.springframework.test.context.ContextConfiguration;
52 import org.springframework.test.context.TestPropertySource;
53 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
54 import org.w3c.dom.Element;
56 @RunWith(SpringJUnit4ClassRunner.class)
57 @ContextConfiguration(classes = {
59 SchemaLocationsBean.class,
60 TestUtilConfigTranslatorforEdges.class,
63 SwaggerGenerationConfiguration.class
66 @TestPropertySource(properties = {
67 "schema.uri.base.path = /aai",
68 "schema.xsd.maxoccurs = 5000"
70 public class NodesYAMLfromOXMTest {
71 //public class NodesYAMLfromOXMTest extends AAISetup {
72 private static final Logger logger = LoggerFactory.getLogger("NodesYAMLfromOXMTest.class");
73 private static final String OXMFILENAME = "src/test/resources/oxm/business_v11.xml";
74 private static final String EDGEFILENAME = "src/test/resources/dbedgerules/EdgeDescriptionRules_test.json";
75 public static AnnotationConfigApplicationContext ctx = null;
76 private static String testXML;
79 NodesYAMLfromOXM nodesYamlFromOxm;
81 SchemaVersions schemaVersions;
84 public static void setUpBeforeClass() throws Exception {
86 XSDElementTest x = new XSDElementTest();
89 logger.debug(testXML);
90 BufferedWriter bw = new BufferedWriter(new FileWriter(OXMFILENAME));
93 BufferedWriter bw1 = new BufferedWriter(new FileWriter(EDGEFILENAME));
94 bw1.write(YAMLfromOXMTest.EdgeDefs());
101 public void setUp() throws Exception {
103 NodeGetOperation.checklist.clear();
104 XSDElementTest x = new XSDElementTest();
108 logger.debug(testXML);
112 public void testGetDocumentHeader() {
113 SchemaVersion v = schemaVersions.getAppRootVersion();
114 String apiVersion = v.toString();
115 String header = null;
117 nodesYamlFromOxm.setXmlVersion(testXML, v);
118 nodesYamlFromOxm.process();
119 header = nodesYamlFromOxm.getDocumentHeader();
120 } catch(Exception e) {
123 assertThat("Header:\n"+header,header, is(YAMLheader()));
127 public void testProcess() {
129 SchemaVersion v = schemaVersions.getAppRootVersion();
130 String apiVersion = v.toString();
131 String fileContent = null;
133 nodesYamlFromOxm.setXmlVersion(testXML, v);
134 fileContent = nodesYamlFromOxm.process();
135 } catch(Exception e) {
138 assertThat("FileContent-I:\n"+fileContent,fileContent, is(YAMLresult()));
142 public void testNodesYAMLfromOXMFileVersionFile() throws IOException {
143 String outfileName = "testXML.xml";
144 File XMLfile = new File(outfileName);
145 XMLfile.createNewFile();
146 BufferedWriter bw = null;
147 Charset charset = Charset.forName("UTF-8");
148 Path path = Paths.get(outfileName);
149 bw = Files.newBufferedWriter(path, charset);
152 SchemaVersion v = schemaVersions.getAppRootVersion();
153 String apiVersion = v.toString();
154 String fileContent = null;
156 nodesYamlFromOxm.setXmlVersion(testXML, v);
157 fileContent = nodesYamlFromOxm.process();
158 } catch(Exception e) {
162 assertThat("FileContent:\n"+fileContent,fileContent, is(YAMLresult()));
166 public void testNodesYAMLfromOXMStringVersionFile() {
167 SchemaVersion v = schemaVersions.getAppRootVersion();
168 String apiVersion = v.toString();
169 String fileContent = null;
171 nodesYamlFromOxm.setXmlVersion(testXML, v);
172 fileContent = nodesYamlFromOxm.process();
173 } catch(Exception e) {
176 assertThat("FileContent-II:\n"+fileContent,fileContent, is(YAMLresult()));
180 public void testAppendDefinitions() {
181 SchemaVersion v = schemaVersions.getAppRootVersion();
182 String apiVersion = v.toString();
183 String definitions = null;
185 nodesYamlFromOxm.setXmlVersion(testXML, v);
186 nodesYamlFromOxm.process();
187 definitions = nodesYamlFromOxm.appendDefinitions();
188 } catch(Exception e) {
191 assertThat("Definitions:\n"+definitions,definitions, is(YAMLgetDefs()));
195 public void testGetXMLRootElementName() {
196 String target = "RootElement=customer";
197 SchemaVersion v = schemaVersions.getAppRootVersion();
198 String apiVersion = v.toString();
199 Element customer = null;
202 nodesYamlFromOxm.setXmlVersion(testXML, v);
203 nodesYamlFromOxm.process();
204 customer = nodesYamlFromOxm.getJavaTypeElementSwagger("Customer");
205 root = nodesYamlFromOxm.getXMLRootElementName(customer);
206 } catch(Exception e) {
209 assertThat("RootElement="+root, is(target));
213 public void testGetXmlRootElementName() {
214 String target = "RootElement=customer";
215 SchemaVersion v = schemaVersions.getAppRootVersion();
216 String apiVersion = v.toString();
219 nodesYamlFromOxm.setXmlVersion(testXML, v);
220 nodesYamlFromOxm.process();
221 root = nodesYamlFromOxm.getXmlRootElementName("Customer");
222 } catch(Exception e) {
225 assertThat("RootElement="+root, is(target));
229 public void testGetJavaTypeElementSwagger() {
230 String target = "Element=java-type/Customer";
231 SchemaVersion v = schemaVersions.getAppRootVersion();
232 String apiVersion = v.toString();
233 Element customer = null;
235 nodesYamlFromOxm.setXmlVersion(testXML, v);
236 nodesYamlFromOxm.process();
237 customer = nodesYamlFromOxm.getJavaTypeElementSwagger("Customer");
238 } catch(Exception e) {
241 assertThat("Element="+customer.getNodeName()+"/"+customer.getAttribute("name"), is(target));
244 public String YAMLresult() {
245 StringBuilder sb = new StringBuilder(32368);
246 sb.append(YAMLheader());
247 sb.append(YAMLops());
248 // sb.append(YAMLdefs());
249 // sb.append(YAMLpatchDefs());
250 sb.append(YAMLgetDefs());
251 return sb.toString();
253 public String YAMLheader() {
254 StringBuilder sb = new StringBuilder(1500);
255 sb.append("swagger: \"2.0\"\n");
256 sb.append("info:\n");
257 sb.append(" description: |\n");
259 sb.append(" [Differences versus the previous schema version](apidocs/aai_swagger_v11.diff)\n");
261 sb.append(" Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.\n");
263 sb.append(" Licensed under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License.\n");
265 sb.append(" You may obtain a copy of the License at\n");
267 sb.append(" (https://creativecommons.org/licenses/by/4.0/)\n");
269 sb.append(" Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n");
271 sb.append(" This document is best viewed with Firefox or Chrome. Nodes can be found by appending /#/definitions/node-type-to-find to the path to this document. Edge definitions can be found with the node definitions.\n");
272 sb.append(" version: \"v11\"\n");
273 sb.append(" title: Active and Available Inventory REST API\n");
274 sb.append(" license:\n");
275 sb.append(" name: Apache 2.0\n");
276 sb.append(" url: http://www.apache.org/licenses/LICENSE-2.0.html\n");
277 sb.append(" contact:\n");
278 sb.append(" name:\n");
279 sb.append(" url:\n");
280 sb.append(" email:\n");
281 sb.append("host:\n");
282 sb.append("basePath: /aai/v11\n");
283 sb.append("schemes:\n");
284 sb.append(" - https\n");
285 sb.append("paths:\n");
286 return sb.toString();
289 public String YAMLops() {
290 StringBuilder sb = new StringBuilder(16384);
291 sb.append(" /nodes/customers/customer/{global-customer-id}:\n");
292 sb.append(" get:\n");
293 sb.append(" tags:\n");
294 sb.append(" - Operations\n");
295 sb.append(" summary: returns customer\n");
296 sb.append(" description: returns customer\n");
297 sb.append(" operationId: getBusinessCustomersCustomer\n");
298 sb.append(" produces:\n");
299 sb.append(" - application/json\n");
300 sb.append(" - application/xml\n");
301 sb.append(" responses:\n");
302 sb.append(" \"200\":\n");
303 sb.append(" description: successful operation\n");
304 sb.append(" schema:\n");
305 sb.append(" $ref: \"#/definitions/customer\"\n");
306 sb.append(" \"default\":\n");
307 sb.append(" null\n parameters:\n");
308 sb.append(" - name: global-customer-id\n");
309 sb.append(" in: path\n");
310 sb.append(" description: Global customer id used across to uniquely identify customer.\n");
311 sb.append(" required: true\n");
312 sb.append(" type: string\n");
313 sb.append(" example: __GLOBAL-CUSTOMER-ID__\n");
314 sb.append(" /nodes/customers?parameter=value[¶meter2=value2]:\n");
315 sb.append(" get:\n");
316 sb.append(" tags:\n");
317 sb.append(" - Operations\n");
318 sb.append(" summary: returns customers\n");
319 sb.append(" description: returns customers\n");
320 sb.append(" operationId: getBusinessCustomers\n");
321 sb.append(" produces:\n");
322 sb.append(" - application/json\n");
323 sb.append(" - application/xml\n");
324 sb.append(" responses:\n");
325 sb.append(" \"200\":\n");
326 sb.append(" description: successful operation\n");
327 sb.append(" schema:\n");
328 sb.append(" $ref: \"#/definitions/customers\"\n");
329 sb.append(" \"default\":\n");
330 sb.append(" null\n parameters:\n");
331 sb.append(" - name: global-customer-id\n");
332 sb.append(" in: query\n");
333 sb.append(" description:\n");
334 sb.append(" required: false\n");
335 sb.append(" type: string\n");
336 sb.append(" - name: subscriber-name\n");
337 sb.append(" in: query\n");
338 sb.append(" description:\n");
339 sb.append(" required: false\n");
340 sb.append(" type: string\n");
341 sb.append(" - name: subscriber-type\n");
342 sb.append(" in: query\n");
343 sb.append(" description:\n");
344 sb.append(" required: false\n");
345 sb.append(" type: string\n");
346 sb.append(" /nodes/service-subscriptions?parameter=value[¶meter2=value2]:\n");
347 sb.append(" get:\n");
348 sb.append(" tags:\n");
349 sb.append(" - Operations\n");
350 sb.append(" summary: returns service-subscriptions\n");
351 sb.append(" description: returns service-subscriptions\n");
352 sb.append(" operationId: getBusinessCustomersCustomerServiceSubscriptions\n");
353 sb.append(" produces:\n");
354 sb.append(" - application/json\n");
355 sb.append(" - application/xml\n");
356 sb.append(" responses:\n");
357 sb.append(" \"200\":\n");
358 sb.append(" description: successful operation\n");
359 sb.append(" schema:\n");
360 sb.append(" $ref: \"#/definitions/service-subscriptions\"\n");
361 sb.append(" \"default\":\n");
362 sb.append(" null\n parameters:\n");
363 sb.append(" - name: service-type\n");
364 sb.append(" in: query\n");
365 sb.append(" description:\n");
366 sb.append(" required: false\n");
367 sb.append(" type: string\n");
368 return sb.toString();
370 public String YAMLdefs() {
371 StringBuilder sb = new StringBuilder(8092);
372 sb.append("definitions:\n");
373 sb.append(" business:\n");
374 sb.append(" description: |\n");
375 sb.append(" Namespace for business related constructs\n");
376 sb.append(" properties:\n");
377 sb.append(" customers:\n");
378 sb.append(" type: array\n");
379 sb.append(" items:\n");
380 sb.append(" $ref: \"#/definitions/customer\"\n");
381 sb.append(" customer:\n");
382 sb.append(" description: |\n");
383 sb.append(" customer identifiers to provide linkage back to BSS information.\n");
384 sb.append(" ###### Related Nodes\n");
385 sb.append(" - FROM service-subscription (CHILD of customer, service-subscription BelongsTo customer, MANY2ONE)(1)\n");
387 sb.append(" -(1) IF this CUSTOMER node is deleted, this FROM node is DELETED also\n");
388 sb.append(" required:\n");
389 sb.append(" - global-customer-id\n");
390 sb.append(" - subscriber-name\n");
391 sb.append(" - subscriber-type\n");
392 sb.append(" properties:\n");
393 sb.append(" global-customer-id:\n");
394 sb.append(" type: string\n");
395 sb.append(" description: Global customer id used across to uniquely identify customer.\n");
396 sb.append(" subscriber-name:\n");
397 sb.append(" type: string\n");
398 sb.append(" description: Subscriber name, an alternate way to retrieve a customer.\n");
399 sb.append(" subscriber-type:\n");
400 sb.append(" type: string\n");
401 sb.append(" description: Subscriber type, a way to provide VID with only the INFRA customers.\n");
402 sb.append(" resource-version:\n");
403 sb.append(" type: string\n");
404 sb.append(" description: Used for optimistic concurrency. Must be empty on create, valid on update and delete.\n");
405 sb.append(" service-subscriptions:\n");
406 sb.append(" type: array\n");
407 sb.append(" items:\n");
408 sb.append(" $ref: \"#/definitions/service-subscription\"\n");
409 sb.append(" customers:\n");
410 sb.append(" description: |\n");
411 sb.append(" Collection of customer identifiers to provide linkage back to BSS information.\n");
412 sb.append(" properties:\n");
413 sb.append(" customer:\n");
414 sb.append(" type: array\n");
415 sb.append(" items: \n");
416 sb.append(" $ref: \"#/definitions/customer\"\n");
417 sb.append(" inventory:\n");
418 sb.append(" properties:\n");
419 sb.append(" business:\n");
420 sb.append(" type: object\n");
421 sb.append(" $ref: \"#/definitions/business\"\n");
422 sb.append(" nodes:\n");
423 sb.append(" properties:\n");
424 sb.append(" inventory-item-data:\n");
425 sb.append(" type: array\n");
426 sb.append(" items:\n");
427 sb.append(" $ref: \"#/definitions/inventory-item-data\"\n");
428 sb.append(" service-subscription:\n");
429 sb.append(" description: |\n");
430 sb.append(" Object that group service instances.\n");
431 sb.append(" ###### Related Nodes\n");
432 sb.append(" - TO customer (PARENT of service-subscription, service-subscription BelongsTo customer, MANY2ONE)(4)\n");
433 sb.append(" - TO tenant( service-subscription Uses tenant, MANY2MANY)\n");
434 sb.append(" - FROM service-instance (CHILD of service-subscription, service-instance BelongsTo service-subscription, MANY2ONE)(1)\n");
436 sb.append(" -(1) IF this SERVICE-SUBSCRIPTION node is deleted, this FROM node is DELETED also\n");
437 sb.append(" -(4) IF this TO node is deleted, this SERVICE-SUBSCRIPTION is DELETED also\n");
438 sb.append(" required:\n");
439 sb.append(" - service-type\n");
440 sb.append(" properties:\n");
441 sb.append(" service-type:\n");
442 sb.append(" type: string\n");
443 sb.append(" description: Value defined by orchestration to identify this service.\n");
444 sb.append(" temp-ub-sub-account-id:\n");
445 sb.append(" type: string\n");
446 sb.append(" description: This property will be deleted from A&AI in the near future. Only stop gap solution.\n");
447 sb.append(" resource-version:\n");
448 sb.append(" type: string\n");
449 sb.append(" description: Used for optimistic concurrency. Must be empty on create, valid on update and delete.\n");
450 sb.append(" service-subscriptions:\n");
451 sb.append(" description: |\n");
452 sb.append(" Collection of objects that group service instances.\n");
453 sb.append(" properties:\n");
454 sb.append(" service-subscription:\n");
455 sb.append(" type: array\n");
456 sb.append(" items: \n");
457 sb.append(" $ref: \"#/definitions/service-subscription\"\n");
458 return sb.toString();
460 public String YAMLpatchDefs() {
461 StringBuilder sb = new StringBuilder(8092);
462 sb.append("patchDefinitions:\n");
463 sb.append(" business:\n");
464 sb.append(" description: |\n");
465 sb.append(" Namespace for business related constructs\n");
466 sb.append(" properties:\n");
467 sb.append(" customers:\n");
468 sb.append(" type: array\n");
469 sb.append(" items:\n");
470 sb.append(" $ref: \"#/patchDefinitions/customer\"\n");
471 sb.append(" customer:\n");
472 sb.append(" description: |\n");
473 sb.append(" customer identifiers to provide linkage back to BSS information.\n");
474 sb.append(" ###### Related Nodes\n");
475 sb.append(" - FROM service-subscription (CHILD of customer, service-subscription BelongsTo customer, MANY2ONE)(1)\n");
477 sb.append(" -(1) IF this CUSTOMER node is deleted, this FROM node is DELETED also\n");
478 sb.append(" required:\n");
479 sb.append(" - global-customer-id\n");
480 sb.append(" - subscriber-name\n");
481 sb.append(" - subscriber-type\n");
482 sb.append(" properties:\n");
483 sb.append(" global-customer-id:\n");
484 sb.append(" type: string\n");
485 sb.append(" description: Global customer id used across to uniquely identify customer.\n");
486 sb.append(" subscriber-name:\n");
487 sb.append(" type: string\n");
488 sb.append(" description: Subscriber name, an alternate way to retrieve a customer.\n");
489 sb.append(" subscriber-type:\n");
490 sb.append(" type: string\n");
491 sb.append(" description: Subscriber type, a way to provide VID with only the INFRA customers.\n");
492 sb.append(" customers:\n");
493 sb.append(" description: |\n");
494 sb.append(" Collection of customer identifiers to provide linkage back to BSS information.\n");
495 sb.append(" properties:\n");
496 sb.append(" customer:\n");
497 sb.append(" type: array\n");
498 sb.append(" items: \n");
499 sb.append(" $ref: \"#/patchDefinitions/customer\"\n");
500 sb.append(" inventory:\n");
501 sb.append(" properties:\n");
502 sb.append(" business:\n");
503 sb.append(" type: object\n");
504 sb.append(" $ref: \"#/patchDefinitions/business\"\n");
505 sb.append(" nodes:\n");
506 sb.append(" properties:\n");
507 sb.append(" inventory-item-data:\n");
508 sb.append(" type: array\n");
509 sb.append(" items:\n");
510 sb.append(" $ref: \"#/patchDefinitions/inventory-item-data\"\n");
511 sb.append(" service-subscription:\n");
512 sb.append(" description: |\n");
513 sb.append(" Object that group service instances.\n");
514 sb.append(" ###### Related Nodes\n");
515 sb.append(" - TO customer (CHILD of customer, service-subscription BelongsTo customer, MANY2ONE)(4)\n");
516 sb.append(" - TO tenant( service-subscription Uses tenant, MANY2MANY)\n");
517 sb.append(" - FROM service-instance (CHILD of service-subscription, service-instance BelongsTo service-subscription, MANY2ONE)(1)\n");
519 sb.append(" -(1) IF this SERVICE-SUBSCRIPTION node is deleted, this FROM node is DELETED also\n");
520 sb.append(" -(4) IF this TO node is deleted, this SERVICE-SUBSCRIPTION is DELETED also\n");
521 sb.append(" required:\n");
522 sb.append(" - service-type\n");
523 sb.append(" properties:\n");
524 sb.append(" service-type:\n");
525 sb.append(" type: string\n");
526 sb.append(" description: Value defined by orchestration to identify this service.\n");
527 sb.append(" temp-ub-sub-account-id:\n");
528 sb.append(" type: string\n");
529 sb.append(" description: This property will be deleted from A&AI in the near future. Only stop gap solution.\n");
530 sb.append(" service-subscriptions:\n");
531 sb.append(" description: |\n");
532 sb.append(" Collection of objects that group service instances.\n");
533 sb.append(" properties:\n");
534 sb.append(" service-subscription:\n");
535 sb.append(" type: array\n");
536 sb.append(" items: \n");
537 sb.append(" $ref: \"#/patchDefinitions/service-subscription\"\n");
538 return sb.toString();
540 public String YAMLgetDefs() {
541 StringBuilder sb = new StringBuilder(8092);
542 sb.append("definitions:\n");
543 sb.append(" business:\n");
544 sb.append(" description: |\n");
545 sb.append(" Namespace for business related constructs\n");
546 sb.append(" properties:\n");
547 sb.append(" customers:\n");
548 sb.append(" type: array\n");
549 sb.append(" items:\n");
550 sb.append(" $ref: \"#/definitions/customer\"\n");
551 sb.append(" customer:\n");
552 sb.append(" description: |\n");
553 sb.append(" customer identifiers to provide linkage back to BSS information.\n");
554 sb.append(" ###### Related Nodes\n");
555 sb.append(" - FROM service-subscription (CHILD of customer, service-subscription BelongsTo customer, MANY2ONE)(1)\n");
557 sb.append(" -(1) IF this CUSTOMER node is deleted, this FROM node is DELETED also\n");
558 sb.append(" required:\n");
559 sb.append(" - global-customer-id\n");
560 sb.append(" - subscriber-name\n");
561 sb.append(" - subscriber-type\n");
562 sb.append(" properties:\n");
563 sb.append(" global-customer-id:\n");
564 sb.append(" type: string\n");
565 sb.append(" description: Global customer id used across to uniquely identify customer.\n");
566 sb.append(" subscriber-name:\n");
567 sb.append(" type: string\n");
568 sb.append(" description: Subscriber name, an alternate way to retrieve a customer.\n");
569 sb.append(" subscriber-type:\n");
570 sb.append(" type: string\n");
571 sb.append(" description: Subscriber type, a way to provide VID with only the INFRA customers.\n");
572 sb.append(" resource-version:\n");
573 sb.append(" type: string\n");
574 sb.append(" description: Used for optimistic concurrency. Must be empty on create, valid on update and delete.\n");
575 sb.append(" service-subscriptions:\n");
576 sb.append(" type: array\n");
577 sb.append(" items:\n");
578 sb.append(" $ref: \"#/definitions/service-subscription\"\n");
579 sb.append(" customers:\n");
580 sb.append(" description: |\n");
581 sb.append(" Collection of customer identifiers to provide linkage back to BSS information.\n");
582 sb.append(" properties:\n");
583 sb.append(" customer:\n");
584 sb.append(" type: array\n");
585 sb.append(" items: \n");
586 sb.append(" $ref: \"#/definitions/customer\"\n");
587 sb.append(" inventory:\n");
588 sb.append(" properties:\n");
589 sb.append(" business:\n");
590 sb.append(" type: object\n");
591 sb.append(" $ref: \"#/definitions/business\"\n");
592 sb.append(" nodes:\n");
593 sb.append(" properties:\n");
594 sb.append(" inventory-item-data:\n");
595 sb.append(" type: array\n");
596 sb.append(" items:\n");
597 sb.append(" $ref: \"#/definitions/inventory-item-data\"\n");
598 sb.append(" service-subscription:\n");
599 sb.append(" description: |\n");
600 sb.append(" Object that group service instances.\n");
601 sb.append(" ###### Related Nodes\n");
602 sb.append(" - TO customer (PARENT of service-subscription, service-subscription BelongsTo customer, MANY2ONE)(4)\n");
603 sb.append(" - TO tenant( service-subscription Uses tenant, MANY2MANY)\n");
604 sb.append(" - FROM service-instance (CHILD of service-subscription, service-instance BelongsTo service-subscription, MANY2ONE)(1)\n");
606 sb.append(" -(1) IF this SERVICE-SUBSCRIPTION node is deleted, this FROM node is DELETED also\n");
607 sb.append(" -(4) IF this TO node is deleted, this SERVICE-SUBSCRIPTION is DELETED also\n");
608 sb.append(" required:\n");
609 sb.append(" - service-type\n");
610 sb.append(" properties:\n");
611 sb.append(" service-type:\n");
612 sb.append(" type: string\n");
613 sb.append(" description: Value defined by orchestration to identify this service.\n");
614 sb.append(" temp-ub-sub-account-id:\n");
615 sb.append(" type: string\n");
616 sb.append(" description: This property will be deleted from A&AI in the near future. Only stop gap solution.\n");
617 sb.append(" resource-version:\n");
618 sb.append(" type: string\n");
619 sb.append(" description: Used for optimistic concurrency. Must be empty on create, valid on update and delete.\n");
620 sb.append(" service-subscriptions:\n");
621 sb.append(" description: |\n");
622 sb.append(" Collection of objects that group service instances.\n");
623 sb.append(" properties:\n");
624 sb.append(" service-subscription:\n");
625 sb.append(" type: array\n");
626 sb.append(" items: \n");
627 sb.append(" $ref: \"#/definitions/service-subscription\"\n");
628 return sb.toString();