@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,307 @@
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 SchemaValidationErrorMessage model module.
26
+ * @module Ntnx/SchemaValidationErrorMessage
27
+ * @version 4.2.1
28
+ * @class SchemaValidationErrorMessage
29
+ */
30
+ var _SchemaValidationErrorMessage_brand = /*#__PURE__*/new WeakSet();
31
+ class SchemaValidationErrorMessage {
32
+ /**
33
+ * Constructs a new <code>SchemaValidationErrorMessage</code>.
34
+ * This schema is generated from SchemaValidationErrorMessage.java
35
+ * @alias module:Ntnx/SchemaValidationErrorMessage
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, _SchemaValidationErrorMessage_brand);
45
+ this.$objectType = "multidomain.v4.error.SchemaValidationErrorMessage";
46
+ /** @type {object<string, any>} */
47
+ this.$reserved = {
48
+ '$fv': "v4.r2"
49
+ };
50
+ /** @type {object<string, any>} */
51
+ this.$unknownFields = {};
52
+ }
53
+
54
+ /**
55
+ * Constructs a <code>SchemaValidationErrorMessage</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/SchemaValidationErrorMessage} obj Optional instance to populate.
59
+ * @param callFromChild {Boolean} Flag to recognise calling instance
60
+ * @return {module:Ntnx/SchemaValidationErrorMessage} The populated <code>SchemaValidationErrorMessage</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 SchemaValidationErrorMessage();
66
+ if (data.hasOwnProperty('location') && data.location !== null && data.location !== undefined) {
67
+ obj.setLocation(data['location']);
68
+ }
69
+ if (data.hasOwnProperty('message') && data.message !== null && data.message !== undefined) {
70
+ obj.setMessage(data['message']);
71
+ }
72
+ if (data.hasOwnProperty('attributePath') && data.attributePath !== null && data.attributePath !== undefined) {
73
+ obj.setAttributePath(data['attributePath']);
74
+ }
75
+ if (data.hasOwnProperty('$reserved')) {
76
+ obj.$reserved = data['$reserved'];
77
+ }
78
+ if (data.hasOwnProperty('$objectType')) {
79
+ obj.$objectType = data['$objectType'];
80
+ }
81
+ if (data.hasOwnProperty('$unknownFields')) {
82
+ obj.$unknownFields = data['$unknownFields'];
83
+ }
84
+ if (!callFromChild) {
85
+ obj.$unknownFields = {
86
+ ...data.$unknownFields
87
+ };
88
+ for (const property in data) {
89
+ // Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
90
+ // as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
91
+ // Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
92
+ // If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
93
+ if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
94
+ obj.$unknownFields[property] = data[property];
95
+ }
96
+ }
97
+ }
98
+ }
99
+ return obj;
100
+ }
101
+
102
+ /**
103
+ * Converts a given snake_case string to camelCase.
104
+ * @param {string} snakeStr - The input string in snake_case format.
105
+ * @returns {string} - The converted string in camelCase format.
106
+ */
107
+ static snakeToCamel(snakeStr) {
108
+ return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
109
+ }
110
+
111
+ /**
112
+ * Returns The part of the request that failed validation. Validation can fail for path, query parameters, and request body.
113
+ * @return {string}
114
+ */
115
+ getLocation() {
116
+ return this.location;
117
+ }
118
+
119
+ /**
120
+ * Sets The part of the request that failed validation. Validation can fail for path, query parameters, and request body.
121
+ * @param {string} location The part of the request that failed validation. Validation can fail for path, query parameters, and request body.
122
+ */
123
+ setLocation(location) {
124
+ this.location = location;
125
+ }
126
+
127
+ /**
128
+ * Returns The detailed message for the validation error.
129
+ * @return {string}
130
+ */
131
+ getMessage() {
132
+ return this.message;
133
+ }
134
+
135
+ /**
136
+ * Sets The detailed message for the validation error.
137
+ * @param {string} message The detailed message for the validation error.
138
+ */
139
+ setMessage(message) {
140
+ this.message = message;
141
+ }
142
+
143
+ /**
144
+ * Returns The path of the attribute that failed validation in the schema.
145
+ * @return {string}
146
+ */
147
+ getAttributePath() {
148
+ return this.attributePath;
149
+ }
150
+
151
+ /**
152
+ * Sets The path of the attribute that failed validation in the schema.
153
+ * @param {string} attributePath The path of the attribute that failed validation in the schema.
154
+ */
155
+ setAttributePath(attributePath) {
156
+ this.attributePath = attributePath;
157
+ }
158
+ get$Reserved() {
159
+ return this.$reserved;
160
+ }
161
+ get$ObjectType() {
162
+ return this.$objectType;
163
+ }
164
+ get$UnknownFields() {
165
+ return this.$unknownFields;
166
+ }
167
+ toJson(forMutation) {
168
+ if (forMutation === false) {
169
+ return {
170
+ ...(typeof this.getLocation() !== 'undefined' && this.getLocation() !== null ? {
171
+ 'location': this.getLocation()
172
+ } : {}),
173
+ ...(typeof this.getMessage() !== 'undefined' && this.getMessage() !== null ? {
174
+ 'message': this.getMessage()
175
+ } : {}),
176
+ ...(typeof this.getAttributePath() !== 'undefined' && this.getAttributePath() !== null ? {
177
+ 'attributePath': this.getAttributePath()
178
+ } : {}),
179
+ '$reserved': this.get$Reserved(),
180
+ '$objectType': this.get$ObjectType(),
181
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
182
+ '$unknownFields': {}
183
+ };
184
+ }
185
+ return {
186
+ ...(typeof this.getLocation() !== 'undefined' && this.getLocation() !== null ? {
187
+ 'location': this.getLocation()
188
+ } : {}),
189
+ ...(typeof this.getMessage() !== 'undefined' && this.getMessage() !== null ? {
190
+ 'message': this.getMessage()
191
+ } : {}),
192
+ ...(typeof this.getAttributePath() !== 'undefined' && this.getAttributePath() !== null ? {
193
+ 'attributePath': this.getAttributePath()
194
+ } : {}),
195
+ '$reserved': this.get$Reserved(),
196
+ '$objectType': this.get$ObjectType(),
197
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
198
+ '$unknownFields': {}
199
+ };
200
+ }
201
+ validate(scope, properties) {
202
+ let propList = [];
203
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
204
+ //cases validate() and validate(scope)
205
+ propList = [];
206
+ } else if (arguments.length === 1) {
207
+ //case validate(properties)
208
+ propList = arguments[0];
209
+ scope = null;
210
+ } else {
211
+ //case validate(scope, properties)
212
+ propList = arguments[1];
213
+ }
214
+ let res = [];
215
+ let err = null;
216
+ propList.forEach(property => {
217
+ err = this.validateProperty(property, scope);
218
+ if (err) {
219
+ res.push(err);
220
+ }
221
+ });
222
+ return new Promise(function (resolve, reject) {
223
+ if (res.length !== 0) {
224
+ reject(err);
225
+ } else {
226
+ resolve();
227
+ }
228
+ });
229
+ }
230
+ validateProperty(scope, property) {
231
+ if (property === "location") {
232
+ if (typeof this.location === 'undefined' || this.location === null) {
233
+ return new _ValidationError.default("location", "undefined or null");
234
+ }
235
+ }
236
+ if (property === "message") {
237
+ if (typeof this.message === 'undefined' || this.message === null) {
238
+ return new _ValidationError.default("message", "undefined or null");
239
+ }
240
+ }
241
+ if (property === "attributePath") {
242
+ if (typeof this.attributePath === 'undefined' || this.attributePath === null) {
243
+ return new _ValidationError.default("attributePath", "undefined or null");
244
+ }
245
+ }
246
+ if (property === "$reserved") {
247
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
248
+ return new _ValidationError.default("$reserved", "undefined or null");
249
+ }
250
+ }
251
+ if (property === "$objectType") {
252
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
253
+ return new _ValidationError.default("$objectType", "undefined or null");
254
+ }
255
+ }
256
+ if (property === "$unknownFields") {
257
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
258
+ return new _ValidationError.default("$unknownFields", "undefined or null");
259
+ }
260
+ }
261
+ return new _ValidationError.default(property, "no such property exists");
262
+ }
263
+ }
264
+
265
+ /**
266
+ * The part of the request that failed validation. Validation can fail for path, query parameters, and request body.
267
+ * @memberof SchemaValidationErrorMessage
268
+ */
269
+ exports.default = SchemaValidationErrorMessage;
270
+ function _toJsonMapType(obj, forMutation) {
271
+ if (obj instanceof Map) {
272
+ return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
273
+ } else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
274
+ return Object.fromEntries(Array.from(Object.entries(obj), entry => {
275
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
276
+ }));
277
+ }
278
+ return obj;
279
+ }
280
+ /*
281
+ * toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
282
+ * @param {Object} obj Object to serialize
283
+ * @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
284
+ * @returns {Object|string} Returns serialized date object or original input object
285
+ */
286
+ function _handleDateType(obj, isDateOnly) {
287
+ if (obj instanceof Date && isDateOnly !== undefined) {
288
+ return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
289
+ }
290
+ return obj;
291
+ }
292
+ SchemaValidationErrorMessage.prototype.location = undefined;
293
+
294
+ /**
295
+ * The detailed message for the validation error.
296
+ * @memberof SchemaValidationErrorMessage
297
+ */
298
+ SchemaValidationErrorMessage.prototype.message = undefined;
299
+
300
+ /**
301
+ * The path of the attribute that failed validation in the schema.
302
+ * @memberof SchemaValidationErrorMessage
303
+ */
304
+ SchemaValidationErrorMessage.prototype.attributePath = undefined;
305
+ SchemaValidationErrorMessage.prototype.$reserved = undefined;
306
+ SchemaValidationErrorMessage.prototype.$objectType = undefined;
307
+ SchemaValidationErrorMessage.prototype.$unknownFields = undefined;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The TaskReference model module.
3
+ * @module Ntnx/TaskReference
4
+ * @version 4.2.1
5
+ * @class TaskReference
6
+ */
7
+ export default class TaskReference {
8
+ /**
9
+ * Constructs a <code>TaskReference</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/TaskReference} obj Optional instance to populate.
13
+ * @param callFromChild {Boolean} Flag to recognise calling instance
14
+ * @return {module:Ntnx/TaskReference} The populated <code>TaskReference</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 A globally unique identifier for a task.
30
+ * @return {string}
31
+ */
32
+ getExtId(): string;
33
+ /**
34
+ * Sets A globally unique identifier for a task.
35
+ * @param {string} extId A globally unique identifier for a task.
36
+ */
37
+ setExtId(extId: string): void;
38
+ extId: string;
39
+ get$Reserved(): any;
40
+ get$ObjectType(): string;
41
+ get$UnknownFields(): any;
42
+ toJson(forMutation: any): any;
43
+ validate(scope: any, properties: any, ...args: any[]): Promise<any>;
44
+ validateProperty(scope: any, property: any): ValidationError;
45
+ #private;
46
+ }
47
+ import ValidationError from "../../../validation/ValidationError";
@@ -0,0 +1,242 @@
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 TaskReference model module.
26
+ * @module Ntnx/TaskReference
27
+ * @version 4.2.1
28
+ * @class TaskReference
29
+ */
30
+ var _TaskReference_brand = /*#__PURE__*/new WeakSet();
31
+ class TaskReference {
32
+ /**
33
+ * Constructs a new <code>TaskReference</code>.
34
+ * A reference to a task tracking an asynchronous operation. The status of the task can be queried by making a GET request to the task URI provided in the metadata section of the API response.
35
+ * @alias module:Ntnx/TaskReference
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, _TaskReference_brand);
45
+ this.$objectType = "prism.v4.config.TaskReference";
46
+ /** @type {object<string, any>} */
47
+ this.$reserved = {
48
+ '$fv': "v4.r2"
49
+ };
50
+ /** @type {object<string, any>} */
51
+ this.$unknownFields = {};
52
+ }
53
+
54
+ /**
55
+ * Constructs a <code>TaskReference</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/TaskReference} obj Optional instance to populate.
59
+ * @param callFromChild {Boolean} Flag to recognise calling instance
60
+ * @return {module:Ntnx/TaskReference} The populated <code>TaskReference</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 TaskReference();
66
+ if (data.hasOwnProperty('extId') && data.extId !== null && data.extId !== undefined) {
67
+ obj.setExtId(data['extId']);
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 A globally unique identifier for a task.
107
+ * @return {string}
108
+ */
109
+ getExtId() {
110
+ return this.extId;
111
+ }
112
+
113
+ /**
114
+ * Sets A globally unique identifier for a task.
115
+ * @param {string} extId A globally unique identifier for a task.
116
+ */
117
+ setExtId(extId) {
118
+ this.extId = extId;
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.getExtId() !== 'undefined' && this.getExtId() !== null ? {
133
+ 'extId': this.getExtId()
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.getExtId() !== 'undefined' && this.getExtId() !== null ? {
143
+ 'extId': this.getExtId()
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 === "extId") {
182
+ if (typeof this.extId === 'undefined' || this.extId === null) {
183
+ return new _ValidationError.default("extId", "undefined or null");
184
+ }
185
+ if (!_ValidationUtils.default.validatePattern(this.extId, /^[a-zA-Z0-9\/+]*={0,2}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/)) {
186
+ return new _ValidationError.default("extId", "does not satisfy required pattern: /^[a-zA-Z0-9\/+]*={0,2}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/");
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
+ * A globally unique identifier for a task.
210
+ * @memberof TaskReference
211
+ */
212
+ exports.default = TaskReference;
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
+ TaskReference.prototype.extId = undefined;
236
+ TaskReference.prototype.$reserved = undefined;
237
+ TaskReference.prototype.$objectType = undefined;
238
+ TaskReference.prototype.$unknownFields = undefined;
239
+
240
+ // Implement OneOfmultidomain.v4.config.UpdateExternalRepositoryApiResponsedata interface:
241
+ // Implement OneOfmultidomain.v4.config.DeleteExternalRepositoryApiResponsedata interface:
242
+ // Implement OneOfmultidomain.v4.config.CreateExternalRepositoryApiResponsedata interface:
@@ -0,0 +1,13 @@
1
+ export default class ValidationError {
2
+ constructor(name: any, message: any);
3
+ name: any;
4
+ message: any;
5
+ getName(): any;
6
+ setName(name: any): void;
7
+ getMessage(): any;
8
+ setMessage(message: any): void;
9
+ toJson(): {
10
+ name: any;
11
+ message: any;
12
+ };
13
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /*
8
+ * Nutanix Multidomain Versioned APIs
9
+ *
10
+ * OpenAPI spec version: 4.2.1
11
+ *
12
+ * NOTE: This class is auto generated by the Open API Dev Platform.
13
+ *
14
+ * Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
15
+ *
16
+ * Do not edit the class manually.
17
+ *
18
+ */
19
+
20
+ class ValidationError {
21
+ constructor(name, message) {
22
+ this.name = name;
23
+ this.message = message;
24
+ }
25
+ getName() {
26
+ return this.name;
27
+ }
28
+ setName(name) {
29
+ this.name = name;
30
+ }
31
+ getMessage() {
32
+ return this.message;
33
+ }
34
+ setMessage(message) {
35
+ this.message = message;
36
+ }
37
+ toJson() {
38
+ return {
39
+ 'name': this.getName(),
40
+ 'message': this.getMessage()
41
+ };
42
+ }
43
+ }
44
+ exports.default = ValidationError;
@@ -0,0 +1,9 @@
1
+ export default ValidationScopes;
2
+ /**
3
+ * *
4
+ */
5
+ type ValidationScopes = any;
6
+ declare namespace ValidationScopes {
7
+ function constructFromObject(obj: any): any;
8
+ function validate(obj: any): void;
9
+ }