@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.
Files changed (178) hide show
  1. package/README.md +33 -20
  2. package/dist/Ntnx-Objects-js-client-prod.js +1 -1
  3. package/dist/Ntnx-Objects-js-client.js +331 -259
  4. package/dist/es/ApiClient.d.ts +35 -7
  5. package/dist/es/ApiClient.js +862 -684
  6. package/dist/es/Paginable.d.ts +1 -1
  7. package/dist/es/Paginable.js +144 -183
  8. package/dist/es/apis/objectstores-endpoints.d.ts +9 -70
  9. package/dist/es/apis/objectstores-endpoints.js +407 -477
  10. package/dist/es/apis/stats-endpoints.d.ts +46 -0
  11. package/dist/es/apis/stats-endpoints.js +122 -0
  12. package/dist/es/index.d.ts +13 -1
  13. package/dist/es/index.js +152 -104
  14. package/dist/es/models/common/v1/config/FQDN.d.ts +2 -7
  15. package/dist/es/models/common/v1/config/FQDN.js +141 -180
  16. package/dist/es/models/common/v1/config/Flag.d.ts +2 -8
  17. package/dist/es/models/common/v1/config/Flag.js +170 -211
  18. package/dist/es/models/common/v1/config/IPAddress.d.ts +2 -20
  19. package/dist/es/models/common/v1/config/IPAddress.js +170 -217
  20. package/dist/es/models/common/v1/config/IPv4Address.d.ts +2 -8
  21. package/dist/es/models/common/v1/config/IPv4Address.js +174 -215
  22. package/dist/es/models/common/v1/config/IPv6Address.d.ts +2 -8
  23. package/dist/es/models/common/v1/config/IPv6Address.js +174 -215
  24. package/dist/es/models/common/v1/config/KVPair.d.ts +2 -8
  25. package/dist/es/models/common/v1/config/KVPair.js +225 -270
  26. package/dist/es/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
  27. package/dist/es/models/common/v1/config/MapOfStringWrapper.js +139 -178
  28. package/dist/es/models/common/v1/config/Message.d.ts +2 -10
  29. package/dist/es/models/common/v1/config/Message.js +213 -258
  30. package/dist/es/models/common/v1/config/MessageSeverity.js +7 -9
  31. package/dist/es/models/common/v1/config/Metadata.d.ts +2 -11
  32. package/dist/es/models/common/v1/config/Metadata.js +261 -308
  33. package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +5 -10
  34. package/dist/es/models/common/v1/config/TenantAwareModel.js +138 -178
  35. package/dist/es/models/common/v1/response/ApiLink.d.ts +2 -8
  36. package/dist/es/models/common/v1/response/ApiLink.js +165 -206
  37. package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
  38. package/dist/es/models/common/v1/response/ApiResponseMetadata.js +281 -344
  39. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
  40. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +155 -203
  41. package/dist/es/models/common/v1/stats/DownSamplingOperator.d.ts +19 -0
  42. package/dist/es/models/common/v1/stats/DownSamplingOperator.js +107 -0
  43. package/dist/es/models/common/v1/stats/TimeIntValuePair.d.ts +58 -0
  44. package/dist/es/models/common/v1/stats/TimeIntValuePair.js +272 -0
  45. package/dist/es/models/objects/v4/config/Certificate.d.ts +24 -34
  46. package/dist/es/models/objects/v4/config/Certificate.js +342 -310
  47. package/dist/es/models/objects/v4/config/CertificateProjection.d.ts +1 -1
  48. package/dist/es/models/objects/v4/config/CertificateProjection.js +75 -103
  49. package/dist/es/models/objects/v4/config/CreateCertificateApiResponse.d.ts +2 -43
  50. package/dist/es/models/objects/v4/config/CreateCertificateApiResponse.js +187 -242
  51. package/dist/es/models/objects/v4/config/CreateObjectstoreApiResponse.d.ts +2 -43
  52. package/dist/es/models/objects/v4/config/CreateObjectstoreApiResponse.js +187 -242
  53. package/dist/es/models/objects/v4/config/DeleteObjectstoreApiResponse.d.ts +2 -43
  54. package/dist/es/models/objects/v4/config/DeleteObjectstoreApiResponse.js +187 -242
  55. package/dist/es/models/objects/v4/config/GetCaApiResponse.d.ts +2 -45
  56. package/dist/es/models/objects/v4/config/GetCaApiResponse.js +187 -242
  57. package/dist/es/models/objects/v4/config/GetCertificateApiResponse.d.ts +2 -43
  58. package/dist/es/models/objects/v4/config/GetCertificateApiResponse.js +187 -242
  59. package/dist/es/models/objects/v4/config/GetObjectstoreApiResponse.d.ts +2 -43
  60. package/dist/es/models/objects/v4/config/GetObjectstoreApiResponse.js +187 -242
  61. package/dist/es/models/objects/v4/config/ListCertificatesApiResponse.d.ts +2 -43
  62. package/dist/es/models/objects/v4/config/ListCertificatesApiResponse.js +213 -268
  63. package/dist/es/models/objects/v4/config/ListObjectstoresApiResponse.d.ts +2 -43
  64. package/dist/es/models/objects/v4/config/ListObjectstoresApiResponse.js +213 -268
  65. package/dist/es/models/objects/v4/config/ObjectStore.d.ts +1 -96
  66. package/dist/es/models/objects/v4/config/ObjectStore.js +629 -712
  67. package/dist/es/models/objects/v4/config/ObjectStoreProjection.d.ts +1 -129
  68. package/dist/es/models/objects/v4/config/ObjectStoreProjection.js +222 -239
  69. package/dist/es/models/objects/v4/config/State.js +7 -9
  70. package/dist/es/models/objects/v4/config/UpdateObjectstoreApiResponse.d.ts +2 -43
  71. package/dist/es/models/objects/v4/config/UpdateObjectstoreApiResponse.js +187 -242
  72. package/dist/es/models/objects/v4/error/AppMessage.d.ts +5 -15
  73. package/dist/es/models/objects/v4/error/AppMessage.js +265 -314
  74. package/dist/es/models/objects/v4/error/ErrorResponse.d.ts +2 -7
  75. package/dist/es/models/objects/v4/error/ErrorResponse.js +177 -219
  76. package/dist/es/models/objects/v4/error/SchemaValidationError.d.ts +2 -18
  77. package/dist/es/models/objects/v4/error/SchemaValidationError.js +249 -300
  78. package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
  79. package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.js +191 -234
  80. package/dist/es/models/objects/v4/stats/GetObjectstoreStatsApiResponse.d.ts +58 -0
  81. package/dist/es/models/objects/v4/stats/GetObjectstoreStatsApiResponse.js +288 -0
  82. package/dist/es/models/objects/v4/stats/ObjectstoreStats.d.ts +255 -0
  83. package/dist/es/models/objects/v4/stats/ObjectstoreStats.js +1253 -0
  84. package/dist/es/models/objects/v4/stats/TimeFloatValuePair.d.ts +58 -0
  85. package/dist/es/models/objects/v4/stats/TimeFloatValuePair.js +272 -0
  86. package/dist/es/models/prism/v4/config/TaskReference.d.ts +2 -7
  87. package/dist/es/models/prism/v4/config/TaskReference.js +142 -181
  88. package/dist/es/models/validation/ValidationError.js +26 -42
  89. package/dist/es/models/validation/ValidationScopes.js +3 -3
  90. package/dist/es/utils/ValidationUtils.js +39 -69
  91. package/dist/lib/ApiClient.d.ts +35 -7
  92. package/dist/lib/ApiClient.js +862 -684
  93. package/dist/lib/Paginable.d.ts +1 -1
  94. package/dist/lib/Paginable.js +144 -183
  95. package/dist/lib/apis/objectstores-endpoints.d.ts +9 -70
  96. package/dist/lib/apis/objectstores-endpoints.js +407 -477
  97. package/dist/lib/apis/stats-endpoints.d.ts +46 -0
  98. package/dist/lib/apis/stats-endpoints.js +122 -0
  99. package/dist/lib/index.d.ts +13 -1
  100. package/dist/lib/index.js +152 -104
  101. package/dist/lib/models/common/v1/config/FQDN.d.ts +2 -7
  102. package/dist/lib/models/common/v1/config/FQDN.js +141 -180
  103. package/dist/lib/models/common/v1/config/Flag.d.ts +2 -8
  104. package/dist/lib/models/common/v1/config/Flag.js +170 -211
  105. package/dist/lib/models/common/v1/config/IPAddress.d.ts +2 -20
  106. package/dist/lib/models/common/v1/config/IPAddress.js +170 -217
  107. package/dist/lib/models/common/v1/config/IPv4Address.d.ts +2 -8
  108. package/dist/lib/models/common/v1/config/IPv4Address.js +174 -215
  109. package/dist/lib/models/common/v1/config/IPv6Address.d.ts +2 -8
  110. package/dist/lib/models/common/v1/config/IPv6Address.js +174 -215
  111. package/dist/lib/models/common/v1/config/KVPair.d.ts +2 -8
  112. package/dist/lib/models/common/v1/config/KVPair.js +225 -270
  113. package/dist/lib/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
  114. package/dist/lib/models/common/v1/config/MapOfStringWrapper.js +139 -178
  115. package/dist/lib/models/common/v1/config/Message.d.ts +2 -10
  116. package/dist/lib/models/common/v1/config/Message.js +213 -258
  117. package/dist/lib/models/common/v1/config/MessageSeverity.js +7 -9
  118. package/dist/lib/models/common/v1/config/Metadata.d.ts +2 -11
  119. package/dist/lib/models/common/v1/config/Metadata.js +261 -308
  120. package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +5 -10
  121. package/dist/lib/models/common/v1/config/TenantAwareModel.js +138 -178
  122. package/dist/lib/models/common/v1/response/ApiLink.d.ts +2 -8
  123. package/dist/lib/models/common/v1/response/ApiLink.js +165 -206
  124. package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
  125. package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +281 -344
  126. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
  127. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +155 -203
  128. package/dist/lib/models/common/v1/stats/DownSamplingOperator.d.ts +19 -0
  129. package/dist/lib/models/common/v1/stats/DownSamplingOperator.js +107 -0
  130. package/dist/lib/models/common/v1/stats/TimeIntValuePair.d.ts +58 -0
  131. package/dist/lib/models/common/v1/stats/TimeIntValuePair.js +272 -0
  132. package/dist/lib/models/objects/v4/config/Certificate.d.ts +24 -34
  133. package/dist/lib/models/objects/v4/config/Certificate.js +342 -310
  134. package/dist/lib/models/objects/v4/config/CertificateProjection.d.ts +1 -1
  135. package/dist/lib/models/objects/v4/config/CertificateProjection.js +75 -103
  136. package/dist/lib/models/objects/v4/config/CreateCertificateApiResponse.d.ts +2 -43
  137. package/dist/lib/models/objects/v4/config/CreateCertificateApiResponse.js +187 -242
  138. package/dist/lib/models/objects/v4/config/CreateObjectstoreApiResponse.d.ts +2 -43
  139. package/dist/lib/models/objects/v4/config/CreateObjectstoreApiResponse.js +187 -242
  140. package/dist/lib/models/objects/v4/config/DeleteObjectstoreApiResponse.d.ts +2 -43
  141. package/dist/lib/models/objects/v4/config/DeleteObjectstoreApiResponse.js +187 -242
  142. package/dist/lib/models/objects/v4/config/GetCaApiResponse.d.ts +2 -45
  143. package/dist/lib/models/objects/v4/config/GetCaApiResponse.js +187 -242
  144. package/dist/lib/models/objects/v4/config/GetCertificateApiResponse.d.ts +2 -43
  145. package/dist/lib/models/objects/v4/config/GetCertificateApiResponse.js +187 -242
  146. package/dist/lib/models/objects/v4/config/GetObjectstoreApiResponse.d.ts +2 -43
  147. package/dist/lib/models/objects/v4/config/GetObjectstoreApiResponse.js +187 -242
  148. package/dist/lib/models/objects/v4/config/ListCertificatesApiResponse.d.ts +2 -43
  149. package/dist/lib/models/objects/v4/config/ListCertificatesApiResponse.js +213 -268
  150. package/dist/lib/models/objects/v4/config/ListObjectstoresApiResponse.d.ts +2 -43
  151. package/dist/lib/models/objects/v4/config/ListObjectstoresApiResponse.js +213 -268
  152. package/dist/lib/models/objects/v4/config/ObjectStore.d.ts +1 -96
  153. package/dist/lib/models/objects/v4/config/ObjectStore.js +629 -712
  154. package/dist/lib/models/objects/v4/config/ObjectStoreProjection.d.ts +1 -129
  155. package/dist/lib/models/objects/v4/config/ObjectStoreProjection.js +222 -239
  156. package/dist/lib/models/objects/v4/config/State.js +7 -9
  157. package/dist/lib/models/objects/v4/config/UpdateObjectstoreApiResponse.d.ts +2 -43
  158. package/dist/lib/models/objects/v4/config/UpdateObjectstoreApiResponse.js +187 -242
  159. package/dist/lib/models/objects/v4/error/AppMessage.d.ts +5 -15
  160. package/dist/lib/models/objects/v4/error/AppMessage.js +265 -314
  161. package/dist/lib/models/objects/v4/error/ErrorResponse.d.ts +2 -7
  162. package/dist/lib/models/objects/v4/error/ErrorResponse.js +177 -219
  163. package/dist/lib/models/objects/v4/error/SchemaValidationError.d.ts +2 -18
  164. package/dist/lib/models/objects/v4/error/SchemaValidationError.js +249 -300
  165. package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
  166. package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.js +191 -234
  167. package/dist/lib/models/objects/v4/stats/GetObjectstoreStatsApiResponse.d.ts +58 -0
  168. package/dist/lib/models/objects/v4/stats/GetObjectstoreStatsApiResponse.js +288 -0
  169. package/dist/lib/models/objects/v4/stats/ObjectstoreStats.d.ts +255 -0
  170. package/dist/lib/models/objects/v4/stats/ObjectstoreStats.js +1253 -0
  171. package/dist/lib/models/objects/v4/stats/TimeFloatValuePair.d.ts +58 -0
  172. package/dist/lib/models/objects/v4/stats/TimeFloatValuePair.js +272 -0
  173. package/dist/lib/models/prism/v4/config/TaskReference.d.ts +2 -7
  174. package/dist/lib/models/prism/v4/config/TaskReference.js +142 -181
  175. package/dist/lib/models/validation/ValidationError.js +26 -42
  176. package/dist/lib/models/validation/ValidationScopes.js +3 -3
  177. package/dist/lib/utils/ValidationUtils.js +39 -69
  178. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A model that represents a paginable response from a list endpoint.
3
3
  * @module Paginable
4
- * @version 4.0.1-beta-1
4
+ * @version 4.0.2
5
5
  */
6
6
  export default class Paginable {
7
7
  /**
@@ -3,42 +3,33 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.default = void 0;
7
7
  var _ApiClient = require("./ApiClient");
8
- 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); }
9
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
10
- 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; } }
11
- 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; }
12
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13
- 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); } }
14
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
- 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); } /*
8
+ /*
17
9
  * Nutanix Objects Storage Management APIs
18
10
  *
19
- * OpenAPI spec version: 4.0.1-beta-1
11
+ * OpenAPI spec version: 4.0.2
20
12
  *
21
13
  * NOTE: This class is auto generated by the Open API Dev Platform.
22
14
  *
23
- * Open API Dev Platform Codegen version: 16.9.0.8546-RELEASE
15
+ * Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
24
16
  *
25
17
  * Do not edit the class manually.
26
18
  *
27
19
  */
20
+
28
21
  /**
29
22
  * A model that represents a paginable response from a list endpoint.
30
23
  * @module Paginable
31
- * @version 4.0.1-beta-1
24
+ * @version 4.0.2
32
25
  */
33
- var Paginable = exports["default"] = /*#__PURE__*/function () {
26
+ class Paginable {
34
27
  /**
35
28
  * Constructs a new <code>Paginable</code>.
36
29
  * @alias module:Paginable
37
30
  * @class
38
31
  */
39
- function Paginable() {
40
- _classCallCheck(this, Paginable);
41
- }
32
+ constructor() {}
42
33
 
43
34
  /**
44
35
  * Constructs a <code>Paginable</code> from a plain Javascript object, optionally creating a new instance.
@@ -47,194 +38,164 @@ var Paginable = exports["default"] = /*#__PURE__*/function () {
47
38
  * @param {module:Paginable} obj Optional instance to populate.
48
39
  * @return {module:Paginable} The populated <code>Paginable</code> instance.
49
40
  */
50
- return _createClass(Paginable, [{
51
- key: "getFirstPage",
52
- value:
53
- /**
54
- * Get the first page of the set, if any
55
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
56
- * or rejects with error message if any issue (link not available, ...)
57
- */
58
- function getFirstPage() {
59
- if (this.isFirstPage()) {
60
- return Promise.reject('Cannot navigate to first page : already on first page');
41
+ static constructFromObject(metadata, obj) {
42
+ if (metadata) {
43
+ obj = obj || new Paginable();
44
+ if (metadata.hasOwnProperty('links') && metadata['links'] !== null && metadata['links'] !== undefined) {
45
+ for (const link of metadata['links']) {
46
+ if (link.hasOwnProperty('rel') && link.hasOwnProperty('href')) {
47
+ switch (link['rel']) {
48
+ case 'first':
49
+ obj.linkFirst = link['href'];
50
+ break;
51
+ case 'prev':
52
+ obj.linkPrev = link['href'];
53
+ break;
54
+ case 'next':
55
+ obj.linkNext = link['href'];
56
+ break;
57
+ case 'last':
58
+ obj.linkLast = link['href'];
59
+ break;
60
+ default:
61
+ break;
62
+ }
63
+ }
64
+ }
61
65
  }
62
- if (this.linkFirst === null) {
63
- return Promise.reject('No link to first page provided in previous API response');
66
+ if (metadata.hasOwnProperty('totalAvailableResults')) {
67
+ obj.resultsTotal = metadata['totalAvailableResults'];
64
68
  }
65
- return this._getLink(this.linkFirst);
66
69
  }
70
+ return obj;
71
+ }
67
72
 
68
- /**
69
- * Get the previous page of the set, if any
70
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
71
- * or rejects with error message if any issue (link not available, ...)
72
- */
73
- }, {
74
- key: "getPrevPage",
75
- value: function getPrevPage() {
76
- if (this.isFirstPage()) {
77
- return Promise.reject('Cannot navigate to previous page : already on first page');
78
- }
79
- if (this.linkPrev === null) {
80
- return Promise.reject('No link to previous page provided in previous API response');
81
- }
82
- return this._getLink(this.linkPrev);
73
+ /**
74
+ * Get the first page of the set, if any
75
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
76
+ * or rejects with error message if any issue (link not available, ...)
77
+ */
78
+ getFirstPage() {
79
+ if (this.isFirstPage()) {
80
+ return Promise.reject('Cannot navigate to first page : already on first page');
83
81
  }
84
-
85
- /**
86
- * Get the next page of the set, if any
87
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
88
- * or rejects with error message if any issue (link not available, ...)
89
- */
90
- }, {
91
- key: "getNextPage",
92
- value: function getNextPage() {
93
- if (this.isLastPage()) {
94
- return Promise.reject('Cannot navigate to next page : already on last page');
95
- }
96
- if (this.linkNext === null) {
97
- return Promise.reject('No link to next page provided in previous API response');
98
- }
99
- return this._getLink(this.linkNext);
82
+ if (this.linkFirst === null) {
83
+ return Promise.reject('No link to first page provided in previous API response');
100
84
  }
85
+ return this._getLink(this.linkFirst);
86
+ }
101
87
 
102
- /**
103
- * Get the last page of the set, if any
104
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
105
- * or rejects with error message if any issue (link not available, ...)
106
- */
107
- }, {
108
- key: "getLastPage",
109
- value: function getLastPage() {
110
- if (this.isLastPage()) {
111
- return Promise.reject('Cannot navigate to last page : already on last page');
112
- }
113
- if (this.linkLast === null) {
114
- return Promise.reject('No link to last page provided in previous API response');
115
- }
116
- return this._getLink(this.linkLast);
88
+ /**
89
+ * Get the previous page of the set, if any
90
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
91
+ * or rejects with error message if any issue (link not available, ...)
92
+ */
93
+ getPrevPage() {
94
+ if (this.isFirstPage()) {
95
+ return Promise.reject('Cannot navigate to previous page : already on first page');
117
96
  }
118
-
119
- /**
120
- * Get the current page number
121
- * @return {Number} the current page number, starts at 0
122
- */
123
- }, {
124
- key: "currentPage",
125
- value: function currentPage() {
126
- if (this.page === null) {
127
- return 0;
128
- }
129
- return this.page;
97
+ if (this.linkPrev === null) {
98
+ return Promise.reject('No link to previous page provided in previous API response');
130
99
  }
100
+ return this._getLink(this.linkPrev);
101
+ }
131
102
 
132
- /**
133
- * Get the total number of pages
134
- * @return {Number} the total number of pages available
135
- */
136
- }, {
137
- key: "countPages",
138
- value: function countPages() {
139
- if (this.resultsPerPage === null || this.resultsTotal === null || this.resultsPerPage === 0) {
140
- return 1;
141
- }
142
- return Math.ceil(this.resultsTotal / this.resultsPerPage);
103
+ /**
104
+ * Get the next page of the set, if any
105
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
106
+ * or rejects with error message if any issue (link not available, ...)
107
+ */
108
+ getNextPage() {
109
+ if (this.isLastPage()) {
110
+ return Promise.reject('Cannot navigate to next page : already on last page');
143
111
  }
144
-
145
- /**
146
- * Check if current page is first page
147
- * @return {Boolean} True if current page is 0, false otherwise
148
- */
149
- }, {
150
- key: "isFirstPage",
151
- value: function isFirstPage() {
152
- return this.currentPage() === 0;
112
+ if (this.linkNext === null) {
113
+ return Promise.reject('No link to next page provided in previous API response');
153
114
  }
115
+ return this._getLink(this.linkNext);
116
+ }
154
117
 
155
- /**
156
- * Check if current page is last page
157
- * @return {Boolean} True if current page is countPages()-1, false otherwise
158
- */
159
- }, {
160
- key: "isLastPage",
161
- value: function isLastPage() {
162
- return this.currentPage() === this.countPages() - 1;
118
+ /**
119
+ * Get the last page of the set, if any
120
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
121
+ * or rejects with error message if any issue (link not available, ...)
122
+ */
123
+ getLastPage() {
124
+ if (this.isLastPage()) {
125
+ return Promise.reject('Cannot navigate to last page : already on last page');
163
126
  }
164
- }, {
165
- key: "populatePaginationMetadata",
166
- value: function populatePaginationMetadata(apiClient, page, resultsPerPage) {
167
- this.apiClient = apiClient;
168
- this.page = page;
169
- this.resultsPerPage = resultsPerPage;
127
+ if (this.linkLast === null) {
128
+ return Promise.reject('No link to last page provided in previous API response');
170
129
  }
171
- }, {
172
- key: "_getLink",
173
- value: function _getLink(path) {
174
- // If no ApiClient defined, instantiate default one
175
- if (this.apiClient === null) {
176
- this.apiClient = _ApiClient.ApiClient.instance;
177
- }
178
- var postBody = {};
179
- var pathParams = {};
180
- var queryParams = {};
181
- var headerParams = {};
182
- var formParams = {};
183
- var authNames = [];
184
- var contentTypes = [];
185
- var accepts = ['application/json'];
186
- var returnType = this.constructor;
187
- return this.apiClient.callApi(path, 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType);
130
+ return this._getLink(this.linkLast);
131
+ }
132
+
133
+ /**
134
+ * Get the current page number
135
+ * @return {Number} the current page number, starts at 0
136
+ */
137
+ currentPage() {
138
+ if (this.page === null) {
139
+ return 0;
188
140
  }
189
- }], [{
190
- key: "constructFromObject",
191
- value: function constructFromObject(metadata, obj) {
192
- if (metadata) {
193
- obj = obj || new Paginable();
194
- if (metadata.hasOwnProperty('links') && metadata['links'] !== null && metadata['links'] !== undefined) {
195
- var _iterator = _createForOfIteratorHelper(metadata['links']),
196
- _step;
197
- try {
198
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
199
- var link = _step.value;
200
- if (link.hasOwnProperty('rel') && link.hasOwnProperty('href')) {
201
- switch (link['rel']) {
202
- case 'first':
203
- obj.linkFirst = link['href'];
204
- break;
205
- case 'prev':
206
- obj.linkPrev = link['href'];
207
- break;
208
- case 'next':
209
- obj.linkNext = link['href'];
210
- break;
211
- case 'last':
212
- obj.linkLast = link['href'];
213
- break;
214
- default:
215
- break;
216
- }
217
- }
218
- }
219
- } catch (err) {
220
- _iterator.e(err);
221
- } finally {
222
- _iterator.f();
223
- }
224
- }
225
- if (metadata.hasOwnProperty('totalAvailableResults')) {
226
- obj.resultsTotal = metadata['totalAvailableResults'];
227
- }
228
- }
229
- return obj;
141
+ return this.page;
142
+ }
143
+
144
+ /**
145
+ * Get the total number of pages
146
+ * @return {Number} the total number of pages available
147
+ */
148
+ countPages() {
149
+ if (this.resultsPerPage === null || this.resultsTotal === null || this.resultsPerPage === 0) {
150
+ return 1;
230
151
  }
231
- }]);
232
- }();
152
+ return Math.ceil(this.resultsTotal / this.resultsPerPage);
153
+ }
154
+
155
+ /**
156
+ * Check if current page is first page
157
+ * @return {Boolean} True if current page is 0, false otherwise
158
+ */
159
+ isFirstPage() {
160
+ return this.currentPage() === 0;
161
+ }
162
+
163
+ /**
164
+ * Check if current page is last page
165
+ * @return {Boolean} True if current page is countPages()-1, false otherwise
166
+ */
167
+ isLastPage() {
168
+ return this.currentPage() === this.countPages() - 1;
169
+ }
170
+ populatePaginationMetadata(apiClient, page, resultsPerPage) {
171
+ this.apiClient = apiClient;
172
+ this.page = page;
173
+ this.resultsPerPage = resultsPerPage;
174
+ }
175
+ _getLink(path) {
176
+ // If no ApiClient defined, instantiate default one
177
+ if (this.apiClient === null) {
178
+ this.apiClient = _ApiClient.ApiClient.instance;
179
+ }
180
+ const postBody = {};
181
+ const pathParams = {};
182
+ const queryParams = {};
183
+ const headerParams = {};
184
+ const formParams = {};
185
+ const authNames = [];
186
+ const contentTypes = [];
187
+ const accepts = ['application/json'];
188
+ const returnType = this.constructor;
189
+ return this.apiClient.callApi(path, 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType);
190
+ }
191
+ }
192
+
233
193
  /**
234
194
  * The link to first page, if any
235
195
  * @type {String}
236
196
  * @memberOf Paginable
237
197
  */
198
+ exports.default = Paginable;
238
199
  Paginable.prototype.linkFirst = null;
239
200
 
240
201
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ObjectStores service.
3
- * @version 4.0.1-beta-1
3
+ * @version 4.0.2
4
4
  * @class ObjectStoresApi
5
5
  */
6
6
  export class ObjectStoresApi {
@@ -20,7 +20,7 @@ export class ObjectStoresApi {
20
20
  apiClient: any;
21
21
  /**
22
22
  * Create a SSL certificate for an Object store
23
- * This operation creates a new default certificate and keys. It also creates the alternate FQDNs for the Object store. The certificate of an Object store can be created when it is in a OBJECT_STORE_AVAILABLE or OBJECT_STORE_CERT_CREATION_FAILED state. If the publicCert, privateKey, and ca values are provided in the request body, these values are used to create the new certificate. If these values are not provided, the existing certificate will be used as the new certificate. Optionally, a list of additional alternate FQDNs can be provided.
23
+ * This operation creates a new default certificate and keys. It also creates the alternate FQDNs and alternate IPs for the Object store. The certificate of an Object store can be created when it is in a OBJECT_STORE_AVAILABLE or OBJECT_STORE_CERT_CREATION_FAILED state. If the publicCert, privateKey, and ca values are provided in the request body, these values are used to create the new certificate. If these values are not provided, a new certificate will be generated if &#x27;shouldGenerate&#x27; is set to true and if it is set to false, the existing certificate will be used as the new certificate. Optionally, a list of additional alternate FQDNs and alternate IPs can be provided. These alternateFqdns and alternateIps must be included in the CA certificate if it has been provided.
24
24
  * @param { Partial<String | ReadableStream> } body Accepts file path as a string or a file stream
25
25
  * @param { String } objectStoreExtId The UUID of the Object store.
26
26
  * @param {Object} args Additional Arguments
@@ -47,11 +47,11 @@ export class ObjectStoresApi {
47
47
  * Download the certificate authority
48
48
  * Download the certificate authority of an Object store certificate.
49
49
  * @param { String } objectStoreExtId The UUID of the Object store.
50
- * @param { String } extId The UUID of the certificate of an Object store.
50
+ * @param { String } certificateExtId The UUID of the certificate of an Object store.
51
51
  * @param {Object} args Additional Arguments
52
52
  * @return {Promise<GetCaApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link GetCaApiResponse } and HTTP response
53
53
  */
54
- getCaByCertificateId(objectStoreExtId: string, extId: string, ...args: any): Promise<GetCaApiResponse>;
54
+ getCaByCertificateId(objectStoreExtId: string, certificateExtId: string, ...args: any): Promise<GetCaApiResponse>;
55
55
  /**
56
56
  * Get the details of an Object store certificate
57
57
  * Get the details of the SSL certificate which can be used to connect to an Object store.
@@ -63,7 +63,7 @@ export class ObjectStoresApi {
63
63
  getCertificateById(objectStoreExtId: string, extId: string, ...args: any): Promise<GetCertificateApiResponse>;
64
64
  /**
65
65
  * Get an Object store
66
- * Get an Object store for the provided UUID. &#x60;state&#x60; string (State of the Object store) Enum for the state of the Object store. | Enum | Description | | ----------- | ----------- | | &#x60;\&quot;DEPLOYING_OBJECT_STORE\&quot;&#x60; | The Object store will be in this state during an ongoing deployment of the Object store. The Object store will be unavailable through S3 APIs in this state. The Object store will move to the OBJECT_STORE_AVAILABLE state if the deployment succeeds, and to the OBJECT_STORE_DEPLOYMENT_FAILED state if the deployment fails. | | &#x60;\&quot;OBJECT_STORE_OPERATION_FAILED\&quot;&#x60; | The Object store is in this state when there is an error while performing an operation on the Object store. The Object store may not be available through S3 APIs in this state. | | &#x60;\&quot;OBJECT_STORE_CERT_CREATION_FAILED\&quot;&#x60; | An Object store enters this state if there is an error while creating the Object store certificate. Creating a new certificate can be retried from this state. The Object store may not be available through S3 APIs in this state. | | &#x60;\&quot;OBJECT_STORE_OPERATION_PENDING\&quot;&#x60; | The Object store is in this state during an ongoing operation on the Object store. The Object store may not be available through S3 APIs in this state. The Object store will enter the OBJECT_STORE_OPERATION_FAILED state if the operation fails, or the OBJECT_STORE_AVAILABLE state if the operation is successful. | | &#x60;\&quot;UNDEPLOYED_OBJECT_STORE\&quot;&#x60; | The Object store is in this state if it has not been deployed. | | &#x60;\&quot;CREATING_OBJECT_STORE_CERT\&quot;&#x60; | The Object store is in this state during a certificate creation for the Object store. The Object store will be unavailable through S3 APIs in this state. It will move to the OBJECT_STORE_AVAILABLE state if the certificate was created successfully, or to the OBJECT_STORE_CERT_CREATION_FAILED state if an error occurs while creating the certificate. | | &#x60;\&quot;OBJECT_STORE_AVAILABLE\&quot;&#x60; | An Object store is in this state if its deployment was successful, and there are no ongoing operations on the Object store. The Object store will be available through S3 APIs in this state. In this state, the Object store can be deleted or a new certificate can be created for this Object store. | | &#x60;\&quot;OBJECT_STORE_DELETION_FAILED\&quot;&#x60; | An Object store enters this state if there is an error deleting the Object store. The Object store will not be available through S3 APIs in this state. Deleting the Object store can be retried from this state. | | &#x60;\&quot;OBJECT_STORE_DEPLOYMENT_FAILED\&quot;&#x60; | An Object store enters this state when its deployment fails. The Object store deployment can be retried or the Object store can be deleted from this state. | | &#x60;\&quot;DELETING_OBJECT_STORE\&quot;&#x60; | A deployed Object store is in this state when the Object store is being deleted. The Object store will be unavailable through S3 APIs in this state. It can be either deleted or move to the OBJECT_STORE_DELETION_FAILED state if the deletion fails. |
66
+ * Get an Object store for the provided UUID. &#x60;state&#x60; string (State of the Object store) Enum for the state of the Object store. | Enum | Description | | ----------- | ----------- | | &#x60;\&quot;DEPLOYING_OBJECT_STORE\&quot;&#x60; | The Object store will be in this state during an ongoing deployment of the Object store. The Object store will be unavailable through S3 APIs in this state. The Object store will move to the OBJECT_STORE_AVAILABLE state if the deployment succeeds, and to the OBJECT_STORE_DEPLOYMENT_FAILED state if the deployment fails. | | &#x60;\&quot;OBJECT_STORE_OPERATION_FAILED\&quot;&#x60; | The Object store is in this state when there is an error while performing an operation on the Object store. The Object store may not be available through S3 APIs in this state. | | &#x60;\&quot;OBJECT_STORE_CERT_CREATION_FAILED\&quot;&#x60; | An Object store enters this state if there is an error while creating the Object store certificate. Creating a new certificate can be retried from this state. The Object store may not be available through S3 APIs in this state. | | &#x60;\&quot;OBJECT_STORE_OPERATION_PENDING\&quot;&#x60; | The Object store is in this state during an ongoing operation on the Object store. The Object store may not be available through S3 APIs in this state. The Object store will enter the OBJECT_STORE_OPERATION_FAILED state if the operation fails, or the OBJECT_STORE_AVAILABLE state if the operation is successful. | | &#x60;\&quot;UNDEPLOYED_OBJECT_STORE\&quot;&#x60; | The Object store is in this state if it has not been deployed. | | &#x60;\&quot;CREATING_OBJECT_STORE_CERT\&quot;&#x60; | The Object store is in this state during a certificate creation for the Object store. The Object store will be unavailable through S3 APIs in this state. It will move to the OBJECT_STORE_AVAILABLE state if the certificate was created successfully, or to the OBJECT_STORE_CERT_CREATION_FAILED state if an error occurs while creating the certificate. | | &#x60;\&quot;OBJECT_STORE_AVAILABLE\&quot;&#x60; | An Object store is in this state if its deployment was successful, and there are no ongoing operations on the Object store. The Object store will be available through S3 APIs in this state. In this state, the Object store can be deleted or a new certificate can be created for this Object store. | | &#x60;\&quot;OBJECT_STORE_DELETION_FAILED\&quot;&#x60; | An Object store enters this state if there is an error deleting the Object store. The Object store will not be available through S3 APIs in this state. Deleting the Object store can be retried from this state. | | &#x60;\&quot;OBJECT_STORE_DEPLOYMENT_FAILED\&quot;&#x60; | An Object store enters this state when its deployment fails. The Object store deployment can be retried or the Object store can be deleted from this state. | | &#x60;\&quot;DELETING_OBJECT_STORE\&quot;&#x60; | A deployed Object store is in this state when the Object store is being deleted. The Object store will be unavailable through S3 APIs in this state. It can be either deleted or move to the OBJECT_STORE_DELETION_FAILED state if the deletion fails. |
67
67
  * @param { String } extId The UUID of the Object store.
68
68
  * @param {Object} args Additional Arguments
69
69
  * @return {Promise<GetObjectstoreApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link GetObjectstoreApiResponse } and HTTP response
@@ -79,13 +79,8 @@ export class ObjectStoresApi {
79
79
  * @param { Number } opts.$limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
80
80
 
81
81
  * @param { String } opts.$filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions.<br>
82
- * For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'.<br>
83
- * The filter can be applied to the following fields:<br>
84
- * - alternateFqdns/value
82
+ * For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'.
85
83
  * @param { String } opts.$select A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned.
86
- - alternateFqdns
87
- - alternateFqdns/value
88
-
89
84
  * @param {Object} args Additional Arguments
90
85
  * @return {Promise<ListCertificatesApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ListCertificatesApiResponse } and HTTP response
91
86
  */
@@ -104,66 +99,10 @@ export class ObjectStoresApi {
104
99
  * @param { Number } opts.$limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
105
100
 
106
101
  * @param { String } opts.$filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions.<br>
107
- * For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'.<br>
108
- * The filter can be applied to the following fields:<br>
109
- * - certificateExtIds<br>
110
- * - clusterExtId<br>
111
- * - creationTime<br>
112
- * - deploymentVersion<br>
113
- * - description<br>
114
- * - domain<br>
115
- * - lastUpdateTime<br>
116
- * - name<br>
117
- * - numWorkerNodes<br>
118
- * - publicNetworkIps/ipv4/value<br>
119
- * - publicNetworkIps/ipv6/value<br>
120
- * - publicNetworkReference<br>
121
- * - region<br>
122
- * - storageNetworkDnsIp/ipv4/value<br>
123
- * - storageNetworkDnsIp/ipv6/value<br>
124
- * - storageNetworkReference<br>
125
- * - storageNetworkVip/ipv4/value<br>
126
- * - storageNetworkVip/ipv6/value<br>
127
- * - totalCapacityGiB
128
- * @param { String } opts.$orderby A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order.<br>
129
- * The orderby can be applied to the following fields:<br>
130
- * - clusterExtId<br>
131
- * - creationTime<br>
132
- * - deploymentVersion<br>
133
- * - description<br>
134
- * - domain<br>
135
- * - lastUpdateTime<br>
136
- * - name<br>
137
- * - numWorkerNodes<br>
138
- * - publicNetworkReference<br>
139
- * - region<br>
140
- * - storageNetworkReference<br>
141
- * - totalCapacityGiB
142
- * @param { String } opts.$expand A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported.
143
- - certificates
144
-
102
+ * For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'.
103
+ * @param { String } opts.$orderby A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order.
104
+ * @param { String } opts.$expand A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby.
145
105
  * @param { String } opts.$select A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned.
146
- - certificateExtIds
147
- - clusterExtId
148
- - creationTime
149
- - deploymentVersion
150
- - description
151
- - domain
152
- - lastUpdateTime
153
- - name
154
- - numWorkerNodes
155
- - publicNetworkIps
156
- - publicNetworkIps/ipv4/value
157
- - publicNetworkReference
158
- - region
159
- - state
160
- - storageNetworkDnsIp
161
- - storageNetworkDnsIp/ipv4/value
162
- - storageNetworkReference
163
- - storageNetworkVip
164
- - storageNetworkVip/ipv4/value
165
- - totalCapacityGiB
166
-
167
106
  * @param {Object} args Additional Arguments
168
107
  * @return {Promise<ListObjectstoresApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ListObjectstoresApiResponse } and HTTP response
169
108
  */