@nutanix-scratch/objects-js-client 4.0.1-beta.1 → 4.0.2
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/README.md +33 -20
- package/dist/Ntnx-Objects-js-client-prod.js +1 -1
- package/dist/Ntnx-Objects-js-client.js +331 -259
- package/dist/es/ApiClient.d.ts +35 -7
- package/dist/es/ApiClient.js +862 -684
- package/dist/es/Paginable.d.ts +1 -1
- package/dist/es/Paginable.js +144 -183
- package/dist/es/apis/objectstores-endpoints.d.ts +9 -70
- package/dist/es/apis/objectstores-endpoints.js +407 -477
- package/dist/es/apis/stats-endpoints.d.ts +46 -0
- package/dist/es/apis/stats-endpoints.js +122 -0
- package/dist/es/index.d.ts +13 -1
- package/dist/es/index.js +152 -104
- package/dist/es/models/common/v1/config/FQDN.d.ts +2 -7
- package/dist/es/models/common/v1/config/FQDN.js +141 -180
- package/dist/es/models/common/v1/config/Flag.d.ts +2 -8
- package/dist/es/models/common/v1/config/Flag.js +170 -211
- package/dist/es/models/common/v1/config/IPAddress.d.ts +2 -20
- package/dist/es/models/common/v1/config/IPAddress.js +170 -217
- package/dist/es/models/common/v1/config/IPv4Address.d.ts +2 -8
- package/dist/es/models/common/v1/config/IPv4Address.js +174 -215
- package/dist/es/models/common/v1/config/IPv6Address.d.ts +2 -8
- package/dist/es/models/common/v1/config/IPv6Address.js +174 -215
- package/dist/es/models/common/v1/config/KVPair.d.ts +2 -8
- package/dist/es/models/common/v1/config/KVPair.js +225 -270
- package/dist/es/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
- package/dist/es/models/common/v1/config/MapOfStringWrapper.js +139 -178
- package/dist/es/models/common/v1/config/Message.d.ts +2 -10
- package/dist/es/models/common/v1/config/Message.js +213 -258
- package/dist/es/models/common/v1/config/MessageSeverity.js +7 -9
- package/dist/es/models/common/v1/config/Metadata.d.ts +2 -11
- package/dist/es/models/common/v1/config/Metadata.js +261 -308
- package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +5 -10
- package/dist/es/models/common/v1/config/TenantAwareModel.js +138 -178
- package/dist/es/models/common/v1/response/ApiLink.d.ts +2 -8
- package/dist/es/models/common/v1/response/ApiLink.js +165 -206
- package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
- package/dist/es/models/common/v1/response/ApiResponseMetadata.js +281 -344
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +155 -203
- package/dist/es/models/common/v1/stats/DownSamplingOperator.d.ts +19 -0
- package/dist/es/models/common/v1/stats/DownSamplingOperator.js +107 -0
- package/dist/es/models/common/v1/stats/TimeIntValuePair.d.ts +58 -0
- package/dist/es/models/common/v1/stats/TimeIntValuePair.js +272 -0
- package/dist/es/models/objects/v4/config/Certificate.d.ts +24 -34
- package/dist/es/models/objects/v4/config/Certificate.js +342 -310
- package/dist/es/models/objects/v4/config/CertificateProjection.d.ts +1 -1
- package/dist/es/models/objects/v4/config/CertificateProjection.js +75 -103
- package/dist/es/models/objects/v4/config/CreateCertificateApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/CreateCertificateApiResponse.js +187 -242
- package/dist/es/models/objects/v4/config/CreateObjectstoreApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/CreateObjectstoreApiResponse.js +187 -242
- package/dist/es/models/objects/v4/config/DeleteObjectstoreApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/DeleteObjectstoreApiResponse.js +187 -242
- package/dist/es/models/objects/v4/config/GetCaApiResponse.d.ts +2 -45
- package/dist/es/models/objects/v4/config/GetCaApiResponse.js +187 -242
- package/dist/es/models/objects/v4/config/GetCertificateApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/GetCertificateApiResponse.js +187 -242
- package/dist/es/models/objects/v4/config/GetObjectstoreApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/GetObjectstoreApiResponse.js +187 -242
- package/dist/es/models/objects/v4/config/ListCertificatesApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/ListCertificatesApiResponse.js +213 -268
- package/dist/es/models/objects/v4/config/ListObjectstoresApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/ListObjectstoresApiResponse.js +213 -268
- package/dist/es/models/objects/v4/config/ObjectStore.d.ts +1 -96
- package/dist/es/models/objects/v4/config/ObjectStore.js +629 -712
- package/dist/es/models/objects/v4/config/ObjectStoreProjection.d.ts +1 -129
- package/dist/es/models/objects/v4/config/ObjectStoreProjection.js +222 -239
- package/dist/es/models/objects/v4/config/State.js +7 -9
- package/dist/es/models/objects/v4/config/UpdateObjectstoreApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/UpdateObjectstoreApiResponse.js +187 -242
- package/dist/es/models/objects/v4/error/AppMessage.d.ts +5 -15
- package/dist/es/models/objects/v4/error/AppMessage.js +265 -314
- package/dist/es/models/objects/v4/error/ErrorResponse.d.ts +2 -7
- package/dist/es/models/objects/v4/error/ErrorResponse.js +177 -219
- package/dist/es/models/objects/v4/error/SchemaValidationError.d.ts +2 -18
- package/dist/es/models/objects/v4/error/SchemaValidationError.js +249 -300
- package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
- package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.js +191 -234
- package/dist/es/models/objects/v4/stats/GetObjectstoreStatsApiResponse.d.ts +58 -0
- package/dist/es/models/objects/v4/stats/GetObjectstoreStatsApiResponse.js +288 -0
- package/dist/es/models/objects/v4/stats/ObjectstoreStats.d.ts +255 -0
- package/dist/es/models/objects/v4/stats/ObjectstoreStats.js +1253 -0
- package/dist/es/models/objects/v4/stats/TimeFloatValuePair.d.ts +58 -0
- package/dist/es/models/objects/v4/stats/TimeFloatValuePair.js +272 -0
- package/dist/es/models/prism/v4/config/TaskReference.d.ts +2 -7
- package/dist/es/models/prism/v4/config/TaskReference.js +142 -181
- package/dist/es/models/validation/ValidationError.js +26 -42
- package/dist/es/models/validation/ValidationScopes.js +3 -3
- package/dist/es/utils/ValidationUtils.js +39 -69
- package/dist/lib/ApiClient.d.ts +35 -7
- package/dist/lib/ApiClient.js +862 -684
- package/dist/lib/Paginable.d.ts +1 -1
- package/dist/lib/Paginable.js +144 -183
- package/dist/lib/apis/objectstores-endpoints.d.ts +9 -70
- package/dist/lib/apis/objectstores-endpoints.js +407 -477
- package/dist/lib/apis/stats-endpoints.d.ts +46 -0
- package/dist/lib/apis/stats-endpoints.js +122 -0
- package/dist/lib/index.d.ts +13 -1
- package/dist/lib/index.js +152 -104
- package/dist/lib/models/common/v1/config/FQDN.d.ts +2 -7
- package/dist/lib/models/common/v1/config/FQDN.js +141 -180
- package/dist/lib/models/common/v1/config/Flag.d.ts +2 -8
- package/dist/lib/models/common/v1/config/Flag.js +170 -211
- package/dist/lib/models/common/v1/config/IPAddress.d.ts +2 -20
- package/dist/lib/models/common/v1/config/IPAddress.js +170 -217
- package/dist/lib/models/common/v1/config/IPv4Address.d.ts +2 -8
- package/dist/lib/models/common/v1/config/IPv4Address.js +174 -215
- package/dist/lib/models/common/v1/config/IPv6Address.d.ts +2 -8
- package/dist/lib/models/common/v1/config/IPv6Address.js +174 -215
- package/dist/lib/models/common/v1/config/KVPair.d.ts +2 -8
- package/dist/lib/models/common/v1/config/KVPair.js +225 -270
- package/dist/lib/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
- package/dist/lib/models/common/v1/config/MapOfStringWrapper.js +139 -178
- package/dist/lib/models/common/v1/config/Message.d.ts +2 -10
- package/dist/lib/models/common/v1/config/Message.js +213 -258
- package/dist/lib/models/common/v1/config/MessageSeverity.js +7 -9
- package/dist/lib/models/common/v1/config/Metadata.d.ts +2 -11
- package/dist/lib/models/common/v1/config/Metadata.js +261 -308
- package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +5 -10
- package/dist/lib/models/common/v1/config/TenantAwareModel.js +138 -178
- package/dist/lib/models/common/v1/response/ApiLink.d.ts +2 -8
- package/dist/lib/models/common/v1/response/ApiLink.js +165 -206
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +281 -344
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +155 -203
- package/dist/lib/models/common/v1/stats/DownSamplingOperator.d.ts +19 -0
- package/dist/lib/models/common/v1/stats/DownSamplingOperator.js +107 -0
- package/dist/lib/models/common/v1/stats/TimeIntValuePair.d.ts +58 -0
- package/dist/lib/models/common/v1/stats/TimeIntValuePair.js +272 -0
- package/dist/lib/models/objects/v4/config/Certificate.d.ts +24 -34
- package/dist/lib/models/objects/v4/config/Certificate.js +342 -310
- package/dist/lib/models/objects/v4/config/CertificateProjection.d.ts +1 -1
- package/dist/lib/models/objects/v4/config/CertificateProjection.js +75 -103
- package/dist/lib/models/objects/v4/config/CreateCertificateApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/CreateCertificateApiResponse.js +187 -242
- package/dist/lib/models/objects/v4/config/CreateObjectstoreApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/CreateObjectstoreApiResponse.js +187 -242
- package/dist/lib/models/objects/v4/config/DeleteObjectstoreApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/DeleteObjectstoreApiResponse.js +187 -242
- package/dist/lib/models/objects/v4/config/GetCaApiResponse.d.ts +2 -45
- package/dist/lib/models/objects/v4/config/GetCaApiResponse.js +187 -242
- package/dist/lib/models/objects/v4/config/GetCertificateApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/GetCertificateApiResponse.js +187 -242
- package/dist/lib/models/objects/v4/config/GetObjectstoreApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/GetObjectstoreApiResponse.js +187 -242
- package/dist/lib/models/objects/v4/config/ListCertificatesApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/ListCertificatesApiResponse.js +213 -268
- package/dist/lib/models/objects/v4/config/ListObjectstoresApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/ListObjectstoresApiResponse.js +213 -268
- package/dist/lib/models/objects/v4/config/ObjectStore.d.ts +1 -96
- package/dist/lib/models/objects/v4/config/ObjectStore.js +629 -712
- package/dist/lib/models/objects/v4/config/ObjectStoreProjection.d.ts +1 -129
- package/dist/lib/models/objects/v4/config/ObjectStoreProjection.js +222 -239
- package/dist/lib/models/objects/v4/config/State.js +7 -9
- package/dist/lib/models/objects/v4/config/UpdateObjectstoreApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/UpdateObjectstoreApiResponse.js +187 -242
- package/dist/lib/models/objects/v4/error/AppMessage.d.ts +5 -15
- package/dist/lib/models/objects/v4/error/AppMessage.js +265 -314
- package/dist/lib/models/objects/v4/error/ErrorResponse.d.ts +2 -7
- package/dist/lib/models/objects/v4/error/ErrorResponse.js +177 -219
- package/dist/lib/models/objects/v4/error/SchemaValidationError.d.ts +2 -18
- package/dist/lib/models/objects/v4/error/SchemaValidationError.js +249 -300
- package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
- package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.js +191 -234
- package/dist/lib/models/objects/v4/stats/GetObjectstoreStatsApiResponse.d.ts +58 -0
- package/dist/lib/models/objects/v4/stats/GetObjectstoreStatsApiResponse.js +288 -0
- package/dist/lib/models/objects/v4/stats/ObjectstoreStats.d.ts +255 -0
- package/dist/lib/models/objects/v4/stats/ObjectstoreStats.js +1253 -0
- package/dist/lib/models/objects/v4/stats/TimeFloatValuePair.d.ts +58 -0
- package/dist/lib/models/objects/v4/stats/TimeFloatValuePair.js +272 -0
- package/dist/lib/models/prism/v4/config/TaskReference.d.ts +2 -7
- package/dist/lib/models/prism/v4/config/TaskReference.js +142 -181
- package/dist/lib/models/validation/ValidationError.js +26 -42
- package/dist/lib/models/validation/ValidationScopes.js +3 -3
- package/dist/lib/utils/ValidationUtils.js +39 -69
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _Flag = _interopRequireDefault(require("../config/Flag"));
|
|
8
8
|
var _KVPair = _interopRequireDefault(require("../config/KVPair"));
|
|
9
9
|
var _Message = _interopRequireDefault(require("../config/Message"));
|
|
@@ -11,31 +11,16 @@ var _ApiLink = _interopRequireDefault(require("./ApiLink"));
|
|
|
11
11
|
var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
|
|
12
12
|
var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
|
|
13
13
|
var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : {
|
|
15
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
16
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
17
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
25
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
26
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
27
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
28
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
29
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
15
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
31
16
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } /*
|
|
32
17
|
* Nutanix Objects Storage Management APIs
|
|
33
18
|
*
|
|
34
|
-
* OpenAPI spec version: 4.0.
|
|
19
|
+
* OpenAPI spec version: 4.0.2
|
|
35
20
|
*
|
|
36
21
|
* NOTE: This class is auto generated by the Open API Dev Platform.
|
|
37
22
|
*
|
|
38
|
-
* Open API Dev Platform Codegen version:
|
|
23
|
+
* Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
|
|
39
24
|
*
|
|
40
25
|
* Do not edit the class manually.
|
|
41
26
|
*
|
|
@@ -43,18 +28,17 @@ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("C
|
|
|
43
28
|
/**
|
|
44
29
|
* The ApiResponseMetadata model module.
|
|
45
30
|
* @module Ntnx/ApiResponseMetadata
|
|
46
|
-
* @version 4.0.
|
|
31
|
+
* @version 4.0.2
|
|
47
32
|
* @class ApiResponseMetadata
|
|
48
33
|
*/
|
|
49
34
|
var _ApiResponseMetadata_brand = /*#__PURE__*/new WeakSet();
|
|
50
|
-
|
|
35
|
+
class ApiResponseMetadata {
|
|
51
36
|
/**
|
|
52
37
|
* Constructs a new <code>ApiResponseMetadata</code>.
|
|
53
38
|
* The metadata associated with an API response. This value is always present and minimally contains the self-link for the API request that produced this response. It also contains pagination data for the paginated requests.
|
|
54
39
|
* @alias module:Ntnx/ApiResponseMetadata
|
|
55
40
|
*/
|
|
56
|
-
|
|
57
|
-
_classCallCheck(this, ApiResponseMetadata);
|
|
41
|
+
constructor() {
|
|
58
42
|
/*
|
|
59
43
|
* toJson method for a map type which supports map with primitive keys and values of object types
|
|
60
44
|
* @param {Object} obj
|
|
@@ -79,362 +63,315 @@ var ApiResponseMetadata = exports["default"] = /*#__PURE__*/function () {
|
|
|
79
63
|
* @param callFromChild {Boolean} Flag to recognise calling instance
|
|
80
64
|
* @return {module:Ntnx/ApiResponseMetadata} The populated <code>ApiResponseMetadata</code> instance.
|
|
81
65
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
66
|
+
static constructFromObject(data, obj = null, callFromChild = false) {
|
|
67
|
+
let items, item, i, itemArr, discriminator;
|
|
68
|
+
if (data) {
|
|
69
|
+
obj = obj || new ApiResponseMetadata();
|
|
70
|
+
if (data.hasOwnProperty('flags') && data.flags !== null && data.flags !== undefined) {
|
|
71
|
+
itemArr = [];
|
|
72
|
+
items = data.flags;
|
|
73
|
+
for (i = 0; i < items.length; i++) {
|
|
74
|
+
item = _Flag.default.constructFromObject(items[i], undefined);
|
|
75
|
+
itemArr.push(item);
|
|
76
|
+
}
|
|
77
|
+
obj.setFlags(itemArr);
|
|
78
|
+
}
|
|
79
|
+
if (data.hasOwnProperty('links') && data.links !== null && data.links !== undefined) {
|
|
80
|
+
itemArr = [];
|
|
81
|
+
items = data.links;
|
|
82
|
+
for (i = 0; i < items.length; i++) {
|
|
83
|
+
item = _ApiLink.default.constructFromObject(items[i], undefined);
|
|
84
|
+
itemArr.push(item);
|
|
85
|
+
}
|
|
86
|
+
obj.setLinks(itemArr);
|
|
87
|
+
}
|
|
88
|
+
if (data.hasOwnProperty('totalAvailableResults') && data.totalAvailableResults !== null && data.totalAvailableResults !== undefined) {
|
|
89
|
+
obj.setTotalAvailableResults(data['totalAvailableResults']);
|
|
90
|
+
}
|
|
91
|
+
if (data.hasOwnProperty('messages') && data.messages !== null && data.messages !== undefined) {
|
|
92
|
+
itemArr = [];
|
|
93
|
+
items = data.messages;
|
|
94
|
+
for (i = 0; i < items.length; i++) {
|
|
95
|
+
item = _Message.default.constructFromObject(items[i], undefined);
|
|
96
|
+
itemArr.push(item);
|
|
97
|
+
}
|
|
98
|
+
obj.setMessages(itemArr);
|
|
99
|
+
}
|
|
100
|
+
if (data.hasOwnProperty('extraInfo') && data.extraInfo !== null && data.extraInfo !== undefined) {
|
|
101
|
+
itemArr = [];
|
|
102
|
+
items = data.extraInfo;
|
|
103
|
+
for (i = 0; i < items.length; i++) {
|
|
104
|
+
item = _KVPair.default.constructFromObject(items[i], undefined);
|
|
105
|
+
itemArr.push(item);
|
|
106
|
+
}
|
|
107
|
+
obj.setExtraInfo(itemArr);
|
|
108
|
+
}
|
|
109
|
+
if (data.hasOwnProperty('$reserved')) {
|
|
110
|
+
obj.$reserved = data['$reserved'];
|
|
111
|
+
}
|
|
112
|
+
if (data.hasOwnProperty('$objectType')) {
|
|
113
|
+
obj.$objectType = data['$objectType'];
|
|
114
|
+
}
|
|
115
|
+
if (data.hasOwnProperty('$unknownFields')) {
|
|
116
|
+
obj.$unknownFields = data['$unknownFields'];
|
|
117
|
+
}
|
|
118
|
+
if (!callFromChild) {
|
|
119
|
+
obj.$unknownFields = {
|
|
120
|
+
...data.$unknownFields
|
|
121
|
+
};
|
|
122
|
+
for (const property in data) {
|
|
123
|
+
// Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
|
|
124
|
+
// as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
|
|
125
|
+
// Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
|
|
126
|
+
// If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
|
|
127
|
+
if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
|
|
128
|
+
obj.$unknownFields[property] = data[property];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
91
132
|
}
|
|
133
|
+
return obj;
|
|
134
|
+
}
|
|
92
135
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
136
|
+
/**
|
|
137
|
+
* Converts a given snake_case string to camelCase.
|
|
138
|
+
* @param {string} snakeStr - The input string in snake_case format.
|
|
139
|
+
* @returns {string} - The converted string in camelCase format.
|
|
140
|
+
*/
|
|
141
|
+
static snakeToCamel(snakeStr) {
|
|
142
|
+
return snakeStr.replace(/(_\w)/g, match => match[1].toUpperCase());
|
|
143
|
+
}
|
|
102
144
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return this.links;
|
|
111
|
-
}
|
|
145
|
+
/**
|
|
146
|
+
* Returns An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated.
|
|
147
|
+
* @return {Flag[]}
|
|
148
|
+
*/
|
|
149
|
+
getFlags() {
|
|
150
|
+
return this.flags;
|
|
151
|
+
}
|
|
112
152
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this.links = links;
|
|
121
|
-
}
|
|
153
|
+
/**
|
|
154
|
+
* Sets An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated.
|
|
155
|
+
* @param {Flag[]} flags An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated.
|
|
156
|
+
*/
|
|
157
|
+
setFlags(flags) {
|
|
158
|
+
this.flags = flags;
|
|
159
|
+
}
|
|
122
160
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return this.totalAvailableResults;
|
|
131
|
-
}
|
|
161
|
+
/**
|
|
162
|
+
* Returns An array of HATEOAS style links for the response that may also include pagination links for list operations.
|
|
163
|
+
* @return {ApiLink[]}
|
|
164
|
+
*/
|
|
165
|
+
getLinks() {
|
|
166
|
+
return this.links;
|
|
167
|
+
}
|
|
132
168
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.totalAvailableResults = totalAvailableResults;
|
|
141
|
-
}
|
|
169
|
+
/**
|
|
170
|
+
* Sets An array of HATEOAS style links for the response that may also include pagination links for list operations.
|
|
171
|
+
* @param {ApiLink[]} links An array of HATEOAS style links for the response that may also include pagination links for list operations.
|
|
172
|
+
*/
|
|
173
|
+
setLinks(links) {
|
|
174
|
+
this.links = links;
|
|
175
|
+
}
|
|
142
176
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return this.messages;
|
|
151
|
-
}
|
|
177
|
+
/**
|
|
178
|
+
* Returns The total number of entities that are available on the server for this type.
|
|
179
|
+
* @return {Number}
|
|
180
|
+
*/
|
|
181
|
+
getTotalAvailableResults() {
|
|
182
|
+
return this.totalAvailableResults;
|
|
183
|
+
}
|
|
152
184
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
this.messages = messages;
|
|
161
|
-
}
|
|
185
|
+
/**
|
|
186
|
+
* Sets The total number of entities that are available on the server for this type.
|
|
187
|
+
* @param {Number} totalAvailableResults The total number of entities that are available on the server for this type.
|
|
188
|
+
*/
|
|
189
|
+
setTotalAvailableResults(totalAvailableResults) {
|
|
190
|
+
this.totalAvailableResults = totalAvailableResults;
|
|
191
|
+
}
|
|
162
192
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return this.extraInfo;
|
|
171
|
-
}
|
|
193
|
+
/**
|
|
194
|
+
* Returns Information, Warning or Error messages that might provide additional contextual information related to the operation.
|
|
195
|
+
* @return {Message[]}
|
|
196
|
+
*/
|
|
197
|
+
getMessages() {
|
|
198
|
+
return this.messages;
|
|
199
|
+
}
|
|
172
200
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Sets Information, Warning or Error messages that might provide additional contextual information related to the operation.
|
|
203
|
+
* @param {Message[]} messages Information, Warning or Error messages that might provide additional contextual information related to the operation.
|
|
204
|
+
*/
|
|
205
|
+
setMessages(messages) {
|
|
206
|
+
this.messages = messages;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Returns An array of entity-specific metadata
|
|
211
|
+
* @return {KVPair[]}
|
|
212
|
+
*/
|
|
213
|
+
getExtraInfo() {
|
|
214
|
+
return this.extraInfo;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Sets An array of entity-specific metadata
|
|
219
|
+
* @param {KVPair[]} extraInfo An array of entity-specific metadata
|
|
220
|
+
*/
|
|
221
|
+
setExtraInfo(extraInfo) {
|
|
222
|
+
this.extraInfo = extraInfo;
|
|
223
|
+
}
|
|
224
|
+
get$Reserved() {
|
|
225
|
+
return this.$reserved;
|
|
226
|
+
}
|
|
227
|
+
get$ObjectType() {
|
|
228
|
+
return this.$objectType;
|
|
229
|
+
}
|
|
230
|
+
get$UnknownFields() {
|
|
231
|
+
return this.$unknownFields;
|
|
232
|
+
}
|
|
233
|
+
toJson(forMutation) {
|
|
234
|
+
if (forMutation === false) {
|
|
235
|
+
return {
|
|
236
|
+
...(typeof this.getFlags() !== 'undefined' && this.getFlags() !== null ? {
|
|
237
|
+
'flags': this.getFlags().map(item => item.toJson(false))
|
|
238
|
+
} : {}),
|
|
239
|
+
...(typeof this.getLinks() !== 'undefined' && this.getLinks() !== null ? {
|
|
240
|
+
'links': this.getLinks().map(item => item.toJson(false))
|
|
241
|
+
} : {}),
|
|
242
|
+
...(typeof this.getTotalAvailableResults() !== 'undefined' && this.getTotalAvailableResults() !== null ? {
|
|
210
243
|
'totalAvailableResults': this.getTotalAvailableResults()
|
|
211
|
-
} : {}),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
'extraInfo': this.getExtraInfo().map(
|
|
217
|
-
|
|
218
|
-
})
|
|
219
|
-
} : {}), {}, {
|
|
220
|
-
'$reserved': this.get$Reserved(),
|
|
221
|
-
'$objectType': this.get$ObjectType(),
|
|
222
|
-
'$unknownFields': this.get$UnknownFields()
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, typeof this.getFlags() !== 'undefined' && this.getFlags() !== null ? {
|
|
226
|
-
'flags': this.getFlags().map(function (item) {
|
|
227
|
-
return item.toJson(false);
|
|
228
|
-
})
|
|
229
|
-
} : {}), typeof this.getLinks() !== 'undefined' && this.getLinks() !== null ? {
|
|
230
|
-
'links': this.getLinks().map(function (item) {
|
|
231
|
-
return item.toJson(false);
|
|
232
|
-
})
|
|
233
|
-
} : {}), typeof this.getTotalAvailableResults() !== 'undefined' && this.getTotalAvailableResults() !== null ? {
|
|
234
|
-
'totalAvailableResults': this.getTotalAvailableResults()
|
|
235
|
-
} : {}), typeof this.getMessages() !== 'undefined' && this.getMessages() !== null ? {
|
|
236
|
-
'messages': this.getMessages().map(function (item) {
|
|
237
|
-
return item.toJson(false);
|
|
238
|
-
})
|
|
239
|
-
} : {}), typeof this.getExtraInfo() !== 'undefined' && this.getExtraInfo() !== null ? {
|
|
240
|
-
'extraInfo': this.getExtraInfo().map(function (item) {
|
|
241
|
-
return item.toJson(false);
|
|
242
|
-
})
|
|
243
|
-
} : {}), {}, {
|
|
244
|
+
} : {}),
|
|
245
|
+
...(typeof this.getMessages() !== 'undefined' && this.getMessages() !== null ? {
|
|
246
|
+
'messages': this.getMessages().map(item => item.toJson(false))
|
|
247
|
+
} : {}),
|
|
248
|
+
...(typeof this.getExtraInfo() !== 'undefined' && this.getExtraInfo() !== null ? {
|
|
249
|
+
'extraInfo': this.getExtraInfo().map(item => item.toJson(false))
|
|
250
|
+
} : {}),
|
|
244
251
|
'$reserved': this.get$Reserved(),
|
|
245
252
|
'$objectType': this.get$ObjectType(),
|
|
246
|
-
|
|
247
|
-
|
|
253
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
254
|
+
'$unknownFields': {}
|
|
255
|
+
};
|
|
248
256
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
return {
|
|
258
|
+
...(typeof this.getFlags() !== 'undefined' && this.getFlags() !== null ? {
|
|
259
|
+
'flags': this.getFlags().map(item => item.toJson(false))
|
|
260
|
+
} : {}),
|
|
261
|
+
...(typeof this.getLinks() !== 'undefined' && this.getLinks() !== null ? {
|
|
262
|
+
'links': this.getLinks().map(item => item.toJson(false))
|
|
263
|
+
} : {}),
|
|
264
|
+
...(typeof this.getTotalAvailableResults() !== 'undefined' && this.getTotalAvailableResults() !== null ? {
|
|
265
|
+
'totalAvailableResults': this.getTotalAvailableResults()
|
|
266
|
+
} : {}),
|
|
267
|
+
...(typeof this.getMessages() !== 'undefined' && this.getMessages() !== null ? {
|
|
268
|
+
'messages': this.getMessages().map(item => item.toJson(false))
|
|
269
|
+
} : {}),
|
|
270
|
+
...(typeof this.getExtraInfo() !== 'undefined' && this.getExtraInfo() !== null ? {
|
|
271
|
+
'extraInfo': this.getExtraInfo().map(item => item.toJson(false))
|
|
272
|
+
} : {}),
|
|
273
|
+
'$reserved': this.get$Reserved(),
|
|
274
|
+
'$objectType': this.get$ObjectType(),
|
|
275
|
+
...(typeof this.get$UnknownFields() !== 'undefined' && this.get$UnknownFields() !== null ? this.get$UnknownFields() : {}),
|
|
276
|
+
'$unknownFields': {}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
validate(scope, properties) {
|
|
280
|
+
let propList = [];
|
|
281
|
+
if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes.default) {
|
|
282
|
+
//cases validate() and validate(scope)
|
|
283
|
+
propList = [];
|
|
284
|
+
} else if (arguments.length === 1) {
|
|
285
|
+
//case validate(properties)
|
|
286
|
+
propList = arguments[0];
|
|
287
|
+
scope = null;
|
|
288
|
+
} else {
|
|
289
|
+
//case validate(scope, properties)
|
|
290
|
+
propList = arguments[1];
|
|
291
|
+
}
|
|
292
|
+
let res = [];
|
|
293
|
+
let err = null;
|
|
294
|
+
propList.forEach(property => {
|
|
295
|
+
err = this.validateProperty(property, scope);
|
|
296
|
+
if (err) {
|
|
297
|
+
res.push(err);
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
return new Promise(function (resolve, reject) {
|
|
301
|
+
if (res.length !== 0) {
|
|
302
|
+
reject(err);
|
|
261
303
|
} else {
|
|
262
|
-
|
|
263
|
-
|
|
304
|
+
resolve();
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
validateProperty(scope, property) {
|
|
309
|
+
if (property === "flags") {
|
|
310
|
+
if (typeof this.flags === 'undefined' || this.flags === null) {
|
|
311
|
+
return new _ValidationError.default("flags", "undefined or null");
|
|
312
|
+
}
|
|
313
|
+
if (!_ValidationUtils.default.validateMaxItems(this.flags, 20)) {
|
|
314
|
+
return new _ValidationError.default("flags", "does not satisfy required maxItems constraint: 20");
|
|
264
315
|
}
|
|
265
|
-
var res = [];
|
|
266
|
-
var err = null;
|
|
267
|
-
propList.forEach(function (property) {
|
|
268
|
-
err = _this.validateProperty(property, scope);
|
|
269
|
-
if (err) {
|
|
270
|
-
res.push(err);
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
return new Promise(function (resolve, reject) {
|
|
274
|
-
if (res.length !== 0) {
|
|
275
|
-
reject(err);
|
|
276
|
-
} else {
|
|
277
|
-
resolve();
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
316
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
if (property === "flags") {
|
|
285
|
-
if (typeof this.flags === 'undefined' || this.flags === null) {
|
|
286
|
-
return new _ValidationError["default"]("flags", "undefined or null");
|
|
287
|
-
}
|
|
288
|
-
if (!_ValidationUtils["default"].validateMaxItems(this.flags, 20)) {
|
|
289
|
-
return new _ValidationError["default"]("flags", "does not satisfy required maxItems constraint: 20");
|
|
290
|
-
}
|
|
317
|
+
if (property === "links") {
|
|
318
|
+
if (typeof this.links === 'undefined' || this.links === null) {
|
|
319
|
+
return new _ValidationError.default("links", "undefined or null");
|
|
291
320
|
}
|
|
292
|
-
if (
|
|
293
|
-
|
|
294
|
-
return new _ValidationError["default"]("links", "undefined or null");
|
|
295
|
-
}
|
|
296
|
-
if (!_ValidationUtils["default"].validateMaxItems(this.links, 20)) {
|
|
297
|
-
return new _ValidationError["default"]("links", "does not satisfy required maxItems constraint: 20");
|
|
298
|
-
}
|
|
321
|
+
if (!_ValidationUtils.default.validateMaxItems(this.links, 20)) {
|
|
322
|
+
return new _ValidationError.default("links", "does not satisfy required maxItems constraint: 20");
|
|
299
323
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
324
|
+
}
|
|
325
|
+
if (property === "totalAvailableResults") {
|
|
326
|
+
if (typeof this.totalAvailableResults === 'undefined' || this.totalAvailableResults === null) {
|
|
327
|
+
return new _ValidationError.default("totalAvailableResults", "undefined or null");
|
|
304
328
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
if (!_ValidationUtils["default"].validateMaxItems(this.messages, 20)) {
|
|
310
|
-
return new _ValidationError["default"]("messages", "does not satisfy required maxItems constraint: 20");
|
|
311
|
-
}
|
|
329
|
+
}
|
|
330
|
+
if (property === "messages") {
|
|
331
|
+
if (typeof this.messages === 'undefined' || this.messages === null) {
|
|
332
|
+
return new _ValidationError.default("messages", "undefined or null");
|
|
312
333
|
}
|
|
313
|
-
if (
|
|
314
|
-
|
|
315
|
-
return new _ValidationError["default"]("extraInfo", "undefined or null");
|
|
316
|
-
}
|
|
317
|
-
if (!_ValidationUtils["default"].validateMaxItems(this.extraInfo, 20)) {
|
|
318
|
-
return new _ValidationError["default"]("extraInfo", "does not satisfy required maxItems constraint: 20");
|
|
319
|
-
}
|
|
334
|
+
if (!_ValidationUtils.default.validateMaxItems(this.messages, 20)) {
|
|
335
|
+
return new _ValidationError.default("messages", "does not satisfy required maxItems constraint: 20");
|
|
320
336
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
337
|
+
}
|
|
338
|
+
if (property === "extraInfo") {
|
|
339
|
+
if (typeof this.extraInfo === 'undefined' || this.extraInfo === null) {
|
|
340
|
+
return new _ValidationError.default("extraInfo", "undefined or null");
|
|
325
341
|
}
|
|
326
|
-
if (
|
|
327
|
-
|
|
328
|
-
return new _ValidationError["default"]("$objectType", "undefined or null");
|
|
329
|
-
}
|
|
342
|
+
if (!_ValidationUtils.default.validateMaxItems(this.extraInfo, 20)) {
|
|
343
|
+
return new _ValidationError.default("extraInfo", "does not satisfy required maxItems constraint: 20");
|
|
330
344
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
345
|
+
}
|
|
346
|
+
if (property === "$reserved") {
|
|
347
|
+
if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
|
|
348
|
+
return new _ValidationError.default("$reserved", "undefined or null");
|
|
335
349
|
}
|
|
336
|
-
return new _ValidationError["default"](property, "no such property exists");
|
|
337
350
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
var obj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
342
|
-
var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
343
|
-
var items, item, i, itemArr, discriminator;
|
|
344
|
-
if (data) {
|
|
345
|
-
obj = obj || new ApiResponseMetadata();
|
|
346
|
-
if (data.hasOwnProperty('flags') && data.flags !== null && data.flags !== undefined) {
|
|
347
|
-
itemArr = [];
|
|
348
|
-
items = data.flags;
|
|
349
|
-
for (i = 0; i < items.length; i++) {
|
|
350
|
-
item = _Flag["default"].constructFromObject(items[i], undefined);
|
|
351
|
-
itemArr.push(item);
|
|
352
|
-
}
|
|
353
|
-
obj.setFlags(itemArr);
|
|
354
|
-
}
|
|
355
|
-
if (data.hasOwnProperty('links') && data.links !== null && data.links !== undefined) {
|
|
356
|
-
itemArr = [];
|
|
357
|
-
items = data.links;
|
|
358
|
-
for (i = 0; i < items.length; i++) {
|
|
359
|
-
item = _ApiLink["default"].constructFromObject(items[i], undefined);
|
|
360
|
-
itemArr.push(item);
|
|
361
|
-
}
|
|
362
|
-
obj.setLinks(itemArr);
|
|
363
|
-
}
|
|
364
|
-
if (data.hasOwnProperty('totalAvailableResults') && data.totalAvailableResults !== null && data.totalAvailableResults !== undefined) {
|
|
365
|
-
obj.setTotalAvailableResults(data['totalAvailableResults']);
|
|
366
|
-
}
|
|
367
|
-
if (data.hasOwnProperty('messages') && data.messages !== null && data.messages !== undefined) {
|
|
368
|
-
itemArr = [];
|
|
369
|
-
items = data.messages;
|
|
370
|
-
for (i = 0; i < items.length; i++) {
|
|
371
|
-
item = _Message["default"].constructFromObject(items[i], undefined);
|
|
372
|
-
itemArr.push(item);
|
|
373
|
-
}
|
|
374
|
-
obj.setMessages(itemArr);
|
|
375
|
-
}
|
|
376
|
-
if (data.hasOwnProperty('extraInfo') && data.extraInfo !== null && data.extraInfo !== undefined) {
|
|
377
|
-
itemArr = [];
|
|
378
|
-
items = data.extraInfo;
|
|
379
|
-
for (i = 0; i < items.length; i++) {
|
|
380
|
-
item = _KVPair["default"].constructFromObject(items[i], undefined);
|
|
381
|
-
itemArr.push(item);
|
|
382
|
-
}
|
|
383
|
-
obj.setExtraInfo(itemArr);
|
|
384
|
-
}
|
|
385
|
-
if (data.hasOwnProperty('$reserved')) {
|
|
386
|
-
obj.$reserved = data['$reserved'];
|
|
387
|
-
}
|
|
388
|
-
if (data.hasOwnProperty('$objectType')) {
|
|
389
|
-
obj.$objectType = data['$objectType'];
|
|
390
|
-
}
|
|
391
|
-
if (data.hasOwnProperty('$unknownFields')) {
|
|
392
|
-
obj.$unknownFields = data['$unknownFields'];
|
|
393
|
-
}
|
|
394
|
-
if (!callFromChild) {
|
|
395
|
-
obj.$unknownFields = _objectSpread({}, data.$unknownFields);
|
|
396
|
-
for (var property in data) {
|
|
397
|
-
// Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
|
|
398
|
-
// as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
|
|
399
|
-
// Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
|
|
400
|
-
// If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
|
|
401
|
-
if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
|
|
402
|
-
obj.$unknownFields[property] = data[property];
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
351
|
+
if (property === "$objectType") {
|
|
352
|
+
if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
|
|
353
|
+
return new _ValidationError.default("$objectType", "undefined or null");
|
|
406
354
|
}
|
|
407
|
-
return obj;
|
|
408
355
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
* @returns {string} - The converted string in camelCase format.
|
|
414
|
-
*/
|
|
415
|
-
}, {
|
|
416
|
-
key: "snakeToCamel",
|
|
417
|
-
value: function snakeToCamel(snakeStr) {
|
|
418
|
-
return snakeStr.replace(/(_\w)/g, function (match) {
|
|
419
|
-
return match[1].toUpperCase();
|
|
420
|
-
});
|
|
356
|
+
if (property === "$unknownFields") {
|
|
357
|
+
if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
|
|
358
|
+
return new _ValidationError.default("$unknownFields", "undefined or null");
|
|
359
|
+
}
|
|
421
360
|
}
|
|
422
|
-
|
|
423
|
-
}
|
|
361
|
+
return new _ValidationError.default(property, "no such property exists");
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
424
365
|
/**
|
|
425
366
|
* An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated.
|
|
426
367
|
* @memberof ApiResponseMetadata
|
|
427
368
|
*/
|
|
369
|
+
exports.default = ApiResponseMetadata;
|
|
428
370
|
function _toJsonMapType(obj, forMutation) {
|
|
429
371
|
if (obj instanceof Map) {
|
|
430
|
-
return Object.fromEntries(Array.from(obj,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
v = _ref2[1];
|
|
434
|
-
return [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v];
|
|
435
|
-
}));
|
|
436
|
-
} else if (_typeof(obj) === 'object' && obj != null && obj.constructor === Object) {
|
|
437
|
-
return Object.fromEntries(Array.from(Object.entries(obj), function (entry) {
|
|
372
|
+
return Object.fromEntries(Array.from(obj, ([k, v]) => [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v]));
|
|
373
|
+
} else if (typeof obj === 'object' && obj != null && obj.constructor === Object) {
|
|
374
|
+
return Object.fromEntries(Array.from(Object.entries(obj), entry => {
|
|
438
375
|
return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
|
|
439
376
|
}));
|
|
440
377
|
}
|