@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,432 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _MessageSeverity = _interopRequireDefault(require("../../../common/v1/config/MessageSeverity"));
8
+ var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
9
+ var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
10
+ var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+ 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); }
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+ 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."); }
15
+ 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); }
16
+ 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; }
17
+ 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; } }
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+ 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; }
20
+ 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; }
21
+ 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; }
22
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
+ 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); } }
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
26
+ 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); }
27
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
28
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
29
+ 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"); } /*
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 AppMessage model module.
43
+ * @module Ntnx/AppMessage
44
+ * @version 4.0.1-alpha-2
45
+ * @class AppMessage
46
+ */
47
+ var _AppMessage_brand = /*#__PURE__*/new WeakSet();
48
+ var AppMessage = exports["default"] = /*#__PURE__*/function () {
49
+ /**
50
+ * Constructs a new <code>AppMessage</code>.
51
+ * Message with associated severity describing status of the current operation.
52
+ * @alias module:Ntnx/AppMessage
53
+ */
54
+ function AppMessage() {
55
+ _classCallCheck(this, AppMessage);
56
+ /*
57
+ * toJson method for a map type which supports map with primitive keys and values of object types
58
+ * @param {Object} obj
59
+ * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
60
+ * Otherwise, just returns the input object.
61
+ */
62
+ _classPrivateMethodInitSpec(this, _AppMessage_brand);
63
+ this.$objectType = "objects.v4.error.AppMessage";
64
+ this.$reserved = {
65
+ '$fv': "v4.r0.a2"
66
+ };
67
+ this.$unknownFields = {};
68
+ }
69
+
70
+ /**
71
+ * Constructs a <code>AppMessage</code> from a plain JavaScript object, optionally creating a new instance.
72
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
73
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
74
+ * @param {module:Ntnx/AppMessage} obj Optional instance to populate.
75
+ * @param callFromChild {Boolean} Flag to recognise calling instance
76
+ * @return {module:Ntnx/AppMessage} The populated <code>AppMessage</code> instance.
77
+ */
78
+ return _createClass(AppMessage, [{
79
+ key: "getMessage",
80
+ value:
81
+ /**
82
+ * Returns The message string.
83
+ * @return {}
84
+ */
85
+ function getMessage() {
86
+ return this.message;
87
+ }
88
+
89
+ /**
90
+ * Sets The message string.
91
+ * @param {} message The message string.
92
+ */
93
+ }, {
94
+ key: "setMessage",
95
+ value: function setMessage(message) {
96
+ this.message = message;
97
+ }
98
+
99
+ /**
100
+ * @return {}
101
+ */
102
+ }, {
103
+ key: "getSeverity",
104
+ value: function getSeverity() {
105
+ return this.severity;
106
+ }
107
+
108
+ /**
109
+ * @param {} severity
110
+ */
111
+ }, {
112
+ key: "setSeverity",
113
+ value: function setSeverity(severity) {
114
+ this.severity = severity;
115
+ }
116
+
117
+ /**
118
+ * Returns The code associated with this message.This string is typically prefixed by the namespace the endpoint belongs to. For example: VMM-40000
119
+ * @return {}
120
+ */
121
+ }, {
122
+ key: "getCode",
123
+ value: function getCode() {
124
+ return this.code;
125
+ }
126
+
127
+ /**
128
+ * Sets The code associated with this message.This string is typically prefixed by the namespace the endpoint belongs to. For example: VMM-40000
129
+ * @param {} code The code associated with this message.This string is typically prefixed by the namespace the endpoint belongs to. For example: VMM-40000
130
+ */
131
+ }, {
132
+ key: "setCode",
133
+ value: function setCode(code) {
134
+ this.code = code;
135
+ }
136
+
137
+ /**
138
+ * Returns Locale for this message. The default locale would be 'en-US'.
139
+ * @return {}
140
+ */
141
+ }, {
142
+ key: "getLocale",
143
+ value: function getLocale() {
144
+ return this.locale;
145
+ }
146
+
147
+ /**
148
+ * Sets Locale for this message. The default locale would be 'en-US'.
149
+ * @param {} locale Locale for this message. The default locale would be 'en-US'.
150
+ */
151
+ }, {
152
+ key: "setLocale",
153
+ value: function setLocale(locale) {
154
+ this.locale = locale;
155
+ }
156
+
157
+ /**
158
+ * Returns The error group associated with this message of severity ERROR.
159
+ * @return {}
160
+ */
161
+ }, {
162
+ key: "getErrorGroup",
163
+ value: function getErrorGroup() {
164
+ return this.errorGroup;
165
+ }
166
+
167
+ /**
168
+ * Sets The error group associated with this message of severity ERROR.
169
+ * @param {} errorGroup The error group associated with this message of severity ERROR.
170
+ */
171
+ }, {
172
+ key: "setErrorGroup",
173
+ value: function setErrorGroup(errorGroup) {
174
+ this.errorGroup = errorGroup;
175
+ }
176
+
177
+ /**
178
+ * Returns The map of argument name to value.
179
+ * @return {}
180
+ */
181
+ }, {
182
+ key: "getArgumentsMap",
183
+ value: function getArgumentsMap() {
184
+ return this.argumentsMap;
185
+ }
186
+
187
+ /**
188
+ * Sets The map of argument name to value.
189
+ * @param {} argumentsMap The map of argument name to value.
190
+ */
191
+ }, {
192
+ key: "setArgumentsMap",
193
+ value: function setArgumentsMap(argumentsMap) {
194
+ this.argumentsMap = argumentsMap;
195
+ }
196
+ }, {
197
+ key: "get$Reserved",
198
+ value: function get$Reserved() {
199
+ return this.$reserved;
200
+ }
201
+ }, {
202
+ key: "get$ObjectType",
203
+ value: function get$ObjectType() {
204
+ return this.$objectType;
205
+ }
206
+ }, {
207
+ key: "get$UnknownFields",
208
+ value: function get$UnknownFields() {
209
+ return this.$unknownFields;
210
+ }
211
+ }, {
212
+ key: "toJson",
213
+ value: function toJson(forMutation) {
214
+ if (forMutation === false) {
215
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, typeof this.getMessage() !== 'undefined' && this.getMessage() !== null ? {
216
+ 'message': this.getMessage()
217
+ } : {}), typeof this.getSeverity() !== 'undefined' && this.getSeverity() !== null ? {
218
+ 'severity': this.getSeverity()
219
+ } : {}), typeof this.getCode() !== 'undefined' && this.getCode() !== null ? {
220
+ 'code': this.getCode()
221
+ } : {}), typeof this.getLocale() !== 'undefined' && this.getLocale() !== null ? {
222
+ 'locale': this.getLocale()
223
+ } : {}), typeof this.getErrorGroup() !== 'undefined' && this.getErrorGroup() !== null ? {
224
+ 'errorGroup': this.getErrorGroup()
225
+ } : {}), typeof this.getArgumentsMap() !== 'undefined' && this.getArgumentsMap() !== null ? {
226
+ 'argumentsMap': _assertClassBrand(_AppMessage_brand, this, _toJsonMapType).call(this, this.getArgumentsMap(), false)
227
+ } : {}), {}, {
228
+ '$reserved': this.get$Reserved(),
229
+ '$objectType': this.get$ObjectType(),
230
+ '$unknownFields': this.get$UnknownFields()
231
+ });
232
+ }
233
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, typeof this.getMessage() !== 'undefined' && this.getMessage() !== null ? {
234
+ 'message': this.getMessage()
235
+ } : {}), typeof this.getSeverity() !== 'undefined' && this.getSeverity() !== null ? {
236
+ 'severity': this.getSeverity()
237
+ } : {}), typeof this.getCode() !== 'undefined' && this.getCode() !== null ? {
238
+ 'code': this.getCode()
239
+ } : {}), typeof this.getLocale() !== 'undefined' && this.getLocale() !== null ? {
240
+ 'locale': this.getLocale()
241
+ } : {}), typeof this.getErrorGroup() !== 'undefined' && this.getErrorGroup() !== null ? {
242
+ 'errorGroup': this.getErrorGroup()
243
+ } : {}), typeof this.getArgumentsMap() !== 'undefined' && this.getArgumentsMap() !== null ? {
244
+ 'argumentsMap': _assertClassBrand(_AppMessage_brand, this, _toJsonMapType).call(this, this.getArgumentsMap())
245
+ } : {}), {}, {
246
+ '$reserved': this.get$Reserved(),
247
+ '$objectType': this.get$ObjectType(),
248
+ '$unknownFields': this.get$UnknownFields()
249
+ });
250
+ }
251
+ }, {
252
+ key: "validate",
253
+ value: function validate(scope, properties) {
254
+ var _this = this;
255
+ var propList = [];
256
+ if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes["default"]) {
257
+ //cases validate() and validate(scope)
258
+ propList = [];
259
+ } else if (arguments.length === 1) {
260
+ //case validate(properties)
261
+ propList = arguments[0];
262
+ scope = null;
263
+ } else {
264
+ //case validate(scope, properties)
265
+ propList = arguments[1];
266
+ }
267
+ var res = [];
268
+ var err = null;
269
+ propList.forEach(function (property) {
270
+ err = _this.validateProperty(property, scope);
271
+ if (err) {
272
+ res.push(err);
273
+ }
274
+ });
275
+ return new Promise(function (resolve, reject) {
276
+ if (res.length !== 0) {
277
+ reject(err);
278
+ } else {
279
+ resolve();
280
+ }
281
+ });
282
+ }
283
+ }, {
284
+ key: "validateProperty",
285
+ value: function validateProperty(scope, property) {
286
+ if (property === "message") {
287
+ if (typeof this.message === 'undefined' || this.message === null) {
288
+ return new _ValidationError["default"]("message", "undefined or null");
289
+ }
290
+ }
291
+ if (property === "severity") {
292
+ if (typeof this.severity === 'undefined' || this.severity === null) {
293
+ return new _ValidationError["default"]("severity", "undefined or null");
294
+ }
295
+ }
296
+ if (property === "code") {
297
+ if (typeof this.code === 'undefined' || this.code === null) {
298
+ return new _ValidationError["default"]("code", "undefined or null");
299
+ }
300
+ }
301
+ if (property === "locale") {
302
+ if (typeof this.locale === 'undefined' || this.locale === null) {
303
+ return new _ValidationError["default"]("locale", "undefined or null");
304
+ }
305
+ }
306
+ if (property === "errorGroup") {
307
+ if (typeof this.errorGroup === 'undefined' || this.errorGroup === null) {
308
+ return new _ValidationError["default"]("errorGroup", "undefined or null");
309
+ }
310
+ }
311
+ if (property === "argumentsMap") {
312
+ if (typeof this.argumentsMap === 'undefined' || this.argumentsMap === null) {
313
+ return new _ValidationError["default"]("argumentsMap", "undefined or null");
314
+ }
315
+ }
316
+ if (property === "$reserved") {
317
+ if (typeof this.$reserved === 'undefined' || this.$reserved === null) {
318
+ return new _ValidationError["default"]("$reserved", "undefined or null");
319
+ }
320
+ }
321
+ if (property === "$objectType") {
322
+ if (typeof this.$objectType === 'undefined' || this.$objectType === null) {
323
+ return new _ValidationError["default"]("$objectType", "undefined or null");
324
+ }
325
+ }
326
+ if (property === "$unknownFields") {
327
+ if (typeof this.$unknownFields === 'undefined' || this.$unknownFields === null) {
328
+ return new _ValidationError["default"]("$unknownFields", "undefined or null");
329
+ }
330
+ }
331
+ return new _ValidationError["default"](property, "no such property exists");
332
+ }
333
+ }], [{
334
+ key: "constructFromObject",
335
+ value: function constructFromObject(data, obj) {
336
+ var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
337
+ var items, item, i, itemArr, discriminator;
338
+ if (data) {
339
+ obj = obj || new AppMessage();
340
+ if (data.hasOwnProperty('message') && data.message !== null && data.message !== undefined) {
341
+ obj.setMessage(data['message']);
342
+ }
343
+ if (data.hasOwnProperty('severity') && data.severity !== null && data.severity !== undefined) {
344
+ obj.setSeverity(_MessageSeverity["default"].constructFromObject(data['severity']));
345
+ }
346
+ if (data.hasOwnProperty('code') && data.code !== null && data.code !== undefined) {
347
+ obj.setCode(data['code']);
348
+ }
349
+ if (data.hasOwnProperty('locale') && data.locale !== null && data.locale !== undefined) {
350
+ obj.setLocale(data['locale']);
351
+ }
352
+ if (data.hasOwnProperty('errorGroup') && data.errorGroup !== null && data.errorGroup !== undefined) {
353
+ obj.setErrorGroup(data['errorGroup']);
354
+ }
355
+ if (data.hasOwnProperty('argumentsMap') && data.argumentsMap !== null && data.argumentsMap !== undefined) {
356
+ obj.setArgumentsMap(data['argumentsMap']);
357
+ }
358
+ if (data.hasOwnProperty('$reserved')) {
359
+ obj.$reserved = data['$reserved'];
360
+ }
361
+ if (data.hasOwnProperty('$objectType')) {
362
+ obj.$objectType = data['$objectType'];
363
+ }
364
+ if (data.hasOwnProperty('$unknownFields')) {
365
+ obj.$unknownFields = data['$unknownFields'];
366
+ }
367
+ if (!callFromChild) {
368
+ obj.$unknownFields = _objectSpread({}, data.$unknownFields);
369
+ for (var property in data) {
370
+ if (!Object.keys(obj).includes(property) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
371
+ obj.$unknownFields[property] = data[property];
372
+ }
373
+ }
374
+ }
375
+ }
376
+ return obj;
377
+ }
378
+ }]);
379
+ }();
380
+ /**
381
+ * The message string.
382
+ * @memberof AppMessage
383
+ */
384
+ function _toJsonMapType(obj, forMutation) {
385
+ if (obj instanceof Map) {
386
+ return Object.fromEntries(Array.from(obj, function (_ref) {
387
+ var _ref2 = _slicedToArray(_ref, 2),
388
+ k = _ref2[0],
389
+ v = _ref2[1];
390
+ return [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v];
391
+ }));
392
+ } else if (_typeof(obj) === 'object' && obj != null && obj.constructor === Object) {
393
+ return Object.fromEntries(Array.from(Object.entries(obj), function (entry) {
394
+ return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
395
+ }));
396
+ }
397
+ return obj;
398
+ }
399
+ AppMessage.prototype.message = undefined;
400
+
401
+ /**
402
+ * @memberof AppMessage
403
+ */
404
+ AppMessage.prototype.severity = undefined;
405
+
406
+ /**
407
+ * The code associated with this message.This string is typically prefixed by the namespace the endpoint belongs to. For example: VMM-40000
408
+ * @memberof AppMessage
409
+ */
410
+ AppMessage.prototype.code = undefined;
411
+
412
+ /**
413
+ * Locale for this message. The default locale would be 'en-US'.
414
+ * @memberof AppMessage
415
+ * @default 'en_US'
416
+ */
417
+ AppMessage.prototype.locale = 'en_US';
418
+
419
+ /**
420
+ * The error group associated with this message of severity ERROR.
421
+ * @memberof AppMessage
422
+ */
423
+ AppMessage.prototype.errorGroup = undefined;
424
+
425
+ /**
426
+ * The map of argument name to value.
427
+ * @memberof AppMessage
428
+ */
429
+ AppMessage.prototype.argumentsMap = undefined;
430
+ AppMessage.prototype.$reserved = undefined;
431
+ AppMessage.prototype.$objectType = undefined;
432
+ AppMessage.prototype.$unknownFields = undefined;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The ErrorResponse model module.
3
+ * @module Ntnx/ErrorResponse
4
+ * @version 4.0.1-alpha-2
5
+ * @class ErrorResponse
6
+ */
7
+ export default class ErrorResponse {
8
+ /**
9
+ * Constructs a <code>ErrorResponse</code> from a plain JavaScript object, optionally creating a new instance.
10
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
11
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
12
+ * @param {module:Ntnx/ErrorResponse} obj Optional instance to populate.
13
+ * @param callFromChild {Boolean} Flag to recognise calling instance
14
+ * @return {module:Ntnx/ErrorResponse} The populated <code>ErrorResponse</code> instance.
15
+ */
16
+ static constructFromObject(data: any, obj: any, callFromChild?: boolean): any;
17
+ $objectType: string;
18
+ $reserved: {
19
+ $fv: string;
20
+ };
21
+ $unknownFields: {};
22
+ /**
23
+ * @return {}
24
+ */
25
+ getError(): any;
26
+ /**
27
+ * @param {} error
28
+ */
29
+ setError(error: any): void;
30
+ error: any;
31
+ get$Reserved(): {
32
+ $fv: string;
33
+ };
34
+ get$ObjectType(): string;
35
+ get$UnknownFields(): {};
36
+ toJson(forMutation: any): {
37
+ $reserved: {
38
+ $fv: string;
39
+ };
40
+ $objectType: string;
41
+ $unknownFields: {};
42
+ error?: any;
43
+ };
44
+ validate(scope: any, properties: any, ...args: any[]): Promise<any>;
45
+ validateProperty(scope: any, property: any): ValidationError;
46
+ #private;
47
+ }
48
+ import ValidationError from "../../../validation/ValidationError";