@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,288 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _ApiResponseMetadata = _interopRequireDefault(require("../../../common/v1/response/ApiResponseMetadata"));
8
+ var _ErrorResponse = _interopRequireDefault(require("../error/ErrorResponse"));
9
+ var _TaskReference = _interopRequireDefault(require("../../../prism/v4/config/TaskReference"));
10
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
11
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
12
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
13
+ var _Paginable = _interopRequireDefault(require("../../../../Paginable"));
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
16
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
17
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } /*
18
+ * Nutanix Multidomain Versioned APIs
19
+ *
20
+ * OpenAPI spec version: 4.2.1
21
+ *
22
+ * NOTE: This class is auto generated by the Open API Dev Platform.
23
+ *
24
+ * Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
25
+ *
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The DeleteExternalRepositoryApiResponse model module.
31
+ * @module Ntnx/DeleteExternalRepositoryApiResponse
32
+ * @version 4.2.1
33
+ * @class DeleteExternalRepositoryApiResponse
34
+ */
35
+ var _DeleteExternalRepositoryApiResponse_brand = /*#__PURE__*/new WeakSet();
36
+ class DeleteExternalRepositoryApiResponse extends _Paginable.default {
37
+ /**
38
+ * Constructs a new <code>DeleteExternalRepositoryApiResponse</code>.
39
+ * REST response for all response codes in API path /multidomain/v4.2/config/external-repositories/{extId} Delete operation
40
+ * @alias module:Ntnx/DeleteExternalRepositoryApiResponse
41
+ */
42
+ constructor() {
43
+ super();
44
+ /*
45
+ * toJson method for a map type which supports map with primitive keys and values of object types
46
+ * @param {Object} obj
47
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
48
+ * Otherwise, just returns the input object.
49
+ */
50
+ _classPrivateMethodInitSpec(this, _DeleteExternalRepositoryApiResponse_brand);
51
+ this.$objectType = "multidomain.v4.config.DeleteExternalRepositoryApiResponse";
52
+ /** @type {object<string, any>} */
53
+ this.$reserved = {
54
+ '$fv': "v4.r2"
55
+ };
56
+ /** @type {object<string, any>} */
57
+ this.$unknownFields = {};
58
+ }
59
+
60
+ /**
61
+ * Constructs a <code>DeleteExternalRepositoryApiResponse</code> from a plain JavaScript object, optionally creating a new instance.
62
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
63
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
64
+ * @param {module:Ntnx/DeleteExternalRepositoryApiResponse} obj Optional instance to populate.
65
+ * @param callFromChild {Boolean} Flag to recognise calling instance
66
+ * @return {module:Ntnx/DeleteExternalRepositoryApiResponse} The populated <code>DeleteExternalRepositoryApiResponse</code> instance.
67
+ */
68
+ static constructFromObject(data, obj = null, callFromChild = false) {
69
+ let items, item, i, itemArr, discriminator;
70
+ if (data) {
71
+ obj = obj || new DeleteExternalRepositoryApiResponse();
72
+ if (data.hasOwnProperty('metadata')) {
73
+ _Paginable.default.constructFromObject(data['metadata'], obj);
74
+ }
75
+ if (data.hasOwnProperty('metadata') && data.metadata !== null && data.metadata !== undefined) {
76
+ obj.setMetadata(_ApiResponseMetadata.default.constructFromObject(data['metadata']));
77
+ }
78
+ if (data.hasOwnProperty('data') && data.data !== null && data.data !== undefined) {
79
+ if (data['data'].hasOwnProperty('$objectType')) {
80
+ discriminator = data['data']['$objectType'];
81
+ } else {
82
+ discriminator = typeof data['data'];
83
+ }
84
+ switch (discriminator) {
85
+ case 'prism.v4.config.TaskReference':
86
+ obj.setData(_TaskReference.default.constructFromObject(data['data'], undefined));
87
+ break;
88
+ case 'multidomain.v4.error.ErrorResponse':
89
+ obj.setData(_ErrorResponse.default.constructFromObject(data['data'], undefined));
90
+ break;
91
+ default:
92
+ throw "Unknown datatype " + discriminator + " in data";
93
+ }
94
+ }
95
+ if (data.hasOwnProperty('$reserved')) {
96
+ obj.$reserved = data['$reserved'];
97
+ }
98
+ if (data.hasOwnProperty('$objectType')) {
99
+ obj.$objectType = data['$objectType'];
100
+ }
101
+ if (data.hasOwnProperty('$unknownFields')) {
102
+ obj.$unknownFields = data['$unknownFields'];
103
+ }
104
+ if (!callFromChild) {
105
+ obj.$unknownFields = {
106
+ ...data.$unknownFields
107
+ };
108
+ for (const property in data) {
109
+ // Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
110
+ // as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
111
+ // Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
112
+ // If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
113
+ if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
114
+ obj.$unknownFields[property] = data[property];
115
+ }
116
+ }
117
+ }
118
+ }
119
+ return obj;
120
+ }
121
+
122
+ /**
123
+ * Converts a given snake_case string to camelCase.
124
+ * @param {string} snakeStr - The input string in snake_case format.
125
+ * @returns {string} - The converted string in camelCase format.
126
+ */
127
+ static snakeToCamel(snakeStr) {
128
+ return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
129
+ }
130
+
131
+ /**
132
+ * @return {ApiResponseMetadata}
133
+ */
134
+ getMetadata() {
135
+ return this.metadata;
136
+ }
137
+
138
+ /**
139
+ * @param {ApiResponseMetadata} metadata
140
+ */
141
+ setMetadata(metadata) {
142
+ this.metadata = metadata;
143
+ }
144
+
145
+ /**
146
+ * @return {TaskReference | ErrorResponse}
147
+ */
148
+ getData() {
149
+ return this.data;
150
+ }
151
+
152
+ /**
153
+ * @param {TaskReference | ErrorResponse} data
154
+ */
155
+ setData(data) {
156
+ this.data = data;
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.getMetadata() !== 'undefined' && this.getMetadata() !== null ? {
171
+ 'metadata': this.getMetadata().toJson(false)
172
+ } : {}),
173
+ ...(typeof this.getData() !== 'undefined' && this.getData() !== null ? {
174
+ 'data': typeof this.getData().toJson !== "undefined" ? this.getData().toJson(false) : Array.isArray(this.getData()) ? this.getData().map(item => typeof item.toJson !== "undefined" ? item.toJson(false) : item) : _assertClassBrand(_DeleteExternalRepositoryApiResponse_brand, this, _toJsonMapType).call(this, this.getData(), false)
175
+ } : {}),
176
+ '$reserved': this.get$Reserved(),
177
+ '$objectType': this.get$ObjectType(),
178
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
179
+ '$unknownFields': {}
180
+ };
181
+ }
182
+ return {
183
+ ...(typeof this.getMetadata() !== 'undefined' && this.getMetadata() !== null ? {
184
+ 'metadata': this.getMetadata().toJson(false)
185
+ } : {}),
186
+ ...(typeof this.getData() !== 'undefined' && this.getData() !== null ? {
187
+ 'data': typeof this.getData().toJson !== "undefined" ? this.getData().toJson() : Array.isArray(this.getData()) ? this.getData().map(item => typeof item.toJson !== "undefined" ? item.toJson() : item) : _assertClassBrand(_DeleteExternalRepositoryApiResponse_brand, this, _toJsonMapType).call(this, this.getData())
188
+ } : {}),
189
+ '$reserved': this.get$Reserved(),
190
+ '$objectType': this.get$ObjectType(),
191
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
192
+ '$unknownFields': {}
193
+ };
194
+ }
195
+ validate(scope, properties) {
196
+ let propList = [];
197
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
198
+ //cases validate() and validate(scope)
199
+ propList = [];
200
+ } else if (arguments.length === 1) {
201
+ //case validate(properties)
202
+ propList = arguments[0];
203
+ scope = null;
204
+ } else {
205
+ //case validate(scope, properties)
206
+ propList = arguments[1];
207
+ }
208
+ let res = [];
209
+ let err = null;
210
+ propList.forEach(property => {
211
+ err = this.validateProperty(property, scope);
212
+ if (err) {
213
+ res.push(err);
214
+ }
215
+ });
216
+ return new Promise(function (resolve, reject) {
217
+ if (res.length !== 0) {
218
+ reject(err);
219
+ } else {
220
+ resolve();
221
+ }
222
+ });
223
+ }
224
+ validateProperty(scope, property) {
225
+ if (property === "metadata") {
226
+ if (typeof this.metadata === 'undefined' || this.metadata === null) {
227
+ return new _ValidationError.default("metadata", "undefined or null");
228
+ }
229
+ }
230
+ if (property === "data") {
231
+ if (typeof this.data === 'undefined' || this.data === null) {
232
+ return new _ValidationError.default("data", "undefined or null");
233
+ }
234
+ }
235
+ if (property === "$reserved") {
236
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
237
+ return new _ValidationError.default("$reserved", "undefined or null");
238
+ }
239
+ }
240
+ if (property === "$objectType") {
241
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
242
+ return new _ValidationError.default("$objectType", "undefined or null");
243
+ }
244
+ }
245
+ if (property === "$unknownFields") {
246
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
247
+ return new _ValidationError.default("$unknownFields", "undefined or null");
248
+ }
249
+ }
250
+ return new _ValidationError.default(property, "no such property exists");
251
+ }
252
+ }
253
+
254
+ /**
255
+ * @memberof DeleteExternalRepositoryApiResponse
256
+ */
257
+ exports.default = DeleteExternalRepositoryApiResponse;
258
+ function _toJsonMapType(obj, forMutation) {
259
+ if (obj instanceof Map) {
260
+ return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
261
+ } else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
262
+ return Object.fromEntries(Array.from(Object.entries(obj), entry => {
263
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
264
+ }));
265
+ }
266
+ return obj;
267
+ }
268
+ /*
269
+ * toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
270
+ * @param {Object} obj Object to serialize
271
+ * @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
272
+ * @returns {Object|string} Returns serialized date object or original input object
273
+ */
274
+ function _handleDateType(obj, isDateOnly) {
275
+ if (obj instanceof Date && isDateOnly !== undefined) {
276
+ return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
277
+ }
278
+ return obj;
279
+ }
280
+ DeleteExternalRepositoryApiResponse.prototype.metadata = undefined;
281
+
282
+ /**
283
+ * @memberof DeleteExternalRepositoryApiResponse
284
+ */
285
+ DeleteExternalRepositoryApiResponse.prototype.data = undefined;
286
+ DeleteExternalRepositoryApiResponse.prototype.$reserved = undefined;
287
+ DeleteExternalRepositoryApiResponse.prototype.$objectType = undefined;
288
+ DeleteExternalRepositoryApiResponse.prototype.$unknownFields = undefined;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The ExternalRepository model module.
3
+ * @module Ntnx/ExternalRepository
4
+ * @version 4.2.1
5
+ * @class ExternalRepository
6
+ * @extends ExternalizableAbstractModel
7
+ *
8
+ * @param { string } name External repository name.
9
+ * @param { NfsRepository } location location Details.
10
+ *
11
+ */
12
+ export default class ExternalRepository extends ExternalizableAbstractModel {
13
+ /**
14
+ * Constructs a new <code>ExternalRepository</code>.
15
+ * @alias module:Ntnx/ExternalRepository
16
+ * @extends module:Ntnx/ExternalizableAbstractModel
17
+ *
18
+ * @param { string } name External repository name.
19
+ * @param { NfsRepository } location location Details.
20
+ *
21
+ */
22
+ constructor(name: string, location: NfsRepository);
23
+ name: string;
24
+ location: NfsRepository;
25
+ /**
26
+ * Returns External repository name.
27
+ * @return {string}
28
+ */
29
+ getName(): string;
30
+ /**
31
+ * Sets External repository name.
32
+ * @param {string} name External repository name.
33
+ */
34
+ setName(name: string): void;
35
+ /**
36
+ * Returns location Details.
37
+ * @return {NfsRepository}
38
+ */
39
+ getLocation(): NfsRepository;
40
+ /**
41
+ * Sets location Details.
42
+ * @param {NfsRepository} location location Details.
43
+ */
44
+ setLocation(location: NfsRepository): void;
45
+ /**
46
+ * Returns External identifier of the owner of the repository.
47
+ * @return {string}
48
+ */
49
+ getOwnerExtId(): string;
50
+ /**
51
+ * Sets External identifier of the owner of the repository.
52
+ * @param {string} ownerExtId External identifier of the owner of the repository.
53
+ */
54
+ setOwnerExtId(ownerExtId: string): void;
55
+ ownerExtId: string;
56
+ #private;
57
+ }
58
+ import ExternalizableAbstractModel from "../../../common/v1/response/ExternalizableAbstractModel";
59
+ import NfsRepository from "./NfsRepository";
@@ -0,0 +1,328 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _TenantAwareModel = _interopRequireDefault(require("../../../common/v1/config/TenantAwareModel"));
8
+ var _ExternalizableAbstractModel = _interopRequireDefault(require("../../../common/v1/response/ExternalizableAbstractModel"));
9
+ var _NfsRepository = _interopRequireDefault(require("./NfsRepository"));
10
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
11
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
12
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
15
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
16
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } /*
17
+ * Nutanix Multidomain Versioned APIs
18
+ *
19
+ * OpenAPI spec version: 4.2.1
20
+ *
21
+ * NOTE: This class is auto generated by the Open API Dev Platform.
22
+ *
23
+ * Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
24
+ *
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The ExternalRepository model module.
30
+ * @module Ntnx/ExternalRepository
31
+ * @version 4.2.1
32
+ * @class ExternalRepository
33
+ * @extends ExternalizableAbstractModel
34
+ *
35
+ * @param { string } name External repository name.
36
+ * @param { NfsRepository } location location Details.
37
+ *
38
+ */
39
+ var _ExternalRepository_brand = /*#__PURE__*/new WeakSet();
40
+ class ExternalRepository extends _ExternalizableAbstractModel.default {
41
+ /**
42
+ * Constructs a new <code>ExternalRepository</code>.
43
+ * @alias module:Ntnx/ExternalRepository
44
+ * @extends module:Ntnx/ExternalizableAbstractModel
45
+ *
46
+ * @param { string } name External repository name.
47
+ * @param { NfsRepository } location location Details.
48
+ *
49
+ */
50
+ constructor(name, location) {
51
+ super();
52
+ /*
53
+ * toJson method for a map type which supports map with primitive keys and values of object types
54
+ * @param {Object} obj
55
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
56
+ * Otherwise, just returns the input object.
57
+ */
58
+ _classPrivateMethodInitSpec(this, _ExternalRepository_brand);
59
+ this.name = name;
60
+ this.location = location;
61
+ this.$objectType = "multidomain.v4.config.ExternalRepository";
62
+ /** @type {object<string, any>} */
63
+ this.$reserved = {
64
+ '$fv': "v4.r2"
65
+ };
66
+ /** @type {object<string, any>} */
67
+ this.$unknownFields = {};
68
+ }
69
+
70
+ /**
71
+ * Constructs a <code>ExternalRepository</code> from a plain JavaScript object, optionally creating a new instance.
72
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
73
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
74
+ * @param {module:Ntnx/ExternalRepository} obj Optional instance to populate.
75
+ * @param callFromChild {Boolean} Flag to recognise calling instance
76
+ * @return {module:Ntnx/ExternalRepository} The populated <code>ExternalRepository</code> instance.
77
+ */
78
+ static constructFromObject(data, obj = null, callFromChild = false) {
79
+ let items, item, i, itemArr, discriminator;
80
+ if (data) {
81
+ obj = obj || new ExternalRepository();
82
+ _ExternalizableAbstractModel.default.constructFromObject(data, obj, true);
83
+ if (data.hasOwnProperty('name') && data.name !== null && data.name !== undefined) {
84
+ obj.setName(data['name']);
85
+ }
86
+ if (data.hasOwnProperty('location') && data.location !== null && data.location !== undefined) {
87
+ if (data['location'].hasOwnProperty('$objectType')) {
88
+ discriminator = data['location']['$objectType'];
89
+ } else {
90
+ discriminator = typeof data['location'];
91
+ }
92
+ switch (discriminator) {
93
+ case 'multidomain.v4.config.NfsRepository':
94
+ obj.setLocation(_NfsRepository.default.constructFromObject(data['location'], undefined));
95
+ break;
96
+ default:
97
+ throw "Unknown datatype " + discriminator + " in data";
98
+ }
99
+ }
100
+ if (data.hasOwnProperty('ownerExtId') && data.ownerExtId !== null && data.ownerExtId !== undefined) {
101
+ obj.setOwnerExtId(data['ownerExtId']);
102
+ }
103
+ if (!callFromChild) {
104
+ obj.$unknownFields = {
105
+ ...data.$unknownFields
106
+ };
107
+ for (const property in data) {
108
+ // Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
109
+ // as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
110
+ // Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
111
+ // If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
112
+ if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
113
+ obj.$unknownFields[property] = data[property];
114
+ }
115
+ }
116
+ }
117
+ }
118
+ return obj;
119
+ }
120
+
121
+ /**
122
+ * Converts a given snake_case string to camelCase.
123
+ * @param {string} snakeStr - The input string in snake_case format.
124
+ * @returns {string} - The converted string in camelCase format.
125
+ */
126
+ static snakeToCamel(snakeStr) {
127
+ return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
128
+ }
129
+
130
+ /**
131
+ * Returns External repository name.
132
+ * @return {string}
133
+ */
134
+ getName() {
135
+ return this.name;
136
+ }
137
+
138
+ /**
139
+ * Sets External repository name.
140
+ * @param {string} name External repository name.
141
+ */
142
+ setName(name) {
143
+ this.name = name;
144
+ }
145
+
146
+ /**
147
+ * Returns location Details.
148
+ * @return {NfsRepository}
149
+ */
150
+ getLocation() {
151
+ return this.location;
152
+ }
153
+
154
+ /**
155
+ * Sets location Details.
156
+ * @param {NfsRepository} location location Details.
157
+ */
158
+ setLocation(location) {
159
+ this.location = location;
160
+ }
161
+
162
+ /**
163
+ * Returns External identifier of the owner of the repository.
164
+ * @return {string}
165
+ */
166
+ getOwnerExtId() {
167
+ return this.ownerExtId;
168
+ }
169
+
170
+ /**
171
+ * Sets External identifier of the owner of the repository.
172
+ * @param {string} ownerExtId External identifier of the owner of the repository.
173
+ */
174
+ setOwnerExtId(ownerExtId) {
175
+ this.ownerExtId = ownerExtId;
176
+ }
177
+ toJson(forMutation) {
178
+ if (forMutation === false) {
179
+ return {
180
+ ...(typeof this.getName() !== 'undefined' && this.getName() !== null ? {
181
+ 'name': this.getName()
182
+ } : {}),
183
+ ...(typeof this.getLocation() !== 'undefined' && this.getLocation() !== null ? {
184
+ 'location': typeof this.getLocation().toJson !== "undefined" ? this.getLocation().toJson(false) : Array.isArray(this.getLocation()) ? this.getLocation().map(item => typeof item.toJson !== "undefined" ? item.toJson(false) : item) : _assertClassBrand(_ExternalRepository_brand, this, _toJsonMapType).call(this, this.getLocation(), false)
185
+ } : {}),
186
+ ...(typeof this.getOwnerExtId() !== 'undefined' && this.getOwnerExtId() !== null ? {
187
+ 'ownerExtId': this.getOwnerExtId()
188
+ } : {}),
189
+ ...(typeof this.getExtId() !== 'undefined' && this.getExtId() !== null ? {
190
+ 'extId': this.getExtId()
191
+ } : {}),
192
+ ...(typeof this.getLinks() !== 'undefined' && this.getLinks() !== null ? {
193
+ 'links': this.getLinks().map(item => item.toJson(false))
194
+ } : {}),
195
+ ...(typeof this.getTenantId() !== 'undefined' && this.getTenantId() !== null ? {
196
+ 'tenantId': this.getTenantId()
197
+ } : {}),
198
+ '$reserved': this.get$Reserved(),
199
+ '$objectType': this.get$ObjectType(),
200
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
201
+ '$unknownFields': {}
202
+ };
203
+ }
204
+ return {
205
+ ...(typeof this.getName() !== 'undefined' && this.getName() !== null ? {
206
+ 'name': this.getName()
207
+ } : {}),
208
+ ...(typeof this.getLocation() !== 'undefined' && this.getLocation() !== null ? {
209
+ 'location': typeof this.getLocation().toJson !== "undefined" ? this.getLocation().toJson() : Array.isArray(this.getLocation()) ? this.getLocation().map(item => typeof item.toJson !== "undefined" ? item.toJson() : item) : _assertClassBrand(_ExternalRepository_brand, this, _toJsonMapType).call(this, this.getLocation())
210
+ } : {}),
211
+ '$reserved': this.get$Reserved(),
212
+ '$objectType': this.get$ObjectType(),
213
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
214
+ '$unknownFields': {}
215
+ };
216
+ }
217
+ validate(scope, properties) {
218
+ let propList = [];
219
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
220
+ //cases validate() and validate(scope)
221
+ propList = ["name", "location"];
222
+ } else if (arguments.length === 1) {
223
+ //case validate(properties)
224
+ propList = arguments[0];
225
+ scope = null;
226
+ } else {
227
+ //case validate(scope, properties)
228
+ propList = arguments[1];
229
+ }
230
+ let res = [];
231
+ let err = null;
232
+ propList.forEach(property => {
233
+ err = this.validateProperty(property, scope);
234
+ if (err) {
235
+ res.push(err);
236
+ }
237
+ });
238
+ return new Promise(function (resolve, reject) {
239
+ if (res.length !== 0) {
240
+ reject(err);
241
+ } else {
242
+ resolve();
243
+ }
244
+ });
245
+ }
246
+ validateProperty(scope, property) {
247
+ if (property === "name") {
248
+ if (typeof this.name === 'undefined' || this.name === null) {
249
+ return new _ValidationError.default("name", "undefined or null");
250
+ }
251
+ if (!_ValidationUtils.default.validateMaxLength(this.name, 255)) {
252
+ return new _ValidationError.default("name", "does not satisfy required maxLength constraint: 255");
253
+ }
254
+ }
255
+ if (property === "location") {
256
+ if (typeof this.location === 'undefined' || this.location === null) {
257
+ return new _ValidationError.default("location", "undefined or null");
258
+ }
259
+ }
260
+ if (property === "ownerExtId") {
261
+ if (typeof this.ownerExtId === 'undefined' || this.ownerExtId === null) {
262
+ return new _ValidationError.default("ownerExtId", "undefined or null");
263
+ }
264
+ if (!_ValidationUtils.default.validatePattern(this.ownerExtId, /^[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}$/)) {
265
+ return new _ValidationError.default("ownerExtId", "does not satisfy required pattern: /^[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}$/");
266
+ }
267
+ }
268
+ return new _ValidationError.default(property, "no such property exists");
269
+ }
270
+ }
271
+
272
+ /**
273
+ * External repository name.
274
+ * @memberof ExternalRepository
275
+ */
276
+ exports.default = ExternalRepository;
277
+ function _toJsonMapType(obj, forMutation) {
278
+ if (obj instanceof Map) {
279
+ return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
280
+ } else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
281
+ return Object.fromEntries(Array.from(Object.entries(obj), entry => {
282
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
283
+ }));
284
+ }
285
+ return obj;
286
+ }
287
+ /*
288
+ * toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
289
+ * @param {Object} obj Object to serialize
290
+ * @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
291
+ * @returns {Object|string} Returns serialized date object or original input object
292
+ */
293
+ function _handleDateType(obj, isDateOnly) {
294
+ if (obj instanceof Date && isDateOnly !== undefined) {
295
+ return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
296
+ }
297
+ return obj;
298
+ }
299
+ ExternalRepository.prototype.name = undefined;
300
+
301
+ /**
302
+ * location Details.
303
+ * @memberof ExternalRepository
304
+ */
305
+ ExternalRepository.prototype.location = undefined;
306
+
307
+ /**
308
+ * External identifier of the owner of the repository.
309
+ * @memberof ExternalRepository
310
+ */
311
+ ExternalRepository.prototype.ownerExtId = undefined;
312
+
313
+ /**
314
+ * A globally unique identifier of an instance that is suitable for external consumption.
315
+ * @memberof ExternalRepository
316
+ */
317
+ _ExternalizableAbstractModel.default.prototype.extId = undefined;
318
+ /**
319
+ * A HATEOAS style link for the response. Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource.
320
+ * @memberof ExternalRepository
321
+ */
322
+ _ExternalizableAbstractModel.default.prototype.links = undefined;
323
+ /**
324
+ * A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this ID to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
325
+ * @memberof ExternalRepository
326
+ */
327
+ _TenantAwareModel.default.prototype.tenantId = undefined;
328
+ // Implement OneOfmultidomain.v4.config.GetExternalRepositoryApiResponsedata interface: