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