@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,243 @@
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 TenantAwareModel model module.
41
+ * @module Ntnx/TenantAwareModel
42
+ * @version 4.0.1-alpha-2
43
+ * @class TenantAwareModel
44
+ */
45
+ var _TenantAwareModel_brand = /*#__PURE__*/new WeakSet();
46
+ var TenantAwareModel = exports["default"] = /*#__PURE__*/function () {
47
+ /**
48
+ * Constructs a new <code>TenantAwareModel</code>.
49
+ * A model base class whose instances are bound to a specific tenant. This model adds a tenantId to the base model class that it extends and is automatically set by the server.
50
+ * @alias module:Ntnx/TenantAwareModel
51
+ */
52
+ function TenantAwareModel() {
53
+ _classCallCheck(this, TenantAwareModel);
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, _TenantAwareModel_brand);
61
+ this.$objectType = "common.v1.config.TenantAwareModel";
62
+ this.$reserved = {
63
+ '$fv': "v1.r0.b1"
64
+ };
65
+ this.$unknownFields = {};
66
+ }
67
+
68
+ /**
69
+ * Constructs a <code>TenantAwareModel</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/TenantAwareModel} obj Optional instance to populate.
73
+ * @param callFromChild {Boolean} Flag to recognise calling instance
74
+ * @return {module:Ntnx/TenantAwareModel} The populated <code>TenantAwareModel</code> instance.
75
+ */
76
+ return _createClass(TenantAwareModel, [{
77
+ key: "getTenantId",
78
+ value:
79
+ /**
80
+ * Returns A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
81
+ * @return {}
82
+ */
83
+ function getTenantId() {
84
+ return this.tenantId;
85
+ }
86
+
87
+ /**
88
+ * Sets A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
89
+ * @param {} tenantId A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
90
+ */
91
+ }, {
92
+ key: "setTenantId",
93
+ value: function setTenantId(tenantId) {
94
+ this.tenantId = tenantId;
95
+ }
96
+ }, {
97
+ key: "get$Reserved",
98
+ value: function get$Reserved() {
99
+ return this.$reserved;
100
+ }
101
+ }, {
102
+ key: "get$ObjectType",
103
+ value: function get$ObjectType() {
104
+ return this.$objectType;
105
+ }
106
+ }, {
107
+ key: "get$UnknownFields",
108
+ value: function get$UnknownFields() {
109
+ return this.$unknownFields;
110
+ }
111
+ }, {
112
+ key: "toJson",
113
+ value: function toJson(forMutation) {
114
+ if (forMutation === false) {
115
+ return _objectSpread(_objectSpread({}, typeof this.getTenantId() !== 'undefined' && this.getTenantId() !== null ? {
116
+ 'tenantId': this.getTenantId()
117
+ } : {}), {}, {
118
+ '$reserved': this.get$Reserved(),
119
+ '$objectType': this.get$ObjectType(),
120
+ '$unknownFields': this.get$UnknownFields()
121
+ });
122
+ }
123
+ return {
124
+ '$reserved': this.get$Reserved(),
125
+ '$objectType': this.get$ObjectType(),
126
+ '$unknownFields': this.get$UnknownFields()
127
+ };
128
+ }
129
+ }, {
130
+ key: "validate",
131
+ value: function validate(scope, properties) {
132
+ var _this = this;
133
+ var propList = [];
134
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes["default"]) {
135
+ //cases validate() and validate(scope)
136
+ propList = [];
137
+ } else if (arguments.length === 1) {
138
+ //case validate(properties)
139
+ propList = arguments[0];
140
+ scope = null;
141
+ } else {
142
+ //case validate(scope, properties)
143
+ propList = arguments[1];
144
+ }
145
+ var res = [];
146
+ var err = null;
147
+ propList.forEach(function (property) {
148
+ err = _this.validateProperty(property, scope);
149
+ if (err) {
150
+ res.push(err);
151
+ }
152
+ });
153
+ return new Promise(function (resolve, reject) {
154
+ if (res.length !== 0) {
155
+ reject(err);
156
+ } else {
157
+ resolve();
158
+ }
159
+ });
160
+ }
161
+ }, {
162
+ key: "validateProperty",
163
+ value: function validateProperty(scope, property) {
164
+ if (property === "tenantId") {
165
+ if (typeof this.tenantId === 'undefined' || this.tenantId === null) {
166
+ return new _ValidationError["default"]("tenantId", "undefined or null");
167
+ }
168
+ if (!_ValidationUtils["default"].validatePattern(this.tenantId, /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)) {
169
+ return new _ValidationError["default"]("tenantId", "does not satisfy required pattern: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/");
170
+ }
171
+ }
172
+ if (property === "$reserved") {
173
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
174
+ return new _ValidationError["default"]("$reserved", "undefined or null");
175
+ }
176
+ }
177
+ if (property === "$objectType") {
178
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
179
+ return new _ValidationError["default"]("$objectType", "undefined or null");
180
+ }
181
+ }
182
+ if (property === "$unknownFields") {
183
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
184
+ return new _ValidationError["default"]("$unknownFields", "undefined or null");
185
+ }
186
+ }
187
+ return new _ValidationError["default"](property, "no such property exists");
188
+ }
189
+ }], [{
190
+ key: "constructFromObject",
191
+ value: function constructFromObject(data, obj) {
192
+ var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
193
+ var items, item, i, itemArr, discriminator;
194
+ if (data) {
195
+ obj = obj || new TenantAwareModel();
196
+ if (data.hasOwnProperty('tenantId') && data.tenantId !== null && data.tenantId !== undefined) {
197
+ obj.setTenantId(data['tenantId']);
198
+ }
199
+ if (data.hasOwnProperty('$reserved')) {
200
+ obj.$reserved = data['$reserved'];
201
+ }
202
+ if (data.hasOwnProperty('$objectType')) {
203
+ obj.$objectType = data['$objectType'];
204
+ }
205
+ if (data.hasOwnProperty('$unknownFields')) {
206
+ obj.$unknownFields = data['$unknownFields'];
207
+ }
208
+ if (!callFromChild) {
209
+ obj.$unknownFields = _objectSpread({}, data.$unknownFields);
210
+ for (var property in data) {
211
+ if (!Object.keys(obj).includes(property) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
212
+ obj.$unknownFields[property] = data[property];
213
+ }
214
+ }
215
+ }
216
+ }
217
+ return obj;
218
+ }
219
+ }]);
220
+ }();
221
+ /**
222
+ * A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
223
+ * @memberof TenantAwareModel
224
+ */
225
+ function _toJsonMapType(obj, forMutation) {
226
+ if (obj instanceof Map) {
227
+ return Object.fromEntries(Array.from(obj, function (_ref) {
228
+ var _ref2 = _slicedToArray(_ref, 2),
229
+ k = _ref2[0],
230
+ v = _ref2[1];
231
+ return [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v];
232
+ }));
233
+ } else if (_typeof(obj) === 'object' && obj != null && obj.constructor === Object) {
234
+ return Object.fromEntries(Array.from(Object.entries(obj), function (entry) {
235
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
236
+ }));
237
+ }
238
+ return obj;
239
+ }
240
+ TenantAwareModel.prototype.tenantId = undefined;
241
+ TenantAwareModel.prototype.$reserved = undefined;
242
+ TenantAwareModel.prototype.$objectType = undefined;
243
+ TenantAwareModel.prototype.$unknownFields = undefined;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The ApiLink model module.
3
+ * @module Ntnx/ApiLink
4
+ * @version 4.0.1-alpha-2
5
+ * @class ApiLink
6
+ */
7
+ export default class ApiLink {
8
+ /**
9
+ * Constructs a <code>ApiLink</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/ApiLink} obj Optional instance to populate.
13
+ * @param callFromChild {Boolean} Flag to recognise calling instance
14
+ * @return {module:Ntnx/ApiLink} The populated <code>ApiLink</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
+ * Returns The URL at which the entity described by the link can be accessed.
24
+ * @return {}
25
+ */
26
+ getHref(): any;
27
+ /**
28
+ * Sets The URL at which the entity described by the link can be accessed.
29
+ * @param {} href The URL at which the entity described by the link can be accessed.
30
+ */
31
+ setHref(href: any): void;
32
+ href: any;
33
+ /**
34
+ * Returns A name that identifies the relationship of the link to the object that is returned by the URL. The unique value of \"self\" identifies the URL for the object.
35
+ * @return {}
36
+ */
37
+ getRel(): any;
38
+ /**
39
+ * Sets A name that identifies the relationship of the link to the object that is returned by the URL. The unique value of \"self\" identifies the URL for the object.
40
+ * @param {} rel A name that identifies the relationship of the link to the object that is returned by the URL. The unique value of \"self\" identifies the URL for the object.
41
+ */
42
+ setRel(rel: any): void;
43
+ rel: any;
44
+ get$Reserved(): {
45
+ $fv: string;
46
+ };
47
+ get$ObjectType(): string;
48
+ get$UnknownFields(): {};
49
+ toJson(forMutation: any): {
50
+ $reserved: {
51
+ $fv: string;
52
+ };
53
+ $objectType: string;
54
+ $unknownFields: {};
55
+ rel?: any;
56
+ href?: any;
57
+ };
58
+ validate(scope: any, properties: any, ...args: any[]): Promise<any>;
59
+ validateProperty(scope: any, property: any): ValidationError;
60
+ #private;
61
+ }
62
+ import ValidationError from "../../../validation/ValidationError";
@@ -0,0 +1,280 @@
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 ApiLink model module.
41
+ * @module Ntnx/ApiLink
42
+ * @version 4.0.1-alpha-2
43
+ * @class ApiLink
44
+ */
45
+ var _ApiLink_brand = /*#__PURE__*/new WeakSet();
46
+ var ApiLink = exports["default"] = /*#__PURE__*/function () {
47
+ /**
48
+ * Constructs a new <code>ApiLink</code>.
49
+ * A HATEOAS style link for the response. Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource.
50
+ * @alias module:Ntnx/ApiLink
51
+ */
52
+ function ApiLink() {
53
+ _classCallCheck(this, ApiLink);
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, _ApiLink_brand);
61
+ this.$objectType = "common.v1.response.ApiLink";
62
+ this.$reserved = {
63
+ '$fv': "v1.r0.b1"
64
+ };
65
+ this.$unknownFields = {};
66
+ }
67
+
68
+ /**
69
+ * Constructs a <code>ApiLink</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/ApiLink} obj Optional instance to populate.
73
+ * @param callFromChild {Boolean} Flag to recognise calling instance
74
+ * @return {module:Ntnx/ApiLink} The populated <code>ApiLink</code> instance.
75
+ */
76
+ return _createClass(ApiLink, [{
77
+ key: "getHref",
78
+ value:
79
+ /**
80
+ * Returns The URL at which the entity described by the link can be accessed.
81
+ * @return {}
82
+ */
83
+ function getHref() {
84
+ return this.href;
85
+ }
86
+
87
+ /**
88
+ * Sets The URL at which the entity described by the link can be accessed.
89
+ * @param {} href The URL at which the entity described by the link can be accessed.
90
+ */
91
+ }, {
92
+ key: "setHref",
93
+ value: function setHref(href) {
94
+ this.href = href;
95
+ }
96
+
97
+ /**
98
+ * Returns A name that identifies the relationship of the link to the object that is returned by the URL. The unique value of \"self\" identifies the URL for the object.
99
+ * @return {}
100
+ */
101
+ }, {
102
+ key: "getRel",
103
+ value: function getRel() {
104
+ return this.rel;
105
+ }
106
+
107
+ /**
108
+ * Sets A name that identifies the relationship of the link to the object that is returned by the URL. The unique value of \"self\" identifies the URL for the object.
109
+ * @param {} rel A name that identifies the relationship of the link to the object that is returned by the URL. The unique value of \"self\" identifies the URL for the object.
110
+ */
111
+ }, {
112
+ key: "setRel",
113
+ value: function setRel(rel) {
114
+ this.rel = rel;
115
+ }
116
+ }, {
117
+ key: "get$Reserved",
118
+ value: function get$Reserved() {
119
+ return this.$reserved;
120
+ }
121
+ }, {
122
+ key: "get$ObjectType",
123
+ value: function get$ObjectType() {
124
+ return this.$objectType;
125
+ }
126
+ }, {
127
+ key: "get$UnknownFields",
128
+ value: function get$UnknownFields() {
129
+ return this.$unknownFields;
130
+ }
131
+ }, {
132
+ key: "toJson",
133
+ value: function toJson(forMutation) {
134
+ if (forMutation === false) {
135
+ return _objectSpread(_objectSpread(_objectSpread({}, typeof this.getHref() !== 'undefined' && this.getHref() !== null ? {
136
+ 'href': this.getHref()
137
+ } : {}), typeof this.getRel() !== 'undefined' && this.getRel() !== null ? {
138
+ 'rel': this.getRel()
139
+ } : {}), {}, {
140
+ '$reserved': this.get$Reserved(),
141
+ '$objectType': this.get$ObjectType(),
142
+ '$unknownFields': this.get$UnknownFields()
143
+ });
144
+ }
145
+ return _objectSpread(_objectSpread(_objectSpread({}, typeof this.getHref() !== 'undefined' && this.getHref() !== null ? {
146
+ 'href': this.getHref()
147
+ } : {}), typeof this.getRel() !== 'undefined' && this.getRel() !== null ? {
148
+ 'rel': this.getRel()
149
+ } : {}), {}, {
150
+ '$reserved': this.get$Reserved(),
151
+ '$objectType': this.get$ObjectType(),
152
+ '$unknownFields': this.get$UnknownFields()
153
+ });
154
+ }
155
+ }, {
156
+ key: "validate",
157
+ value: function validate(scope, properties) {
158
+ var _this = this;
159
+ var propList = [];
160
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes["default"]) {
161
+ //cases validate() and validate(scope)
162
+ propList = [];
163
+ } else if (arguments.length === 1) {
164
+ //case validate(properties)
165
+ propList = arguments[0];
166
+ scope = null;
167
+ } else {
168
+ //case validate(scope, properties)
169
+ propList = arguments[1];
170
+ }
171
+ var res = [];
172
+ var err = null;
173
+ propList.forEach(function (property) {
174
+ err = _this.validateProperty(property, scope);
175
+ if (err) {
176
+ res.push(err);
177
+ }
178
+ });
179
+ return new Promise(function (resolve, reject) {
180
+ if (res.length !== 0) {
181
+ reject(err);
182
+ } else {
183
+ resolve();
184
+ }
185
+ });
186
+ }
187
+ }, {
188
+ key: "validateProperty",
189
+ value: function validateProperty(scope, property) {
190
+ if (property === "href") {
191
+ if (typeof this.href === 'undefined' || this.href === null) {
192
+ return new _ValidationError["default"]("href", "undefined or null");
193
+ }
194
+ }
195
+ if (property === "rel") {
196
+ if (typeof this.rel === 'undefined' || this.rel === null) {
197
+ return new _ValidationError["default"]("rel", "undefined or null");
198
+ }
199
+ }
200
+ if (property === "$reserved") {
201
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
202
+ return new _ValidationError["default"]("$reserved", "undefined or null");
203
+ }
204
+ }
205
+ if (property === "$objectType") {
206
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
207
+ return new _ValidationError["default"]("$objectType", "undefined or null");
208
+ }
209
+ }
210
+ if (property === "$unknownFields") {
211
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
212
+ return new _ValidationError["default"]("$unknownFields", "undefined or null");
213
+ }
214
+ }
215
+ return new _ValidationError["default"](property, "no such property exists");
216
+ }
217
+ }], [{
218
+ key: "constructFromObject",
219
+ value: function constructFromObject(data, obj) {
220
+ var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
221
+ var items, item, i, itemArr, discriminator;
222
+ if (data) {
223
+ obj = obj || new ApiLink();
224
+ if (data.hasOwnProperty('href') && data.href !== null && data.href !== undefined) {
225
+ obj.setHref(data['href']);
226
+ }
227
+ if (data.hasOwnProperty('rel') && data.rel !== null && data.rel !== undefined) {
228
+ obj.setRel(data['rel']);
229
+ }
230
+ if (data.hasOwnProperty('$reserved')) {
231
+ obj.$reserved = data['$reserved'];
232
+ }
233
+ if (data.hasOwnProperty('$objectType')) {
234
+ obj.$objectType = data['$objectType'];
235
+ }
236
+ if (data.hasOwnProperty('$unknownFields')) {
237
+ obj.$unknownFields = data['$unknownFields'];
238
+ }
239
+ if (!callFromChild) {
240
+ obj.$unknownFields = _objectSpread({}, data.$unknownFields);
241
+ for (var property in data) {
242
+ if (!Object.keys(obj).includes(property) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
243
+ obj.$unknownFields[property] = data[property];
244
+ }
245
+ }
246
+ }
247
+ }
248
+ return obj;
249
+ }
250
+ }]);
251
+ }();
252
+ /**
253
+ * The URL at which the entity described by the link can be accessed.
254
+ * @memberof ApiLink
255
+ */
256
+ function _toJsonMapType(obj, forMutation) {
257
+ if (obj instanceof Map) {
258
+ return Object.fromEntries(Array.from(obj, function (_ref) {
259
+ var _ref2 = _slicedToArray(_ref, 2),
260
+ k = _ref2[0],
261
+ v = _ref2[1];
262
+ return [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v];
263
+ }));
264
+ } else if (_typeof(obj) === 'object' && obj != null && obj.constructor === Object) {
265
+ return Object.fromEntries(Array.from(Object.entries(obj), function (entry) {
266
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
267
+ }));
268
+ }
269
+ return obj;
270
+ }
271
+ ApiLink.prototype.href = undefined;
272
+
273
+ /**
274
+ * A name that identifies the relationship of the link to the object that is returned by the URL. The unique value of \"self\" identifies the URL for the object.
275
+ * @memberof ApiLink
276
+ */
277
+ ApiLink.prototype.rel = undefined;
278
+ ApiLink.prototype.$reserved = undefined;
279
+ ApiLink.prototype.$objectType = undefined;
280
+ ApiLink.prototype.$unknownFields = undefined;