@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.
- package/LICENSE.txt +202 -0
- package/README.md +224 -0
- package/dist/Ntnx-Multidomain-js-client-prod.js +1 -0
- package/dist/Ntnx-Multidomain-js-client.js +713 -0
- package/dist/es/ApiClient.d.ts +194 -0
- package/dist/es/ApiClient.js +1449 -0
- package/dist/es/Paginable.d.ts +95 -0
- package/dist/es/Paginable.js +248 -0
- package/dist/es/apis/externalrepositories-endpoints.d.ts +84 -0
- package/dist/es/apis/externalrepositories-endpoints.js +267 -0
- package/dist/es/index.d.ts +60 -0
- package/dist/es/index.js +236 -0
- package/dist/es/models/common/v1/config/FQDN.d.ts +47 -0
- package/dist/es/models/common/v1/config/FQDN.js +238 -0
- package/dist/es/models/common/v1/config/Flag.d.ts +58 -0
- package/dist/es/models/common/v1/config/Flag.js +278 -0
- package/dist/es/models/common/v1/config/IPAddressOrFQDN.d.ts +70 -0
- package/dist/es/models/common/v1/config/IPAddressOrFQDN.js +313 -0
- package/dist/es/models/common/v1/config/IPv4Address.d.ts +70 -0
- package/dist/es/models/common/v1/config/IPv4Address.js +288 -0
- package/dist/es/models/common/v1/config/IPv6Address.d.ts +70 -0
- package/dist/es/models/common/v1/config/IPv6Address.js +288 -0
- package/dist/es/models/common/v1/config/KVPair.d.ts +65 -0
- package/dist/es/models/common/v1/config/KVPair.js +333 -0
- package/dist/es/models/common/v1/config/MapOfStringWrapper.d.ts +53 -0
- package/dist/es/models/common/v1/config/MapOfStringWrapper.js +236 -0
- package/dist/es/models/common/v1/config/Message.d.ts +79 -0
- package/dist/es/models/common/v1/config/Message.js +341 -0
- package/dist/es/models/common/v1/config/MessageSeverity.d.ts +19 -0
- package/dist/es/models/common/v1/config/MessageSeverity.js +89 -0
- package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +47 -0
- package/dist/es/models/common/v1/config/TenantAwareModel.js +235 -0
- package/dist/es/models/common/v1/response/ApiLink.d.ts +58 -0
- package/dist/es/models/common/v1/response/ApiLink.js +271 -0
- package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +95 -0
- package/dist/es/models/common/v1/response/ApiResponseMetadata.js +419 -0
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +34 -0
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +262 -0
- package/dist/es/models/multidomain/v4/config/CreateExternalRepositoryApiResponse.d.ts +58 -0
- package/dist/es/models/multidomain/v4/config/CreateExternalRepositoryApiResponse.js +288 -0
- package/dist/es/models/multidomain/v4/config/DeleteExternalRepositoryApiResponse.d.ts +58 -0
- package/dist/es/models/multidomain/v4/config/DeleteExternalRepositoryApiResponse.js +288 -0
- package/dist/es/models/multidomain/v4/config/ExternalRepository.d.ts +59 -0
- package/dist/es/models/multidomain/v4/config/ExternalRepository.js +328 -0
- package/dist/es/models/multidomain/v4/config/GetExternalRepositoryApiResponse.d.ts +58 -0
- package/dist/es/models/multidomain/v4/config/GetExternalRepositoryApiResponse.js +288 -0
- package/dist/es/models/multidomain/v4/config/ListExternalRepositoriesApiResponse.d.ts +58 -0
- package/dist/es/models/multidomain/v4/config/ListExternalRepositoriesApiResponse.js +310 -0
- package/dist/es/models/multidomain/v4/config/NFSServerAddress.d.ts +71 -0
- package/dist/es/models/multidomain/v4/config/NFSServerAddress.js +279 -0
- package/dist/es/models/multidomain/v4/config/NfsRepository.d.ts +73 -0
- package/dist/es/models/multidomain/v4/config/NfsRepository.js +299 -0
- package/dist/es/models/multidomain/v4/config/UpdateExternalRepositoryApiResponse.d.ts +58 -0
- package/dist/es/models/multidomain/v4/config/UpdateExternalRepositoryApiResponse.js +288 -0
- package/dist/es/models/multidomain/v4/error/AppMessage.d.ts +107 -0
- package/dist/es/models/multidomain/v4/error/AppMessage.js +415 -0
- package/dist/es/models/multidomain/v4/error/ErrorResponse.d.ts +47 -0
- package/dist/es/models/multidomain/v4/error/ErrorResponse.js +277 -0
- package/dist/es/models/multidomain/v4/error/SchemaValidationError.d.ts +92 -0
- package/dist/es/models/multidomain/v4/error/SchemaValidationError.js +389 -0
- package/dist/es/models/multidomain/v4/error/SchemaValidationErrorMessage.d.ts +69 -0
- package/dist/es/models/multidomain/v4/error/SchemaValidationErrorMessage.js +307 -0
- package/dist/es/models/prism/v4/config/TaskReference.d.ts +47 -0
- package/dist/es/models/prism/v4/config/TaskReference.js +242 -0
- package/dist/es/models/validation/ValidationError.d.ts +13 -0
- package/dist/es/models/validation/ValidationError.js +44 -0
- package/dist/es/models/validation/ValidationScopes.d.ts +9 -0
- package/dist/es/models/validation/ValidationScopes.js +38 -0
- package/dist/es/utils/ValidationUtils.d.ts +13 -0
- package/dist/es/utils/ValidationUtils.js +55 -0
- package/dist/lib/ApiClient.d.ts +194 -0
- package/dist/lib/ApiClient.js +1449 -0
- package/dist/lib/Paginable.d.ts +95 -0
- package/dist/lib/Paginable.js +248 -0
- package/dist/lib/apis/externalrepositories-endpoints.d.ts +84 -0
- package/dist/lib/apis/externalrepositories-endpoints.js +267 -0
- package/dist/lib/index.d.ts +60 -0
- package/dist/lib/index.js +236 -0
- package/dist/lib/models/common/v1/config/FQDN.d.ts +47 -0
- package/dist/lib/models/common/v1/config/FQDN.js +238 -0
- package/dist/lib/models/common/v1/config/Flag.d.ts +58 -0
- package/dist/lib/models/common/v1/config/Flag.js +278 -0
- package/dist/lib/models/common/v1/config/IPAddressOrFQDN.d.ts +70 -0
- package/dist/lib/models/common/v1/config/IPAddressOrFQDN.js +313 -0
- package/dist/lib/models/common/v1/config/IPv4Address.d.ts +70 -0
- package/dist/lib/models/common/v1/config/IPv4Address.js +288 -0
- package/dist/lib/models/common/v1/config/IPv6Address.d.ts +70 -0
- package/dist/lib/models/common/v1/config/IPv6Address.js +288 -0
- package/dist/lib/models/common/v1/config/KVPair.d.ts +65 -0
- package/dist/lib/models/common/v1/config/KVPair.js +333 -0
- package/dist/lib/models/common/v1/config/MapOfStringWrapper.d.ts +53 -0
- package/dist/lib/models/common/v1/config/MapOfStringWrapper.js +236 -0
- package/dist/lib/models/common/v1/config/Message.d.ts +79 -0
- package/dist/lib/models/common/v1/config/Message.js +341 -0
- package/dist/lib/models/common/v1/config/MessageSeverity.d.ts +19 -0
- package/dist/lib/models/common/v1/config/MessageSeverity.js +89 -0
- package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +47 -0
- package/dist/lib/models/common/v1/config/TenantAwareModel.js +235 -0
- package/dist/lib/models/common/v1/response/ApiLink.d.ts +58 -0
- package/dist/lib/models/common/v1/response/ApiLink.js +271 -0
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +95 -0
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +419 -0
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +34 -0
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +262 -0
- package/dist/lib/models/multidomain/v4/config/CreateExternalRepositoryApiResponse.d.ts +58 -0
- package/dist/lib/models/multidomain/v4/config/CreateExternalRepositoryApiResponse.js +288 -0
- package/dist/lib/models/multidomain/v4/config/DeleteExternalRepositoryApiResponse.d.ts +58 -0
- package/dist/lib/models/multidomain/v4/config/DeleteExternalRepositoryApiResponse.js +288 -0
- package/dist/lib/models/multidomain/v4/config/ExternalRepository.d.ts +59 -0
- package/dist/lib/models/multidomain/v4/config/ExternalRepository.js +328 -0
- package/dist/lib/models/multidomain/v4/config/GetExternalRepositoryApiResponse.d.ts +58 -0
- package/dist/lib/models/multidomain/v4/config/GetExternalRepositoryApiResponse.js +288 -0
- package/dist/lib/models/multidomain/v4/config/ListExternalRepositoriesApiResponse.d.ts +58 -0
- package/dist/lib/models/multidomain/v4/config/ListExternalRepositoriesApiResponse.js +310 -0
- package/dist/lib/models/multidomain/v4/config/NFSServerAddress.d.ts +71 -0
- package/dist/lib/models/multidomain/v4/config/NFSServerAddress.js +279 -0
- package/dist/lib/models/multidomain/v4/config/NfsRepository.d.ts +73 -0
- package/dist/lib/models/multidomain/v4/config/NfsRepository.js +299 -0
- package/dist/lib/models/multidomain/v4/config/UpdateExternalRepositoryApiResponse.d.ts +58 -0
- package/dist/lib/models/multidomain/v4/config/UpdateExternalRepositoryApiResponse.js +288 -0
- package/dist/lib/models/multidomain/v4/error/AppMessage.d.ts +107 -0
- package/dist/lib/models/multidomain/v4/error/AppMessage.js +415 -0
- package/dist/lib/models/multidomain/v4/error/ErrorResponse.d.ts +47 -0
- package/dist/lib/models/multidomain/v4/error/ErrorResponse.js +277 -0
- package/dist/lib/models/multidomain/v4/error/SchemaValidationError.d.ts +92 -0
- package/dist/lib/models/multidomain/v4/error/SchemaValidationError.js +389 -0
- package/dist/lib/models/multidomain/v4/error/SchemaValidationErrorMessage.d.ts +69 -0
- package/dist/lib/models/multidomain/v4/error/SchemaValidationErrorMessage.js +307 -0
- package/dist/lib/models/prism/v4/config/TaskReference.d.ts +47 -0
- package/dist/lib/models/prism/v4/config/TaskReference.js +242 -0
- package/dist/lib/models/validation/ValidationError.d.ts +13 -0
- package/dist/lib/models/validation/ValidationError.js +44 -0
- package/dist/lib/models/validation/ValidationScopes.d.ts +9 -0
- package/dist/lib/models/validation/ValidationScopes.js +38 -0
- package/dist/lib/utils/ValidationUtils.d.ts +13 -0
- package/dist/lib/utils/ValidationUtils.js +55 -0
- package/package.json +53 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _SchemaValidationErrorMessage = _interopRequireDefault(require("./SchemaValidationErrorMessage"));
|
|
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 SchemaValidationError model module.
|
|
28
|
+
* @module Ntnx/SchemaValidationError
|
|
29
|
+
* @version 4.2.1
|
|
30
|
+
* @class SchemaValidationError
|
|
31
|
+
*/
|
|
32
|
+
var _SchemaValidationError_brand = /*#__PURE__*/new WeakSet();
|
|
33
|
+
class SchemaValidationError {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>SchemaValidationError</code>.
|
|
36
|
+
* This schema is generated from SchemaValidationError.java
|
|
37
|
+
* @alias module:Ntnx/SchemaValidationError
|
|
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, _SchemaValidationError_brand);
|
|
47
|
+
this.$objectType = "multidomain.v4.error.SchemaValidationError";
|
|
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>SchemaValidationError</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/SchemaValidationError} obj Optional instance to populate.
|
|
61
|
+
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
62
|
+
* @return {module:Ntnx/SchemaValidationError} The populated <code>SchemaValidationError</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 SchemaValidationError();
|
|
68
|
+
if (data.hasOwnProperty('timestamp') && data.timestamp !== null && data.timestamp !== undefined) {
|
|
69
|
+
obj.setTimestamp(data['timestamp']);
|
|
70
|
+
}
|
|
71
|
+
if (data.hasOwnProperty('statusCode') && data.statusCode !== null && data.statusCode !== undefined) {
|
|
72
|
+
obj.setStatusCode(data['statusCode']);
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('error') && data.error !== null && data.error !== undefined) {
|
|
75
|
+
obj.setError(data['error']);
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('path') && data.path !== null && data.path !== undefined) {
|
|
78
|
+
obj.setPath(data['path']);
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('validationErrorMessages') && data.validationErrorMessages !== null && data.validationErrorMessages !== undefined) {
|
|
81
|
+
itemArr = [];
|
|
82
|
+
items = data.validationErrorMessages;
|
|
83
|
+
for (i = 0; i < items.length; i++) {
|
|
84
|
+
item = _SchemaValidationErrorMessage.default.constructFromObject(items[i], undefined);
|
|
85
|
+
itemArr.push(item);
|
|
86
|
+
}
|
|
87
|
+
obj.setValidationErrorMessages(itemArr);
|
|
88
|
+
}
|
|
89
|
+
if (data.hasOwnProperty('$reserved')) {
|
|
90
|
+
obj.$reserved = data['$reserved'];
|
|
91
|
+
}
|
|
92
|
+
if (data.hasOwnProperty('$objectType')) {
|
|
93
|
+
obj.$objectType = data['$objectType'];
|
|
94
|
+
}
|
|
95
|
+
if (data.hasOwnProperty('$unknownFields')) {
|
|
96
|
+
obj.$unknownFields = data['$unknownFields'];
|
|
97
|
+
}
|
|
98
|
+
if (!callFromChild) {
|
|
99
|
+
obj.$unknownFields = {
|
|
100
|
+
...data.$unknownFields
|
|
101
|
+
};
|
|
102
|
+
for (const property in data) {
|
|
103
|
+
// Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
|
|
104
|
+
// as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
|
|
105
|
+
// Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
|
|
106
|
+
// If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
|
|
107
|
+
if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
|
|
108
|
+
obj.$unknownFields[property] = data[property];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return obj;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Converts a given snake_case string to camelCase.
|
|
118
|
+
* @param {string} snakeStr - The input string in snake_case format.
|
|
119
|
+
* @returns {string} - The converted string in camelCase format.
|
|
120
|
+
*/
|
|
121
|
+
static snakeToCamel(snakeStr) {
|
|
122
|
+
return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Returns Timestamp of the response.
|
|
127
|
+
* @return {Date}
|
|
128
|
+
*/
|
|
129
|
+
getTimestamp() {
|
|
130
|
+
return this.timestamp;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Sets Timestamp of the response.
|
|
135
|
+
* @param {Date} timestamp Timestamp of the response.
|
|
136
|
+
*/
|
|
137
|
+
setTimestamp(timestamp) {
|
|
138
|
+
this.timestamp = timestamp;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Returns The HTTP status code of the response.
|
|
143
|
+
* @return {Number}
|
|
144
|
+
*/
|
|
145
|
+
getStatusCode() {
|
|
146
|
+
return this.statusCode;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Sets The HTTP status code of the response.
|
|
151
|
+
* @param {Number} statusCode The HTTP status code of the response.
|
|
152
|
+
*/
|
|
153
|
+
setStatusCode(statusCode) {
|
|
154
|
+
this.statusCode = statusCode;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Returns The generic error message for the response.
|
|
159
|
+
* @return {string}
|
|
160
|
+
*/
|
|
161
|
+
getError() {
|
|
162
|
+
return this.error;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Sets The generic error message for the response.
|
|
167
|
+
* @param {string} error The generic error message for the response.
|
|
168
|
+
*/
|
|
169
|
+
setError(error) {
|
|
170
|
+
this.error = error;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Returns API path on which the request was made.
|
|
175
|
+
* @return {string}
|
|
176
|
+
*/
|
|
177
|
+
getPath() {
|
|
178
|
+
return this.path;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Sets API path on which the request was made.
|
|
183
|
+
* @param {string} path API path on which the request was made.
|
|
184
|
+
*/
|
|
185
|
+
setPath(path) {
|
|
186
|
+
this.path = path;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Returns List of validation error messages
|
|
191
|
+
* @return {SchemaValidationErrorMessage[]}
|
|
192
|
+
*/
|
|
193
|
+
getValidationErrorMessages() {
|
|
194
|
+
return this.validationErrorMessages;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Sets List of validation error messages
|
|
199
|
+
* @param {SchemaValidationErrorMessage[]} validationErrorMessages List of validation error messages
|
|
200
|
+
*/
|
|
201
|
+
setValidationErrorMessages(validationErrorMessages) {
|
|
202
|
+
this.validationErrorMessages = validationErrorMessages;
|
|
203
|
+
}
|
|
204
|
+
get$Reserved() {
|
|
205
|
+
return this.$reserved;
|
|
206
|
+
}
|
|
207
|
+
get$ObjectType() {
|
|
208
|
+
return this.$objectType;
|
|
209
|
+
}
|
|
210
|
+
get$UnknownFields() {
|
|
211
|
+
return this.$unknownFields;
|
|
212
|
+
}
|
|
213
|
+
toJson(forMutation) {
|
|
214
|
+
if (forMutation === false) {
|
|
215
|
+
return {
|
|
216
|
+
...(typeof this.getTimestamp() !== 'undefined' && this.getTimestamp() !== null ? {
|
|
217
|
+
'timestamp': _assertClassBrand(_SchemaValidationError_brand, this, _handleDateType).call(this, this.getTimestamp(), false)
|
|
218
|
+
} : {}),
|
|
219
|
+
...(typeof this.getStatusCode() !== 'undefined' && this.getStatusCode() !== null ? {
|
|
220
|
+
'statusCode': this.getStatusCode()
|
|
221
|
+
} : {}),
|
|
222
|
+
...(typeof this.getError() !== 'undefined' && this.getError() !== null ? {
|
|
223
|
+
'error': this.getError()
|
|
224
|
+
} : {}),
|
|
225
|
+
...(typeof this.getPath() !== 'undefined' && this.getPath() !== null ? {
|
|
226
|
+
'path': this.getPath()
|
|
227
|
+
} : {}),
|
|
228
|
+
...(typeof this.getValidationErrorMessages() !== 'undefined' && this.getValidationErrorMessages() !== null ? {
|
|
229
|
+
'validationErrorMessages': this.getValidationErrorMessages().map(item => item.toJson(false))
|
|
230
|
+
} : {}),
|
|
231
|
+
'$reserved': this.get$Reserved(),
|
|
232
|
+
'$objectType': this.get$ObjectType(),
|
|
233
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
234
|
+
'$unknownFields': {}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
...(typeof this.getTimestamp() !== 'undefined' && this.getTimestamp() !== null ? {
|
|
239
|
+
'timestamp': _assertClassBrand(_SchemaValidationError_brand, this, _handleDateType).call(this, this.getTimestamp(), false)
|
|
240
|
+
} : {}),
|
|
241
|
+
...(typeof this.getStatusCode() !== 'undefined' && this.getStatusCode() !== null ? {
|
|
242
|
+
'statusCode': this.getStatusCode()
|
|
243
|
+
} : {}),
|
|
244
|
+
...(typeof this.getError() !== 'undefined' && this.getError() !== null ? {
|
|
245
|
+
'error': this.getError()
|
|
246
|
+
} : {}),
|
|
247
|
+
...(typeof this.getPath() !== 'undefined' && this.getPath() !== null ? {
|
|
248
|
+
'path': this.getPath()
|
|
249
|
+
} : {}),
|
|
250
|
+
...(typeof this.getValidationErrorMessages() !== 'undefined' && this.getValidationErrorMessages() !== null ? {
|
|
251
|
+
'validationErrorMessages': this.getValidationErrorMessages().map(item => item.toJson(false))
|
|
252
|
+
} : {}),
|
|
253
|
+
'$reserved': this.get$Reserved(),
|
|
254
|
+
'$objectType': this.get$ObjectType(),
|
|
255
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
256
|
+
'$unknownFields': {}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
validate(scope, properties) {
|
|
260
|
+
let propList = [];
|
|
261
|
+
if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
|
|
262
|
+
//cases validate() and validate(scope)
|
|
263
|
+
propList = [];
|
|
264
|
+
} else if (arguments.length === 1) {
|
|
265
|
+
//case validate(properties)
|
|
266
|
+
propList = arguments[0];
|
|
267
|
+
scope = null;
|
|
268
|
+
} else {
|
|
269
|
+
//case validate(scope, properties)
|
|
270
|
+
propList = arguments[1];
|
|
271
|
+
}
|
|
272
|
+
let res = [];
|
|
273
|
+
let err = null;
|
|
274
|
+
propList.forEach(property => {
|
|
275
|
+
err = this.validateProperty(property, scope);
|
|
276
|
+
if (err) {
|
|
277
|
+
res.push(err);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
return new Promise(function (resolve, reject) {
|
|
281
|
+
if (res.length !== 0) {
|
|
282
|
+
reject(err);
|
|
283
|
+
} else {
|
|
284
|
+
resolve();
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
validateProperty(scope, property) {
|
|
289
|
+
if (property === "timestamp") {
|
|
290
|
+
if (typeof this.timestamp === 'undefined' || this.timestamp === null) {
|
|
291
|
+
return new _ValidationError.default("timestamp", "undefined or null");
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (property === "statusCode") {
|
|
295
|
+
if (typeof this.statusCode === 'undefined' || this.statusCode === null) {
|
|
296
|
+
return new _ValidationError.default("statusCode", "undefined or null");
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
if (property === "error") {
|
|
300
|
+
if (typeof this.error === 'undefined' || this.error === null) {
|
|
301
|
+
return new _ValidationError.default("error", "undefined or null");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
if (property === "path") {
|
|
305
|
+
if (typeof this.path === 'undefined' || this.path === null) {
|
|
306
|
+
return new _ValidationError.default("path", "undefined or null");
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (property === "validationErrorMessages") {
|
|
310
|
+
if (typeof this.validationErrorMessages === 'undefined' || this.validationErrorMessages === null) {
|
|
311
|
+
return new _ValidationError.default("validationErrorMessages", "undefined or null");
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (property === "$reserved") {
|
|
315
|
+
if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
|
|
316
|
+
return new _ValidationError.default("$reserved", "undefined or null");
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (property === "$objectType") {
|
|
320
|
+
if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
|
|
321
|
+
return new _ValidationError.default("$objectType", "undefined or null");
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (property === "$unknownFields") {
|
|
325
|
+
if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
|
|
326
|
+
return new _ValidationError.default("$unknownFields", "undefined or null");
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return new _ValidationError.default(property, "no such property exists");
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Timestamp of the response.
|
|
335
|
+
* @memberof SchemaValidationError
|
|
336
|
+
*/
|
|
337
|
+
exports.default = SchemaValidationError;
|
|
338
|
+
function _toJsonMapType(obj, forMutation) {
|
|
339
|
+
if (obj instanceof Map) {
|
|
340
|
+
return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
|
|
341
|
+
} else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
|
|
342
|
+
return Object.fromEntries(Array.from(Object.entries(obj), entry => {
|
|
343
|
+
return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
|
|
344
|
+
}));
|
|
345
|
+
}
|
|
346
|
+
return obj;
|
|
347
|
+
}
|
|
348
|
+
/*
|
|
349
|
+
* toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
|
|
350
|
+
* @param {Object} obj Object to serialize
|
|
351
|
+
* @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
|
|
352
|
+
* @returns {Object|string} Returns serialized date object or original input object
|
|
353
|
+
*/
|
|
354
|
+
function _handleDateType(obj, isDateOnly) {
|
|
355
|
+
if (obj instanceof Date && isDateOnly !== undefined) {
|
|
356
|
+
return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
|
|
357
|
+
}
|
|
358
|
+
return obj;
|
|
359
|
+
}
|
|
360
|
+
SchemaValidationError.prototype.timestamp = undefined;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* The HTTP status code of the response.
|
|
364
|
+
* @memberof SchemaValidationError
|
|
365
|
+
*/
|
|
366
|
+
SchemaValidationError.prototype.statusCode = undefined;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* The generic error message for the response.
|
|
370
|
+
* @memberof SchemaValidationError
|
|
371
|
+
*/
|
|
372
|
+
SchemaValidationError.prototype.error = undefined;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* API path on which the request was made.
|
|
376
|
+
* @memberof SchemaValidationError
|
|
377
|
+
*/
|
|
378
|
+
SchemaValidationError.prototype.path = undefined;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* List of validation error messages
|
|
382
|
+
* @memberof SchemaValidationError
|
|
383
|
+
*/
|
|
384
|
+
SchemaValidationError.prototype.validationErrorMessages = undefined;
|
|
385
|
+
SchemaValidationError.prototype.$reserved = undefined;
|
|
386
|
+
SchemaValidationError.prototype.$objectType = undefined;
|
|
387
|
+
SchemaValidationError.prototype.$unknownFields = undefined;
|
|
388
|
+
|
|
389
|
+
// Implement OneOfmultidomain.v4.error.ErrorResponseerror interface:
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SchemaValidationErrorMessage model module.
|
|
3
|
+
* @module Ntnx/SchemaValidationErrorMessage
|
|
4
|
+
* @version 4.2.1
|
|
5
|
+
* @class SchemaValidationErrorMessage
|
|
6
|
+
*/
|
|
7
|
+
export default class SchemaValidationErrorMessage {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a <code>SchemaValidationErrorMessage</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/SchemaValidationErrorMessage} obj Optional instance to populate.
|
|
13
|
+
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
14
|
+
* @return {module:Ntnx/SchemaValidationErrorMessage} The populated <code>SchemaValidationErrorMessage</code> instance.
|
|
15
|
+
*/
|
|
16
|
+
static constructFromObject(data: any, obj?: any, callFromChild?: boolean): any;
|
|
17
|
+
/**
|
|
18
|
+
* Converts a given snake_case string to camelCase.
|
|
19
|
+
* @param {string} snakeStr - The input string in snake_case format.
|
|
20
|
+
* @returns {string} - The converted string in camelCase format.
|
|
21
|
+
*/
|
|
22
|
+
static snakeToCamel(snakeStr: string): string;
|
|
23
|
+
$objectType: string;
|
|
24
|
+
/** @type {object<string, any>} */
|
|
25
|
+
$reserved: object;
|
|
26
|
+
/** @type {object<string, any>} */
|
|
27
|
+
$unknownFields: object;
|
|
28
|
+
/**
|
|
29
|
+
* Returns The part of the request that failed validation. Validation can fail for path, query parameters, and request body.
|
|
30
|
+
* @return {string}
|
|
31
|
+
*/
|
|
32
|
+
getLocation(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Sets The part of the request that failed validation. Validation can fail for path, query parameters, and request body.
|
|
35
|
+
* @param {string} location The part of the request that failed validation. Validation can fail for path, query parameters, and request body.
|
|
36
|
+
*/
|
|
37
|
+
setLocation(location: string): void;
|
|
38
|
+
location: string;
|
|
39
|
+
/**
|
|
40
|
+
* Returns The detailed message for the validation error.
|
|
41
|
+
* @return {string}
|
|
42
|
+
*/
|
|
43
|
+
getMessage(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Sets The detailed message for the validation error.
|
|
46
|
+
* @param {string} message The detailed message for the validation error.
|
|
47
|
+
*/
|
|
48
|
+
setMessage(message: string): void;
|
|
49
|
+
message: string;
|
|
50
|
+
/**
|
|
51
|
+
* Returns The path of the attribute that failed validation in the schema.
|
|
52
|
+
* @return {string}
|
|
53
|
+
*/
|
|
54
|
+
getAttributePath(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Sets The path of the attribute that failed validation in the schema.
|
|
57
|
+
* @param {string} attributePath The path of the attribute that failed validation in the schema.
|
|
58
|
+
*/
|
|
59
|
+
setAttributePath(attributePath: string): void;
|
|
60
|
+
attributePath: string;
|
|
61
|
+
get$Reserved(): any;
|
|
62
|
+
get$ObjectType(): string;
|
|
63
|
+
get$UnknownFields(): any;
|
|
64
|
+
toJson(forMutation: any): any;
|
|
65
|
+
validate(scope: any, properties: any, ...args: any[]): Promise<any>;
|
|
66
|
+
validateProperty(scope: any, property: any): ValidationError;
|
|
67
|
+
#private;
|
|
68
|
+
}
|
|
69
|
+
import ValidationError from "../../../validation/ValidationError";
|