@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,95 @@
1
+ /**
2
+ * A model that represents a paginable response from a list endpoint.
3
+ * @module Paginable
4
+ * @version 4.0.1-alpha-2
5
+ */
6
+ export default class Paginable {
7
+ /**
8
+ * Constructs a <code>Paginable</code> from a plain Javascript object, optionally creating a new instance.
9
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
10
+ * @param {Object} metadata The plain Javascript object bearing properties of interest.
11
+ * @param {module:Paginable} obj Optional instance to populate.
12
+ * @return {module:Paginable} The populated <code>Paginable</code> instance.
13
+ */
14
+ static constructFromObject(metadata: any, obj: any): any;
15
+ /**
16
+ * Get the first page of the set, if any
17
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
18
+ * or rejects with error message if any issue (link not available, ...)
19
+ */
20
+ getFirstPage(): Promise<any>;
21
+ /**
22
+ * Get the previous page of the set, if any
23
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
24
+ * or rejects with error message if any issue (link not available, ...)
25
+ */
26
+ getPrevPage(): Promise<any>;
27
+ /**
28
+ * Get the next page of the set, if any
29
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
30
+ * or rejects with error message if any issue (link not available, ...)
31
+ */
32
+ getNextPage(): Promise<any>;
33
+ /**
34
+ * Get the last page of the set, if any
35
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
36
+ * or rejects with error message if any issue (link not available, ...)
37
+ */
38
+ getLastPage(): Promise<any>;
39
+ /**
40
+ * Get the current page number
41
+ * @return {Number} the current page number, starts at 0
42
+ */
43
+ currentPage(): number;
44
+ /**
45
+ * Get the total number of pages
46
+ * @return {Number} the total number of pages available
47
+ */
48
+ countPages(): number;
49
+ /**
50
+ * Check if current page is first page
51
+ * @return {Boolean} True if current page is 0, false otherwise
52
+ */
53
+ isFirstPage(): boolean;
54
+ /**
55
+ * Check if current page is last page
56
+ * @return {Boolean} True if current page is countPages()-1, false otherwise
57
+ */
58
+ isLastPage(): boolean;
59
+ populatePaginationMetadata(apiClient: any, page: any, resultsPerPage: any): void;
60
+ apiClient: ApiClient;
61
+ page: number;
62
+ resultsPerPage: number;
63
+ _getLink(path: any): Promise<any>;
64
+ /**
65
+ * The link to first page, if any
66
+ * @type {String}
67
+ * @memberOf Paginable
68
+ */
69
+ linkFirst: string;
70
+ /**
71
+ * The link to previous page, if any
72
+ * @type {String}
73
+ * @memberOf Paginable
74
+ */
75
+ linkPrev: string;
76
+ /**
77
+ * The link to next page, if any
78
+ * @type {String}
79
+ * @memberOf Paginable
80
+ */
81
+ linkNext: string;
82
+ /**
83
+ * The link to last page, if any
84
+ * @type {String}
85
+ * @memberOf Paginable
86
+ */
87
+ linkLast: string;
88
+ /**
89
+ * Number of total results available
90
+ * @type {Number}
91
+ * @memberOf Paginable
92
+ */
93
+ resultsTotal: number;
94
+ }
95
+ import { ApiClient } from "./ApiClient";
@@ -0,0 +1,287 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
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(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
10
+ 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); }
11
+ 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; }
12
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
+ 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); } }
14
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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); } /*
17
+ * Nutanix Objects Storage Management APIs
18
+ *
19
+ * OpenAPI spec version: 4.0.1-alpha-2
20
+ *
21
+ * NOTE: This class is auto generated by the Open API Dev Platform.
22
+ *
23
+ * Open API Dev Platform Codegen version: 16.8.0.7344-RELEASE
24
+ *
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * A model that represents a paginable response from a list endpoint.
30
+ * @module Paginable
31
+ * @version 4.0.1-alpha-2
32
+ */
33
+ var Paginable = exports["default"] = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>Paginable</code>.
36
+ * @alias module:Paginable
37
+ * @class
38
+ */
39
+ function Paginable() {
40
+ _classCallCheck(this, Paginable);
41
+ }
42
+
43
+ /**
44
+ * Constructs a <code>Paginable</code> from a plain Javascript object, optionally creating a new instance.
45
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
46
+ * @param {Object} metadata The plain Javascript object bearing properties of interest.
47
+ * @param {module:Paginable} obj Optional instance to populate.
48
+ * @return {module:Paginable} The populated <code>Paginable</code> instance.
49
+ */
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');
61
+ }
62
+ if (this.linkFirst === null) {
63
+ return Promise.reject('No link to first page provided in previous API response');
64
+ }
65
+ return this._getLink(this.linkFirst);
66
+ }
67
+
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);
83
+ }
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);
100
+ }
101
+
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);
117
+ }
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;
130
+ }
131
+
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);
143
+ }
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;
153
+ }
154
+
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;
163
+ }
164
+ }, {
165
+ key: "populatePaginationMetadata",
166
+ value: function populatePaginationMetadata(apiClient, page, resultsPerPage) {
167
+ this.apiClient = apiClient;
168
+ this.page = page;
169
+ this.resultsPerPage = resultsPerPage;
170
+ }
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);
188
+ }
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;
230
+ }
231
+ }]);
232
+ }();
233
+ /**
234
+ * The link to first page, if any
235
+ * @type {String}
236
+ * @memberOf Paginable
237
+ */
238
+ Paginable.prototype.linkFirst = null;
239
+
240
+ /**
241
+ * The link to previous page, if any
242
+ * @type {String}
243
+ * @memberOf Paginable
244
+ */
245
+ Paginable.prototype.linkPrev = null;
246
+
247
+ /**
248
+ * The link to next page, if any
249
+ * @type {String}
250
+ * @memberOf Paginable
251
+ */
252
+ Paginable.prototype.linkNext = null;
253
+
254
+ /**
255
+ * The link to last page, if any
256
+ * @type {String}
257
+ * @memberOf Paginable
258
+ */
259
+ Paginable.prototype.linkLast = null;
260
+
261
+ /**
262
+ * The ApiClient instance to use for further query
263
+ * @type {ApiClient}
264
+ * @memberOf Paginable
265
+ */
266
+ Paginable.prototype.apiClient = null;
267
+
268
+ /**
269
+ * Current page number
270
+ * @type {Number}
271
+ * @memberOf Paginable
272
+ */
273
+ Paginable.prototype.page = null;
274
+
275
+ /**
276
+ * Number of results per page
277
+ * @type {Number}
278
+ * @memberOf Paginable
279
+ */
280
+ Paginable.prototype.resultsPerPage = null;
281
+
282
+ /**
283
+ * Number of total results available
284
+ * @type {Number}
285
+ * @memberOf Paginable
286
+ */
287
+ Paginable.prototype.resultsTotal = null;
@@ -0,0 +1,231 @@
1
+ /**
2
+ * ObjectStores service.
3
+ * @version 4.0.1-alpha-2
4
+ * @class ObjectStoresApi
5
+ */
6
+ export class ObjectStoresApi {
7
+ /**
8
+ * Make the default {@link ApiClient} class available for developers to be able to extend it and bring
9
+ * their own fetch methods into the SDK
10
+ */
11
+ static get ApiClient(): typeof ApiClient;
12
+ /**
13
+ * Constructs a new ObjectStoresApi.
14
+ * @alias module:api/ObjectStoresApi
15
+ * @class
16
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
17
+ * default to {@link module:ApiClient#instance} if unspecified.
18
+ */
19
+ constructor(apiClient?: any);
20
+ apiClient: any;
21
+ /**
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_CREATE_CERT_ERROR 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, they will be generated for the new certificate. Optionally, a list of additional alternate FQDNs can be provided.
24
+ * @param { String } objectStoreExtId The UUID of the Object store.
25
+ * @param {Object} opts Optional parameters defined for the operation
26
+ * @param { String } opts.publicCert
27
+ * @param { String } opts.privateKey
28
+ * @param { common.v1.config.Metadata } opts.metadata
29
+ * @param { Array } opts.alternateFqdns
30
+ * @param { String } opts.tenantId
31
+ * @param { Array } opts.links
32
+ * @param { String } opts.extId
33
+ * @param { String } opts.ca
34
+ * @param {Object} args Additional Arguments
35
+ * @return {Promise<TaskReferenceApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link TaskReferenceApiResponse } and HTTP response
36
+ */
37
+ createCertificate(objectStoreExtId: string, opts: {
38
+ publicCert: string;
39
+ privateKey: string;
40
+ metadata: common.v1.config.Metadata;
41
+ alternateFqdns: any[];
42
+ tenantId: string;
43
+ links: any[];
44
+ extId: string;
45
+ ca: string;
46
+ }, ...args: any): Promise<TaskReferenceApiResponse>;
47
+ /**
48
+ * Create an Object store
49
+ * Run the prechecks, create and start the deployment of an Object store on Prism Central.
50
+ * @param { Required<Pick<Objectstore, 'name'>> & Partial<Objectstore> } body specification
51
+ * @param {Object} args Additional Arguments
52
+ * @return {Promise<TaskReferenceApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link TaskReferenceApiResponse } and HTTP response
53
+ */
54
+ createObjectstore(body: Required<Pick<Objectstore, 'name'>> & Partial<Objectstore>, ...args: any): Promise<TaskReferenceApiResponse>;
55
+ /**
56
+ * Delete an Object store
57
+ * Send a request to delete an Object store for the provided UUID and clean up its data. An Object store can only be deleted when it is in the state OBJECT_STORE_INPUT, OBJECT_STORE_DELETE_INPUT_ERROR, OBJECT_STORE_AVAILABLE, OBJECT_STORE_DEPLOYMENT_ERROR or OBJECT_STORE_DELETE_ERROR and does not contain any buckets.
58
+ * @param { String } extId The UUID of the Object store.
59
+ * @param {Object} args Additional Arguments
60
+ * @return {Promise<TaskReferenceApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link TaskReferenceApiResponse } and HTTP response
61
+ */
62
+ deleteObjectstore(extId: string, ...args: any): Promise<TaskReferenceApiResponse>;
63
+ /**
64
+ * Get the details of an Object store certificate
65
+ * Get the details of the SSL certificate which can be used to connect to an Object store.
66
+ * @param { String } objectStoreExtId The UUID of the Object store.
67
+ * @param { String } extId The UUID of the certificate of an Object store.
68
+ * @param {Object} args Additional Arguments
69
+ * @return {Promise<CertificateApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link CertificateApiResponse } and HTTP response
70
+ */
71
+ getCertificate(objectStoreExtId: string, extId: string, ...args: any): Promise<CertificateApiResponse>;
72
+ /**
73
+ * Get a list of the SSL certificates of an Object store
74
+ * Get a list of the SSL certificates which can be used to access an Object store.
75
+ * @param { String } objectStoreExtId The UUID of the Object store.
76
+ * @param {Object} opts Optional parameters defined for the operation
77
+ * @param { Number } opts.$page A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
78
+
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
+
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
+ * - ca
85
+ * @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>
86
+ * The orderby can be applied to the following fields:<br>
87
+ * - ca
88
+ * @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.
89
+ - alternateFqdns
90
+ - ca
91
+ - extId
92
+ - links
93
+ - metadata
94
+ - privateKey
95
+ - publicCert
96
+ - tenantId
97
+
98
+ * @param {Object} args Additional Arguments
99
+ * @return {Promise<CertificateListApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link CertificateListApiResponse } and HTTP response
100
+ */
101
+ getCertificates(objectStoreExtId: string, opts: {
102
+ $page: number;
103
+ $limit: number;
104
+ $filter: string;
105
+ $orderby: string;
106
+ $select: string;
107
+ }, ...args: any): Promise<CertificateListApiResponse>;
108
+ /**
109
+ * Get an Object store
110
+ * 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;OBJECT_STORE_DEPLOYING\&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_ERROR state if the deployment fails. | | &#x60;\&quot;OBJECT_STORE_OPERATION_ERROR\&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_CREATE_CERT_ERROR\&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_ERROR state if the operation fails, or the OBJECT_STORE_AVAILABLE state if the operation is successful. | | &#x60;\&quot;OBJECT_STORE_INPUT\&quot;&#x60; | The Object store is in this state if it has not been deployed. | | &#x60;\&quot;OBJECT_STORE_CREATING_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_CREATE_CERT_ERROR 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_DELETE_INPUT_ERROR\&quot;&#x60; | An undeployed Object store enters this state if there is an error deleting it. Deleting the Object store can be retried from this state. | | &#x60;\&quot;OBJECT_STORE_DELETING_INPUT\&quot;&#x60; | An undeployed Object store being deleted is in this state. It will be either deleted or move to the OBJECT_STORE_DELETE_INPUT_ERROR state if the deletion fails. | | &#x60;\&quot;OBJECT_STORE_DELETE_ERROR\&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_ERROR\&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;OBJECT_STORE_DELETING\&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_DELETE_ERROR state if the deletion fails. |
111
+ * @param { String } extId The UUID of the Object store.
112
+ * @param {Object} opts Optional parameters defined for the operation
113
+ * @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.
114
+ - certificate
115
+
116
+ * @param {Object} args Additional Arguments
117
+ * @return {Promise<ObjectstoreApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ObjectstoreApiResponse } and HTTP response
118
+ */
119
+ getObjectstore(extId: string, opts: {
120
+ $expand: string;
121
+ }, ...args: any): Promise<ObjectstoreApiResponse>;
122
+ /**
123
+ * Get a list of the Object stores
124
+ * Get a list of all the Object store details on the registered Prism Central.
125
+ * @param {Object} opts Optional parameters defined for the operation
126
+ * @param { Number } opts.$page A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
127
+
128
+ * @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.
129
+
130
+ * @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>
131
+ * 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>
132
+ * The filter can be applied to the following fields:<br>
133
+ * - certificateReference<br>
134
+ * - clusterReference<br>
135
+ * - creationTime<br>
136
+ * - deploymentVersion<br>
137
+ * - description<br>
138
+ * - domain<br>
139
+ * - lastUpdateTime<br>
140
+ * - name<br>
141
+ * - numWorkerNodes<br>
142
+ * - publicNetworkReference<br>
143
+ * - region<br>
144
+ * - state<br>
145
+ * - storageNetworkDnsIp/ipv4/value<br>
146
+ * - storageNetworkDnsIp/ipv6/value<br>
147
+ * - storageNetworkReference<br>
148
+ * - storageNetworkVip/ipv4/value<br>
149
+ * - storageNetworkVip/ipv6/value<br>
150
+ * - totalCapacityGiB
151
+ * @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>
152
+ * The orderby can be applied to the following fields:<br>
153
+ * - certificateReference<br>
154
+ * - clusterReference<br>
155
+ * - creationTime<br>
156
+ * - deploymentVersion<br>
157
+ * - description<br>
158
+ * - domain<br>
159
+ * - lastUpdateTime<br>
160
+ * - name<br>
161
+ * - numWorkerNodes<br>
162
+ * - publicNetworkReference<br>
163
+ * - region<br>
164
+ * - state<br>
165
+ * - storageNetworkDnsIp/ipv4/value<br>
166
+ * - storageNetworkDnsIp/ipv6/value<br>
167
+ * - storageNetworkReference<br>
168
+ * - storageNetworkVip/ipv4/value<br>
169
+ * - storageNetworkVip/ipv6/value<br>
170
+ * - totalCapacityGiB
171
+ * @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.
172
+ - certificate
173
+
174
+ * @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.
175
+ - certificateReference
176
+ - clusterReference
177
+ - creationTime
178
+ - deploymentVersion
179
+ - description
180
+ - domain
181
+ - extId
182
+ - lastUpdateTime
183
+ - links
184
+ - metadata
185
+ - name
186
+ - numWorkerNodes
187
+ - publicNetworkIps
188
+ - publicNetworkReference
189
+ - region
190
+ - state
191
+ - storageNetworkDnsIp/ipv4/prefixLength
192
+ - storageNetworkDnsIp/ipv4/value
193
+ - storageNetworkDnsIp/ipv6/prefixLength
194
+ - storageNetworkDnsIp/ipv6/value
195
+ - storageNetworkReference
196
+ - storageNetworkVip/ipv4/prefixLength
197
+ - storageNetworkVip/ipv4/value
198
+ - storageNetworkVip/ipv6/prefixLength
199
+ - storageNetworkVip/ipv6/value
200
+ - tenantId
201
+ - totalCapacityGiB
202
+
203
+ * @param {Object} args Additional Arguments
204
+ * @return {Promise<ObjectstoreListApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ObjectstoreListApiResponse } and HTTP response
205
+ */
206
+ getObjectstores(opts: {
207
+ $page: number;
208
+ $limit: number;
209
+ $filter: string;
210
+ $orderby: string;
211
+ $expand: string;
212
+ $select: string;
213
+ }, ...args: any): Promise<ObjectstoreListApiResponse>;
214
+ /**
215
+ * Update an Object store
216
+ * Update an Object store. The deployment of an Object store can be restarted from the state OBJECT_STORE_DEPLOYMENT_ERROR.
217
+ * @param { Required<Pick<Objectstore, 'name'>> & Partial<Objectstore> } body specification
218
+ * @param { String } extId The UUID of the Object store.
219
+ * @param {Object} args Additional Arguments
220
+ * @return {Promise<TaskReferenceApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link TaskReferenceApiResponse } and HTTP response
221
+ */
222
+ updateObjectstore(extId: string, body: Required<Pick<Objectstore, 'name'>> & Partial<Objectstore>, ...args: any): Promise<TaskReferenceApiResponse>;
223
+ #private;
224
+ }
225
+ import TaskReferenceApiResponse from "../models/objects/v4/operations/TaskReferenceApiResponse";
226
+ import Objectstore from "../models/objects/v4/operations/Objectstore";
227
+ import CertificateApiResponse from "../models/objects/v4/operations/CertificateApiResponse";
228
+ import CertificateListApiResponse from "../models/objects/v4/operations/CertificateListApiResponse";
229
+ import ObjectstoreApiResponse from "../models/objects/v4/operations/ObjectstoreApiResponse";
230
+ import ObjectstoreListApiResponse from "../models/objects/v4/operations/ObjectstoreListApiResponse";
231
+ import { ApiClient } from "../ApiClient";