@blues-inc/notehub-js 1.0.4

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 (83) hide show
  1. package/README.md +297 -0
  2. package/dist/ApiClient.js +699 -0
  3. package/dist/api/AuthorizationApi.js +74 -0
  4. package/dist/api/BillingAccountApi.js +68 -0
  5. package/dist/api/DeviceApi.js +784 -0
  6. package/dist/api/DevicesApi.js +293 -0
  7. package/dist/api/EnvironmentVariablesApi.js +567 -0
  8. package/dist/api/EventApi.js +284 -0
  9. package/dist/api/FilesApi.js +193 -0
  10. package/dist/api/FleetApi.js +715 -0
  11. package/dist/api/NotesApi.js +435 -0
  12. package/dist/api/ProductApi.js +163 -0
  13. package/dist/api/ProjectApi.js +716 -0
  14. package/dist/api/RouteApi.js +266 -0
  15. package/dist/index.js +566 -0
  16. package/dist/model/Aws.js +233 -0
  17. package/dist/model/Azure.js +166 -0
  18. package/dist/model/BillingAccount.js +130 -0
  19. package/dist/model/BillingAccountRole.js +42 -0
  20. package/dist/model/Body.js +78 -0
  21. package/dist/model/Contact.js +118 -0
  22. package/dist/model/CreateFleetRequest.js +83 -0
  23. package/dist/model/CreateProductRequest.js +142 -0
  24. package/dist/model/CreateProjectRequest.js +119 -0
  25. package/dist/model/DFUEnv.js +97 -0
  26. package/dist/model/DFUState.js +276 -0
  27. package/dist/model/DeleteDeviceFleetsRequest.js +106 -0
  28. package/dist/model/Device.js +267 -0
  29. package/dist/model/DeviceSession.js +537 -0
  30. package/dist/model/DeviceTowerInfo.js +102 -0
  31. package/dist/model/DeviceUsage.js +150 -0
  32. package/dist/model/EnvironmentVariables.js +103 -0
  33. package/dist/model/Error.js +164 -0
  34. package/dist/model/Event.js +676 -0
  35. package/dist/model/Fleet.js +129 -0
  36. package/dist/model/GetBillingAccounts200Response.js +103 -0
  37. package/dist/model/GetDeviceEnvironmentVariables200Response.js +117 -0
  38. package/dist/model/GetDeviceHealthLog200Response.js +123 -0
  39. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +125 -0
  40. package/dist/model/GetDeviceLatest200Response.js +104 -0
  41. package/dist/model/GetDevicePublicKey200Response.js +119 -0
  42. package/dist/model/GetDeviceSessions200Response.js +133 -0
  43. package/dist/model/GetProjectDevicePublicKeys200Response.js +133 -0
  44. package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +94 -0
  45. package/dist/model/GetProjectDevices200Response.js +133 -0
  46. package/dist/model/GetProjectEvents200Response.js +149 -0
  47. package/dist/model/GetProjectEventsByCursor200Response.js +149 -0
  48. package/dist/model/GetProjectFleets200Response.js +123 -0
  49. package/dist/model/GetProjectMembers200Response.js +123 -0
  50. package/dist/model/GetProjectProducts200Response.js +103 -0
  51. package/dist/model/GetProjects200Response.js +103 -0
  52. package/dist/model/Google.js +142 -0
  53. package/dist/model/HandleNoteChanges200Response.js +97 -0
  54. package/dist/model/HandleNoteGet200Response.js +101 -0
  55. package/dist/model/HandleNoteSignal200Response.js +79 -0
  56. package/dist/model/HandleNotefileChanges200Response.js +97 -0
  57. package/dist/model/HandleNotefileChangesPending200Response.js +106 -0
  58. package/dist/model/HandleNotefileDeleteRequest.js +83 -0
  59. package/dist/model/Http.js +163 -0
  60. package/dist/model/HttpFilter.js +128 -0
  61. package/dist/model/HttpTransform.js +139 -0
  62. package/dist/model/Location.js +167 -0
  63. package/dist/model/Login200Response.js +82 -0
  64. package/dist/model/LoginRequest.js +94 -0
  65. package/dist/model/Mqtt.js +240 -0
  66. package/dist/model/Note.js +90 -0
  67. package/dist/model/Product.js +141 -0
  68. package/dist/model/Project.js +165 -0
  69. package/dist/model/ProjectMember.js +131 -0
  70. package/dist/model/Proxy.js +128 -0
  71. package/dist/model/PutDeviceFleetsRequest.js +106 -0
  72. package/dist/model/Radresponder.js +130 -0
  73. package/dist/model/Role.js +43 -0
  74. package/dist/model/Route.js +245 -0
  75. package/dist/model/RouteSchema.js +427 -0
  76. package/dist/model/Snowflake.js +185 -0
  77. package/dist/model/SnowflakeTransform.js +97 -0
  78. package/dist/model/Thingworx.js +154 -0
  79. package/dist/model/TowerLocation.js +204 -0
  80. package/dist/model/Twilio.js +181 -0
  81. package/dist/model/UpdateFleetRequest.js +109 -0
  82. package/dist/model/UserDbRoute.js +131 -0
  83. package/package.json +49 -0
@@ -0,0 +1,240 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _HttpFilter = _interopRequireDefault(require("./HttpFilter"));
9
+ var _HttpTransform = _interopRequireDefault(require("./HttpTransform"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
+ /**
18
+ * The Mqtt model module.
19
+ * @module model/Mqtt
20
+ * @version 1.0.4
21
+ */
22
+ var Mqtt = /*#__PURE__*/function () {
23
+ /**
24
+ * Constructs a new <code>Mqtt</code>.
25
+ * Route settings specific to MQTT routes. Only used for MQTT route types
26
+ * @alias module:model/Mqtt
27
+ */
28
+ function Mqtt() {
29
+ _classCallCheck(this, Mqtt);
30
+ Mqtt.initialize(this);
31
+ }
32
+
33
+ /**
34
+ * Initializes the fields of this object.
35
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
36
+ * Only for internal use.
37
+ */
38
+ _createClass(Mqtt, null, [{
39
+ key: "initialize",
40
+ value: function initialize(obj) {}
41
+
42
+ /**
43
+ * Constructs a <code>Mqtt</code> from a plain JavaScript object, optionally creating a new instance.
44
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
45
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
46
+ * @param {module:model/Mqtt} obj Optional instance to populate.
47
+ * @return {module:model/Mqtt} The populated <code>Mqtt</code> instance.
48
+ */
49
+ }, {
50
+ key: "constructFromObject",
51
+ value: function constructFromObject(data, obj) {
52
+ if (data) {
53
+ obj = obj || new Mqtt();
54
+ if (data.hasOwnProperty('fleets')) {
55
+ obj['fleets'] = _ApiClient["default"].convertToType(data['fleets'], ['String']);
56
+ }
57
+ if (data.hasOwnProperty('filter')) {
58
+ obj['filter'] = _HttpFilter["default"].constructFromObject(data['filter']);
59
+ }
60
+ if (data.hasOwnProperty('transform')) {
61
+ obj['transform'] = _HttpTransform["default"].constructFromObject(data['transform']);
62
+ }
63
+ if (data.hasOwnProperty('throttle_ms')) {
64
+ obj['throttle_ms'] = _ApiClient["default"].convertToType(data['throttle_ms'], 'Number');
65
+ }
66
+ if (data.hasOwnProperty('timeout')) {
67
+ obj['timeout'] = _ApiClient["default"].convertToType(data['timeout'], 'Number');
68
+ }
69
+ if (data.hasOwnProperty('broker')) {
70
+ obj['broker'] = _ApiClient["default"].convertToType(data['broker'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('port')) {
73
+ obj['port'] = _ApiClient["default"].convertToType(data['port'], 'Number');
74
+ }
75
+ if (data.hasOwnProperty('username')) {
76
+ obj['username'] = _ApiClient["default"].convertToType(data['username'], 'String');
77
+ }
78
+ if (data.hasOwnProperty('password')) {
79
+ obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('topic')) {
82
+ obj['topic'] = _ApiClient["default"].convertToType(data['topic'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('certificate')) {
85
+ obj['certificate'] = _ApiClient["default"].convertToType(data['certificate'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('certificate_name')) {
88
+ obj['certificate_name'] = _ApiClient["default"].convertToType(data['certificate_name'], 'String');
89
+ }
90
+ if (data.hasOwnProperty('key')) {
91
+ obj['key'] = _ApiClient["default"].convertToType(data['key'], 'String');
92
+ }
93
+ if (data.hasOwnProperty('private_key_name')) {
94
+ obj['private_key_name'] = _ApiClient["default"].convertToType(data['private_key_name'], 'String');
95
+ }
96
+ } else if (data === null) {
97
+ return null;
98
+ }
99
+ return obj;
100
+ }
101
+
102
+ /**
103
+ * Validates the JSON data with respect to <code>Mqtt</code>.
104
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
105
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Mqtt</code>.
106
+ */
107
+ }, {
108
+ key: "validateJSON",
109
+ value: function validateJSON(data) {
110
+ // ensure the json data is an array
111
+ if (!Array.isArray(data['fleets'])) {
112
+ throw new Error("Expected the field `fleets` to be an array in the JSON data but got " + data['fleets']);
113
+ }
114
+ // validate the optional field `filter`
115
+ if (data['filter']) {
116
+ // data not null
117
+ _HttpFilter["default"].validateJSON(data['filter']);
118
+ }
119
+ // validate the optional field `transform`
120
+ if (data['transform']) {
121
+ // data not null
122
+ _HttpTransform["default"].validateJSON(data['transform']);
123
+ }
124
+ // ensure the json data is a string
125
+ if (data['broker'] && !(typeof data['broker'] === 'string' || data['broker'] instanceof String)) {
126
+ throw new Error("Expected the field `broker` to be a primitive type in the JSON string but got " + data['broker']);
127
+ }
128
+ // ensure the json data is a string
129
+ if (data['username'] && !(typeof data['username'] === 'string' || data['username'] instanceof String)) {
130
+ throw new Error("Expected the field `username` to be a primitive type in the JSON string but got " + data['username']);
131
+ }
132
+ // ensure the json data is a string
133
+ if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
134
+ throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
135
+ }
136
+ // ensure the json data is a string
137
+ if (data['topic'] && !(typeof data['topic'] === 'string' || data['topic'] instanceof String)) {
138
+ throw new Error("Expected the field `topic` to be a primitive type in the JSON string but got " + data['topic']);
139
+ }
140
+ // ensure the json data is a string
141
+ if (data['certificate'] && !(typeof data['certificate'] === 'string' || data['certificate'] instanceof String)) {
142
+ throw new Error("Expected the field `certificate` to be a primitive type in the JSON string but got " + data['certificate']);
143
+ }
144
+ // ensure the json data is a string
145
+ if (data['certificate_name'] && !(typeof data['certificate_name'] === 'string' || data['certificate_name'] instanceof String)) {
146
+ throw new Error("Expected the field `certificate_name` to be a primitive type in the JSON string but got " + data['certificate_name']);
147
+ }
148
+ // ensure the json data is a string
149
+ if (data['key'] && !(typeof data['key'] === 'string' || data['key'] instanceof String)) {
150
+ throw new Error("Expected the field `key` to be a primitive type in the JSON string but got " + data['key']);
151
+ }
152
+ // ensure the json data is a string
153
+ if (data['private_key_name'] && !(typeof data['private_key_name'] === 'string' || data['private_key_name'] instanceof String)) {
154
+ throw new Error("Expected the field `private_key_name` to be a primitive type in the JSON string but got " + data['private_key_name']);
155
+ }
156
+ return true;
157
+ }
158
+ }]);
159
+ return Mqtt;
160
+ }();
161
+ /**
162
+ * list of Fleet UIDs to apply route to, if any. If empty, applies to all Fleets
163
+ * @member {Array.<String>} fleets
164
+ */
165
+ Mqtt.prototype['fleets'] = undefined;
166
+
167
+ /**
168
+ * @member {module:model/HttpFilter} filter
169
+ */
170
+ Mqtt.prototype['filter'] = undefined;
171
+
172
+ /**
173
+ * @member {module:model/HttpTransform} transform
174
+ */
175
+ Mqtt.prototype['transform'] = undefined;
176
+
177
+ /**
178
+ * @member {Number} throttle_ms
179
+ */
180
+ Mqtt.prototype['throttle_ms'] = undefined;
181
+
182
+ /**
183
+ * Timeout in seconds for each request
184
+ * @member {Number} timeout
185
+ * @default 15
186
+ */
187
+ Mqtt.prototype['timeout'] = 15;
188
+
189
+ /**
190
+ * @member {String} broker
191
+ */
192
+ Mqtt.prototype['broker'] = undefined;
193
+
194
+ /**
195
+ * @member {Number} port
196
+ */
197
+ Mqtt.prototype['port'] = undefined;
198
+
199
+ /**
200
+ * @member {String} username
201
+ */
202
+ Mqtt.prototype['username'] = undefined;
203
+
204
+ /**
205
+ * @member {String} password
206
+ */
207
+ Mqtt.prototype['password'] = undefined;
208
+
209
+ /**
210
+ * @member {String} topic
211
+ */
212
+ Mqtt.prototype['topic'] = undefined;
213
+
214
+ /**
215
+ * Certificate with \\n newlines. Field is input only, will not show contents on GET operations.
216
+ * @member {String} certificate
217
+ */
218
+ Mqtt.prototype['certificate'] = undefined;
219
+
220
+ /**
221
+ * Name of certificate. If omitted, defaults to \"present\"
222
+ * @member {String} certificate_name
223
+ * @default 'present'
224
+ */
225
+ Mqtt.prototype['certificate_name'] = 'present';
226
+
227
+ /**
228
+ * Key with \\n newlines. Field is input only, will not show contents on GET operations.
229
+ * @member {String} key
230
+ */
231
+ Mqtt.prototype['key'] = undefined;
232
+
233
+ /**
234
+ * Name of key. If omitted, defaults to \"present\"
235
+ * @member {String} private_key_name
236
+ * @default 'present'
237
+ */
238
+ Mqtt.prototype['private_key_name'] = 'present';
239
+ var _default = Mqtt;
240
+ exports["default"] = _default;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+ 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); } }
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
+ /**
16
+ * The Note model module.
17
+ * @module model/Note
18
+ * @version 1.0.4
19
+ */
20
+ var Note = /*#__PURE__*/function () {
21
+ /**
22
+ * Constructs a new <code>Note</code>.
23
+ * @alias module:model/Note
24
+ */
25
+ function Note() {
26
+ _classCallCheck(this, Note);
27
+ Note.initialize(this);
28
+ }
29
+
30
+ /**
31
+ * Initializes the fields of this object.
32
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
33
+ * Only for internal use.
34
+ */
35
+ _createClass(Note, null, [{
36
+ key: "initialize",
37
+ value: function initialize(obj) {}
38
+
39
+ /**
40
+ * Constructs a <code>Note</code> from a plain JavaScript object, optionally creating a new instance.
41
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
42
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
43
+ * @param {module:model/Note} obj Optional instance to populate.
44
+ * @return {module:model/Note} The populated <code>Note</code> instance.
45
+ */
46
+ }, {
47
+ key: "constructFromObject",
48
+ value: function constructFromObject(data, obj) {
49
+ if (data) {
50
+ obj = obj || new Note();
51
+ if (data.hasOwnProperty('body')) {
52
+ obj['body'] = _ApiClient["default"].convertToType(data['body'], Object);
53
+ }
54
+ if (data.hasOwnProperty('payload')) {
55
+ obj['payload'] = _ApiClient["default"].convertToType(data['payload'], 'String');
56
+ }
57
+ } else if (data === null) {
58
+ return null;
59
+ }
60
+ return obj;
61
+ }
62
+
63
+ /**
64
+ * Validates the JSON data with respect to <code>Note</code>.
65
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
66
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Note</code>.
67
+ */
68
+ }, {
69
+ key: "validateJSON",
70
+ value: function validateJSON(data) {
71
+ // ensure the json data is a string
72
+ if (data['payload'] && !(typeof data['payload'] === 'string' || data['payload'] instanceof String)) {
73
+ throw new Error("Expected the field `payload` to be a primitive type in the JSON string but got " + data['payload']);
74
+ }
75
+ return true;
76
+ }
77
+ }]);
78
+ return Note;
79
+ }();
80
+ /**
81
+ * @member {Object} body
82
+ */
83
+ Note.prototype['body'] = undefined;
84
+
85
+ /**
86
+ * @member {String} payload
87
+ */
88
+ Note.prototype['payload'] = undefined;
89
+ var _default = Note;
90
+ exports["default"] = _default;
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
+ 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; } } }; }
11
+ 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); }
12
+ 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; }
13
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
+ 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); } }
15
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
+ /**
19
+ * The Product model module.
20
+ * @module model/Product
21
+ * @version 1.0.4
22
+ */
23
+ var Product = /*#__PURE__*/function () {
24
+ /**
25
+ * Constructs a new <code>Product</code>.
26
+ * @alias module:model/Product
27
+ * @param uid {String}
28
+ * @param label {String}
29
+ * @param disableDevicesByDefault {Boolean}
30
+ */
31
+ function Product(uid, label, disableDevicesByDefault) {
32
+ _classCallCheck(this, Product);
33
+ Product.initialize(this, uid, label, disableDevicesByDefault);
34
+ }
35
+
36
+ /**
37
+ * Initializes the fields of this object.
38
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
39
+ * Only for internal use.
40
+ */
41
+ _createClass(Product, null, [{
42
+ key: "initialize",
43
+ value: function initialize(obj, uid, label, disableDevicesByDefault) {
44
+ obj['uid'] = uid;
45
+ obj['label'] = label;
46
+ obj['disable_devices_by_default'] = disableDevicesByDefault;
47
+ }
48
+
49
+ /**
50
+ * Constructs a <code>Product</code> from a plain JavaScript object, optionally creating a new instance.
51
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
52
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
53
+ * @param {module:model/Product} obj Optional instance to populate.
54
+ * @return {module:model/Product} The populated <code>Product</code> instance.
55
+ */
56
+ }, {
57
+ key: "constructFromObject",
58
+ value: function constructFromObject(data, obj) {
59
+ if (data) {
60
+ obj = obj || new Product();
61
+ if (data.hasOwnProperty('uid')) {
62
+ obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
63
+ }
64
+ if (data.hasOwnProperty('label')) {
65
+ obj['label'] = _ApiClient["default"].convertToType(data['label'], 'String');
66
+ }
67
+ if (data.hasOwnProperty('auto_provision_fleets')) {
68
+ obj['auto_provision_fleets'] = _ApiClient["default"].convertToType(data['auto_provision_fleets'], ['String']);
69
+ }
70
+ if (data.hasOwnProperty('disable_devices_by_default')) {
71
+ obj['disable_devices_by_default'] = _ApiClient["default"].convertToType(data['disable_devices_by_default'], 'Boolean');
72
+ }
73
+ } else if (data === null) {
74
+ return null;
75
+ }
76
+ return obj;
77
+ }
78
+
79
+ /**
80
+ * Validates the JSON data with respect to <code>Product</code>.
81
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
82
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Product</code>.
83
+ */
84
+ }, {
85
+ key: "validateJSON",
86
+ value: function validateJSON(data) {
87
+ // check to make sure all required properties are present in the JSON string
88
+ var _iterator = _createForOfIteratorHelper(Product.RequiredProperties),
89
+ _step;
90
+ try {
91
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
92
+ var property = _step.value;
93
+ if (!data[property]) {
94
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
95
+ }
96
+ }
97
+ // ensure the json data is a string
98
+ } catch (err) {
99
+ _iterator.e(err);
100
+ } finally {
101
+ _iterator.f();
102
+ }
103
+ if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
104
+ throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
105
+ }
106
+ // ensure the json data is a string
107
+ if (data['label'] && !(typeof data['label'] === 'string' || data['label'] instanceof String)) {
108
+ throw new Error("Expected the field `label` to be a primitive type in the JSON string but got " + data['label']);
109
+ }
110
+ // ensure the json data is an array
111
+ if (!Array.isArray(data['auto_provision_fleets'])) {
112
+ throw new Error("Expected the field `auto_provision_fleets` to be an array in the JSON data but got " + data['auto_provision_fleets']);
113
+ }
114
+ return true;
115
+ }
116
+ }]);
117
+ return Product;
118
+ }();
119
+ Product.RequiredProperties = ["uid", "label", "disable_devices_by_default"];
120
+
121
+ /**
122
+ * @member {String} uid
123
+ */
124
+ Product.prototype['uid'] = undefined;
125
+
126
+ /**
127
+ * @member {String} label
128
+ */
129
+ Product.prototype['label'] = undefined;
130
+
131
+ /**
132
+ * @member {Array.<String>} auto_provision_fleets
133
+ */
134
+ Product.prototype['auto_provision_fleets'] = undefined;
135
+
136
+ /**
137
+ * @member {Boolean} disable_devices_by_default
138
+ */
139
+ Product.prototype['disable_devices_by_default'] = undefined;
140
+ var _default = Product;
141
+ exports["default"] = _default;
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _Contact = _interopRequireDefault(require("./Contact"));
9
+ var _Role = _interopRequireDefault(require("./Role"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
12
+ 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; } } }; }
13
+ 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); }
14
+ 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; }
15
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
+ 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); } }
17
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
+ /**
21
+ * The Project model module.
22
+ * @module model/Project
23
+ * @version 1.0.4
24
+ */
25
+ var Project = /*#__PURE__*/function () {
26
+ /**
27
+ * Constructs a new <code>Project</code>.
28
+ * @alias module:model/Project
29
+ * @param uid {String}
30
+ * @param label {String}
31
+ * @param created {Date}
32
+ */
33
+ function Project(uid, label, created) {
34
+ _classCallCheck(this, Project);
35
+ Project.initialize(this, uid, label, created);
36
+ }
37
+
38
+ /**
39
+ * Initializes the fields of this object.
40
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
41
+ * Only for internal use.
42
+ */
43
+ _createClass(Project, null, [{
44
+ key: "initialize",
45
+ value: function initialize(obj, uid, label, created) {
46
+ obj['uid'] = uid;
47
+ obj['label'] = label;
48
+ obj['created'] = created;
49
+ }
50
+
51
+ /**
52
+ * Constructs a <code>Project</code> from a plain JavaScript object, optionally creating a new instance.
53
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
54
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
55
+ * @param {module:model/Project} obj Optional instance to populate.
56
+ * @return {module:model/Project} The populated <code>Project</code> instance.
57
+ */
58
+ }, {
59
+ key: "constructFromObject",
60
+ value: function constructFromObject(data, obj) {
61
+ if (data) {
62
+ obj = obj || new Project();
63
+ if (data.hasOwnProperty('uid')) {
64
+ obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
65
+ }
66
+ if (data.hasOwnProperty('label')) {
67
+ obj['label'] = _ApiClient["default"].convertToType(data['label'], 'String');
68
+ }
69
+ if (data.hasOwnProperty('created')) {
70
+ obj['created'] = _ApiClient["default"].convertToType(data['created'], 'Date');
71
+ }
72
+ if (data.hasOwnProperty('role')) {
73
+ obj['role'] = _Role["default"].constructFromObject(data['role']);
74
+ }
75
+ if (data.hasOwnProperty('administrative_contact')) {
76
+ obj['administrative_contact'] = _Contact["default"].constructFromObject(data['administrative_contact']);
77
+ }
78
+ if (data.hasOwnProperty('technical_contact')) {
79
+ obj['technical_contact'] = _Contact["default"].constructFromObject(data['technical_contact']);
80
+ }
81
+ } else if (data === null) {
82
+ return null;
83
+ }
84
+ return obj;
85
+ }
86
+
87
+ /**
88
+ * Validates the JSON data with respect to <code>Project</code>.
89
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
90
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Project</code>.
91
+ */
92
+ }, {
93
+ key: "validateJSON",
94
+ value: function validateJSON(data) {
95
+ // check to make sure all required properties are present in the JSON string
96
+ var _iterator = _createForOfIteratorHelper(Project.RequiredProperties),
97
+ _step;
98
+ try {
99
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
100
+ var property = _step.value;
101
+ if (!data[property]) {
102
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
103
+ }
104
+ }
105
+ // ensure the json data is a string
106
+ } catch (err) {
107
+ _iterator.e(err);
108
+ } finally {
109
+ _iterator.f();
110
+ }
111
+ if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
112
+ throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
113
+ }
114
+ // ensure the json data is a string
115
+ if (data['label'] && !(typeof data['label'] === 'string' || data['label'] instanceof String)) {
116
+ throw new Error("Expected the field `label` to be a primitive type in the JSON string but got " + data['label']);
117
+ }
118
+ // validate the optional field `administrative_contact`
119
+ if (data['administrative_contact']) {
120
+ // data not null
121
+ _Contact["default"].validateJSON(data['administrative_contact']);
122
+ }
123
+ // validate the optional field `technical_contact`
124
+ if (data['technical_contact']) {
125
+ // data not null
126
+ _Contact["default"].validateJSON(data['technical_contact']);
127
+ }
128
+ return true;
129
+ }
130
+ }]);
131
+ return Project;
132
+ }();
133
+ Project.RequiredProperties = ["uid", "label", "created"];
134
+
135
+ /**
136
+ * @member {String} uid
137
+ */
138
+ Project.prototype['uid'] = undefined;
139
+
140
+ /**
141
+ * @member {String} label
142
+ */
143
+ Project.prototype['label'] = undefined;
144
+
145
+ /**
146
+ * @member {Date} created
147
+ */
148
+ Project.prototype['created'] = undefined;
149
+
150
+ /**
151
+ * @member {module:model/Role} role
152
+ */
153
+ Project.prototype['role'] = undefined;
154
+
155
+ /**
156
+ * @member {module:model/Contact} administrative_contact
157
+ */
158
+ Project.prototype['administrative_contact'] = undefined;
159
+
160
+ /**
161
+ * @member {module:model/Contact} technical_contact
162
+ */
163
+ Project.prototype['technical_contact'] = undefined;
164
+ var _default = Project;
165
+ exports["default"] = _default;