@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,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Message model module.
|
|
3
|
+
* @module Ntnx/Message
|
|
4
|
+
* @version 4.2.1
|
|
5
|
+
* @class Message
|
|
6
|
+
*/
|
|
7
|
+
export default class Message {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a <code>Message</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/Message} obj Optional instance to populate.
|
|
13
|
+
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
14
|
+
* @return {module:Ntnx/Message} The populated <code>Message</code> instance.
|
|
15
|
+
*/
|
|
16
|
+
static constructFromObject(data: any, obj?: any, callFromChild?: boolean): any;
|
|
17
|
+
/**
|
|
18
|
+
* Converts a given snake_case string to camelCase.
|
|
19
|
+
* @param {string} snakeStr - The input string in snake_case format.
|
|
20
|
+
* @returns {string} - The converted string in camelCase format.
|
|
21
|
+
*/
|
|
22
|
+
static snakeToCamel(snakeStr: string): string;
|
|
23
|
+
$objectType: string;
|
|
24
|
+
/** @type {object<string, any>} */
|
|
25
|
+
$reserved: object;
|
|
26
|
+
/** @type {object<string, any>} */
|
|
27
|
+
$unknownFields: object;
|
|
28
|
+
/**
|
|
29
|
+
* Returns A code that uniquely identifies a message.
|
|
30
|
+
* @return {string}
|
|
31
|
+
*/
|
|
32
|
+
getCode(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Sets A code that uniquely identifies a message.
|
|
35
|
+
* @param {string} code A code that uniquely identifies a message.
|
|
36
|
+
*/
|
|
37
|
+
setCode(code: string): void;
|
|
38
|
+
code: string;
|
|
39
|
+
/**
|
|
40
|
+
* Returns The description of the message.
|
|
41
|
+
* @return {string}
|
|
42
|
+
*/
|
|
43
|
+
getMessage(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Sets The description of the message.
|
|
46
|
+
* @param {string} message The description of the message.
|
|
47
|
+
*/
|
|
48
|
+
setMessage(message: string): void;
|
|
49
|
+
message: string;
|
|
50
|
+
/**
|
|
51
|
+
* Returns The locale for the message description.
|
|
52
|
+
* @return {string}
|
|
53
|
+
*/
|
|
54
|
+
getLocale(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Sets The locale for the message description.
|
|
57
|
+
* @param {string} locale The locale for the message description.
|
|
58
|
+
*/
|
|
59
|
+
setLocale(locale: string): void;
|
|
60
|
+
locale: string;
|
|
61
|
+
/**
|
|
62
|
+
* @return {MessageSeverity}
|
|
63
|
+
*/
|
|
64
|
+
getSeverity(): MessageSeverity;
|
|
65
|
+
/**
|
|
66
|
+
* @param {MessageSeverity} severity
|
|
67
|
+
*/
|
|
68
|
+
setSeverity(severity: MessageSeverity): void;
|
|
69
|
+
severity: string;
|
|
70
|
+
get$Reserved(): any;
|
|
71
|
+
get$ObjectType(): string;
|
|
72
|
+
get$UnknownFields(): any;
|
|
73
|
+
toJson(forMutation: any): any;
|
|
74
|
+
validate(scope: any, properties: any, ...args: any[]): Promise<any>;
|
|
75
|
+
validateProperty(scope: any, property: any): ValidationError;
|
|
76
|
+
#private;
|
|
77
|
+
}
|
|
78
|
+
import MessageSeverity from "./MessageSeverity";
|
|
79
|
+
import ValidationError from "../../../validation/ValidationError";
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _MessageSeverity = _interopRequireDefault(require("./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
|
+
* Nutanix Multidomain Versioned APIs
|
|
15
|
+
*
|
|
16
|
+
* OpenAPI spec version: 4.2.1
|
|
17
|
+
*
|
|
18
|
+
* NOTE: This class is auto generated by the Open API Dev Platform.
|
|
19
|
+
*
|
|
20
|
+
* Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
|
|
21
|
+
*
|
|
22
|
+
* Do not edit the class manually.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* The Message model module.
|
|
27
|
+
* @module Ntnx/Message
|
|
28
|
+
* @version 4.2.1
|
|
29
|
+
* @class Message
|
|
30
|
+
*/
|
|
31
|
+
var _Message_brand = /*#__PURE__*/new WeakSet();
|
|
32
|
+
class Message {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>Message</code>.
|
|
35
|
+
* @alias module:Ntnx/Message
|
|
36
|
+
*/
|
|
37
|
+
constructor() {
|
|
38
|
+
/*
|
|
39
|
+
* toJson method for a map type which supports map with primitive keys and values of object types
|
|
40
|
+
* @param {Object} obj
|
|
41
|
+
* @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
|
|
42
|
+
* Otherwise, just returns the input object.
|
|
43
|
+
*/
|
|
44
|
+
_classPrivateMethodInitSpec(this, _Message_brand);
|
|
45
|
+
this.$objectType = "common.v1.config.Message";
|
|
46
|
+
/** @type {object<string, any>} */
|
|
47
|
+
this.$reserved = {
|
|
48
|
+
'$fv': "v1.r0"
|
|
49
|
+
};
|
|
50
|
+
/** @type {object<string, any>} */
|
|
51
|
+
this.$unknownFields = {};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a <code>Message</code> from a plain JavaScript object, optionally creating a new instance.
|
|
56
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
57
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
58
|
+
* @param {module:Ntnx/Message} obj Optional instance to populate.
|
|
59
|
+
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
60
|
+
* @return {module:Ntnx/Message} The populated <code>Message</code> instance.
|
|
61
|
+
*/
|
|
62
|
+
static constructFromObject(data, obj = null, callFromChild = false) {
|
|
63
|
+
let items, item, i, itemArr, discriminator;
|
|
64
|
+
if (data) {
|
|
65
|
+
obj = obj || new Message();
|
|
66
|
+
if (data.hasOwnProperty('code') && data.code !== null && data.code !== undefined) {
|
|
67
|
+
obj.setCode(data['code']);
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('message') && data.message !== null && data.message !== undefined) {
|
|
70
|
+
obj.setMessage(data['message']);
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('locale') && data.locale !== null && data.locale !== undefined) {
|
|
73
|
+
obj.setLocale(data['locale']);
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('severity') && data.severity !== null && data.severity !== undefined) {
|
|
76
|
+
obj.setSeverity(_MessageSeverity.default.constructFromObject(data['severity']));
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('$reserved')) {
|
|
79
|
+
obj.$reserved = data['$reserved'];
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('$objectType')) {
|
|
82
|
+
obj.$objectType = data['$objectType'];
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('$unknownFields')) {
|
|
85
|
+
obj.$unknownFields = data['$unknownFields'];
|
|
86
|
+
}
|
|
87
|
+
if (!callFromChild) {
|
|
88
|
+
obj.$unknownFields = {
|
|
89
|
+
...data.$unknownFields
|
|
90
|
+
};
|
|
91
|
+
for (const property in data) {
|
|
92
|
+
// Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
|
|
93
|
+
// as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
|
|
94
|
+
// Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
|
|
95
|
+
// If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
|
|
96
|
+
if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
|
|
97
|
+
obj.$unknownFields[property] = data[property];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return obj;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Converts a given snake_case string to camelCase.
|
|
107
|
+
* @param {string} snakeStr - The input string in snake_case format.
|
|
108
|
+
* @returns {string} - The converted string in camelCase format.
|
|
109
|
+
*/
|
|
110
|
+
static snakeToCamel(snakeStr) {
|
|
111
|
+
return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Returns A code that uniquely identifies a message.
|
|
116
|
+
* @return {string}
|
|
117
|
+
*/
|
|
118
|
+
getCode() {
|
|
119
|
+
return this.code;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Sets A code that uniquely identifies a message.
|
|
124
|
+
* @param {string} code A code that uniquely identifies a message.
|
|
125
|
+
*/
|
|
126
|
+
setCode(code) {
|
|
127
|
+
this.code = code;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Returns The description of the message.
|
|
132
|
+
* @return {string}
|
|
133
|
+
*/
|
|
134
|
+
getMessage() {
|
|
135
|
+
return this.message;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Sets The description of the message.
|
|
140
|
+
* @param {string} message The description of the message.
|
|
141
|
+
*/
|
|
142
|
+
setMessage(message) {
|
|
143
|
+
this.message = message;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Returns The locale for the message description.
|
|
148
|
+
* @return {string}
|
|
149
|
+
*/
|
|
150
|
+
getLocale() {
|
|
151
|
+
return this.locale;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Sets The locale for the message description.
|
|
156
|
+
* @param {string} locale The locale for the message description.
|
|
157
|
+
*/
|
|
158
|
+
setLocale(locale) {
|
|
159
|
+
this.locale = locale;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @return {MessageSeverity}
|
|
164
|
+
*/
|
|
165
|
+
getSeverity() {
|
|
166
|
+
return this.severity;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @param {MessageSeverity} severity
|
|
171
|
+
*/
|
|
172
|
+
setSeverity(severity) {
|
|
173
|
+
this.severity = severity;
|
|
174
|
+
}
|
|
175
|
+
get$Reserved() {
|
|
176
|
+
return this.$reserved;
|
|
177
|
+
}
|
|
178
|
+
get$ObjectType() {
|
|
179
|
+
return this.$objectType;
|
|
180
|
+
}
|
|
181
|
+
get$UnknownFields() {
|
|
182
|
+
return this.$unknownFields;
|
|
183
|
+
}
|
|
184
|
+
toJson(forMutation) {
|
|
185
|
+
if (forMutation === false) {
|
|
186
|
+
return {
|
|
187
|
+
...(typeof this.getCode() !== 'undefined' && this.getCode() !== null ? {
|
|
188
|
+
'code': this.getCode()
|
|
189
|
+
} : {}),
|
|
190
|
+
...(typeof this.getMessage() !== 'undefined' && this.getMessage() !== null ? {
|
|
191
|
+
'message': this.getMessage()
|
|
192
|
+
} : {}),
|
|
193
|
+
...(typeof this.getLocale() !== 'undefined' && this.getLocale() !== null ? {
|
|
194
|
+
'locale': this.getLocale()
|
|
195
|
+
} : {}),
|
|
196
|
+
...(typeof this.getSeverity() !== 'undefined' && this.getSeverity() !== null ? {
|
|
197
|
+
'severity': this.getSeverity()
|
|
198
|
+
} : {}),
|
|
199
|
+
'$reserved': this.get$Reserved(),
|
|
200
|
+
'$objectType': this.get$ObjectType(),
|
|
201
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
202
|
+
'$unknownFields': {}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
...(typeof this.getCode() !== 'undefined' && this.getCode() !== null ? {
|
|
207
|
+
'code': this.getCode()
|
|
208
|
+
} : {}),
|
|
209
|
+
...(typeof this.getMessage() !== 'undefined' && this.getMessage() !== null ? {
|
|
210
|
+
'message': this.getMessage()
|
|
211
|
+
} : {}),
|
|
212
|
+
...(typeof this.getLocale() !== 'undefined' && this.getLocale() !== null ? {
|
|
213
|
+
'locale': this.getLocale()
|
|
214
|
+
} : {}),
|
|
215
|
+
...(typeof this.getSeverity() !== 'undefined' && this.getSeverity() !== null ? {
|
|
216
|
+
'severity': this.getSeverity()
|
|
217
|
+
} : {}),
|
|
218
|
+
'$reserved': this.get$Reserved(),
|
|
219
|
+
'$objectType': this.get$ObjectType(),
|
|
220
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
221
|
+
'$unknownFields': {}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
validate(scope, properties) {
|
|
225
|
+
let propList = [];
|
|
226
|
+
if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
|
|
227
|
+
//cases validate() and validate(scope)
|
|
228
|
+
propList = [];
|
|
229
|
+
} else if (arguments.length === 1) {
|
|
230
|
+
//case validate(properties)
|
|
231
|
+
propList = arguments[0];
|
|
232
|
+
scope = null;
|
|
233
|
+
} else {
|
|
234
|
+
//case validate(scope, properties)
|
|
235
|
+
propList = arguments[1];
|
|
236
|
+
}
|
|
237
|
+
let res = [];
|
|
238
|
+
let err = null;
|
|
239
|
+
propList.forEach(property => {
|
|
240
|
+
err = this.validateProperty(property, scope);
|
|
241
|
+
if (err) {
|
|
242
|
+
res.push(err);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
return new Promise(function (resolve, reject) {
|
|
246
|
+
if (res.length !== 0) {
|
|
247
|
+
reject(err);
|
|
248
|
+
} else {
|
|
249
|
+
resolve();
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
validateProperty(scope, property) {
|
|
254
|
+
if (property === "code") {
|
|
255
|
+
if (typeof this.code === 'undefined' || this.code === null) {
|
|
256
|
+
return new _ValidationError.default("code", "undefined or null");
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (property === "message") {
|
|
260
|
+
if (typeof this.message === 'undefined' || this.message === null) {
|
|
261
|
+
return new _ValidationError.default("message", "undefined or null");
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (property === "locale") {
|
|
265
|
+
if (typeof this.locale === 'undefined' || this.locale === null) {
|
|
266
|
+
return new _ValidationError.default("locale", "undefined or null");
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (property === "severity") {
|
|
270
|
+
if (typeof this.severity === 'undefined' || this.severity === null) {
|
|
271
|
+
return new _ValidationError.default("severity", "undefined or null");
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (property === "$reserved") {
|
|
275
|
+
if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
|
|
276
|
+
return new _ValidationError.default("$reserved", "undefined or null");
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (property === "$objectType") {
|
|
280
|
+
if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
|
|
281
|
+
return new _ValidationError.default("$objectType", "undefined or null");
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (property === "$unknownFields") {
|
|
285
|
+
if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
|
|
286
|
+
return new _ValidationError.default("$unknownFields", "undefined or null");
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return new _ValidationError.default(property, "no such property exists");
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* A code that uniquely identifies a message.
|
|
295
|
+
* @memberof Message
|
|
296
|
+
*/
|
|
297
|
+
exports.default = Message;
|
|
298
|
+
function _toJsonMapType(obj, forMutation) {
|
|
299
|
+
if (obj instanceof Map) {
|
|
300
|
+
return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
|
|
301
|
+
} else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
|
|
302
|
+
return Object.fromEntries(Array.from(Object.entries(obj), entry => {
|
|
303
|
+
return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
|
|
304
|
+
}));
|
|
305
|
+
}
|
|
306
|
+
return obj;
|
|
307
|
+
}
|
|
308
|
+
/*
|
|
309
|
+
* toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
|
|
310
|
+
* @param {Object} obj Object to serialize
|
|
311
|
+
* @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
|
|
312
|
+
* @returns {Object|string} Returns serialized date object or original input object
|
|
313
|
+
*/
|
|
314
|
+
function _handleDateType(obj, isDateOnly) {
|
|
315
|
+
if (obj instanceof Date && isDateOnly !== undefined) {
|
|
316
|
+
return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
|
|
317
|
+
}
|
|
318
|
+
return obj;
|
|
319
|
+
}
|
|
320
|
+
Message.prototype.code = undefined;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* The description of the message.
|
|
324
|
+
* @memberof Message
|
|
325
|
+
*/
|
|
326
|
+
Message.prototype.message = undefined;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* The locale for the message description.
|
|
330
|
+
* @memberof Message
|
|
331
|
+
* @default 'en_US'
|
|
332
|
+
*/
|
|
333
|
+
Message.prototype.locale = 'en_US';
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @memberof Message
|
|
337
|
+
*/
|
|
338
|
+
Message.prototype.severity = undefined;
|
|
339
|
+
Message.prototype.$reserved = undefined;
|
|
340
|
+
Message.prototype.$objectType = undefined;
|
|
341
|
+
Message.prototype.$unknownFields = undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default MessageSeverity;
|
|
2
|
+
/**
|
|
3
|
+
* *
|
|
4
|
+
*/
|
|
5
|
+
type MessageSeverity = string;
|
|
6
|
+
declare namespace MessageSeverity {
|
|
7
|
+
/**
|
|
8
|
+
* Returns a <code>MessageSeverity</code> enum value from a JavaScript object name.
|
|
9
|
+
* @param {Object} obj The plain JavaScript object containing the name of the enum value.
|
|
10
|
+
* @return {MessageSeverity} The enum <code>MessageSeverity</code> value.
|
|
11
|
+
*/
|
|
12
|
+
function constructFromObject(obj: any): string;
|
|
13
|
+
/**
|
|
14
|
+
* Validates <code>MessageSeverity</code> enum value.
|
|
15
|
+
* @param {Object} obj The plain JavaScript object containing the name of the enum value.
|
|
16
|
+
* @return {null} Throws error for invalid value.
|
|
17
|
+
*/
|
|
18
|
+
function validate(obj: any): null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
|
|
8
|
+
var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
|
|
9
|
+
var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
/*
|
|
12
|
+
* Nutanix Multidomain Versioned APIs
|
|
13
|
+
*
|
|
14
|
+
* OpenAPI spec version: 4.2.1
|
|
15
|
+
*
|
|
16
|
+
* NOTE: This class is auto generated by the Open API Dev Platform.
|
|
17
|
+
*
|
|
18
|
+
* Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
|
|
19
|
+
*
|
|
20
|
+
* Do not edit the class manually.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Enum class MessageSeverity.
|
|
26
|
+
* @enum {string}
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
29
|
+
const MessageSeverity = {
|
|
30
|
+
/**
|
|
31
|
+
* Unknown value.
|
|
32
|
+
* @const
|
|
33
|
+
*/
|
|
34
|
+
$UNKNOWN: "$UNKNOWN",
|
|
35
|
+
/**
|
|
36
|
+
* Redacted value.
|
|
37
|
+
* @const
|
|
38
|
+
*/
|
|
39
|
+
$REDACTED: "$REDACTED",
|
|
40
|
+
/**
|
|
41
|
+
* Information about successful completion.
|
|
42
|
+
* @const
|
|
43
|
+
*/
|
|
44
|
+
INFO: "INFO",
|
|
45
|
+
/**
|
|
46
|
+
* Warning indicating future error.
|
|
47
|
+
* @const
|
|
48
|
+
*/
|
|
49
|
+
WARNING: "WARNING",
|
|
50
|
+
/**
|
|
51
|
+
* Error indicating failed completion.
|
|
52
|
+
* @const
|
|
53
|
+
*/
|
|
54
|
+
ERROR: "ERROR"
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Returns a <code>MessageSeverity</code> enum value from a JavaScript object name.
|
|
59
|
+
* @param {Object} obj The plain JavaScript object containing the name of the enum value.
|
|
60
|
+
* @return {MessageSeverity} The enum <code>MessageSeverity</code> value.
|
|
61
|
+
*/
|
|
62
|
+
MessageSeverity.constructFromObject = function (obj) {
|
|
63
|
+
if (typeof obj === 'string' || obj instanceof String) {
|
|
64
|
+
let enumVal = Object.keys(MessageSeverity).find(key => MessageSeverity[key] === obj);
|
|
65
|
+
return enumVal === undefined || enumVal === null ? MessageSeverity.$UNKNOWN : MessageSeverity[enumVal];
|
|
66
|
+
} else {
|
|
67
|
+
throw new Error("Received object name is not an instance of String");
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Validates <code>MessageSeverity</code> enum value.
|
|
73
|
+
* @param {Object} obj The plain JavaScript object containing the name of the enum value.
|
|
74
|
+
* @return {null} Throws error for invalid value.
|
|
75
|
+
*/
|
|
76
|
+
MessageSeverity.validate = function (obj) {
|
|
77
|
+
switch (obj) {
|
|
78
|
+
case MessageSeverity.$UNKNOWN:
|
|
79
|
+
case MessageSeverity.$REDACTED:
|
|
80
|
+
case MessageSeverity.INFO:
|
|
81
|
+
case MessageSeverity.WARNING:
|
|
82
|
+
case MessageSeverity.ERROR:
|
|
83
|
+
return;
|
|
84
|
+
default:
|
|
85
|
+
throw new Error("Invalid : must be MessageSeverity.{ $UNKNOWN|$REDACTED|INFO|WARNING|ERROR }");
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
Object.freeze(MessageSeverity);
|
|
89
|
+
var _default = exports.default = MessageSeverity;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The TenantAwareModel model module.
|
|
3
|
+
* @module Ntnx/TenantAwareModel
|
|
4
|
+
* @version 4.2.1
|
|
5
|
+
* @class TenantAwareModel
|
|
6
|
+
*/
|
|
7
|
+
export default class TenantAwareModel {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a <code>TenantAwareModel</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/TenantAwareModel} obj Optional instance to populate.
|
|
13
|
+
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
14
|
+
* @return {module:Ntnx/TenantAwareModel} The populated <code>TenantAwareModel</code> instance.
|
|
15
|
+
*/
|
|
16
|
+
static constructFromObject(data: any, obj?: any, callFromChild?: boolean): any;
|
|
17
|
+
/**
|
|
18
|
+
* Converts a given snake_case string to camelCase.
|
|
19
|
+
* @param {string} snakeStr - The input string in snake_case format.
|
|
20
|
+
* @returns {string} - The converted string in camelCase format.
|
|
21
|
+
*/
|
|
22
|
+
static snakeToCamel(snakeStr: string): string;
|
|
23
|
+
$objectType: string;
|
|
24
|
+
/** @type {object<string, any>} */
|
|
25
|
+
$reserved: object;
|
|
26
|
+
/** @type {object<string, any>} */
|
|
27
|
+
$unknownFields: object;
|
|
28
|
+
/**
|
|
29
|
+
* Returns A globally unique identifier 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).
|
|
30
|
+
* @return {string}
|
|
31
|
+
*/
|
|
32
|
+
getTenantId(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Sets 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).
|
|
35
|
+
* @param {string} tenantId 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).
|
|
36
|
+
*/
|
|
37
|
+
setTenantId(tenantId: string): void;
|
|
38
|
+
tenantId: string;
|
|
39
|
+
get$Reserved(): any;
|
|
40
|
+
get$ObjectType(): string;
|
|
41
|
+
get$UnknownFields(): any;
|
|
42
|
+
toJson(forMutation: any): any;
|
|
43
|
+
validate(scope: any, properties: any, ...args: any[]): Promise<any>;
|
|
44
|
+
validateProperty(scope: any, property: any): ValidationError;
|
|
45
|
+
#private;
|
|
46
|
+
}
|
|
47
|
+
import ValidationError from "../../../validation/ValidationError";
|