@nutanix-scratch/multidomain-js-client 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/LICENSE.txt +202 -0
  2. package/README.md +224 -0
  3. package/dist/Ntnx-Multidomain-js-client-prod.js +1 -0
  4. package/dist/Ntnx-Multidomain-js-client.js +713 -0
  5. package/dist/es/ApiClient.d.ts +194 -0
  6. package/dist/es/ApiClient.js +1449 -0
  7. package/dist/es/Paginable.d.ts +95 -0
  8. package/dist/es/Paginable.js +248 -0
  9. package/dist/es/apis/externalrepositories-endpoints.d.ts +84 -0
  10. package/dist/es/apis/externalrepositories-endpoints.js +267 -0
  11. package/dist/es/index.d.ts +60 -0
  12. package/dist/es/index.js +236 -0
  13. package/dist/es/models/common/v1/config/FQDN.d.ts +47 -0
  14. package/dist/es/models/common/v1/config/FQDN.js +238 -0
  15. package/dist/es/models/common/v1/config/Flag.d.ts +58 -0
  16. package/dist/es/models/common/v1/config/Flag.js +278 -0
  17. package/dist/es/models/common/v1/config/IPAddressOrFQDN.d.ts +70 -0
  18. package/dist/es/models/common/v1/config/IPAddressOrFQDN.js +313 -0
  19. package/dist/es/models/common/v1/config/IPv4Address.d.ts +70 -0
  20. package/dist/es/models/common/v1/config/IPv4Address.js +288 -0
  21. package/dist/es/models/common/v1/config/IPv6Address.d.ts +70 -0
  22. package/dist/es/models/common/v1/config/IPv6Address.js +288 -0
  23. package/dist/es/models/common/v1/config/KVPair.d.ts +65 -0
  24. package/dist/es/models/common/v1/config/KVPair.js +333 -0
  25. package/dist/es/models/common/v1/config/MapOfStringWrapper.d.ts +53 -0
  26. package/dist/es/models/common/v1/config/MapOfStringWrapper.js +236 -0
  27. package/dist/es/models/common/v1/config/Message.d.ts +79 -0
  28. package/dist/es/models/common/v1/config/Message.js +341 -0
  29. package/dist/es/models/common/v1/config/MessageSeverity.d.ts +19 -0
  30. package/dist/es/models/common/v1/config/MessageSeverity.js +89 -0
  31. package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +47 -0
  32. package/dist/es/models/common/v1/config/TenantAwareModel.js +235 -0
  33. package/dist/es/models/common/v1/response/ApiLink.d.ts +58 -0
  34. package/dist/es/models/common/v1/response/ApiLink.js +271 -0
  35. package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +95 -0
  36. package/dist/es/models/common/v1/response/ApiResponseMetadata.js +419 -0
  37. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +34 -0
  38. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +262 -0
  39. package/dist/es/models/multidomain/v4/config/CreateExternalRepositoryApiResponse.d.ts +58 -0
  40. package/dist/es/models/multidomain/v4/config/CreateExternalRepositoryApiResponse.js +288 -0
  41. package/dist/es/models/multidomain/v4/config/DeleteExternalRepositoryApiResponse.d.ts +58 -0
  42. package/dist/es/models/multidomain/v4/config/DeleteExternalRepositoryApiResponse.js +288 -0
  43. package/dist/es/models/multidomain/v4/config/ExternalRepository.d.ts +59 -0
  44. package/dist/es/models/multidomain/v4/config/ExternalRepository.js +328 -0
  45. package/dist/es/models/multidomain/v4/config/GetExternalRepositoryApiResponse.d.ts +58 -0
  46. package/dist/es/models/multidomain/v4/config/GetExternalRepositoryApiResponse.js +288 -0
  47. package/dist/es/models/multidomain/v4/config/ListExternalRepositoriesApiResponse.d.ts +58 -0
  48. package/dist/es/models/multidomain/v4/config/ListExternalRepositoriesApiResponse.js +310 -0
  49. package/dist/es/models/multidomain/v4/config/NFSServerAddress.d.ts +71 -0
  50. package/dist/es/models/multidomain/v4/config/NFSServerAddress.js +279 -0
  51. package/dist/es/models/multidomain/v4/config/NfsRepository.d.ts +73 -0
  52. package/dist/es/models/multidomain/v4/config/NfsRepository.js +299 -0
  53. package/dist/es/models/multidomain/v4/config/UpdateExternalRepositoryApiResponse.d.ts +58 -0
  54. package/dist/es/models/multidomain/v4/config/UpdateExternalRepositoryApiResponse.js +288 -0
  55. package/dist/es/models/multidomain/v4/error/AppMessage.d.ts +107 -0
  56. package/dist/es/models/multidomain/v4/error/AppMessage.js +415 -0
  57. package/dist/es/models/multidomain/v4/error/ErrorResponse.d.ts +47 -0
  58. package/dist/es/models/multidomain/v4/error/ErrorResponse.js +277 -0
  59. package/dist/es/models/multidomain/v4/error/SchemaValidationError.d.ts +92 -0
  60. package/dist/es/models/multidomain/v4/error/SchemaValidationError.js +389 -0
  61. package/dist/es/models/multidomain/v4/error/SchemaValidationErrorMessage.d.ts +69 -0
  62. package/dist/es/models/multidomain/v4/error/SchemaValidationErrorMessage.js +307 -0
  63. package/dist/es/models/prism/v4/config/TaskReference.d.ts +47 -0
  64. package/dist/es/models/prism/v4/config/TaskReference.js +242 -0
  65. package/dist/es/models/validation/ValidationError.d.ts +13 -0
  66. package/dist/es/models/validation/ValidationError.js +44 -0
  67. package/dist/es/models/validation/ValidationScopes.d.ts +9 -0
  68. package/dist/es/models/validation/ValidationScopes.js +38 -0
  69. package/dist/es/utils/ValidationUtils.d.ts +13 -0
  70. package/dist/es/utils/ValidationUtils.js +55 -0
  71. package/dist/lib/ApiClient.d.ts +194 -0
  72. package/dist/lib/ApiClient.js +1449 -0
  73. package/dist/lib/Paginable.d.ts +95 -0
  74. package/dist/lib/Paginable.js +248 -0
  75. package/dist/lib/apis/externalrepositories-endpoints.d.ts +84 -0
  76. package/dist/lib/apis/externalrepositories-endpoints.js +267 -0
  77. package/dist/lib/index.d.ts +60 -0
  78. package/dist/lib/index.js +236 -0
  79. package/dist/lib/models/common/v1/config/FQDN.d.ts +47 -0
  80. package/dist/lib/models/common/v1/config/FQDN.js +238 -0
  81. package/dist/lib/models/common/v1/config/Flag.d.ts +58 -0
  82. package/dist/lib/models/common/v1/config/Flag.js +278 -0
  83. package/dist/lib/models/common/v1/config/IPAddressOrFQDN.d.ts +70 -0
  84. package/dist/lib/models/common/v1/config/IPAddressOrFQDN.js +313 -0
  85. package/dist/lib/models/common/v1/config/IPv4Address.d.ts +70 -0
  86. package/dist/lib/models/common/v1/config/IPv4Address.js +288 -0
  87. package/dist/lib/models/common/v1/config/IPv6Address.d.ts +70 -0
  88. package/dist/lib/models/common/v1/config/IPv6Address.js +288 -0
  89. package/dist/lib/models/common/v1/config/KVPair.d.ts +65 -0
  90. package/dist/lib/models/common/v1/config/KVPair.js +333 -0
  91. package/dist/lib/models/common/v1/config/MapOfStringWrapper.d.ts +53 -0
  92. package/dist/lib/models/common/v1/config/MapOfStringWrapper.js +236 -0
  93. package/dist/lib/models/common/v1/config/Message.d.ts +79 -0
  94. package/dist/lib/models/common/v1/config/Message.js +341 -0
  95. package/dist/lib/models/common/v1/config/MessageSeverity.d.ts +19 -0
  96. package/dist/lib/models/common/v1/config/MessageSeverity.js +89 -0
  97. package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +47 -0
  98. package/dist/lib/models/common/v1/config/TenantAwareModel.js +235 -0
  99. package/dist/lib/models/common/v1/response/ApiLink.d.ts +58 -0
  100. package/dist/lib/models/common/v1/response/ApiLink.js +271 -0
  101. package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +95 -0
  102. package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +419 -0
  103. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +34 -0
  104. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +262 -0
  105. package/dist/lib/models/multidomain/v4/config/CreateExternalRepositoryApiResponse.d.ts +58 -0
  106. package/dist/lib/models/multidomain/v4/config/CreateExternalRepositoryApiResponse.js +288 -0
  107. package/dist/lib/models/multidomain/v4/config/DeleteExternalRepositoryApiResponse.d.ts +58 -0
  108. package/dist/lib/models/multidomain/v4/config/DeleteExternalRepositoryApiResponse.js +288 -0
  109. package/dist/lib/models/multidomain/v4/config/ExternalRepository.d.ts +59 -0
  110. package/dist/lib/models/multidomain/v4/config/ExternalRepository.js +328 -0
  111. package/dist/lib/models/multidomain/v4/config/GetExternalRepositoryApiResponse.d.ts +58 -0
  112. package/dist/lib/models/multidomain/v4/config/GetExternalRepositoryApiResponse.js +288 -0
  113. package/dist/lib/models/multidomain/v4/config/ListExternalRepositoriesApiResponse.d.ts +58 -0
  114. package/dist/lib/models/multidomain/v4/config/ListExternalRepositoriesApiResponse.js +310 -0
  115. package/dist/lib/models/multidomain/v4/config/NFSServerAddress.d.ts +71 -0
  116. package/dist/lib/models/multidomain/v4/config/NFSServerAddress.js +279 -0
  117. package/dist/lib/models/multidomain/v4/config/NfsRepository.d.ts +73 -0
  118. package/dist/lib/models/multidomain/v4/config/NfsRepository.js +299 -0
  119. package/dist/lib/models/multidomain/v4/config/UpdateExternalRepositoryApiResponse.d.ts +58 -0
  120. package/dist/lib/models/multidomain/v4/config/UpdateExternalRepositoryApiResponse.js +288 -0
  121. package/dist/lib/models/multidomain/v4/error/AppMessage.d.ts +107 -0
  122. package/dist/lib/models/multidomain/v4/error/AppMessage.js +415 -0
  123. package/dist/lib/models/multidomain/v4/error/ErrorResponse.d.ts +47 -0
  124. package/dist/lib/models/multidomain/v4/error/ErrorResponse.js +277 -0
  125. package/dist/lib/models/multidomain/v4/error/SchemaValidationError.d.ts +92 -0
  126. package/dist/lib/models/multidomain/v4/error/SchemaValidationError.js +389 -0
  127. package/dist/lib/models/multidomain/v4/error/SchemaValidationErrorMessage.d.ts +69 -0
  128. package/dist/lib/models/multidomain/v4/error/SchemaValidationErrorMessage.js +307 -0
  129. package/dist/lib/models/prism/v4/config/TaskReference.d.ts +47 -0
  130. package/dist/lib/models/prism/v4/config/TaskReference.js +242 -0
  131. package/dist/lib/models/validation/ValidationError.d.ts +13 -0
  132. package/dist/lib/models/validation/ValidationError.js +44 -0
  133. package/dist/lib/models/validation/ValidationScopes.d.ts +9 -0
  134. package/dist/lib/models/validation/ValidationScopes.js +38 -0
  135. package/dist/lib/utils/ValidationUtils.d.ts +13 -0
  136. package/dist/lib/utils/ValidationUtils.js +55 -0
  137. package/package.json +53 -0
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
8
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
9
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
12
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } /*
13
+ * Nutanix Multidomain Versioned APIs
14
+ *
15
+ * OpenAPI spec version: 4.2.1
16
+ *
17
+ * NOTE: This class is auto generated by the Open API Dev Platform.
18
+ *
19
+ * Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
20
+ *
21
+ * Do not edit the class manually.
22
+ *
23
+ */
24
+ /**
25
+ * The FQDN model module.
26
+ * @module Ntnx/FQDN
27
+ * @version 4.2.1
28
+ * @class FQDN
29
+ */
30
+ var _FQDN_brand = /*#__PURE__*/new WeakSet();
31
+ class FQDN {
32
+ /**
33
+ * Constructs a new <code>FQDN</code>.
34
+ * A fully qualified domain name that specifies its exact location in the tree hierarchy of the Domain Name System.
35
+ * @alias module:Ntnx/FQDN
36
+ */
37
+ constructor() {
38
+ /*
39
+ * toJson method for a map type which supports map with primitive keys and values of object types
40
+ * @param {Object} obj
41
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
42
+ * Otherwise, just returns the input object.
43
+ */
44
+ _classPrivateMethodInitSpec(this, _FQDN_brand);
45
+ this.$objectType = "common.v1.config.FQDN";
46
+ /** @type {object<string, any>} */
47
+ this.$reserved = {
48
+ '$fv': "v1.r0"
49
+ };
50
+ /** @type {object<string, any>} */
51
+ this.$unknownFields = {};
52
+ }
53
+
54
+ /**
55
+ * Constructs a <code>FQDN</code> from a plain JavaScript object, optionally creating a new instance.
56
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
57
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
58
+ * @param {module:Ntnx/FQDN} obj Optional instance to populate.
59
+ * @param callFromChild {Boolean} Flag to recognise calling instance
60
+ * @return {module:Ntnx/FQDN} The populated <code>FQDN</code> instance.
61
+ */
62
+ static constructFromObject(data, obj = null, callFromChild = false) {
63
+ let items, item, i, itemArr, discriminator;
64
+ if (data) {
65
+ obj = obj || new FQDN();
66
+ if (data.hasOwnProperty('value') && data.value !== null && data.value !== undefined) {
67
+ obj.setValue(data['value']);
68
+ }
69
+ if (data.hasOwnProperty('$reserved')) {
70
+ obj.$reserved = data['$reserved'];
71
+ }
72
+ if (data.hasOwnProperty('$objectType')) {
73
+ obj.$objectType = data['$objectType'];
74
+ }
75
+ if (data.hasOwnProperty('$unknownFields')) {
76
+ obj.$unknownFields = data['$unknownFields'];
77
+ }
78
+ if (!callFromChild) {
79
+ obj.$unknownFields = {
80
+ ...data.$unknownFields
81
+ };
82
+ for (const property in data) {
83
+ // Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
84
+ // as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
85
+ // Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
86
+ // If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
87
+ if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
88
+ obj.$unknownFields[property] = data[property];
89
+ }
90
+ }
91
+ }
92
+ }
93
+ return obj;
94
+ }
95
+
96
+ /**
97
+ * Converts a given snake_case string to camelCase.
98
+ * @param {string} snakeStr - The input string in snake_case format.
99
+ * @returns {string} - The converted string in camelCase format.
100
+ */
101
+ static snakeToCamel(snakeStr) {
102
+ return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
103
+ }
104
+
105
+ /**
106
+ * Returns The fully qualified domain name of the host.
107
+ * @return {string}
108
+ */
109
+ getValue() {
110
+ return this.value;
111
+ }
112
+
113
+ /**
114
+ * Sets The fully qualified domain name of the host.
115
+ * @param {string} value The fully qualified domain name of the host.
116
+ */
117
+ setValue(value) {
118
+ this.value = value;
119
+ }
120
+ get$Reserved() {
121
+ return this.$reserved;
122
+ }
123
+ get$ObjectType() {
124
+ return this.$objectType;
125
+ }
126
+ get$UnknownFields() {
127
+ return this.$unknownFields;
128
+ }
129
+ toJson(forMutation) {
130
+ if (forMutation === false) {
131
+ return {
132
+ ...(typeof this.getValue() !== 'undefined' && this.getValue() !== null ? {
133
+ 'value': this.getValue()
134
+ } : {}),
135
+ '$reserved': this.get$Reserved(),
136
+ '$objectType': this.get$ObjectType(),
137
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
138
+ '$unknownFields': {}
139
+ };
140
+ }
141
+ return {
142
+ ...(typeof this.getValue() !== 'undefined' && this.getValue() !== null ? {
143
+ 'value': this.getValue()
144
+ } : {}),
145
+ '$reserved': this.get$Reserved(),
146
+ '$objectType': this.get$ObjectType(),
147
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
148
+ '$unknownFields': {}
149
+ };
150
+ }
151
+ validate(scope, properties) {
152
+ let propList = [];
153
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
154
+ //cases validate() and validate(scope)
155
+ propList = [];
156
+ } else if (arguments.length === 1) {
157
+ //case validate(properties)
158
+ propList = arguments[0];
159
+ scope = null;
160
+ } else {
161
+ //case validate(scope, properties)
162
+ propList = arguments[1];
163
+ }
164
+ let res = [];
165
+ let err = null;
166
+ propList.forEach(property => {
167
+ err = this.validateProperty(property, scope);
168
+ if (err) {
169
+ res.push(err);
170
+ }
171
+ });
172
+ return new Promise(function (resolve, reject) {
173
+ if (res.length !== 0) {
174
+ reject(err);
175
+ } else {
176
+ resolve();
177
+ }
178
+ });
179
+ }
180
+ validateProperty(scope, property) {
181
+ if (property === "value") {
182
+ if (typeof this.value === 'undefined' || this.value === null) {
183
+ return new _ValidationError.default("value", "undefined or null");
184
+ }
185
+ if (!_ValidationUtils.default.validatePattern(this.value, /^([a-zA-Z0-9À-ÿ]+(?:-[a-zA-Z0-9À-ÿ]+)*\\.)+[a-zA-ZÀ-ÿ]{2,63}$/)) {
186
+ return new _ValidationError.default("value", "does not satisfy required pattern: /^([a-zA-Z0-9À-ÿ]+(?:-[a-zA-Z0-9À-ÿ]+)*\\.)+[a-zA-ZÀ-ÿ]{2,63}$/");
187
+ }
188
+ }
189
+ if (property === "$reserved") {
190
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
191
+ return new _ValidationError.default("$reserved", "undefined or null");
192
+ }
193
+ }
194
+ if (property === "$objectType") {
195
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
196
+ return new _ValidationError.default("$objectType", "undefined or null");
197
+ }
198
+ }
199
+ if (property === "$unknownFields") {
200
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
201
+ return new _ValidationError.default("$unknownFields", "undefined or null");
202
+ }
203
+ }
204
+ return new _ValidationError.default(property, "no such property exists");
205
+ }
206
+ }
207
+
208
+ /**
209
+ * The fully qualified domain name of the host.
210
+ * @memberof FQDN
211
+ */
212
+ exports.default = FQDN;
213
+ function _toJsonMapType(obj, forMutation) {
214
+ if (obj instanceof Map) {
215
+ return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
216
+ } else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
217
+ return Object.fromEntries(Array.from(Object.entries(obj), entry => {
218
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
219
+ }));
220
+ }
221
+ return obj;
222
+ }
223
+ /*
224
+ * toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
225
+ * @param {Object} obj Object to serialize
226
+ * @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
227
+ * @returns {Object|string} Returns serialized date object or original input object
228
+ */
229
+ function _handleDateType(obj, isDateOnly) {
230
+ if (obj instanceof Date && isDateOnly !== undefined) {
231
+ return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
232
+ }
233
+ return obj;
234
+ }
235
+ FQDN.prototype.value = undefined;
236
+ FQDN.prototype.$reserved = undefined;
237
+ FQDN.prototype.$objectType = undefined;
238
+ FQDN.prototype.$unknownFields = undefined;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The Flag model module.
3
+ * @module Ntnx/Flag
4
+ * @version 4.2.1
5
+ * @class Flag
6
+ */
7
+ export default class Flag {
8
+ /**
9
+ * Constructs a <code>Flag</code> from a plain JavaScript object, optionally creating a new instance.
10
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
11
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
12
+ * @param {module:Ntnx/Flag} obj Optional instance to populate.
13
+ * @param callFromChild {Boolean} Flag to recognise calling instance
14
+ * @return {module:Ntnx/Flag} The populated <code>Flag</code> instance.
15
+ */
16
+ static constructFromObject(data: any, obj?: any, callFromChild?: boolean): any;
17
+ /**
18
+ * Converts a given snake_case string to camelCase.
19
+ * @param {string} snakeStr - The input string in snake_case format.
20
+ * @returns {string} - The converted string in camelCase format.
21
+ */
22
+ static snakeToCamel(snakeStr: string): string;
23
+ $objectType: string;
24
+ /** @type {object<string, any>} */
25
+ $reserved: object;
26
+ /** @type {object<string, any>} */
27
+ $unknownFields: object;
28
+ /**
29
+ * Returns Name of the flag.
30
+ * @return {string}
31
+ */
32
+ getName(): string;
33
+ /**
34
+ * Sets Name of the flag.
35
+ * @param {string} name Name of the flag.
36
+ */
37
+ setName(name: string): void;
38
+ name: string;
39
+ /**
40
+ * Returns Value of the flag.
41
+ * @return {boolean}
42
+ */
43
+ getValue(): boolean;
44
+ /**
45
+ * Sets Value of the flag.
46
+ * @param {boolean} value Value of the flag.
47
+ */
48
+ setValue(value: boolean): void;
49
+ value: boolean;
50
+ get$Reserved(): any;
51
+ get$ObjectType(): string;
52
+ get$UnknownFields(): any;
53
+ toJson(forMutation: any): any;
54
+ validate(scope: any, properties: any, ...args: any[]): Promise<any>;
55
+ validateProperty(scope: any, property: any): ValidationError;
56
+ #private;
57
+ }
58
+ import ValidationError from "../../../validation/ValidationError";
@@ -0,0 +1,278 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
8
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
9
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
12
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } /*
13
+ * Nutanix Multidomain Versioned APIs
14
+ *
15
+ * OpenAPI spec version: 4.2.1
16
+ *
17
+ * NOTE: This class is auto generated by the Open API Dev Platform.
18
+ *
19
+ * Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
20
+ *
21
+ * Do not edit the class manually.
22
+ *
23
+ */
24
+ /**
25
+ * The Flag model module.
26
+ * @module Ntnx/Flag
27
+ * @version 4.2.1
28
+ * @class Flag
29
+ */
30
+ var _Flag_brand = /*#__PURE__*/new WeakSet();
31
+ class Flag {
32
+ /**
33
+ * Constructs a new <code>Flag</code>.
34
+ * Many entities in the Nutanix APIs carry flags. This object captures all the flags associated with that entity through this object. The field that hosts this type of object must have an attribute called x-bounded-map-keys that tells which flags are actually present for that entity.
35
+ * @alias module:Ntnx/Flag
36
+ */
37
+ constructor() {
38
+ /*
39
+ * toJson method for a map type which supports map with primitive keys and values of object types
40
+ * @param {Object} obj
41
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
42
+ * Otherwise, just returns the input object.
43
+ */
44
+ _classPrivateMethodInitSpec(this, _Flag_brand);
45
+ this.$objectType = "common.v1.config.Flag";
46
+ /** @type {object<string, any>} */
47
+ this.$reserved = {
48
+ '$fv': "v1.r0"
49
+ };
50
+ /** @type {object<string, any>} */
51
+ this.$unknownFields = {};
52
+ }
53
+
54
+ /**
55
+ * Constructs a <code>Flag</code> from a plain JavaScript object, optionally creating a new instance.
56
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
57
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
58
+ * @param {module:Ntnx/Flag} obj Optional instance to populate.
59
+ * @param callFromChild {Boolean} Flag to recognise calling instance
60
+ * @return {module:Ntnx/Flag} The populated <code>Flag</code> instance.
61
+ */
62
+ static constructFromObject(data, obj = null, callFromChild = false) {
63
+ let items, item, i, itemArr, discriminator;
64
+ if (data) {
65
+ obj = obj || new Flag();
66
+ if (data.hasOwnProperty('name') && data.name !== null && data.name !== undefined) {
67
+ obj.setName(data['name']);
68
+ }
69
+ if (data.hasOwnProperty('value') && data.value !== null && data.value !== undefined) {
70
+ obj.setValue(data['value']);
71
+ }
72
+ if (data.hasOwnProperty('$reserved')) {
73
+ obj.$reserved = data['$reserved'];
74
+ }
75
+ if (data.hasOwnProperty('$objectType')) {
76
+ obj.$objectType = data['$objectType'];
77
+ }
78
+ if (data.hasOwnProperty('$unknownFields')) {
79
+ obj.$unknownFields = data['$unknownFields'];
80
+ }
81
+ if (!callFromChild) {
82
+ obj.$unknownFields = {
83
+ ...data.$unknownFields
84
+ };
85
+ for (const property in data) {
86
+ // Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
87
+ // as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
88
+ // Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
89
+ // If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
90
+ if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
91
+ obj.$unknownFields[property] = data[property];
92
+ }
93
+ }
94
+ }
95
+ }
96
+ return obj;
97
+ }
98
+
99
+ /**
100
+ * Converts a given snake_case string to camelCase.
101
+ * @param {string} snakeStr - The input string in snake_case format.
102
+ * @returns {string} - The converted string in camelCase format.
103
+ */
104
+ static snakeToCamel(snakeStr) {
105
+ return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
106
+ }
107
+
108
+ /**
109
+ * Returns Name of the flag.
110
+ * @return {string}
111
+ */
112
+ getName() {
113
+ return this.name;
114
+ }
115
+
116
+ /**
117
+ * Sets Name of the flag.
118
+ * @param {string} name Name of the flag.
119
+ */
120
+ setName(name) {
121
+ this.name = name;
122
+ }
123
+
124
+ /**
125
+ * Returns Value of the flag.
126
+ * @return {boolean}
127
+ */
128
+ getValue() {
129
+ return this.value;
130
+ }
131
+
132
+ /**
133
+ * Sets Value of the flag.
134
+ * @param {boolean} value Value of the flag.
135
+ */
136
+ setValue(value) {
137
+ this.value = value;
138
+ }
139
+ get$Reserved() {
140
+ return this.$reserved;
141
+ }
142
+ get$ObjectType() {
143
+ return this.$objectType;
144
+ }
145
+ get$UnknownFields() {
146
+ return this.$unknownFields;
147
+ }
148
+ toJson(forMutation) {
149
+ if (forMutation === false) {
150
+ return {
151
+ ...(typeof this.getName() !== 'undefined' && this.getName() !== null ? {
152
+ 'name': this.getName()
153
+ } : {}),
154
+ ...(typeof this.getValue() !== 'undefined' && this.getValue() !== null ? {
155
+ 'value': this.getValue()
156
+ } : {}),
157
+ '$reserved': this.get$Reserved(),
158
+ '$objectType': this.get$ObjectType(),
159
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
160
+ '$unknownFields': {}
161
+ };
162
+ }
163
+ return {
164
+ ...(typeof this.getName() !== 'undefined' && this.getName() !== null ? {
165
+ 'name': this.getName()
166
+ } : {}),
167
+ ...(typeof this.getValue() !== 'undefined' && this.getValue() !== null ? {
168
+ 'value': this.getValue()
169
+ } : {}),
170
+ '$reserved': this.get$Reserved(),
171
+ '$objectType': this.get$ObjectType(),
172
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
173
+ '$unknownFields': {}
174
+ };
175
+ }
176
+ validate(scope, properties) {
177
+ let propList = [];
178
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
179
+ //cases validate() and validate(scope)
180
+ propList = [];
181
+ } else if (arguments.length === 1) {
182
+ //case validate(properties)
183
+ propList = arguments[0];
184
+ scope = null;
185
+ } else {
186
+ //case validate(scope, properties)
187
+ propList = arguments[1];
188
+ }
189
+ let res = [];
190
+ let err = null;
191
+ propList.forEach(property => {
192
+ err = this.validateProperty(property, scope);
193
+ if (err) {
194
+ res.push(err);
195
+ }
196
+ });
197
+ return new Promise(function (resolve, reject) {
198
+ if (res.length !== 0) {
199
+ reject(err);
200
+ } else {
201
+ resolve();
202
+ }
203
+ });
204
+ }
205
+ validateProperty(scope, property) {
206
+ if (property === "name") {
207
+ if (typeof this.name === 'undefined' || this.name === null) {
208
+ return new _ValidationError.default("name", "undefined or null");
209
+ }
210
+ if (!_ValidationUtils.default.validateMaxLength(this.name, 128)) {
211
+ return new _ValidationError.default("name", "does not satisfy required maxLength constraint: 128");
212
+ }
213
+ if (!_ValidationUtils.default.validateMinLength(this.name, 3)) {
214
+ return new _ValidationError.default("name", "does not satisfy required minLength constraint: 3");
215
+ }
216
+ }
217
+ if (property === "value") {
218
+ if (typeof this.value === 'undefined' || this.value === null) {
219
+ return new _ValidationError.default("value", "undefined or null");
220
+ }
221
+ }
222
+ if (property === "$reserved") {
223
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
224
+ return new _ValidationError.default("$reserved", "undefined or null");
225
+ }
226
+ }
227
+ if (property === "$objectType") {
228
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
229
+ return new _ValidationError.default("$objectType", "undefined or null");
230
+ }
231
+ }
232
+ if (property === "$unknownFields") {
233
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
234
+ return new _ValidationError.default("$unknownFields", "undefined or null");
235
+ }
236
+ }
237
+ return new _ValidationError.default(property, "no such property exists");
238
+ }
239
+ }
240
+
241
+ /**
242
+ * Name of the flag.
243
+ * @memberof Flag
244
+ */
245
+ exports.default = Flag;
246
+ function _toJsonMapType(obj, forMutation) {
247
+ if (obj instanceof Map) {
248
+ return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
249
+ } else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
250
+ return Object.fromEntries(Array.from(Object.entries(obj), entry => {
251
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
252
+ }));
253
+ }
254
+ return obj;
255
+ }
256
+ /*
257
+ * toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
258
+ * @param {Object} obj Object to serialize
259
+ * @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
260
+ * @returns {Object|string} Returns serialized date object or original input object
261
+ */
262
+ function _handleDateType(obj, isDateOnly) {
263
+ if (obj instanceof Date && isDateOnly !== undefined) {
264
+ return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
265
+ }
266
+ return obj;
267
+ }
268
+ Flag.prototype.name = undefined;
269
+
270
+ /**
271
+ * Value of the flag.
272
+ * @memberof Flag
273
+ * @default false
274
+ */
275
+ Flag.prototype.value = false;
276
+ Flag.prototype.$reserved = undefined;
277
+ Flag.prototype.$objectType = undefined;
278
+ Flag.prototype.$unknownFields = undefined;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The IPAddressOrFQDN model module.
3
+ * @module Ntnx/IPAddressOrFQDN
4
+ * @version 4.2.1
5
+ * @class IPAddressOrFQDN
6
+ */
7
+ export default class IPAddressOrFQDN {
8
+ /**
9
+ * Constructs a <code>IPAddressOrFQDN</code> from a plain JavaScript object, optionally creating a new instance.
10
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
11
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
12
+ * @param {module:Ntnx/IPAddressOrFQDN} obj Optional instance to populate.
13
+ * @param callFromChild {Boolean} Flag to recognise calling instance
14
+ * @return {module:Ntnx/IPAddressOrFQDN} The populated <code>IPAddressOrFQDN</code> instance.
15
+ */
16
+ static constructFromObject(data: any, obj?: any, callFromChild?: boolean): any;
17
+ /**
18
+ * Converts a given snake_case string to camelCase.
19
+ * @param {string} snakeStr - The input string in snake_case format.
20
+ * @returns {string} - The converted string in camelCase format.
21
+ */
22
+ static snakeToCamel(snakeStr: string): string;
23
+ $objectType: string;
24
+ /** @type {object<string, any>} */
25
+ $reserved: object;
26
+ /** @type {object<string, any>} */
27
+ $unknownFields: object;
28
+ /**
29
+ * @return {IPv4Address}
30
+ */
31
+ getIpv4(): IPv4Address;
32
+ /**
33
+ * @param {IPv4Address} ipv4
34
+ */
35
+ setIpv4(ipv4: IPv4Address): void;
36
+ ipv4: IPv4Address;
37
+ /**
38
+ * @return {IPv6Address}
39
+ */
40
+ getIpv6(): IPv6Address;
41
+ /**
42
+ * @param {IPv6Address} ipv6
43
+ */
44
+ setIpv6(ipv6: IPv6Address): void;
45
+ ipv6: IPv6Address;
46
+ /**
47
+ * @return {FQDN}
48
+ */
49
+ getFqdn(): FQDN;
50
+ /**
51
+ * @param {FQDN} fqdn
52
+ */
53
+ setFqdn(fqdn: FQDN): void;
54
+ fqdn: FQDN;
55
+ get$Reserved(): any;
56
+ get$ObjectType(): string;
57
+ get$UnknownFields(): any;
58
+ hasIpv4(): boolean;
59
+ hasIpv6(): boolean;
60
+ hasFqdn(): boolean;
61
+ isValid(): boolean;
62
+ toJson(forMutation: any): any;
63
+ validate(scope: any, properties: any, ...args: any[]): Promise<any>;
64
+ validateProperty(scope: any, property: any): ValidationError;
65
+ #private;
66
+ }
67
+ import IPv4Address from "./IPv4Address";
68
+ import IPv6Address from "./IPv6Address";
69
+ import FQDN from "./FQDN";
70
+ import ValidationError from "../../../validation/ValidationError";