@nutanix-scratch/objects-js-client 4.0.1-alpha.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.
Files changed (145) hide show
  1. package/LICENSE.txt +49 -0
  2. package/README.md +200 -0
  3. package/dist/Ntnx-Objects-js-client-prod.js +1 -0
  4. package/dist/Ntnx-Objects-js-client.js +729 -0
  5. package/dist/es/ApiClient.d.ts +159 -0
  6. package/dist/es/ApiClient.js +1211 -0
  7. package/dist/es/Paginable.d.ts +95 -0
  8. package/dist/es/Paginable.js +287 -0
  9. package/dist/es/apis/objectstores-endpoints.d.ts +231 -0
  10. package/dist/es/apis/objectstores-endpoints.js +522 -0
  11. package/dist/es/index.d.ts +64 -0
  12. package/dist/es/index.js +252 -0
  13. package/dist/es/models/common/v1/config/FQDN.d.ts +48 -0
  14. package/dist/es/models/common/v1/config/FQDN.js +242 -0
  15. package/dist/es/models/common/v1/config/Flag.d.ts +58 -0
  16. package/dist/es/models/common/v1/config/Flag.js +275 -0
  17. package/dist/es/models/common/v1/config/IPAddress.d.ts +61 -0
  18. package/dist/es/models/common/v1/config/IPAddress.js +291 -0
  19. package/dist/es/models/common/v1/config/IPv4Address.d.ts +62 -0
  20. package/dist/es/models/common/v1/config/IPv4Address.js +288 -0
  21. package/dist/es/models/common/v1/config/IPv6Address.d.ts +62 -0
  22. package/dist/es/models/common/v1/config/IPv6Address.js +288 -0
  23. package/dist/es/models/common/v1/config/KVPair.d.ts +62 -0
  24. package/dist/es/models/common/v1/config/KVPair.js +332 -0
  25. package/dist/es/models/common/v1/config/Message.d.ts +84 -0
  26. package/dist/es/models/common/v1/config/Message.js +354 -0
  27. package/dist/es/models/common/v1/config/MessageSeverity.d.ts +19 -0
  28. package/dist/es/models/common/v1/config/MessageSeverity.js +91 -0
  29. package/dist/es/models/common/v1/config/Metadata.d.ts +98 -0
  30. package/dist/es/models/common/v1/config/Metadata.js +411 -0
  31. package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +50 -0
  32. package/dist/es/models/common/v1/config/TenantAwareModel.js +243 -0
  33. package/dist/es/models/common/v1/response/ApiLink.d.ts +62 -0
  34. package/dist/es/models/common/v1/response/ApiLink.js +280 -0
  35. package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +98 -0
  36. package/dist/es/models/common/v1/response/ApiResponseMetadata.js +438 -0
  37. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +42 -0
  38. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +270 -0
  39. package/dist/es/models/objects/v4/error/AppMessage.d.ts +108 -0
  40. package/dist/es/models/objects/v4/error/AppMessage.js +432 -0
  41. package/dist/es/models/objects/v4/error/ErrorResponse.d.ts +48 -0
  42. package/dist/es/models/objects/v4/error/ErrorResponse.js +288 -0
  43. package/dist/es/models/objects/v4/error/SchemaValidationError.d.ts +98 -0
  44. package/dist/es/models/objects/v4/error/SchemaValidationError.js +407 -0
  45. package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +74 -0
  46. package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.js +318 -0
  47. package/dist/es/models/objects/v4/operations/Certificate.d.ts +78 -0
  48. package/dist/es/models/objects/v4/operations/Certificate.js +411 -0
  49. package/dist/es/models/objects/v4/operations/CertificateApiResponse.d.ts +59 -0
  50. package/dist/es/models/objects/v4/operations/CertificateApiResponse.js +311 -0
  51. package/dist/es/models/objects/v4/operations/CertificateListApiResponse.d.ts +59 -0
  52. package/dist/es/models/objects/v4/operations/CertificateListApiResponse.js +338 -0
  53. package/dist/es/models/objects/v4/operations/CertificateProjection.d.ts +9 -0
  54. package/dist/es/models/objects/v4/operations/CertificateProjection.js +131 -0
  55. package/dist/es/models/objects/v4/operations/Objectstore.d.ts +242 -0
  56. package/dist/es/models/objects/v4/operations/Objectstore.js +945 -0
  57. package/dist/es/models/objects/v4/operations/ObjectstoreApiResponse.d.ts +59 -0
  58. package/dist/es/models/objects/v4/operations/ObjectstoreApiResponse.js +311 -0
  59. package/dist/es/models/objects/v4/operations/ObjectstoreListApiResponse.d.ts +59 -0
  60. package/dist/es/models/objects/v4/operations/ObjectstoreListApiResponse.js +338 -0
  61. package/dist/es/models/objects/v4/operations/ObjectstoreProjection.d.ts +50 -0
  62. package/dist/es/models/objects/v4/operations/ObjectstoreProjection.js +298 -0
  63. package/dist/es/models/objects/v4/operations/StateEnum.d.ts +19 -0
  64. package/dist/es/models/objects/v4/operations/StateEnum.js +145 -0
  65. package/dist/es/models/objects/v4/operations/TaskReferenceApiResponse.d.ts +59 -0
  66. package/dist/es/models/objects/v4/operations/TaskReferenceApiResponse.js +311 -0
  67. package/dist/es/models/prism/v4/config/TaskReference.d.ts +50 -0
  68. package/dist/es/models/prism/v4/config/TaskReference.js +247 -0
  69. package/dist/es/models/validation/ValidationError.d.ts +13 -0
  70. package/dist/es/models/validation/ValidationError.js +60 -0
  71. package/dist/es/models/validation/ValidationScopes.d.ts +9 -0
  72. package/dist/es/models/validation/ValidationScopes.js +38 -0
  73. package/dist/es/utils/ValidationUtils.d.ts +13 -0
  74. package/dist/es/utils/ValidationUtils.js +85 -0
  75. package/dist/lib/ApiClient.d.ts +159 -0
  76. package/dist/lib/ApiClient.js +1211 -0
  77. package/dist/lib/Paginable.d.ts +95 -0
  78. package/dist/lib/Paginable.js +287 -0
  79. package/dist/lib/apis/objectstores-endpoints.d.ts +231 -0
  80. package/dist/lib/apis/objectstores-endpoints.js +522 -0
  81. package/dist/lib/index.d.ts +64 -0
  82. package/dist/lib/index.js +252 -0
  83. package/dist/lib/models/common/v1/config/FQDN.d.ts +48 -0
  84. package/dist/lib/models/common/v1/config/FQDN.js +242 -0
  85. package/dist/lib/models/common/v1/config/Flag.d.ts +58 -0
  86. package/dist/lib/models/common/v1/config/Flag.js +275 -0
  87. package/dist/lib/models/common/v1/config/IPAddress.d.ts +61 -0
  88. package/dist/lib/models/common/v1/config/IPAddress.js +291 -0
  89. package/dist/lib/models/common/v1/config/IPv4Address.d.ts +62 -0
  90. package/dist/lib/models/common/v1/config/IPv4Address.js +288 -0
  91. package/dist/lib/models/common/v1/config/IPv6Address.d.ts +62 -0
  92. package/dist/lib/models/common/v1/config/IPv6Address.js +288 -0
  93. package/dist/lib/models/common/v1/config/KVPair.d.ts +62 -0
  94. package/dist/lib/models/common/v1/config/KVPair.js +332 -0
  95. package/dist/lib/models/common/v1/config/Message.d.ts +84 -0
  96. package/dist/lib/models/common/v1/config/Message.js +354 -0
  97. package/dist/lib/models/common/v1/config/MessageSeverity.d.ts +19 -0
  98. package/dist/lib/models/common/v1/config/MessageSeverity.js +91 -0
  99. package/dist/lib/models/common/v1/config/Metadata.d.ts +98 -0
  100. package/dist/lib/models/common/v1/config/Metadata.js +411 -0
  101. package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +50 -0
  102. package/dist/lib/models/common/v1/config/TenantAwareModel.js +243 -0
  103. package/dist/lib/models/common/v1/response/ApiLink.d.ts +62 -0
  104. package/dist/lib/models/common/v1/response/ApiLink.js +280 -0
  105. package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +98 -0
  106. package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +438 -0
  107. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +42 -0
  108. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +270 -0
  109. package/dist/lib/models/objects/v4/error/AppMessage.d.ts +108 -0
  110. package/dist/lib/models/objects/v4/error/AppMessage.js +432 -0
  111. package/dist/lib/models/objects/v4/error/ErrorResponse.d.ts +48 -0
  112. package/dist/lib/models/objects/v4/error/ErrorResponse.js +288 -0
  113. package/dist/lib/models/objects/v4/error/SchemaValidationError.d.ts +98 -0
  114. package/dist/lib/models/objects/v4/error/SchemaValidationError.js +407 -0
  115. package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +74 -0
  116. package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.js +318 -0
  117. package/dist/lib/models/objects/v4/operations/Certificate.d.ts +78 -0
  118. package/dist/lib/models/objects/v4/operations/Certificate.js +411 -0
  119. package/dist/lib/models/objects/v4/operations/CertificateApiResponse.d.ts +59 -0
  120. package/dist/lib/models/objects/v4/operations/CertificateApiResponse.js +311 -0
  121. package/dist/lib/models/objects/v4/operations/CertificateListApiResponse.d.ts +59 -0
  122. package/dist/lib/models/objects/v4/operations/CertificateListApiResponse.js +338 -0
  123. package/dist/lib/models/objects/v4/operations/CertificateProjection.d.ts +9 -0
  124. package/dist/lib/models/objects/v4/operations/CertificateProjection.js +131 -0
  125. package/dist/lib/models/objects/v4/operations/Objectstore.d.ts +242 -0
  126. package/dist/lib/models/objects/v4/operations/Objectstore.js +945 -0
  127. package/dist/lib/models/objects/v4/operations/ObjectstoreApiResponse.d.ts +59 -0
  128. package/dist/lib/models/objects/v4/operations/ObjectstoreApiResponse.js +311 -0
  129. package/dist/lib/models/objects/v4/operations/ObjectstoreListApiResponse.d.ts +59 -0
  130. package/dist/lib/models/objects/v4/operations/ObjectstoreListApiResponse.js +338 -0
  131. package/dist/lib/models/objects/v4/operations/ObjectstoreProjection.d.ts +50 -0
  132. package/dist/lib/models/objects/v4/operations/ObjectstoreProjection.js +298 -0
  133. package/dist/lib/models/objects/v4/operations/StateEnum.d.ts +19 -0
  134. package/dist/lib/models/objects/v4/operations/StateEnum.js +145 -0
  135. package/dist/lib/models/objects/v4/operations/TaskReferenceApiResponse.d.ts +59 -0
  136. package/dist/lib/models/objects/v4/operations/TaskReferenceApiResponse.js +311 -0
  137. package/dist/lib/models/prism/v4/config/TaskReference.d.ts +50 -0
  138. package/dist/lib/models/prism/v4/config/TaskReference.js +247 -0
  139. package/dist/lib/models/validation/ValidationError.d.ts +13 -0
  140. package/dist/lib/models/validation/ValidationError.js +60 -0
  141. package/dist/lib/models/validation/ValidationScopes.d.ts +9 -0
  142. package/dist/lib/models/validation/ValidationScopes.js +38 -0
  143. package/dist/lib/utils/ValidationUtils.d.ts +13 -0
  144. package/dist/lib/utils/ValidationUtils.js +85 -0
  145. package/package.json +53 -0
@@ -0,0 +1,275 @@
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(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ 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); }
12
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
+ 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."); }
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
16
+ 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; } }
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+ 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; }
19
+ 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; }
20
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
23
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
24
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
25
+ 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); }
26
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
27
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } /*
28
+ * Nutanix Objects Storage Management APIs
29
+ *
30
+ * OpenAPI spec version: 4.0.1-alpha-2
31
+ *
32
+ * NOTE: This class is auto generated by the Open API Dev Platform.
33
+ *
34
+ * Open API Dev Platform Codegen version: 16.8.0.7344-RELEASE
35
+ *
36
+ * Do not edit the class manually.
37
+ *
38
+ */
39
+ /**
40
+ * The Flag model module.
41
+ * @module Ntnx/Flag
42
+ * @version 4.0.1-alpha-2
43
+ * @class Flag
44
+ */
45
+ var _Flag_brand = /*#__PURE__*/new WeakSet();
46
+ var Flag = exports["default"] = /*#__PURE__*/function () {
47
+ /**
48
+ * Constructs a new <code>Flag</code>.
49
+ * Many entities in the Nutanix APIs carry flags. This object captures all the flags associated with that entity through this object. The field that hosts this type of object must have an attribute called x-bounded-map-keys that tells which flags are actually present for that entity.
50
+ * @alias module:Ntnx/Flag
51
+ */
52
+ function Flag() {
53
+ _classCallCheck(this, Flag);
54
+ /*
55
+ * toJson method for a map type which supports map with primitive keys and values of object types
56
+ * @param {Object} obj
57
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
58
+ * Otherwise, just returns the input object.
59
+ */
60
+ _classPrivateMethodInitSpec(this, _Flag_brand);
61
+ this.$objectType = "common.v1.config.Flag";
62
+ this.$reserved = {
63
+ '$fv': "v1.r0.b1"
64
+ };
65
+ this.$unknownFields = {};
66
+ }
67
+
68
+ /**
69
+ * Constructs a <code>Flag</code> from a plain JavaScript object, optionally creating a new instance.
70
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
71
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
72
+ * @param {module:Ntnx/Flag} obj Optional instance to populate.
73
+ * @param callFromChild {Boolean} Flag to recognise calling instance
74
+ * @return {module:Ntnx/Flag} The populated <code>Flag</code> instance.
75
+ */
76
+ return _createClass(Flag, [{
77
+ key: "getName",
78
+ value:
79
+ /**
80
+ * @return {}
81
+ */
82
+ function getName() {
83
+ return this.name;
84
+ }
85
+
86
+ /**
87
+ * @param {} name
88
+ */
89
+ }, {
90
+ key: "setName",
91
+ value: function setName(name) {
92
+ this.name = name;
93
+ }
94
+
95
+ /**
96
+ * @return {}
97
+ */
98
+ }, {
99
+ key: "getValue",
100
+ value: function getValue() {
101
+ return this.value;
102
+ }
103
+
104
+ /**
105
+ * @param {} value
106
+ */
107
+ }, {
108
+ key: "setValue",
109
+ value: function setValue(value) {
110
+ this.value = value;
111
+ }
112
+ }, {
113
+ key: "get$Reserved",
114
+ value: function get$Reserved() {
115
+ return this.$reserved;
116
+ }
117
+ }, {
118
+ key: "get$ObjectType",
119
+ value: function get$ObjectType() {
120
+ return this.$objectType;
121
+ }
122
+ }, {
123
+ key: "get$UnknownFields",
124
+ value: function get$UnknownFields() {
125
+ return this.$unknownFields;
126
+ }
127
+ }, {
128
+ key: "toJson",
129
+ value: function toJson(forMutation) {
130
+ if (forMutation === false) {
131
+ return _objectSpread(_objectSpread(_objectSpread({}, typeof this.getName() !== 'undefined' && this.getName() !== null ? {
132
+ 'name': this.getName()
133
+ } : {}), typeof this.getValue() !== 'undefined' && this.getValue() !== null ? {
134
+ 'value': this.getValue()
135
+ } : {}), {}, {
136
+ '$reserved': this.get$Reserved(),
137
+ '$objectType': this.get$ObjectType(),
138
+ '$unknownFields': this.get$UnknownFields()
139
+ });
140
+ }
141
+ return _objectSpread(_objectSpread(_objectSpread({}, typeof this.getName() !== 'undefined' && this.getName() !== null ? {
142
+ 'name': this.getName()
143
+ } : {}), typeof this.getValue() !== 'undefined' && this.getValue() !== null ? {
144
+ 'value': this.getValue()
145
+ } : {}), {}, {
146
+ '$reserved': this.get$Reserved(),
147
+ '$objectType': this.get$ObjectType(),
148
+ '$unknownFields': this.get$UnknownFields()
149
+ });
150
+ }
151
+ }, {
152
+ key: "validate",
153
+ value: function validate(scope, properties) {
154
+ var _this = this;
155
+ var propList = [];
156
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes["default"]) {
157
+ //cases validate() and validate(scope)
158
+ propList = [];
159
+ } else if (arguments.length === 1) {
160
+ //case validate(properties)
161
+ propList = arguments[0];
162
+ scope = null;
163
+ } else {
164
+ //case validate(scope, properties)
165
+ propList = arguments[1];
166
+ }
167
+ var res = [];
168
+ var err = null;
169
+ propList.forEach(function (property) {
170
+ err = _this.validateProperty(property, scope);
171
+ if (err) {
172
+ res.push(err);
173
+ }
174
+ });
175
+ return new Promise(function (resolve, reject) {
176
+ if (res.length !== 0) {
177
+ reject(err);
178
+ } else {
179
+ resolve();
180
+ }
181
+ });
182
+ }
183
+ }, {
184
+ key: "validateProperty",
185
+ value: function validateProperty(scope, property) {
186
+ if (property === "name") {
187
+ if (typeof this.name === 'undefined' || this.name === null) {
188
+ return new _ValidationError["default"]("name", "undefined or null");
189
+ }
190
+ }
191
+ if (property === "value") {
192
+ if (typeof this.value === 'undefined' || this.value === null) {
193
+ return new _ValidationError["default"]("value", "undefined or null");
194
+ }
195
+ }
196
+ if (property === "$reserved") {
197
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
198
+ return new _ValidationError["default"]("$reserved", "undefined or null");
199
+ }
200
+ }
201
+ if (property === "$objectType") {
202
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
203
+ return new _ValidationError["default"]("$objectType", "undefined or null");
204
+ }
205
+ }
206
+ if (property === "$unknownFields") {
207
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
208
+ return new _ValidationError["default"]("$unknownFields", "undefined or null");
209
+ }
210
+ }
211
+ return new _ValidationError["default"](property, "no such property exists");
212
+ }
213
+ }], [{
214
+ key: "constructFromObject",
215
+ value: function constructFromObject(data, obj) {
216
+ var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
217
+ var items, item, i, itemArr, discriminator;
218
+ if (data) {
219
+ obj = obj || new Flag();
220
+ if (data.hasOwnProperty('name') && data.name !== null && data.name !== undefined) {
221
+ obj.setName(data['name']);
222
+ }
223
+ if (data.hasOwnProperty('value') && data.value !== null && data.value !== undefined) {
224
+ obj.setValue(data['value']);
225
+ }
226
+ if (data.hasOwnProperty('$reserved')) {
227
+ obj.$reserved = data['$reserved'];
228
+ }
229
+ if (data.hasOwnProperty('$objectType')) {
230
+ obj.$objectType = data['$objectType'];
231
+ }
232
+ if (data.hasOwnProperty('$unknownFields')) {
233
+ obj.$unknownFields = data['$unknownFields'];
234
+ }
235
+ if (!callFromChild) {
236
+ obj.$unknownFields = _objectSpread({}, data.$unknownFields);
237
+ for (var property in data) {
238
+ if (!Object.keys(obj).includes(property) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
239
+ obj.$unknownFields[property] = data[property];
240
+ }
241
+ }
242
+ }
243
+ }
244
+ return obj;
245
+ }
246
+ }]);
247
+ }();
248
+ /**
249
+ * @memberof Flag
250
+ */
251
+ function _toJsonMapType(obj, forMutation) {
252
+ if (obj instanceof Map) {
253
+ return Object.fromEntries(Array.from(obj, function (_ref) {
254
+ var _ref2 = _slicedToArray(_ref, 2),
255
+ k = _ref2[0],
256
+ v = _ref2[1];
257
+ return [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v];
258
+ }));
259
+ } else if (_typeof(obj) === 'object' && obj != null && obj.constructor === Object) {
260
+ return Object.fromEntries(Array.from(Object.entries(obj), function (entry) {
261
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
262
+ }));
263
+ }
264
+ return obj;
265
+ }
266
+ Flag.prototype.name = undefined;
267
+
268
+ /**
269
+ * @memberof Flag
270
+ * @default false
271
+ */
272
+ Flag.prototype.value = false;
273
+ Flag.prototype.$reserved = undefined;
274
+ Flag.prototype.$objectType = undefined;
275
+ Flag.prototype.$unknownFields = undefined;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The IPAddress model module.
3
+ * @module Ntnx/IPAddress
4
+ * @version 4.0.1-alpha-2
5
+ * @class IPAddress
6
+ */
7
+ export default class IPAddress {
8
+ /**
9
+ * Constructs a <code>IPAddress</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/IPAddress} obj Optional instance to populate.
13
+ * @param callFromChild {Boolean} Flag to recognise calling instance
14
+ * @return {module:Ntnx/IPAddress} The populated <code>IPAddress</code> instance.
15
+ */
16
+ static constructFromObject(data: any, obj: any, callFromChild?: boolean): any;
17
+ $objectType: string;
18
+ $reserved: {
19
+ $fv: string;
20
+ };
21
+ $unknownFields: {};
22
+ /**
23
+ * @return {}
24
+ */
25
+ getIpv4(): any;
26
+ /**
27
+ * @param {} ipv4
28
+ */
29
+ setIpv4(ipv4: any): void;
30
+ ipv4: any;
31
+ /**
32
+ * @return {}
33
+ */
34
+ getIpv6(): any;
35
+ /**
36
+ * @param {} ipv6
37
+ */
38
+ setIpv6(ipv6: any): void;
39
+ ipv6: any;
40
+ get$Reserved(): {
41
+ $fv: string;
42
+ };
43
+ get$ObjectType(): string;
44
+ get$UnknownFields(): {};
45
+ hasIpv4(): boolean;
46
+ hasIpv6(): boolean;
47
+ isValid(): boolean;
48
+ toJson(forMutation: any): {
49
+ $reserved: {
50
+ $fv: string;
51
+ };
52
+ $objectType: string;
53
+ $unknownFields: {};
54
+ ipv6?: any;
55
+ ipv4?: any;
56
+ };
57
+ validate(scope: any, properties: any, ...args: any[]): Promise<any>;
58
+ validateProperty(scope: any, property: any): ValidationError;
59
+ #private;
60
+ }
61
+ import ValidationError from "../../../validation/ValidationError";
@@ -0,0 +1,291 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _IPv4Address = _interopRequireDefault(require("./IPv4Address"));
8
+ var _IPv6Address = _interopRequireDefault(require("./IPv6Address"));
9
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
10
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
11
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+ 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); }
14
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
+ 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."); }
16
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
18
+ 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; } }
19
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
+ 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; }
21
+ 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; }
22
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
25
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
26
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
27
+ 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); }
28
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
29
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } /*
30
+ * Nutanix Objects Storage Management APIs
31
+ *
32
+ * OpenAPI spec version: 4.0.1-alpha-2
33
+ *
34
+ * NOTE: This class is auto generated by the Open API Dev Platform.
35
+ *
36
+ * Open API Dev Platform Codegen version: 16.8.0.7344-RELEASE
37
+ *
38
+ * Do not edit the class manually.
39
+ *
40
+ */
41
+ /**
42
+ * The IPAddress model module.
43
+ * @module Ntnx/IPAddress
44
+ * @version 4.0.1-alpha-2
45
+ * @class IPAddress
46
+ */
47
+ var _IPAddress_brand = /*#__PURE__*/new WeakSet();
48
+ var IPAddress = exports["default"] = /*#__PURE__*/function () {
49
+ /**
50
+ * Constructs a new <code>IPAddress</code>.
51
+ * An unique address that identifies a device on the internet or a local network in IPv4 or IPv6 format.
52
+ * @alias module:Ntnx/IPAddress
53
+ */
54
+ function IPAddress() {
55
+ _classCallCheck(this, IPAddress);
56
+ /*
57
+ * toJson method for a map type which supports map with primitive keys and values of object types
58
+ * @param {Object} obj
59
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
60
+ * Otherwise, just returns the input object.
61
+ */
62
+ _classPrivateMethodInitSpec(this, _IPAddress_brand);
63
+ this.$objectType = "common.v1.config.IPAddress";
64
+ this.$reserved = {
65
+ '$fv': "v1.r0.b1"
66
+ };
67
+ this.$unknownFields = {};
68
+ }
69
+
70
+ /**
71
+ * Constructs a <code>IPAddress</code> from a plain JavaScript object, optionally creating a new instance.
72
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
73
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
74
+ * @param {module:Ntnx/IPAddress} obj Optional instance to populate.
75
+ * @param callFromChild {Boolean} Flag to recognise calling instance
76
+ * @return {module:Ntnx/IPAddress} The populated <code>IPAddress</code> instance.
77
+ */
78
+ return _createClass(IPAddress, [{
79
+ key: "getIpv4",
80
+ value:
81
+ /**
82
+ * @return {}
83
+ */
84
+ function getIpv4() {
85
+ return this.ipv4;
86
+ }
87
+
88
+ /**
89
+ * @param {} ipv4
90
+ */
91
+ }, {
92
+ key: "setIpv4",
93
+ value: function setIpv4(ipv4) {
94
+ this.ipv4 = ipv4;
95
+ }
96
+
97
+ /**
98
+ * @return {}
99
+ */
100
+ }, {
101
+ key: "getIpv6",
102
+ value: function getIpv6() {
103
+ return this.ipv6;
104
+ }
105
+
106
+ /**
107
+ * @param {} ipv6
108
+ */
109
+ }, {
110
+ key: "setIpv6",
111
+ value: function setIpv6(ipv6) {
112
+ this.ipv6 = ipv6;
113
+ }
114
+ }, {
115
+ key: "get$Reserved",
116
+ value: function get$Reserved() {
117
+ return this.$reserved;
118
+ }
119
+ }, {
120
+ key: "get$ObjectType",
121
+ value: function get$ObjectType() {
122
+ return this.$objectType;
123
+ }
124
+ }, {
125
+ key: "get$UnknownFields",
126
+ value: function get$UnknownFields() {
127
+ return this.$unknownFields;
128
+ }
129
+ }, {
130
+ key: "hasIpv4",
131
+ value: function hasIpv4() {
132
+ return !(typeof this.ipv4 === 'undefined' || this.ipv4 === null);
133
+ }
134
+ }, {
135
+ key: "hasIpv6",
136
+ value: function hasIpv6() {
137
+ return !(typeof this.ipv6 === 'undefined' || this.ipv6 === null);
138
+ }
139
+ }, {
140
+ key: "isValid",
141
+ value: function isValid() {
142
+ return this.hasIpv4() || this.hasIpv6();
143
+ }
144
+ }, {
145
+ key: "toJson",
146
+ value: function toJson(forMutation) {
147
+ if (forMutation === false) {
148
+ return _objectSpread(_objectSpread(_objectSpread({}, typeof this.getIpv4() !== 'undefined' && this.getIpv4() !== null ? {
149
+ 'ipv4': this.getIpv4().toJson(false)
150
+ } : {}), typeof this.getIpv6() !== 'undefined' && this.getIpv6() !== null ? {
151
+ 'ipv6': this.getIpv6().toJson(false)
152
+ } : {}), {}, {
153
+ '$reserved': this.get$Reserved(),
154
+ '$objectType': this.get$ObjectType(),
155
+ '$unknownFields': this.get$UnknownFields()
156
+ });
157
+ }
158
+ return _objectSpread(_objectSpread(_objectSpread({}, typeof this.getIpv4() !== 'undefined' && this.getIpv4() !== null ? {
159
+ 'ipv4': this.getIpv4().toJson(false)
160
+ } : {}), typeof this.getIpv6() !== 'undefined' && this.getIpv6() !== null ? {
161
+ 'ipv6': this.getIpv6().toJson(false)
162
+ } : {}), {}, {
163
+ '$reserved': this.get$Reserved(),
164
+ '$objectType': this.get$ObjectType(),
165
+ '$unknownFields': this.get$UnknownFields()
166
+ });
167
+ }
168
+ }, {
169
+ key: "validate",
170
+ value: function validate(scope, properties) {
171
+ var _this = this;
172
+ var propList = [];
173
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes["default"]) {
174
+ //cases validate() and validate(scope)
175
+ propList = [];
176
+ } else if (arguments.length === 1) {
177
+ //case validate(properties)
178
+ propList = arguments[0];
179
+ scope = null;
180
+ } else {
181
+ //case validate(scope, properties)
182
+ propList = arguments[1];
183
+ }
184
+ var res = [];
185
+ var err = null;
186
+ propList.forEach(function (property) {
187
+ err = _this.validateProperty(property, scope);
188
+ if (err) {
189
+ res.push(err);
190
+ }
191
+ });
192
+ return new Promise(function (resolve, reject) {
193
+ if (res.length !== 0) {
194
+ reject(err);
195
+ } else {
196
+ resolve();
197
+ }
198
+ });
199
+ }
200
+ }, {
201
+ key: "validateProperty",
202
+ value: function validateProperty(scope, property) {
203
+ if (property === "ipv4") {
204
+ if (typeof this.ipv4 === 'undefined' || this.ipv4 === null) {
205
+ return new _ValidationError["default"]("ipv4", "undefined or null");
206
+ }
207
+ }
208
+ if (property === "ipv6") {
209
+ if (typeof this.ipv6 === 'undefined' || this.ipv6 === null) {
210
+ return new _ValidationError["default"]("ipv6", "undefined or null");
211
+ }
212
+ }
213
+ if (property === "$reserved") {
214
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
215
+ return new _ValidationError["default"]("$reserved", "undefined or null");
216
+ }
217
+ }
218
+ if (property === "$objectType") {
219
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
220
+ return new _ValidationError["default"]("$objectType", "undefined or null");
221
+ }
222
+ }
223
+ if (property === "$unknownFields") {
224
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
225
+ return new _ValidationError["default"]("$unknownFields", "undefined or null");
226
+ }
227
+ }
228
+ return new _ValidationError["default"](property, "no such property exists");
229
+ }
230
+ }], [{
231
+ key: "constructFromObject",
232
+ value: function constructFromObject(data, obj) {
233
+ var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
234
+ var items, item, i, itemArr, discriminator;
235
+ if (data) {
236
+ obj = obj || new IPAddress();
237
+ if (data.hasOwnProperty('ipv4') && data.ipv4 !== null && data.ipv4 !== undefined) {
238
+ obj.setIpv4(_IPv4Address["default"].constructFromObject(data['ipv4']));
239
+ }
240
+ if (data.hasOwnProperty('ipv6') && data.ipv6 !== null && data.ipv6 !== undefined) {
241
+ obj.setIpv6(_IPv6Address["default"].constructFromObject(data['ipv6']));
242
+ }
243
+ if (data.hasOwnProperty('$reserved')) {
244
+ obj.$reserved = data['$reserved'];
245
+ }
246
+ if (data.hasOwnProperty('$objectType')) {
247
+ obj.$objectType = data['$objectType'];
248
+ }
249
+ if (data.hasOwnProperty('$unknownFields')) {
250
+ obj.$unknownFields = data['$unknownFields'];
251
+ }
252
+ if (!callFromChild) {
253
+ obj.$unknownFields = _objectSpread({}, data.$unknownFields);
254
+ for (var property in data) {
255
+ if (!Object.keys(obj).includes(property) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
256
+ obj.$unknownFields[property] = data[property];
257
+ }
258
+ }
259
+ }
260
+ }
261
+ return obj;
262
+ }
263
+ }]);
264
+ }();
265
+ /**
266
+ * @memberof IPAddress
267
+ */
268
+ function _toJsonMapType(obj, forMutation) {
269
+ if (obj instanceof Map) {
270
+ return Object.fromEntries(Array.from(obj, function (_ref) {
271
+ var _ref2 = _slicedToArray(_ref, 2),
272
+ k = _ref2[0],
273
+ v = _ref2[1];
274
+ return [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v];
275
+ }));
276
+ } else if (_typeof(obj) === 'object' && obj != null && obj.constructor === Object) {
277
+ return Object.fromEntries(Array.from(Object.entries(obj), function (entry) {
278
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
279
+ }));
280
+ }
281
+ return obj;
282
+ }
283
+ IPAddress.prototype.ipv4 = undefined;
284
+
285
+ /**
286
+ * @memberof IPAddress
287
+ */
288
+ IPAddress.prototype.ipv6 = undefined;
289
+ IPAddress.prototype.$reserved = undefined;
290
+ IPAddress.prototype.$objectType = undefined;
291
+ IPAddress.prototype.$unknownFields = undefined;