@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,338 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiResponseMetadata = _interopRequireDefault(require("../../../common/v1/response/ApiResponseMetadata"));
8
+ var _ErrorResponse = _interopRequireDefault(require("../error/ErrorResponse"));
9
+ var _Certificate = _interopRequireDefault(require("./Certificate"));
10
+ var _CertificateProjection = _interopRequireDefault(require("./CertificateProjection"));
11
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
12
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
13
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
14
+ var _Paginable2 = _interopRequireDefault(require("../../../../Paginable"));
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
+ 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); }
19
+ 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; }
20
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
21
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
+ 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); }
23
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
+ 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); } }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
30
+ 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); }
31
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
32
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
33
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
34
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
35
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
36
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
38
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
39
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
40
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } /*
41
+ * Nutanix Objects Storage Management APIs
42
+ *
43
+ * OpenAPI spec version: 4.0.1-alpha-2
44
+ *
45
+ * NOTE: This class is auto generated by the Open API Dev Platform.
46
+ *
47
+ * Open API Dev Platform Codegen version: 16.8.0.7344-RELEASE
48
+ *
49
+ * Do not edit the class manually.
50
+ *
51
+ */
52
+ /**
53
+ * The CertificateListApiResponse model module.
54
+ * @module Ntnx/CertificateListApiResponse
55
+ * @version 4.0.1-alpha-2
56
+ * @class CertificateListApiResponse
57
+ */
58
+ var _CertificateListApiResponse_brand = /*#__PURE__*/new WeakSet();
59
+ var CertificateListApiResponse = exports["default"] = /*#__PURE__*/function (_Paginable) {
60
+ /**
61
+ * Constructs a new <code>CertificateListApiResponse</code>.
62
+ * REST response for all response codes in API path /objects/v4.0.a2/operations/object-stores/{objectStoreExtId}/certificates Get operation
63
+ * @alias module:Ntnx/CertificateListApiResponse
64
+ */
65
+ function CertificateListApiResponse() {
66
+ var _this;
67
+ _classCallCheck(this, CertificateListApiResponse);
68
+ _this = _callSuper(this, CertificateListApiResponse);
69
+ /*
70
+ * toJson method for a map type which supports map with primitive keys and values of object types
71
+ * @param {Object} obj
72
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
73
+ * Otherwise, just returns the input object.
74
+ */
75
+ _classPrivateMethodInitSpec(_this, _CertificateListApiResponse_brand);
76
+ _this.$objectType = "objects.v4.operations.CertificateListApiResponse";
77
+ _this.$reserved = {
78
+ '$fv': "v4.r0.a2"
79
+ };
80
+ _this.$unknownFields = {};
81
+ return _this;
82
+ }
83
+
84
+ /**
85
+ * Constructs a <code>CertificateListApiResponse</code> from a plain JavaScript object, optionally creating a new instance.
86
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
87
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
88
+ * @param {module:Ntnx/CertificateListApiResponse} obj Optional instance to populate.
89
+ * @param callFromChild {Boolean} Flag to recognise calling instance
90
+ * @return {module:Ntnx/CertificateListApiResponse} The populated <code>CertificateListApiResponse</code> instance.
91
+ */
92
+ _inherits(CertificateListApiResponse, _Paginable);
93
+ return _createClass(CertificateListApiResponse, [{
94
+ key: "getMetadata",
95
+ value:
96
+ /**
97
+ * @return {}
98
+ */
99
+ function getMetadata() {
100
+ return this.metadata;
101
+ }
102
+
103
+ /**
104
+ * @param {} metadata
105
+ */
106
+ }, {
107
+ key: "setMetadata",
108
+ value: function setMetadata(metadata) {
109
+ this.metadata = metadata;
110
+ }
111
+
112
+ /**
113
+ * @return {}
114
+ */
115
+ }, {
116
+ key: "getData",
117
+ value: function getData() {
118
+ return this.data;
119
+ }
120
+
121
+ /**
122
+ * @param {} data
123
+ */
124
+ }, {
125
+ key: "setData",
126
+ value: function setData(data) {
127
+ this.data = data;
128
+ }
129
+ }, {
130
+ key: "get$Reserved",
131
+ value: function get$Reserved() {
132
+ return this.$reserved;
133
+ }
134
+ }, {
135
+ key: "get$ObjectType",
136
+ value: function get$ObjectType() {
137
+ return this.$objectType;
138
+ }
139
+ }, {
140
+ key: "get$UnknownFields",
141
+ value: function get$UnknownFields() {
142
+ return this.$unknownFields;
143
+ }
144
+ }, {
145
+ key: "toJson",
146
+ value: function toJson(forMutation) {
147
+ if (forMutation === false) {
148
+ return _objectSpread(_objectSpread(_objectSpread({}, typeof this.getMetadata() !== 'undefined' && this.getMetadata() !== null ? {
149
+ 'metadata': this.getMetadata().toJson(false)
150
+ } : {}), typeof this.getData() !== 'undefined' && this.getData() !== null ? {
151
+ 'data': typeof this.getData().toJson !== "undefined" ? this.getData().toJson(false) : Array.isArray(this.getData()) ? this.getData().map(function (item) {
152
+ return typeof item.toJson !== "undefined" ? item.toJson(false) : item;
153
+ }) : _assertClassBrand(_CertificateListApiResponse_brand, this, _toJsonMapType).call(this, this.getData(), false)
154
+ } : {}), {}, {
155
+ '$reserved': this.get$Reserved(),
156
+ '$objectType': this.get$ObjectType(),
157
+ '$unknownFields': this.get$UnknownFields()
158
+ });
159
+ }
160
+ return _objectSpread(_objectSpread(_objectSpread({}, typeof this.getMetadata() !== 'undefined' && this.getMetadata() !== null ? {
161
+ 'metadata': this.getMetadata().toJson(false)
162
+ } : {}), typeof this.getData() !== 'undefined' && this.getData() !== null ? {
163
+ 'data': typeof this.getData().toJson !== "undefined" ? this.getData().toJson() : Array.isArray(this.getData()) ? this.getData().map(function (item) {
164
+ return typeof item.toJson !== "undefined" ? item.toJson() : item;
165
+ }) : _assertClassBrand(_CertificateListApiResponse_brand, this, _toJsonMapType).call(this, this.getData())
166
+ } : {}), {}, {
167
+ '$reserved': this.get$Reserved(),
168
+ '$objectType': this.get$ObjectType(),
169
+ '$unknownFields': this.get$UnknownFields()
170
+ });
171
+ }
172
+ }, {
173
+ key: "validate",
174
+ value: function validate(scope, properties) {
175
+ var _this2 = this;
176
+ var propList = [];
177
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes["default"]) {
178
+ //cases validate() and validate(scope)
179
+ propList = [];
180
+ } else if (arguments.length === 1) {
181
+ //case validate(properties)
182
+ propList = arguments[0];
183
+ scope = null;
184
+ } else {
185
+ //case validate(scope, properties)
186
+ propList = arguments[1];
187
+ }
188
+ var res = [];
189
+ var err = null;
190
+ propList.forEach(function (property) {
191
+ err = _this2.validateProperty(property, scope);
192
+ if (err) {
193
+ res.push(err);
194
+ }
195
+ });
196
+ return new Promise(function (resolve, reject) {
197
+ if (res.length !== 0) {
198
+ reject(err);
199
+ } else {
200
+ resolve();
201
+ }
202
+ });
203
+ }
204
+ }, {
205
+ key: "validateProperty",
206
+ value: function validateProperty(scope, property) {
207
+ if (property === "metadata") {
208
+ if (typeof this.metadata === 'undefined' || this.metadata === null) {
209
+ return new _ValidationError["default"]("metadata", "undefined or null");
210
+ }
211
+ }
212
+ if (property === "data") {
213
+ if (typeof this.data === 'undefined' || this.data === null) {
214
+ return new _ValidationError["default"]("data", "undefined or null");
215
+ }
216
+ }
217
+ if (property === "$reserved") {
218
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
219
+ return new _ValidationError["default"]("$reserved", "undefined or null");
220
+ }
221
+ }
222
+ if (property === "$objectType") {
223
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
224
+ return new _ValidationError["default"]("$objectType", "undefined or null");
225
+ }
226
+ }
227
+ if (property === "$unknownFields") {
228
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
229
+ return new _ValidationError["default"]("$unknownFields", "undefined or null");
230
+ }
231
+ }
232
+ return new _ValidationError["default"](property, "no such property exists");
233
+ }
234
+ }], [{
235
+ key: "constructFromObject",
236
+ value: function constructFromObject(data, obj) {
237
+ var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
238
+ var items, item, i, itemArr, discriminator;
239
+ if (data) {
240
+ obj = obj || new CertificateListApiResponse();
241
+ if (data.hasOwnProperty('metadata')) {
242
+ _Paginable2["default"].constructFromObject(data['metadata'], obj);
243
+ }
244
+ if (data.hasOwnProperty('metadata') && data.metadata !== null && data.metadata !== undefined) {
245
+ obj.setMetadata(_ApiResponseMetadata["default"].constructFromObject(data['metadata']));
246
+ }
247
+ if (data.hasOwnProperty('data') && data.data !== null && data.data !== undefined) {
248
+ if (Array.isArray(data['data'])) {
249
+ if (data['data'].length === 0) {
250
+ obj.setData([]);
251
+ } else {
252
+ itemArr = [];
253
+ items = data['data'];
254
+ if (items[0].hasOwnProperty('$objectType')) {
255
+ discriminator = items[0]['$objectType'];
256
+ } else {
257
+ discriminator = _typeof(items[0]);
258
+ }
259
+ for (i = 0; i < items.length; i++) {
260
+ switch (discriminator) {
261
+ case 'objects.v4.operations.Certificate':
262
+ item = _Certificate["default"].constructFromObject(items[i], undefined);
263
+ itemArr.push(item);
264
+ break;
265
+ case 'objects.v4.operations.CertificateProjection':
266
+ item = _CertificateProjection["default"].constructFromObject(items[i], undefined);
267
+ itemArr.push(item);
268
+ break;
269
+ default:
270
+ throw "Unknown list of type " + discriminator + " in data";
271
+ }
272
+ }
273
+ obj.setData(itemArr);
274
+ }
275
+ } else {
276
+ if (data['data'].hasOwnProperty('$objectType')) {
277
+ discriminator = data['data']['$objectType'];
278
+ } else {
279
+ discriminator = _typeof(data['data']);
280
+ }
281
+ switch (discriminator) {
282
+ case 'objects.v4.error.ErrorResponse':
283
+ obj.setData(_ErrorResponse["default"].constructFromObject(data['data'], undefined));
284
+ break;
285
+ default:
286
+ throw "Unknown datatype " + discriminator + " in data";
287
+ }
288
+ }
289
+ }
290
+ if (data.hasOwnProperty('$reserved')) {
291
+ obj.$reserved = data['$reserved'];
292
+ }
293
+ if (data.hasOwnProperty('$objectType')) {
294
+ obj.$objectType = data['$objectType'];
295
+ }
296
+ if (data.hasOwnProperty('$unknownFields')) {
297
+ obj.$unknownFields = data['$unknownFields'];
298
+ }
299
+ if (!callFromChild) {
300
+ obj.$unknownFields = _objectSpread({}, data.$unknownFields);
301
+ for (var property in data) {
302
+ if (!Object.keys(obj).includes(property) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
303
+ obj.$unknownFields[property] = data[property];
304
+ }
305
+ }
306
+ }
307
+ }
308
+ return obj;
309
+ }
310
+ }]);
311
+ }(_Paginable2["default"]);
312
+ /**
313
+ * @memberof CertificateListApiResponse
314
+ */
315
+ function _toJsonMapType(obj, forMutation) {
316
+ if (obj instanceof Map) {
317
+ return Object.fromEntries(Array.from(obj, function (_ref) {
318
+ var _ref2 = _slicedToArray(_ref, 2),
319
+ k = _ref2[0],
320
+ v = _ref2[1];
321
+ return [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v];
322
+ }));
323
+ } else if (_typeof(obj) === 'object' && obj != null && obj.constructor === Object) {
324
+ return Object.fromEntries(Array.from(Object.entries(obj), function (entry) {
325
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
326
+ }));
327
+ }
328
+ return obj;
329
+ }
330
+ CertificateListApiResponse.prototype.metadata = undefined;
331
+
332
+ /**
333
+ * @memberof CertificateListApiResponse
334
+ */
335
+ CertificateListApiResponse.prototype.data = undefined;
336
+ CertificateListApiResponse.prototype.$reserved = undefined;
337
+ CertificateListApiResponse.prototype.$objectType = undefined;
338
+ CertificateListApiResponse.prototype.$unknownFields = undefined;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The CertificateProjection model module.
3
+ * @module Ntnx/CertificateProjection
4
+ * @version 4.0.1-alpha-2
5
+ * @class CertificateProjection
6
+ */
7
+ export default class CertificateProjection extends Certificate {
8
+ }
9
+ import Certificate from "./Certificate";
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _FQDN = _interopRequireDefault(require("../../../common/v1/config/FQDN"));
9
+ var _Metadata = _interopRequireDefault(require("../../../common/v1/config/Metadata"));
10
+ var _Certificate2 = _interopRequireDefault(require("./Certificate"));
11
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
12
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
13
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
+ 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); } }
20
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22
+ 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); }
23
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
24
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
25
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
26
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
27
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /*
30
+ * Nutanix Objects Storage Management APIs
31
+ *
32
+ * OpenAPI spec version: 4.0.1-alpha-2
33
+ *
34
+ * NOTE: This class is auto generated by the Open API Dev Platform.
35
+ *
36
+ * Open API Dev Platform Codegen version: 16.8.0.7344-RELEASE
37
+ *
38
+ * Do not edit the class manually.
39
+ *
40
+ */
41
+ /**
42
+ * The CertificateProjection model module.
43
+ * @module Ntnx/CertificateProjection
44
+ * @version 4.0.1-alpha-2
45
+ * @class CertificateProjection
46
+ */
47
+ var CertificateProjection = exports["default"] = /*#__PURE__*/function (_Certificate) {
48
+ /**
49
+ * Constructs a new <code>CertificateProjection</code>.
50
+ * @alias module:Ntnx/CertificateProjection
51
+ * @extends module:Ntnx/Certificate
52
+ */
53
+ function CertificateProjection() {
54
+ var _this;
55
+ _classCallCheck(this, CertificateProjection);
56
+ _this = _callSuper(this, CertificateProjection);
57
+ _this.$objectType = "objects.v4.operations.CertificateProjection";
58
+ _this.$reserved = {
59
+ '$fv': "v4.r0.a2"
60
+ };
61
+ _this.$unknownFields = {};
62
+ return _this;
63
+ }
64
+
65
+ /**
66
+ * Constructs a <code>CertificateProjection</code> from a plain JavaScript object, optionally creating a new instance.
67
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
68
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
69
+ * @param {module:Ntnx/CertificateProjection} obj Optional instance to populate.
70
+ * @param callFromChild {Boolean} Flag to recognise calling instance
71
+ * @return {module:Ntnx/CertificateProjection} The populated <code>CertificateProjection</code> instance.
72
+ */
73
+ _inherits(CertificateProjection, _Certificate);
74
+ return _createClass(CertificateProjection, [{
75
+ key: "validate",
76
+ value: function validate(scope, properties) {
77
+ var _this2 = this;
78
+ var propList = [];
79
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes["default"]) {
80
+ //cases validate() and validate(scope)
81
+ propList = [];
82
+ } else if (arguments.length === 1) {
83
+ //case validate(properties)
84
+ propList = arguments[0];
85
+ scope = null;
86
+ } else {
87
+ //case validate(scope, properties)
88
+ propList = arguments[1];
89
+ }
90
+ var res = [];
91
+ var err = null;
92
+ propList.forEach(function (property) {
93
+ err = _this2.validateProperty(property, scope);
94
+ if (err) {
95
+ res.push(err);
96
+ }
97
+ });
98
+ return new Promise(function (resolve, reject) {
99
+ if (res.length !== 0) {
100
+ reject(err);
101
+ } else {
102
+ resolve();
103
+ }
104
+ });
105
+ }
106
+ }, {
107
+ key: "validateProperty",
108
+ value: function validateProperty(scope, property) {
109
+ return new _ValidationError["default"](property, "no such property exists");
110
+ }
111
+ }], [{
112
+ key: "constructFromObject",
113
+ value: function constructFromObject(data, obj) {
114
+ var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
115
+ var items, item, i, itemArr, discriminator;
116
+ if (data) {
117
+ obj = obj || new CertificateProjection();
118
+ _Certificate2["default"].constructFromObject(data, obj, true);
119
+ if (!callFromChild) {
120
+ obj.$unknownFields = _objectSpread({}, data.$unknownFields);
121
+ for (var property in data) {
122
+ if (!Object.keys(obj).includes(property) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
123
+ obj.$unknownFields[property] = data[property];
124
+ }
125
+ }
126
+ }
127
+ }
128
+ return obj;
129
+ }
130
+ }]);
131
+ }(_Certificate2["default"]);