@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,419 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _Flag = _interopRequireDefault(require("../config/Flag"));
8
+ var _KVPair = _interopRequireDefault(require("../config/KVPair"));
9
+ var _Message = _interopRequireDefault(require("../config/Message"));
10
+ var _ApiLink = _interopRequireDefault(require("./ApiLink"));
11
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
12
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
13
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
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
+ * 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 ApiResponseMetadata model module.
30
+ * @module Ntnx/ApiResponseMetadata
31
+ * @version 4.2.1
32
+ * @class ApiResponseMetadata
33
+ */
34
+ var _ApiResponseMetadata_brand = /*#__PURE__*/new WeakSet();
35
+ class ApiResponseMetadata {
36
+ /**
37
+ * Constructs a new <code>ApiResponseMetadata</code>.
38
+ * The metadata associated with an API response. This value is always present and minimally contains the self-link for the API request that produced this response. It also contains pagination data for the paginated requests.
39
+ * @alias module:Ntnx/ApiResponseMetadata
40
+ */
41
+ constructor() {
42
+ /*
43
+ * toJson method for a map type which supports map with primitive keys and values of object types
44
+ * @param {Object} obj
45
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
46
+ * Otherwise, just returns the input object.
47
+ */
48
+ _classPrivateMethodInitSpec(this, _ApiResponseMetadata_brand);
49
+ this.$objectType = "common.v1.response.ApiResponseMetadata";
50
+ /** @type {object<string, any>} */
51
+ this.$reserved = {
52
+ '$fv': "v1.r0"
53
+ };
54
+ /** @type {object<string, any>} */
55
+ this.$unknownFields = {};
56
+ }
57
+
58
+ /**
59
+ * Constructs a <code>ApiResponseMetadata</code> from a plain JavaScript object, optionally creating a new instance.
60
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
61
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
62
+ * @param {module:Ntnx/ApiResponseMetadata} obj Optional instance to populate.
63
+ * @param callFromChild {Boolean} Flag to recognise calling instance
64
+ * @return {module:Ntnx/ApiResponseMetadata} The populated <code>ApiResponseMetadata</code> instance.
65
+ */
66
+ static constructFromObject(data, obj = null, callFromChild = false) {
67
+ let items, item, i, itemArr, discriminator;
68
+ if (data) {
69
+ obj = obj || new ApiResponseMetadata();
70
+ if (data.hasOwnProperty('flags') && data.flags !== null && data.flags !== undefined) {
71
+ itemArr = [];
72
+ items = data.flags;
73
+ for (i = 0; i < items.length; i++) {
74
+ item = _Flag.default.constructFromObject(items[i], undefined);
75
+ itemArr.push(item);
76
+ }
77
+ obj.setFlags(itemArr);
78
+ }
79
+ if (data.hasOwnProperty('links') && data.links !== null && data.links !== undefined) {
80
+ itemArr = [];
81
+ items = data.links;
82
+ for (i = 0; i < items.length; i++) {
83
+ item = _ApiLink.default.constructFromObject(items[i], undefined);
84
+ itemArr.push(item);
85
+ }
86
+ obj.setLinks(itemArr);
87
+ }
88
+ if (data.hasOwnProperty('totalAvailableResults') && data.totalAvailableResults !== null && data.totalAvailableResults !== undefined) {
89
+ obj.setTotalAvailableResults(data['totalAvailableResults']);
90
+ }
91
+ if (data.hasOwnProperty('messages') && data.messages !== null && data.messages !== undefined) {
92
+ itemArr = [];
93
+ items = data.messages;
94
+ for (i = 0; i < items.length; i++) {
95
+ item = _Message.default.constructFromObject(items[i], undefined);
96
+ itemArr.push(item);
97
+ }
98
+ obj.setMessages(itemArr);
99
+ }
100
+ if (data.hasOwnProperty('extraInfo') && data.extraInfo !== null && data.extraInfo !== undefined) {
101
+ itemArr = [];
102
+ items = data.extraInfo;
103
+ for (i = 0; i < items.length; i++) {
104
+ item = _KVPair.default.constructFromObject(items[i], undefined);
105
+ itemArr.push(item);
106
+ }
107
+ obj.setExtraInfo(itemArr);
108
+ }
109
+ if (data.hasOwnProperty('$reserved')) {
110
+ obj.$reserved = data['$reserved'];
111
+ }
112
+ if (data.hasOwnProperty('$objectType')) {
113
+ obj.$objectType = data['$objectType'];
114
+ }
115
+ if (data.hasOwnProperty('$unknownFields')) {
116
+ obj.$unknownFields = data['$unknownFields'];
117
+ }
118
+ if (!callFromChild) {
119
+ obj.$unknownFields = {
120
+ ...data.$unknownFields
121
+ };
122
+ for (const property in data) {
123
+ // Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
124
+ // as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
125
+ // Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
126
+ // If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
127
+ if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
128
+ obj.$unknownFields[property] = data[property];
129
+ }
130
+ }
131
+ }
132
+ }
133
+ return obj;
134
+ }
135
+
136
+ /**
137
+ * Converts a given snake_case string to camelCase.
138
+ * @param {string} snakeStr - The input string in snake_case format.
139
+ * @returns {string} - The converted string in camelCase format.
140
+ */
141
+ static snakeToCamel(snakeStr) {
142
+ return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
143
+ }
144
+
145
+ /**
146
+ * Returns An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated.
147
+ * @return {Flag[]}
148
+ */
149
+ getFlags() {
150
+ return this.flags;
151
+ }
152
+
153
+ /**
154
+ * Sets An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated.
155
+ * @param {Flag[]} flags An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated.
156
+ */
157
+ setFlags(flags) {
158
+ this.flags = flags;
159
+ }
160
+
161
+ /**
162
+ * Returns An array of HATEOAS style links for the response that may also include pagination links for list operations.
163
+ * @return {ApiLink[]}
164
+ */
165
+ getLinks() {
166
+ return this.links;
167
+ }
168
+
169
+ /**
170
+ * Sets An array of HATEOAS style links for the response that may also include pagination links for list operations.
171
+ * @param {ApiLink[]} links An array of HATEOAS style links for the response that may also include pagination links for list operations.
172
+ */
173
+ setLinks(links) {
174
+ this.links = links;
175
+ }
176
+
177
+ /**
178
+ * Returns The total number of entities that are available on the server for this type.
179
+ * @return {Number}
180
+ */
181
+ getTotalAvailableResults() {
182
+ return this.totalAvailableResults;
183
+ }
184
+
185
+ /**
186
+ * Sets The total number of entities that are available on the server for this type.
187
+ * @param {Number} totalAvailableResults The total number of entities that are available on the server for this type.
188
+ */
189
+ setTotalAvailableResults(totalAvailableResults) {
190
+ this.totalAvailableResults = totalAvailableResults;
191
+ }
192
+
193
+ /**
194
+ * Returns Information, Warning or Error messages that might provide additional contextual information related to the operation.
195
+ * @return {Message[]}
196
+ */
197
+ getMessages() {
198
+ return this.messages;
199
+ }
200
+
201
+ /**
202
+ * Sets Information, Warning or Error messages that might provide additional contextual information related to the operation.
203
+ * @param {Message[]} messages Information, Warning or Error messages that might provide additional contextual information related to the operation.
204
+ */
205
+ setMessages(messages) {
206
+ this.messages = messages;
207
+ }
208
+
209
+ /**
210
+ * Returns An array of entity-specific metadata
211
+ * @return {KVPair[]}
212
+ */
213
+ getExtraInfo() {
214
+ return this.extraInfo;
215
+ }
216
+
217
+ /**
218
+ * Sets An array of entity-specific metadata
219
+ * @param {KVPair[]} extraInfo An array of entity-specific metadata
220
+ */
221
+ setExtraInfo(extraInfo) {
222
+ this.extraInfo = extraInfo;
223
+ }
224
+ get$Reserved() {
225
+ return this.$reserved;
226
+ }
227
+ get$ObjectType() {
228
+ return this.$objectType;
229
+ }
230
+ get$UnknownFields() {
231
+ return this.$unknownFields;
232
+ }
233
+ toJson(forMutation) {
234
+ if (forMutation === false) {
235
+ return {
236
+ ...(typeof this.getFlags() !== 'undefined' && this.getFlags() !== null ? {
237
+ 'flags': this.getFlags().map(item => item.toJson(false))
238
+ } : {}),
239
+ ...(typeof this.getLinks() !== 'undefined' && this.getLinks() !== null ? {
240
+ 'links': this.getLinks().map(item => item.toJson(false))
241
+ } : {}),
242
+ ...(typeof this.getTotalAvailableResults() !== 'undefined' && this.getTotalAvailableResults() !== null ? {
243
+ 'totalAvailableResults': this.getTotalAvailableResults()
244
+ } : {}),
245
+ ...(typeof this.getMessages() !== 'undefined' && this.getMessages() !== null ? {
246
+ 'messages': this.getMessages().map(item => item.toJson(false))
247
+ } : {}),
248
+ ...(typeof this.getExtraInfo() !== 'undefined' && this.getExtraInfo() !== null ? {
249
+ 'extraInfo': this.getExtraInfo().map(item => item.toJson(false))
250
+ } : {}),
251
+ '$reserved': this.get$Reserved(),
252
+ '$objectType': this.get$ObjectType(),
253
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
254
+ '$unknownFields': {}
255
+ };
256
+ }
257
+ return {
258
+ ...(typeof this.getFlags() !== 'undefined' && this.getFlags() !== null ? {
259
+ 'flags': this.getFlags().map(item => item.toJson(false))
260
+ } : {}),
261
+ ...(typeof this.getLinks() !== 'undefined' && this.getLinks() !== null ? {
262
+ 'links': this.getLinks().map(item => item.toJson(false))
263
+ } : {}),
264
+ ...(typeof this.getTotalAvailableResults() !== 'undefined' && this.getTotalAvailableResults() !== null ? {
265
+ 'totalAvailableResults': this.getTotalAvailableResults()
266
+ } : {}),
267
+ ...(typeof this.getMessages() !== 'undefined' && this.getMessages() !== null ? {
268
+ 'messages': this.getMessages().map(item => item.toJson(false))
269
+ } : {}),
270
+ ...(typeof this.getExtraInfo() !== 'undefined' && this.getExtraInfo() !== null ? {
271
+ 'extraInfo': this.getExtraInfo().map(item => item.toJson(false))
272
+ } : {}),
273
+ '$reserved': this.get$Reserved(),
274
+ '$objectType': this.get$ObjectType(),
275
+ ...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
276
+ '$unknownFields': {}
277
+ };
278
+ }
279
+ validate(scope, properties) {
280
+ let propList = [];
281
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
282
+ //cases validate() and validate(scope)
283
+ propList = [];
284
+ } else if (arguments.length === 1) {
285
+ //case validate(properties)
286
+ propList = arguments[0];
287
+ scope = null;
288
+ } else {
289
+ //case validate(scope, properties)
290
+ propList = arguments[1];
291
+ }
292
+ let res = [];
293
+ let err = null;
294
+ propList.forEach(property => {
295
+ err = this.validateProperty(property, scope);
296
+ if (err) {
297
+ res.push(err);
298
+ }
299
+ });
300
+ return new Promise(function (resolve, reject) {
301
+ if (res.length !== 0) {
302
+ reject(err);
303
+ } else {
304
+ resolve();
305
+ }
306
+ });
307
+ }
308
+ validateProperty(scope, property) {
309
+ if (property === "flags") {
310
+ if (typeof this.flags === 'undefined' || this.flags === null) {
311
+ return new _ValidationError.default("flags", "undefined or null");
312
+ }
313
+ if (!_ValidationUtils.default.validateMaxItems(this.flags, 20)) {
314
+ return new _ValidationError.default("flags", "does not satisfy required maxItems constraint: 20");
315
+ }
316
+ }
317
+ if (property === "links") {
318
+ if (typeof this.links === 'undefined' || this.links === null) {
319
+ return new _ValidationError.default("links", "undefined or null");
320
+ }
321
+ if (!_ValidationUtils.default.validateMaxItems(this.links, 20)) {
322
+ return new _ValidationError.default("links", "does not satisfy required maxItems constraint: 20");
323
+ }
324
+ }
325
+ if (property === "totalAvailableResults") {
326
+ if (typeof this.totalAvailableResults === 'undefined' || this.totalAvailableResults === null) {
327
+ return new _ValidationError.default("totalAvailableResults", "undefined or null");
328
+ }
329
+ }
330
+ if (property === "messages") {
331
+ if (typeof this.messages === 'undefined' || this.messages === null) {
332
+ return new _ValidationError.default("messages", "undefined or null");
333
+ }
334
+ if (!_ValidationUtils.default.validateMaxItems(this.messages, 20)) {
335
+ return new _ValidationError.default("messages", "does not satisfy required maxItems constraint: 20");
336
+ }
337
+ }
338
+ if (property === "extraInfo") {
339
+ if (typeof this.extraInfo === 'undefined' || this.extraInfo === null) {
340
+ return new _ValidationError.default("extraInfo", "undefined or null");
341
+ }
342
+ if (!_ValidationUtils.default.validateMaxItems(this.extraInfo, 20)) {
343
+ return new _ValidationError.default("extraInfo", "does not satisfy required maxItems constraint: 20");
344
+ }
345
+ }
346
+ if (property === "$reserved") {
347
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
348
+ return new _ValidationError.default("$reserved", "undefined or null");
349
+ }
350
+ }
351
+ if (property === "$objectType") {
352
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
353
+ return new _ValidationError.default("$objectType", "undefined or null");
354
+ }
355
+ }
356
+ if (property === "$unknownFields") {
357
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
358
+ return new _ValidationError.default("$unknownFields", "undefined or null");
359
+ }
360
+ }
361
+ return new _ValidationError.default(property, "no such property exists");
362
+ }
363
+ }
364
+
365
+ /**
366
+ * An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated.
367
+ * @memberof ApiResponseMetadata
368
+ */
369
+ exports.default = ApiResponseMetadata;
370
+ function _toJsonMapType(obj, forMutation) {
371
+ if (obj instanceof Map) {
372
+ return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
373
+ } else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
374
+ return Object.fromEntries(Array.from(Object.entries(obj), entry => {
375
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
376
+ }));
377
+ }
378
+ return obj;
379
+ }
380
+ /*
381
+ * toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
382
+ * @param {Object} obj Object to serialize
383
+ * @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
384
+ * @returns {Object|string} Returns serialized date object or original input object
385
+ */
386
+ function _handleDateType(obj, isDateOnly) {
387
+ if (obj instanceof Date && isDateOnly !== undefined) {
388
+ return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
389
+ }
390
+ return obj;
391
+ }
392
+ ApiResponseMetadata.prototype.flags = undefined;
393
+
394
+ /**
395
+ * An array of HATEOAS style links for the response that may also include pagination links for list operations.
396
+ * @memberof ApiResponseMetadata
397
+ */
398
+ ApiResponseMetadata.prototype.links = undefined;
399
+
400
+ /**
401
+ * The total number of entities that are available on the server for this type.
402
+ * @memberof ApiResponseMetadata
403
+ */
404
+ ApiResponseMetadata.prototype.totalAvailableResults = undefined;
405
+
406
+ /**
407
+ * Information, Warning or Error messages that might provide additional contextual information related to the operation.
408
+ * @memberof ApiResponseMetadata
409
+ */
410
+ ApiResponseMetadata.prototype.messages = undefined;
411
+
412
+ /**
413
+ * An array of entity-specific metadata
414
+ * @memberof ApiResponseMetadata
415
+ */
416
+ ApiResponseMetadata.prototype.extraInfo = undefined;
417
+ ApiResponseMetadata.prototype.$reserved = undefined;
418
+ ApiResponseMetadata.prototype.$objectType = undefined;
419
+ ApiResponseMetadata.prototype.$unknownFields = undefined;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The ExternalizableAbstractModel model module.
3
+ * @module Ntnx/ExternalizableAbstractModel
4
+ * @version 4.2.1
5
+ * @class ExternalizableAbstractModel
6
+ * @extends TenantAwareModel
7
+ */
8
+ export default class ExternalizableAbstractModel extends TenantAwareModel {
9
+ /**
10
+ * Returns A globally unique identifier of an instance that is suitable for external consumption.
11
+ * @return {string}
12
+ */
13
+ getExtId(): string;
14
+ /**
15
+ * Sets A globally unique identifier of an instance that is suitable for external consumption.
16
+ * @param {string} extId A globally unique identifier of an instance that is suitable for external consumption.
17
+ */
18
+ setExtId(extId: string): void;
19
+ extId: string;
20
+ /**
21
+ * Returns 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.
22
+ * @return {ApiLink[]}
23
+ */
24
+ getLinks(): ApiLink[];
25
+ /**
26
+ * Sets 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.
27
+ * @param {ApiLink[]} links 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.
28
+ */
29
+ setLinks(links: ApiLink[]): void;
30
+ links: ApiLink[];
31
+ #private;
32
+ }
33
+ import TenantAwareModel from "../config/TenantAwareModel";
34
+ import ApiLink from "./ApiLink";