@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,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _FQDN = _interopRequireDefault(require("./FQDN"));
|
|
8
|
+
var _IPv4Address = _interopRequireDefault(require("./IPv4Address"));
|
|
9
|
+
var _IPv6Address = _interopRequireDefault(require("./IPv6Address"));
|
|
10
|
+
var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
|
|
11
|
+
var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
|
|
12
|
+
var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
15
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } /*
|
|
16
|
+
* Nutanix Multidomain Versioned APIs
|
|
17
|
+
*
|
|
18
|
+
* OpenAPI spec version: 4.2.1
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This class is auto generated by the Open API Dev Platform.
|
|
21
|
+
*
|
|
22
|
+
* Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
|
|
23
|
+
*
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The IPAddressOrFQDN model module.
|
|
29
|
+
* @module Ntnx/IPAddressOrFQDN
|
|
30
|
+
* @version 4.2.1
|
|
31
|
+
* @class IPAddressOrFQDN
|
|
32
|
+
*/
|
|
33
|
+
var _IPAddressOrFQDN_brand = /*#__PURE__*/new WeakSet();
|
|
34
|
+
class IPAddressOrFQDN {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>IPAddressOrFQDN</code>.
|
|
37
|
+
* An unique address that identifies a device on the internet or a local network in IPv4/IPv6 format or a Fully Qualified Domain Name.
|
|
38
|
+
* @alias module:Ntnx/IPAddressOrFQDN
|
|
39
|
+
*/
|
|
40
|
+
constructor() {
|
|
41
|
+
/*
|
|
42
|
+
* toJson method for a map type which supports map with primitive keys and values of object types
|
|
43
|
+
* @param {Object} obj
|
|
44
|
+
* @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
|
|
45
|
+
* Otherwise, just returns the input object.
|
|
46
|
+
*/
|
|
47
|
+
_classPrivateMethodInitSpec(this, _IPAddressOrFQDN_brand);
|
|
48
|
+
this.$objectType = "common.v1.config.IPAddressOrFQDN";
|
|
49
|
+
/** @type {object<string, any>} */
|
|
50
|
+
this.$reserved = {
|
|
51
|
+
'$fv': "v1.r0"
|
|
52
|
+
};
|
|
53
|
+
/** @type {object<string, any>} */
|
|
54
|
+
this.$unknownFields = {};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a <code>IPAddressOrFQDN</code> from a plain JavaScript object, optionally creating a new instance.
|
|
59
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
60
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
61
|
+
* @param {module:Ntnx/IPAddressOrFQDN} obj Optional instance to populate.
|
|
62
|
+
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
63
|
+
* @return {module:Ntnx/IPAddressOrFQDN} The populated <code>IPAddressOrFQDN</code> instance.
|
|
64
|
+
*/
|
|
65
|
+
static constructFromObject(data, obj = null, callFromChild = false) {
|
|
66
|
+
let items, item, i, itemArr, discriminator;
|
|
67
|
+
if (data) {
|
|
68
|
+
obj = obj || new IPAddressOrFQDN();
|
|
69
|
+
if (data.hasOwnProperty('ipv4') && data.ipv4 !== null && data.ipv4 !== undefined) {
|
|
70
|
+
obj.setIpv4(_IPv4Address.default.constructFromObject(data['ipv4']));
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('ipv6') && data.ipv6 !== null && data.ipv6 !== undefined) {
|
|
73
|
+
obj.setIpv6(_IPv6Address.default.constructFromObject(data['ipv6']));
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('fqdn') && data.fqdn !== null && data.fqdn !== undefined) {
|
|
76
|
+
obj.setFqdn(_FQDN.default.constructFromObject(data['fqdn']));
|
|
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
|
+
* @return {IPv4Address}
|
|
116
|
+
*/
|
|
117
|
+
getIpv4() {
|
|
118
|
+
return this.ipv4;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @param {IPv4Address} ipv4
|
|
123
|
+
*/
|
|
124
|
+
setIpv4(ipv4) {
|
|
125
|
+
this.ipv4 = ipv4;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @return {IPv6Address}
|
|
130
|
+
*/
|
|
131
|
+
getIpv6() {
|
|
132
|
+
return this.ipv6;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @param {IPv6Address} ipv6
|
|
137
|
+
*/
|
|
138
|
+
setIpv6(ipv6) {
|
|
139
|
+
this.ipv6 = ipv6;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @return {FQDN}
|
|
144
|
+
*/
|
|
145
|
+
getFqdn() {
|
|
146
|
+
return this.fqdn;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @param {FQDN} fqdn
|
|
151
|
+
*/
|
|
152
|
+
setFqdn(fqdn) {
|
|
153
|
+
this.fqdn = fqdn;
|
|
154
|
+
}
|
|
155
|
+
get$Reserved() {
|
|
156
|
+
return this.$reserved;
|
|
157
|
+
}
|
|
158
|
+
get$ObjectType() {
|
|
159
|
+
return this.$objectType;
|
|
160
|
+
}
|
|
161
|
+
get$UnknownFields() {
|
|
162
|
+
return this.$unknownFields;
|
|
163
|
+
}
|
|
164
|
+
hasIpv4() {
|
|
165
|
+
return !(typeof this.ipv4 === 'undefined' || this.ipv4 === null);
|
|
166
|
+
}
|
|
167
|
+
hasIpv6() {
|
|
168
|
+
return !(typeof this.ipv6 === 'undefined' || this.ipv6 === null);
|
|
169
|
+
}
|
|
170
|
+
hasFqdn() {
|
|
171
|
+
return !(typeof this.fqdn === 'undefined' || this.fqdn === null);
|
|
172
|
+
}
|
|
173
|
+
isValid() {
|
|
174
|
+
return this.hasIpv4() || this.hasIpv6() || this.hasFqdn();
|
|
175
|
+
}
|
|
176
|
+
toJson(forMutation) {
|
|
177
|
+
if (forMutation === false) {
|
|
178
|
+
return {
|
|
179
|
+
...(typeof this.getIpv4() !== 'undefined' && this.getIpv4() !== null ? {
|
|
180
|
+
'ipv4': this.getIpv4().toJson(false)
|
|
181
|
+
} : {}),
|
|
182
|
+
...(typeof this.getIpv6() !== 'undefined' && this.getIpv6() !== null ? {
|
|
183
|
+
'ipv6': this.getIpv6().toJson(false)
|
|
184
|
+
} : {}),
|
|
185
|
+
...(typeof this.getFqdn() !== 'undefined' && this.getFqdn() !== null ? {
|
|
186
|
+
'fqdn': this.getFqdn().toJson(false)
|
|
187
|
+
} : {}),
|
|
188
|
+
'$reserved': this.get$Reserved(),
|
|
189
|
+
'$objectType': this.get$ObjectType(),
|
|
190
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
191
|
+
'$unknownFields': {}
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
...(typeof this.getIpv4() !== 'undefined' && this.getIpv4() !== null ? {
|
|
196
|
+
'ipv4': this.getIpv4().toJson(false)
|
|
197
|
+
} : {}),
|
|
198
|
+
...(typeof this.getIpv6() !== 'undefined' && this.getIpv6() !== null ? {
|
|
199
|
+
'ipv6': this.getIpv6().toJson(false)
|
|
200
|
+
} : {}),
|
|
201
|
+
...(typeof this.getFqdn() !== 'undefined' && this.getFqdn() !== null ? {
|
|
202
|
+
'fqdn': this.getFqdn().toJson(false)
|
|
203
|
+
} : {}),
|
|
204
|
+
'$reserved': this.get$Reserved(),
|
|
205
|
+
'$objectType': this.get$ObjectType(),
|
|
206
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
207
|
+
'$unknownFields': {}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
validate(scope, properties) {
|
|
211
|
+
let propList = [];
|
|
212
|
+
if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
|
|
213
|
+
//cases validate() and validate(scope)
|
|
214
|
+
propList = [];
|
|
215
|
+
} else if (arguments.length === 1) {
|
|
216
|
+
//case validate(properties)
|
|
217
|
+
propList = arguments[0];
|
|
218
|
+
scope = null;
|
|
219
|
+
} else {
|
|
220
|
+
//case validate(scope, properties)
|
|
221
|
+
propList = arguments[1];
|
|
222
|
+
}
|
|
223
|
+
let res = [];
|
|
224
|
+
let err = null;
|
|
225
|
+
propList.forEach(property => {
|
|
226
|
+
err = this.validateProperty(property, scope);
|
|
227
|
+
if (err) {
|
|
228
|
+
res.push(err);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
return new Promise(function (resolve, reject) {
|
|
232
|
+
if (res.length !== 0) {
|
|
233
|
+
reject(err);
|
|
234
|
+
} else {
|
|
235
|
+
resolve();
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
validateProperty(scope, property) {
|
|
240
|
+
if (property === "ipv4") {
|
|
241
|
+
if (typeof this.ipv4 === 'undefined' || this.ipv4 === null) {
|
|
242
|
+
return new _ValidationError.default("ipv4", "undefined or null");
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (property === "ipv6") {
|
|
246
|
+
if (typeof this.ipv6 === 'undefined' || this.ipv6 === null) {
|
|
247
|
+
return new _ValidationError.default("ipv6", "undefined or null");
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (property === "fqdn") {
|
|
251
|
+
if (typeof this.fqdn === 'undefined' || this.fqdn === null) {
|
|
252
|
+
return new _ValidationError.default("fqdn", "undefined or null");
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (property === "$reserved") {
|
|
256
|
+
if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
|
|
257
|
+
return new _ValidationError.default("$reserved", "undefined or null");
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (property === "$objectType") {
|
|
261
|
+
if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
|
|
262
|
+
return new _ValidationError.default("$objectType", "undefined or null");
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (property === "$unknownFields") {
|
|
266
|
+
if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
|
|
267
|
+
return new _ValidationError.default("$unknownFields", "undefined or null");
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return new _ValidationError.default(property, "no such property exists");
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @memberof IPAddressOrFQDN
|
|
276
|
+
*/
|
|
277
|
+
exports.default = IPAddressOrFQDN;
|
|
278
|
+
function _toJsonMapType(obj, forMutation) {
|
|
279
|
+
if (obj instanceof Map) {
|
|
280
|
+
return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
|
|
281
|
+
} else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
|
|
282
|
+
return Object.fromEntries(Array.from(Object.entries(obj), entry => {
|
|
283
|
+
return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
return obj;
|
|
287
|
+
}
|
|
288
|
+
/*
|
|
289
|
+
* toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
|
|
290
|
+
* @param {Object} obj Object to serialize
|
|
291
|
+
* @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
|
|
292
|
+
* @returns {Object|string} Returns serialized date object or original input object
|
|
293
|
+
*/
|
|
294
|
+
function _handleDateType(obj, isDateOnly) {
|
|
295
|
+
if (obj instanceof Date && isDateOnly !== undefined) {
|
|
296
|
+
return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
|
|
297
|
+
}
|
|
298
|
+
return obj;
|
|
299
|
+
}
|
|
300
|
+
IPAddressOrFQDN.prototype.ipv4 = undefined;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @memberof IPAddressOrFQDN
|
|
304
|
+
*/
|
|
305
|
+
IPAddressOrFQDN.prototype.ipv6 = undefined;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @memberof IPAddressOrFQDN
|
|
309
|
+
*/
|
|
310
|
+
IPAddressOrFQDN.prototype.fqdn = undefined;
|
|
311
|
+
IPAddressOrFQDN.prototype.$reserved = undefined;
|
|
312
|
+
IPAddressOrFQDN.prototype.$objectType = undefined;
|
|
313
|
+
IPAddressOrFQDN.prototype.$unknownFields = undefined;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The IPv4Address model module.
|
|
3
|
+
* @module Ntnx/IPv4Address
|
|
4
|
+
* @version 4.2.1
|
|
5
|
+
* @class IPv4Address
|
|
6
|
+
*
|
|
7
|
+
* @param { string } value The IPv4 address of the host.
|
|
8
|
+
*/
|
|
9
|
+
export default class IPv4Address {
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a <code>IPv4Address</code> from a plain JavaScript object, optionally creating a new instance.
|
|
12
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
13
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
14
|
+
* @param {module:Ntnx/IPv4Address} obj Optional instance to populate.
|
|
15
|
+
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
16
|
+
* @return {module:Ntnx/IPv4Address} The populated <code>IPv4Address</code> instance.
|
|
17
|
+
*/
|
|
18
|
+
static constructFromObject(data: any, obj?: any, callFromChild?: boolean): any;
|
|
19
|
+
/**
|
|
20
|
+
* Converts a given snake_case string to camelCase.
|
|
21
|
+
* @param {string} snakeStr - The input string in snake_case format.
|
|
22
|
+
* @returns {string} - The converted string in camelCase format.
|
|
23
|
+
*/
|
|
24
|
+
static snakeToCamel(snakeStr: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Constructs a new <code>IPv4Address</code>.
|
|
27
|
+
* An unique address that identifies a device on the internet or a local network in IPv4 format.
|
|
28
|
+
* @alias module:Ntnx/IPv4Address
|
|
29
|
+
*
|
|
30
|
+
* @param { string } value The IPv4 address of the host.
|
|
31
|
+
*/
|
|
32
|
+
constructor(value: string);
|
|
33
|
+
value: string;
|
|
34
|
+
$objectType: string;
|
|
35
|
+
/** @type {object<string, any>} */
|
|
36
|
+
$reserved: object;
|
|
37
|
+
/** @type {object<string, any>} */
|
|
38
|
+
$unknownFields: object;
|
|
39
|
+
/**
|
|
40
|
+
* Returns The IPv4 address of the host.
|
|
41
|
+
* @return {string}
|
|
42
|
+
*/
|
|
43
|
+
getValue(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Sets The IPv4 address of the host.
|
|
46
|
+
* @param {string} value The IPv4 address of the host.
|
|
47
|
+
*/
|
|
48
|
+
setValue(value: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Returns The prefix length of the network to which this host IPv4 address belongs.
|
|
51
|
+
* minimum: 0
|
|
52
|
+
* maximum: 32
|
|
53
|
+
* @return {Number}
|
|
54
|
+
*/
|
|
55
|
+
getPrefixLength(): number;
|
|
56
|
+
/**
|
|
57
|
+
* Sets The prefix length of the network to which this host IPv4 address belongs.
|
|
58
|
+
* @param {Number} prefixLength The prefix length of the network to which this host IPv4 address belongs.
|
|
59
|
+
*/
|
|
60
|
+
setPrefixLength(prefixLength: number): void;
|
|
61
|
+
prefixLength: number;
|
|
62
|
+
get$Reserved(): any;
|
|
63
|
+
get$ObjectType(): string;
|
|
64
|
+
get$UnknownFields(): any;
|
|
65
|
+
toJson(forMutation: any): any;
|
|
66
|
+
validate(scope: any, properties: any, ...args: any[]): Promise<any>;
|
|
67
|
+
validateProperty(scope: any, property: any): ValidationError;
|
|
68
|
+
#private;
|
|
69
|
+
}
|
|
70
|
+
import ValidationError from "../../../validation/ValidationError";
|
|
@@ -0,0 +1,288 @@
|
|
|
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
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
12
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } /*
|
|
13
|
+
* Nutanix Multidomain Versioned APIs
|
|
14
|
+
*
|
|
15
|
+
* OpenAPI spec version: 4.2.1
|
|
16
|
+
*
|
|
17
|
+
* NOTE: This class is auto generated by the Open API Dev Platform.
|
|
18
|
+
*
|
|
19
|
+
* Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
|
|
20
|
+
*
|
|
21
|
+
* Do not edit the class manually.
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The IPv4Address model module.
|
|
26
|
+
* @module Ntnx/IPv4Address
|
|
27
|
+
* @version 4.2.1
|
|
28
|
+
* @class IPv4Address
|
|
29
|
+
*
|
|
30
|
+
* @param { string } value The IPv4 address of the host.
|
|
31
|
+
*/
|
|
32
|
+
var _IPv4Address_brand = /*#__PURE__*/new WeakSet();
|
|
33
|
+
class IPv4Address {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>IPv4Address</code>.
|
|
36
|
+
* An unique address that identifies a device on the internet or a local network in IPv4 format.
|
|
37
|
+
* @alias module:Ntnx/IPv4Address
|
|
38
|
+
*
|
|
39
|
+
* @param { string } value The IPv4 address of the host.
|
|
40
|
+
*/
|
|
41
|
+
constructor(value) {
|
|
42
|
+
/*
|
|
43
|
+
* toJson method for a map type which supports map with primitive keys and values of object types
|
|
44
|
+
* @param {Object} obj
|
|
45
|
+
* @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
|
|
46
|
+
* Otherwise, just returns the input object.
|
|
47
|
+
*/
|
|
48
|
+
_classPrivateMethodInitSpec(this, _IPv4Address_brand);
|
|
49
|
+
this.value = value;
|
|
50
|
+
this.$objectType = "common.v1.config.IPv4Address";
|
|
51
|
+
/** @type {object<string, any>} */
|
|
52
|
+
this.$reserved = {
|
|
53
|
+
'$fv': "v1.r0"
|
|
54
|
+
};
|
|
55
|
+
/** @type {object<string, any>} */
|
|
56
|
+
this.$unknownFields = {};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>IPv4Address</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:Ntnx/IPv4Address} obj Optional instance to populate.
|
|
64
|
+
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
65
|
+
* @return {module:Ntnx/IPv4Address} The populated <code>IPv4Address</code> instance.
|
|
66
|
+
*/
|
|
67
|
+
static constructFromObject(data, obj = null, callFromChild = false) {
|
|
68
|
+
let items, item, i, itemArr, discriminator;
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new IPv4Address();
|
|
71
|
+
if (data.hasOwnProperty('value') && data.value !== null && data.value !== undefined) {
|
|
72
|
+
obj.setValue(data['value']);
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('prefixLength') && data.prefixLength !== null && data.prefixLength !== undefined) {
|
|
75
|
+
obj.setPrefixLength(data['prefixLength']);
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('$reserved')) {
|
|
78
|
+
obj.$reserved = data['$reserved'];
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('$objectType')) {
|
|
81
|
+
obj.$objectType = data['$objectType'];
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('$unknownFields')) {
|
|
84
|
+
obj.$unknownFields = data['$unknownFields'];
|
|
85
|
+
}
|
|
86
|
+
if (!callFromChild) {
|
|
87
|
+
obj.$unknownFields = {
|
|
88
|
+
...data.$unknownFields
|
|
89
|
+
};
|
|
90
|
+
for (const property in data) {
|
|
91
|
+
// Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
|
|
92
|
+
// as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
|
|
93
|
+
// Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
|
|
94
|
+
// If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
|
|
95
|
+
if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
|
|
96
|
+
obj.$unknownFields[property] = data[property];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return obj;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Converts a given snake_case string to camelCase.
|
|
106
|
+
* @param {string} snakeStr - The input string in snake_case format.
|
|
107
|
+
* @returns {string} - The converted string in camelCase format.
|
|
108
|
+
*/
|
|
109
|
+
static snakeToCamel(snakeStr) {
|
|
110
|
+
return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Returns The IPv4 address of the host.
|
|
115
|
+
* @return {string}
|
|
116
|
+
*/
|
|
117
|
+
getValue() {
|
|
118
|
+
return this.value;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Sets The IPv4 address of the host.
|
|
123
|
+
* @param {string} value The IPv4 address of the host.
|
|
124
|
+
*/
|
|
125
|
+
setValue(value) {
|
|
126
|
+
this.value = value;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Returns The prefix length of the network to which this host IPv4 address belongs.
|
|
131
|
+
* minimum: 0
|
|
132
|
+
* maximum: 32
|
|
133
|
+
* @return {Number}
|
|
134
|
+
*/
|
|
135
|
+
getPrefixLength() {
|
|
136
|
+
return this.prefixLength;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Sets The prefix length of the network to which this host IPv4 address belongs.
|
|
141
|
+
* @param {Number} prefixLength The prefix length of the network to which this host IPv4 address belongs.
|
|
142
|
+
*/
|
|
143
|
+
setPrefixLength(prefixLength) {
|
|
144
|
+
this.prefixLength = prefixLength;
|
|
145
|
+
}
|
|
146
|
+
get$Reserved() {
|
|
147
|
+
return this.$reserved;
|
|
148
|
+
}
|
|
149
|
+
get$ObjectType() {
|
|
150
|
+
return this.$objectType;
|
|
151
|
+
}
|
|
152
|
+
get$UnknownFields() {
|
|
153
|
+
return this.$unknownFields;
|
|
154
|
+
}
|
|
155
|
+
toJson(forMutation) {
|
|
156
|
+
if (forMutation === false) {
|
|
157
|
+
return {
|
|
158
|
+
...(typeof this.getValue() !== 'undefined' && this.getValue() !== null ? {
|
|
159
|
+
'value': this.getValue()
|
|
160
|
+
} : {}),
|
|
161
|
+
...(typeof this.getPrefixLength() !== 'undefined' && this.getPrefixLength() !== null ? {
|
|
162
|
+
'prefixLength': this.getPrefixLength()
|
|
163
|
+
} : {}),
|
|
164
|
+
'$reserved': this.get$Reserved(),
|
|
165
|
+
'$objectType': this.get$ObjectType(),
|
|
166
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
167
|
+
'$unknownFields': {}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
...(typeof this.getValue() !== 'undefined' && this.getValue() !== null ? {
|
|
172
|
+
'value': this.getValue()
|
|
173
|
+
} : {}),
|
|
174
|
+
...(typeof this.getPrefixLength() !== 'undefined' && this.getPrefixLength() !== null ? {
|
|
175
|
+
'prefixLength': this.getPrefixLength()
|
|
176
|
+
} : {}),
|
|
177
|
+
'$reserved': this.get$Reserved(),
|
|
178
|
+
'$objectType': this.get$ObjectType(),
|
|
179
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
180
|
+
'$unknownFields': {}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
validate(scope, properties) {
|
|
184
|
+
let propList = [];
|
|
185
|
+
if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
|
|
186
|
+
//cases validate() and validate(scope)
|
|
187
|
+
propList = ["value"];
|
|
188
|
+
} else if (arguments.length === 1) {
|
|
189
|
+
//case validate(properties)
|
|
190
|
+
propList = arguments[0];
|
|
191
|
+
scope = null;
|
|
192
|
+
} else {
|
|
193
|
+
//case validate(scope, properties)
|
|
194
|
+
propList = arguments[1];
|
|
195
|
+
}
|
|
196
|
+
let res = [];
|
|
197
|
+
let err = null;
|
|
198
|
+
propList.forEach(property => {
|
|
199
|
+
err = this.validateProperty(property, scope);
|
|
200
|
+
if (err) {
|
|
201
|
+
res.push(err);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return new Promise(function (resolve, reject) {
|
|
205
|
+
if (res.length !== 0) {
|
|
206
|
+
reject(err);
|
|
207
|
+
} else {
|
|
208
|
+
resolve();
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
validateProperty(scope, property) {
|
|
213
|
+
if (property === "value") {
|
|
214
|
+
if (typeof this.value === 'undefined' || this.value === null) {
|
|
215
|
+
return new _ValidationError.default("value", "undefined or null");
|
|
216
|
+
}
|
|
217
|
+
if (!_ValidationUtils.default.validatePattern(this.value, /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/)) {
|
|
218
|
+
return new _ValidationError.default("value", "does not satisfy required pattern: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/");
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (property === "prefixLength") {
|
|
222
|
+
if (typeof this.prefixLength === 'undefined' || this.prefixLength === null) {
|
|
223
|
+
return new _ValidationError.default("prefixLength", "undefined or null");
|
|
224
|
+
}
|
|
225
|
+
if (!_ValidationUtils.default.validateMaximum(this.prefixLength, 32)) {
|
|
226
|
+
return new _ValidationError.default("prefixLength", "does not satisfy required maximum constraint: 32");
|
|
227
|
+
}
|
|
228
|
+
if (!_ValidationUtils.default.validateMinimum(this.prefixLength, 0)) {
|
|
229
|
+
return new _ValidationError.default("prefixLength", "does not satisfy required minimum constraint: 0");
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (property === "$reserved") {
|
|
233
|
+
if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
|
|
234
|
+
return new _ValidationError.default("$reserved", "undefined or null");
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (property === "$objectType") {
|
|
238
|
+
if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
|
|
239
|
+
return new _ValidationError.default("$objectType", "undefined or null");
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (property === "$unknownFields") {
|
|
243
|
+
if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
|
|
244
|
+
return new _ValidationError.default("$unknownFields", "undefined or null");
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return new _ValidationError.default(property, "no such property exists");
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* The IPv4 address of the host.
|
|
253
|
+
* @memberof IPv4Address
|
|
254
|
+
*/
|
|
255
|
+
exports.default = IPv4Address;
|
|
256
|
+
function _toJsonMapType(obj, forMutation) {
|
|
257
|
+
if (obj instanceof Map) {
|
|
258
|
+
return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
|
|
259
|
+
} else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
|
|
260
|
+
return Object.fromEntries(Array.from(Object.entries(obj), entry => {
|
|
261
|
+
return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
return obj;
|
|
265
|
+
}
|
|
266
|
+
/*
|
|
267
|
+
* toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
|
|
268
|
+
* @param {Object} obj Object to serialize
|
|
269
|
+
* @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
|
|
270
|
+
* @returns {Object|string} Returns serialized date object or original input object
|
|
271
|
+
*/
|
|
272
|
+
function _handleDateType(obj, isDateOnly) {
|
|
273
|
+
if (obj instanceof Date && isDateOnly !== undefined) {
|
|
274
|
+
return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
|
|
275
|
+
}
|
|
276
|
+
return obj;
|
|
277
|
+
}
|
|
278
|
+
IPv4Address.prototype.value = undefined;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The prefix length of the network to which this host IPv4 address belongs.
|
|
282
|
+
* @memberof IPv4Address
|
|
283
|
+
* @default 32
|
|
284
|
+
*/
|
|
285
|
+
IPv4Address.prototype.prefixLength = 32;
|
|
286
|
+
IPv4Address.prototype.$reserved = undefined;
|
|
287
|
+
IPv4Address.prototype.$objectType = undefined;
|
|
288
|
+
IPv4Address.prototype.$unknownFields = undefined;
|