@nutanix-scratch/objects-js-client 4.0.1 → 4.0.3

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 (174) hide show
  1. package/README.md +31 -18
  2. package/dist/Ntnx-Objects-js-client-prod.js +1 -1
  3. package/dist/Ntnx-Objects-js-client.js +289 -283
  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 +5 -69
  9. package/dist/es/apis/objectstores-endpoints.js +406 -479
  10. package/dist/es/apis/stats-endpoints.d.ts +3 -25
  11. package/dist/es/apis/stats-endpoints.js +75 -107
  12. package/dist/es/index.js +120 -120
  13. package/dist/es/models/common/v1/config/FQDN.d.ts +2 -7
  14. package/dist/es/models/common/v1/config/FQDN.js +141 -180
  15. package/dist/es/models/common/v1/config/Flag.d.ts +2 -8
  16. package/dist/es/models/common/v1/config/Flag.js +170 -211
  17. package/dist/es/models/common/v1/config/IPAddress.d.ts +2 -20
  18. package/dist/es/models/common/v1/config/IPAddress.js +170 -217
  19. package/dist/es/models/common/v1/config/IPv4Address.d.ts +2 -8
  20. package/dist/es/models/common/v1/config/IPv4Address.js +174 -215
  21. package/dist/es/models/common/v1/config/IPv6Address.d.ts +2 -8
  22. package/dist/es/models/common/v1/config/IPv6Address.js +174 -215
  23. package/dist/es/models/common/v1/config/KVPair.d.ts +2 -8
  24. package/dist/es/models/common/v1/config/KVPair.js +225 -270
  25. package/dist/es/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
  26. package/dist/es/models/common/v1/config/MapOfStringWrapper.js +139 -178
  27. package/dist/es/models/common/v1/config/Message.d.ts +2 -10
  28. package/dist/es/models/common/v1/config/Message.js +213 -258
  29. package/dist/es/models/common/v1/config/MessageSeverity.js +7 -9
  30. package/dist/es/models/common/v1/config/Metadata.d.ts +2 -11
  31. package/dist/es/models/common/v1/config/Metadata.js +261 -308
  32. package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +5 -10
  33. package/dist/es/models/common/v1/config/TenantAwareModel.js +138 -178
  34. package/dist/es/models/common/v1/response/ApiLink.d.ts +2 -8
  35. package/dist/es/models/common/v1/response/ApiLink.js +165 -206
  36. package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
  37. package/dist/es/models/common/v1/response/ApiResponseMetadata.js +281 -344
  38. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
  39. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +155 -203
  40. package/dist/es/models/common/v1/stats/DownSamplingOperator.js +7 -9
  41. package/dist/es/models/common/v1/stats/TimeIntValuePair.d.ts +2 -8
  42. package/dist/es/models/common/v1/stats/TimeIntValuePair.js +165 -206
  43. package/dist/es/models/objects/v4/config/Certificate.d.ts +1 -58
  44. package/dist/es/models/objects/v4/config/Certificate.js +319 -381
  45. package/dist/es/models/objects/v4/config/CertificateProjection.d.ts +1 -1
  46. package/dist/es/models/objects/v4/config/CertificateProjection.js +73 -102
  47. package/dist/es/models/objects/v4/config/CreateCertificateApiResponse.d.ts +2 -45
  48. package/dist/es/models/objects/v4/config/CreateCertificateApiResponse.js +185 -240
  49. package/dist/es/models/objects/v4/config/CreateObjectstoreApiResponse.d.ts +2 -43
  50. package/dist/es/models/objects/v4/config/CreateObjectstoreApiResponse.js +185 -240
  51. package/dist/es/models/objects/v4/config/DeleteObjectstoreApiResponse.d.ts +2 -43
  52. package/dist/es/models/objects/v4/config/DeleteObjectstoreApiResponse.js +185 -240
  53. package/dist/es/models/objects/v4/config/GetCaApiResponse.d.ts +2 -43
  54. package/dist/es/models/objects/v4/config/GetCaApiResponse.js +185 -240
  55. package/dist/es/models/objects/v4/config/GetCertificateApiResponse.d.ts +2 -43
  56. package/dist/es/models/objects/v4/config/GetCertificateApiResponse.js +185 -240
  57. package/dist/es/models/objects/v4/config/GetObjectstoreApiResponse.d.ts +2 -45
  58. package/dist/es/models/objects/v4/config/GetObjectstoreApiResponse.js +185 -240
  59. package/dist/es/models/objects/v4/config/ListCertificatesApiResponse.d.ts +2 -43
  60. package/dist/es/models/objects/v4/config/ListCertificatesApiResponse.js +211 -266
  61. package/dist/es/models/objects/v4/config/ListObjectstoresApiResponse.d.ts +2 -43
  62. package/dist/es/models/objects/v4/config/ListObjectstoresApiResponse.js +211 -266
  63. package/dist/es/models/objects/v4/config/ObjectStore.d.ts +1 -96
  64. package/dist/es/models/objects/v4/config/ObjectStore.js +628 -711
  65. package/dist/es/models/objects/v4/config/ObjectStoreProjection.d.ts +1 -152
  66. package/dist/es/models/objects/v4/config/ObjectStoreProjection.js +221 -238
  67. package/dist/es/models/objects/v4/config/State.js +7 -9
  68. package/dist/es/models/objects/v4/config/UpdateObjectstoreApiResponse.d.ts +2 -43
  69. package/dist/es/models/objects/v4/config/UpdateObjectstoreApiResponse.js +185 -240
  70. package/dist/es/models/objects/v4/error/AppMessage.d.ts +5 -15
  71. package/dist/es/models/objects/v4/error/AppMessage.js +264 -313
  72. package/dist/es/models/objects/v4/error/ErrorResponse.d.ts +2 -7
  73. package/dist/es/models/objects/v4/error/ErrorResponse.js +174 -217
  74. package/dist/es/models/objects/v4/error/SchemaValidationError.d.ts +2 -18
  75. package/dist/es/models/objects/v4/error/SchemaValidationError.js +248 -299
  76. package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
  77. package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.js +190 -233
  78. package/dist/es/models/objects/v4/stats/GetObjectstoreStatsApiResponse.d.ts +2 -43
  79. package/dist/es/models/objects/v4/stats/GetObjectstoreStatsApiResponse.js +185 -240
  80. package/dist/es/models/objects/v4/stats/ObjectstoreStats.d.ts +1 -169
  81. package/dist/es/models/objects/v4/stats/ObjectstoreStats.js +957 -1129
  82. package/dist/es/models/objects/v4/stats/TimeFloatValuePair.d.ts +2 -8
  83. package/dist/es/models/objects/v4/stats/TimeFloatValuePair.js +165 -206
  84. package/dist/es/models/prism/v4/config/TaskReference.d.ts +5 -10
  85. package/dist/es/models/prism/v4/config/TaskReference.js +143 -182
  86. package/dist/es/models/validation/ValidationError.js +26 -42
  87. package/dist/es/models/validation/ValidationScopes.js +3 -3
  88. package/dist/es/utils/ValidationUtils.js +39 -69
  89. package/dist/lib/ApiClient.d.ts +35 -7
  90. package/dist/lib/ApiClient.js +862 -684
  91. package/dist/lib/Paginable.d.ts +1 -1
  92. package/dist/lib/Paginable.js +144 -183
  93. package/dist/lib/apis/objectstores-endpoints.d.ts +5 -69
  94. package/dist/lib/apis/objectstores-endpoints.js +406 -479
  95. package/dist/lib/apis/stats-endpoints.d.ts +3 -25
  96. package/dist/lib/apis/stats-endpoints.js +75 -107
  97. package/dist/lib/index.js +120 -120
  98. package/dist/lib/models/common/v1/config/FQDN.d.ts +2 -7
  99. package/dist/lib/models/common/v1/config/FQDN.js +141 -180
  100. package/dist/lib/models/common/v1/config/Flag.d.ts +2 -8
  101. package/dist/lib/models/common/v1/config/Flag.js +170 -211
  102. package/dist/lib/models/common/v1/config/IPAddress.d.ts +2 -20
  103. package/dist/lib/models/common/v1/config/IPAddress.js +170 -217
  104. package/dist/lib/models/common/v1/config/IPv4Address.d.ts +2 -8
  105. package/dist/lib/models/common/v1/config/IPv4Address.js +174 -215
  106. package/dist/lib/models/common/v1/config/IPv6Address.d.ts +2 -8
  107. package/dist/lib/models/common/v1/config/IPv6Address.js +174 -215
  108. package/dist/lib/models/common/v1/config/KVPair.d.ts +2 -8
  109. package/dist/lib/models/common/v1/config/KVPair.js +225 -270
  110. package/dist/lib/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
  111. package/dist/lib/models/common/v1/config/MapOfStringWrapper.js +139 -178
  112. package/dist/lib/models/common/v1/config/Message.d.ts +2 -10
  113. package/dist/lib/models/common/v1/config/Message.js +213 -258
  114. package/dist/lib/models/common/v1/config/MessageSeverity.js +7 -9
  115. package/dist/lib/models/common/v1/config/Metadata.d.ts +2 -11
  116. package/dist/lib/models/common/v1/config/Metadata.js +261 -308
  117. package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +5 -10
  118. package/dist/lib/models/common/v1/config/TenantAwareModel.js +138 -178
  119. package/dist/lib/models/common/v1/response/ApiLink.d.ts +2 -8
  120. package/dist/lib/models/common/v1/response/ApiLink.js +165 -206
  121. package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
  122. package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +281 -344
  123. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
  124. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +155 -203
  125. package/dist/lib/models/common/v1/stats/DownSamplingOperator.js +7 -9
  126. package/dist/lib/models/common/v1/stats/TimeIntValuePair.d.ts +2 -8
  127. package/dist/lib/models/common/v1/stats/TimeIntValuePair.js +165 -206
  128. package/dist/lib/models/objects/v4/config/Certificate.d.ts +1 -58
  129. package/dist/lib/models/objects/v4/config/Certificate.js +319 -381
  130. package/dist/lib/models/objects/v4/config/CertificateProjection.d.ts +1 -1
  131. package/dist/lib/models/objects/v4/config/CertificateProjection.js +73 -102
  132. package/dist/lib/models/objects/v4/config/CreateCertificateApiResponse.d.ts +2 -45
  133. package/dist/lib/models/objects/v4/config/CreateCertificateApiResponse.js +185 -240
  134. package/dist/lib/models/objects/v4/config/CreateObjectstoreApiResponse.d.ts +2 -43
  135. package/dist/lib/models/objects/v4/config/CreateObjectstoreApiResponse.js +185 -240
  136. package/dist/lib/models/objects/v4/config/DeleteObjectstoreApiResponse.d.ts +2 -43
  137. package/dist/lib/models/objects/v4/config/DeleteObjectstoreApiResponse.js +185 -240
  138. package/dist/lib/models/objects/v4/config/GetCaApiResponse.d.ts +2 -43
  139. package/dist/lib/models/objects/v4/config/GetCaApiResponse.js +185 -240
  140. package/dist/lib/models/objects/v4/config/GetCertificateApiResponse.d.ts +2 -43
  141. package/dist/lib/models/objects/v4/config/GetCertificateApiResponse.js +185 -240
  142. package/dist/lib/models/objects/v4/config/GetObjectstoreApiResponse.d.ts +2 -45
  143. package/dist/lib/models/objects/v4/config/GetObjectstoreApiResponse.js +185 -240
  144. package/dist/lib/models/objects/v4/config/ListCertificatesApiResponse.d.ts +2 -43
  145. package/dist/lib/models/objects/v4/config/ListCertificatesApiResponse.js +211 -266
  146. package/dist/lib/models/objects/v4/config/ListObjectstoresApiResponse.d.ts +2 -43
  147. package/dist/lib/models/objects/v4/config/ListObjectstoresApiResponse.js +211 -266
  148. package/dist/lib/models/objects/v4/config/ObjectStore.d.ts +1 -96
  149. package/dist/lib/models/objects/v4/config/ObjectStore.js +628 -711
  150. package/dist/lib/models/objects/v4/config/ObjectStoreProjection.d.ts +1 -152
  151. package/dist/lib/models/objects/v4/config/ObjectStoreProjection.js +221 -238
  152. package/dist/lib/models/objects/v4/config/State.js +7 -9
  153. package/dist/lib/models/objects/v4/config/UpdateObjectstoreApiResponse.d.ts +2 -43
  154. package/dist/lib/models/objects/v4/config/UpdateObjectstoreApiResponse.js +185 -240
  155. package/dist/lib/models/objects/v4/error/AppMessage.d.ts +5 -15
  156. package/dist/lib/models/objects/v4/error/AppMessage.js +264 -313
  157. package/dist/lib/models/objects/v4/error/ErrorResponse.d.ts +2 -7
  158. package/dist/lib/models/objects/v4/error/ErrorResponse.js +174 -217
  159. package/dist/lib/models/objects/v4/error/SchemaValidationError.d.ts +2 -18
  160. package/dist/lib/models/objects/v4/error/SchemaValidationError.js +248 -299
  161. package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
  162. package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.js +190 -233
  163. package/dist/lib/models/objects/v4/stats/GetObjectstoreStatsApiResponse.d.ts +2 -43
  164. package/dist/lib/models/objects/v4/stats/GetObjectstoreStatsApiResponse.js +185 -240
  165. package/dist/lib/models/objects/v4/stats/ObjectstoreStats.d.ts +1 -169
  166. package/dist/lib/models/objects/v4/stats/ObjectstoreStats.js +957 -1129
  167. package/dist/lib/models/objects/v4/stats/TimeFloatValuePair.d.ts +2 -8
  168. package/dist/lib/models/objects/v4/stats/TimeFloatValuePair.js +165 -206
  169. package/dist/lib/models/prism/v4/config/TaskReference.d.ts +5 -10
  170. package/dist/lib/models/prism/v4/config/TaskReference.js +143 -182
  171. package/dist/lib/models/validation/ValidationError.js +26 -42
  172. package/dist/lib/models/validation/ValidationScopes.js +3 -3
  173. package/dist/lib/utils/ValidationUtils.js +39 -69
  174. 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
4
+ * @version 4.0.3
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
11
+ * OpenAPI spec version: 4.0.3
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.1.8738-RELEASE
15
+ * Open API Dev Platform Codegen version: 17.5.1.10573-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
24
+ * @version 4.0.3
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
3
+ * @version 4.0.3
4
4
  * @class ObjectStoresApi
5
5
  */
6
6
  export class ObjectStoresApi {
@@ -79,16 +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<br>
85
- * - alternateIps/ipv4/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'.
86
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.
87
- - alternateFqdns
88
- - alternateFqdns/value
89
- - alternateIps
90
- - alternateIps/ipv4/value
91
-
92
84
  * @param {Object} args Additional Arguments
93
85
  * @return {Promise<ListCertificatesApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ListCertificatesApiResponse } and HTTP response
94
86
  */
@@ -107,66 +99,10 @@ export class ObjectStoresApi {
107
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.
108
100
 
109
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>
110
- * 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>
111
- * The filter can be applied to the following fields:<br>
112
- * - certificateExtIds<br>
113
- * - clusterExtId<br>
114
- * - creationTime<br>
115
- * - deploymentVersion<br>
116
- * - description<br>
117
- * - domain<br>
118
- * - lastUpdateTime<br>
119
- * - name<br>
120
- * - numWorkerNodes<br>
121
- * - publicNetworkIps/ipv4/value<br>
122
- * - publicNetworkIps/ipv6/value<br>
123
- * - publicNetworkReference<br>
124
- * - region<br>
125
- * - storageNetworkDnsIp/ipv4/value<br>
126
- * - storageNetworkDnsIp/ipv6/value<br>
127
- * - storageNetworkReference<br>
128
- * - storageNetworkVip/ipv4/value<br>
129
- * - storageNetworkVip/ipv6/value<br>
130
- * - totalCapacityGiB
131
- * @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>
132
- * The orderby can be applied to the following fields:<br>
133
- * - clusterExtId<br>
134
- * - creationTime<br>
135
- * - deploymentVersion<br>
136
- * - description<br>
137
- * - domain<br>
138
- * - lastUpdateTime<br>
139
- * - name<br>
140
- * - numWorkerNodes<br>
141
- * - publicNetworkReference<br>
142
- * - region<br>
143
- * - storageNetworkReference<br>
144
- * - totalCapacityGiB
145
- * @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.
146
- - certificates
147
-
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.
148
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.
149
- - certificateExtIds
150
- - clusterExtId
151
- - creationTime
152
- - deploymentVersion
153
- - description
154
- - domain
155
- - lastUpdateTime
156
- - name
157
- - numWorkerNodes
158
- - publicNetworkIps
159
- - publicNetworkIps/ipv4/value
160
- - publicNetworkReference
161
- - region
162
- - state
163
- - storageNetworkDnsIp
164
- - storageNetworkDnsIp/ipv4/value
165
- - storageNetworkReference
166
- - storageNetworkVip
167
- - storageNetworkVip/ipv4/value
168
- - totalCapacityGiB
169
-
170
106
  * @param {Object} args Additional Arguments
171
107
  * @return {Promise<ListObjectstoresApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ListObjectstoresApiResponse } and HTTP response
172
108
  */