@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,276 @@
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 DFUState model module.
17
+ * @module model/DFUState
18
+ * @version 1.0.4
19
+ */
20
+ var DFUState = /*#__PURE__*/function () {
21
+ /**
22
+ * Constructs a new <code>DFUState</code>.
23
+ * @alias module:model/DFUState
24
+ */
25
+ function DFUState() {
26
+ _classCallCheck(this, DFUState);
27
+ DFUState.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(DFUState, null, [{
36
+ key: "initialize",
37
+ value: function initialize(obj) {}
38
+
39
+ /**
40
+ * Constructs a <code>DFUState</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/DFUState} obj Optional instance to populate.
44
+ * @return {module:model/DFUState} The populated <code>DFUState</code> instance.
45
+ */
46
+ }, {
47
+ key: "constructFromObject",
48
+ value: function constructFromObject(data, obj) {
49
+ if (data) {
50
+ obj = obj || new DFUState();
51
+ if (data.hasOwnProperty('type')) {
52
+ obj['type'] = _ApiClient["default"].convertToType(data['type'], 'String');
53
+ }
54
+ if (data.hasOwnProperty('file')) {
55
+ obj['file'] = _ApiClient["default"].convertToType(data['file'], 'String');
56
+ }
57
+ if (data.hasOwnProperty('length')) {
58
+ obj['length'] = _ApiClient["default"].convertToType(data['length'], 'Number');
59
+ }
60
+ if (data.hasOwnProperty('crc32')) {
61
+ obj['crc32'] = _ApiClient["default"].convertToType(data['crc32'], 'Number');
62
+ }
63
+ if (data.hasOwnProperty('md5')) {
64
+ obj['md5'] = _ApiClient["default"].convertToType(data['md5'], 'String');
65
+ }
66
+ if (data.hasOwnProperty('mode')) {
67
+ obj['mode'] = _ApiClient["default"].convertToType(data['mode'], 'String');
68
+ }
69
+ if (data.hasOwnProperty('status')) {
70
+ obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('began')) {
73
+ obj['began'] = _ApiClient["default"].convertToType(data['began'], 'Number');
74
+ }
75
+ if (data.hasOwnProperty('retry')) {
76
+ obj['retry'] = _ApiClient["default"].convertToType(data['retry'], 'Number');
77
+ }
78
+ if (data.hasOwnProperty('errors')) {
79
+ obj['errors'] = _ApiClient["default"].convertToType(data['errors'], 'Number');
80
+ }
81
+ if (data.hasOwnProperty('read')) {
82
+ obj['read'] = _ApiClient["default"].convertToType(data['read'], 'Number');
83
+ }
84
+ if (data.hasOwnProperty('updated')) {
85
+ obj['updated'] = _ApiClient["default"].convertToType(data['updated'], 'Number');
86
+ }
87
+ if (data.hasOwnProperty('version')) {
88
+ obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
89
+ }
90
+ } else if (data === null) {
91
+ return null;
92
+ }
93
+ return obj;
94
+ }
95
+
96
+ /**
97
+ * Validates the JSON data with respect to <code>DFUState</code>.
98
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
99
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DFUState</code>.
100
+ */
101
+ }, {
102
+ key: "validateJSON",
103
+ value: function validateJSON(data) {
104
+ // ensure the json data is a string
105
+ if (data['type'] && !(typeof data['type'] === 'string' || data['type'] instanceof String)) {
106
+ throw new Error("Expected the field `type` to be a primitive type in the JSON string but got " + data['type']);
107
+ }
108
+ // ensure the json data is a string
109
+ if (data['file'] && !(typeof data['file'] === 'string' || data['file'] instanceof String)) {
110
+ throw new Error("Expected the field `file` to be a primitive type in the JSON string but got " + data['file']);
111
+ }
112
+ // ensure the json data is a string
113
+ if (data['md5'] && !(typeof data['md5'] === 'string' || data['md5'] instanceof String)) {
114
+ throw new Error("Expected the field `md5` to be a primitive type in the JSON string but got " + data['md5']);
115
+ }
116
+ // ensure the json data is a string
117
+ if (data['mode'] && !(typeof data['mode'] === 'string' || data['mode'] instanceof String)) {
118
+ throw new Error("Expected the field `mode` to be a primitive type in the JSON string but got " + data['mode']);
119
+ }
120
+ // ensure the json data is a string
121
+ if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
122
+ throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
123
+ }
124
+ // ensure the json data is a string
125
+ if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
126
+ throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
127
+ }
128
+ return true;
129
+ }
130
+ }]);
131
+ return DFUState;
132
+ }();
133
+ /**
134
+ * @member {module:model/DFUState.TypeEnum} type
135
+ */
136
+ DFUState.prototype['type'] = undefined;
137
+
138
+ /**
139
+ * Firmware filename
140
+ * @member {String} file
141
+ */
142
+ DFUState.prototype['file'] = undefined;
143
+
144
+ /**
145
+ * Length of firmware file
146
+ * @member {Number} length
147
+ */
148
+ DFUState.prototype['length'] = undefined;
149
+
150
+ /**
151
+ * Used for image verification
152
+ * @member {Number} crc32
153
+ */
154
+ DFUState.prototype['crc32'] = undefined;
155
+
156
+ /**
157
+ * Used for image verification
158
+ * @member {String} md5
159
+ */
160
+ DFUState.prototype['md5'] = undefined;
161
+
162
+ /**
163
+ * * \"idle\" - nothing downloading or downloaded * \"error\" - halted and in the error state * \"downloading\" - transferring data from cloud to module * \"sideloading\" - transferring data via request to module * \"ready\" - DFU data is ready/verified and waiting on external storage * \"ready-retry\" - DFU data is ready/verified and retrying * \"updating\" - currently updating * \"completed\" - DFU is done successfully
164
+ * @member {module:model/DFUState.ModeEnum} mode
165
+ */
166
+ DFUState.prototype['mode'] = undefined;
167
+
168
+ /**
169
+ * Status message
170
+ * @member {String} status
171
+ */
172
+ DFUState.prototype['status'] = undefined;
173
+
174
+ /**
175
+ * The time when the DFU began
176
+ * @member {Number} began
177
+ */
178
+ DFUState.prototype['began'] = undefined;
179
+
180
+ /**
181
+ * Value of _fw_retry environment var at time of DFU initialization
182
+ * @member {Number} retry
183
+ */
184
+ DFUState.prototype['retry'] = undefined;
185
+
186
+ /**
187
+ * The number of consecutive errors the DFU process has encountered
188
+ * @member {Number} errors
189
+ */
190
+ DFUState.prototype['errors'] = undefined;
191
+
192
+ /**
193
+ * The amount the notecard has read of the image from notehub
194
+ * @member {Number} read
195
+ */
196
+ DFUState.prototype['read'] = undefined;
197
+
198
+ /**
199
+ * Last updated timestamp
200
+ * @member {Number} updated
201
+ */
202
+ DFUState.prototype['updated'] = undefined;
203
+
204
+ /**
205
+ * Last known version, which is generally a JSON object contained within the firmware image
206
+ * @member {String} version
207
+ */
208
+ DFUState.prototype['version'] = undefined;
209
+
210
+ /**
211
+ * Allowed values for the <code>type</code> property.
212
+ * @enum {String}
213
+ * @readonly
214
+ */
215
+ DFUState['TypeEnum'] = {
216
+ /**
217
+ * value: "card"
218
+ * @const
219
+ */
220
+ "card": "card",
221
+ /**
222
+ * value: "user"
223
+ * @const
224
+ */
225
+ "user": "user"
226
+ };
227
+
228
+ /**
229
+ * Allowed values for the <code>mode</code> property.
230
+ * @enum {String}
231
+ * @readonly
232
+ */
233
+ DFUState['ModeEnum'] = {
234
+ /**
235
+ * value: "idle"
236
+ * @const
237
+ */
238
+ "idle": "idle",
239
+ /**
240
+ * value: "error"
241
+ * @const
242
+ */
243
+ "error": "error",
244
+ /**
245
+ * value: "downloading"
246
+ * @const
247
+ */
248
+ "downloading": "downloading",
249
+ /**
250
+ * value: "sideloading"
251
+ * @const
252
+ */
253
+ "sideloading": "sideloading",
254
+ /**
255
+ * value: "ready"
256
+ * @const
257
+ */
258
+ "ready": "ready",
259
+ /**
260
+ * value: "ready-retry"
261
+ * @const
262
+ */
263
+ "ready-retry": "ready-retry",
264
+ /**
265
+ * value: "updating"
266
+ * @const
267
+ */
268
+ "updating": "updating",
269
+ /**
270
+ * value: "completed"
271
+ * @const
272
+ */
273
+ "completed": "completed"
274
+ };
275
+ var _default = DFUState;
276
+ exports["default"] = _default;
@@ -0,0 +1,106 @@
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 DeleteDeviceFleetsRequest model module.
20
+ * @module model/DeleteDeviceFleetsRequest
21
+ * @version 1.0.4
22
+ */
23
+ var DeleteDeviceFleetsRequest = /*#__PURE__*/function () {
24
+ /**
25
+ * Constructs a new <code>DeleteDeviceFleetsRequest</code>.
26
+ * @alias module:model/DeleteDeviceFleetsRequest
27
+ * @param fleetUids {Array.<String>} The fleetUIDs to remove from the device.
28
+ */
29
+ function DeleteDeviceFleetsRequest(fleetUids) {
30
+ _classCallCheck(this, DeleteDeviceFleetsRequest);
31
+ DeleteDeviceFleetsRequest.initialize(this, fleetUids);
32
+ }
33
+
34
+ /**
35
+ * Initializes the fields of this object.
36
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
37
+ * Only for internal use.
38
+ */
39
+ _createClass(DeleteDeviceFleetsRequest, null, [{
40
+ key: "initialize",
41
+ value: function initialize(obj, fleetUids) {
42
+ obj['fleet_uids'] = fleetUids;
43
+ }
44
+
45
+ /**
46
+ * Constructs a <code>DeleteDeviceFleetsRequest</code> from a plain JavaScript object, optionally creating a new instance.
47
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
48
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
49
+ * @param {module:model/DeleteDeviceFleetsRequest} obj Optional instance to populate.
50
+ * @return {module:model/DeleteDeviceFleetsRequest} The populated <code>DeleteDeviceFleetsRequest</code> instance.
51
+ */
52
+ }, {
53
+ key: "constructFromObject",
54
+ value: function constructFromObject(data, obj) {
55
+ if (data) {
56
+ obj = obj || new DeleteDeviceFleetsRequest();
57
+ if (data.hasOwnProperty('fleet_uids')) {
58
+ obj['fleet_uids'] = _ApiClient["default"].convertToType(data['fleet_uids'], ['String']);
59
+ }
60
+ } else if (data === null) {
61
+ return null;
62
+ }
63
+ return obj;
64
+ }
65
+
66
+ /**
67
+ * Validates the JSON data with respect to <code>DeleteDeviceFleetsRequest</code>.
68
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
69
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DeleteDeviceFleetsRequest</code>.
70
+ */
71
+ }, {
72
+ key: "validateJSON",
73
+ value: function validateJSON(data) {
74
+ // check to make sure all required properties are present in the JSON string
75
+ var _iterator = _createForOfIteratorHelper(DeleteDeviceFleetsRequest.RequiredProperties),
76
+ _step;
77
+ try {
78
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
79
+ var property = _step.value;
80
+ if (!data[property]) {
81
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
82
+ }
83
+ }
84
+ // ensure the json data is an array
85
+ } catch (err) {
86
+ _iterator.e(err);
87
+ } finally {
88
+ _iterator.f();
89
+ }
90
+ if (!Array.isArray(data['fleet_uids'])) {
91
+ throw new Error("Expected the field `fleet_uids` to be an array in the JSON data but got " + data['fleet_uids']);
92
+ }
93
+ return true;
94
+ }
95
+ }]);
96
+ return DeleteDeviceFleetsRequest;
97
+ }();
98
+ DeleteDeviceFleetsRequest.RequiredProperties = ["fleet_uids"];
99
+
100
+ /**
101
+ * The fleetUIDs to remove from the device.
102
+ * @member {Array.<String>} fleet_uids
103
+ */
104
+ DeleteDeviceFleetsRequest.prototype['fleet_uids'] = undefined;
105
+ var _default = DeleteDeviceFleetsRequest;
106
+ exports["default"] = _default;
@@ -0,0 +1,267 @@
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 _DFUEnv = _interopRequireDefault(require("./DFUEnv"));
10
+ var _DeviceTowerInfo = _interopRequireDefault(require("./DeviceTowerInfo"));
11
+ var _Location = _interopRequireDefault(require("./Location"));
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+ 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); }
14
+ 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; } } }; }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
+ 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); } }
19
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
20
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
21
+ 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); }
22
+ /**
23
+ * The Device model module.
24
+ * @module model/Device
25
+ * @version 1.0.4
26
+ */
27
+ var Device = /*#__PURE__*/function () {
28
+ /**
29
+ * Constructs a new <code>Device</code>.
30
+ * @alias module:model/Device
31
+ * @param uid {String}
32
+ * @param serialNumber {String}
33
+ * @param provisioned {Date}
34
+ * @param productUid {String}
35
+ * @param fleetUids {Array.<String>}
36
+ * @param voltage {Number}
37
+ * @param temperature {Number}
38
+ */
39
+ function Device(uid, serialNumber, provisioned, productUid, fleetUids, voltage, temperature) {
40
+ _classCallCheck(this, Device);
41
+ Device.initialize(this, uid, serialNumber, provisioned, productUid, fleetUids, voltage, temperature);
42
+ }
43
+
44
+ /**
45
+ * Initializes the fields of this object.
46
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
47
+ * Only for internal use.
48
+ */
49
+ _createClass(Device, null, [{
50
+ key: "initialize",
51
+ value: function initialize(obj, uid, serialNumber, provisioned, productUid, fleetUids, voltage, temperature) {
52
+ obj['uid'] = uid;
53
+ obj['serial_number'] = serialNumber;
54
+ obj['provisioned'] = provisioned;
55
+ obj['product_uid'] = productUid;
56
+ obj['fleet_uids'] = fleetUids;
57
+ obj['voltage'] = voltage;
58
+ obj['temperature'] = temperature;
59
+ }
60
+
61
+ /**
62
+ * Constructs a <code>Device</code> from a plain JavaScript object, optionally creating a new instance.
63
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
64
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
65
+ * @param {module:model/Device} obj Optional instance to populate.
66
+ * @return {module:model/Device} The populated <code>Device</code> instance.
67
+ */
68
+ }, {
69
+ key: "constructFromObject",
70
+ value: function constructFromObject(data, obj) {
71
+ if (data) {
72
+ obj = obj || new Device();
73
+ if (data.hasOwnProperty('uid')) {
74
+ obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
75
+ }
76
+ if (data.hasOwnProperty('serial_number')) {
77
+ obj['serial_number'] = _ApiClient["default"].convertToType(data['serial_number'], 'String');
78
+ }
79
+ if (data.hasOwnProperty('provisioned')) {
80
+ obj['provisioned'] = _ApiClient["default"].convertToType(data['provisioned'], 'Date');
81
+ }
82
+ if (data.hasOwnProperty('last_activity')) {
83
+ obj['last_activity'] = _ApiClient["default"].convertToType(data['last_activity'], 'Date');
84
+ }
85
+ if (data.hasOwnProperty('contact')) {
86
+ obj['contact'] = _Contact["default"].constructFromObject(data['contact']);
87
+ }
88
+ if (data.hasOwnProperty('product_uid')) {
89
+ obj['product_uid'] = _ApiClient["default"].convertToType(data['product_uid'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('fleet_uids')) {
92
+ obj['fleet_uids'] = _ApiClient["default"].convertToType(data['fleet_uids'], ['String']);
93
+ }
94
+ if (data.hasOwnProperty('tower_info')) {
95
+ obj['tower_info'] = _DeviceTowerInfo["default"].constructFromObject(data['tower_info']);
96
+ }
97
+ if (data.hasOwnProperty('tower_location')) {
98
+ obj['tower_location'] = _Location["default"].constructFromObject(data['tower_location']);
99
+ }
100
+ if (data.hasOwnProperty('gps_location')) {
101
+ obj['gps_location'] = _Location["default"].constructFromObject(data['gps_location']);
102
+ }
103
+ if (data.hasOwnProperty('triangulated_location')) {
104
+ obj['triangulated_location'] = _Location["default"].constructFromObject(data['triangulated_location']);
105
+ }
106
+ if (data.hasOwnProperty('voltage')) {
107
+ obj['voltage'] = _ApiClient["default"].convertToType(data['voltage'], 'Number');
108
+ }
109
+ if (data.hasOwnProperty('temperature')) {
110
+ obj['temperature'] = _ApiClient["default"].convertToType(data['temperature'], 'Number');
111
+ }
112
+ if (data.hasOwnProperty('dfu')) {
113
+ obj['dfu'] = _DFUEnv["default"].constructFromObject(data['dfu']);
114
+ }
115
+ } else if (data === null) {
116
+ return null;
117
+ }
118
+ return obj;
119
+ }
120
+
121
+ /**
122
+ * Validates the JSON data with respect to <code>Device</code>.
123
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
124
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Device</code>.
125
+ */
126
+ }, {
127
+ key: "validateJSON",
128
+ value: function validateJSON(data) {
129
+ // check to make sure all required properties are present in the JSON string
130
+ var _iterator = _createForOfIteratorHelper(Device.RequiredProperties),
131
+ _step;
132
+ try {
133
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
134
+ var property = _step.value;
135
+ if (!data[property]) {
136
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
137
+ }
138
+ }
139
+ // ensure the json data is a string
140
+ } catch (err) {
141
+ _iterator.e(err);
142
+ } finally {
143
+ _iterator.f();
144
+ }
145
+ if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
146
+ throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
147
+ }
148
+ // ensure the json data is a string
149
+ if (data['serial_number'] && !(typeof data['serial_number'] === 'string' || data['serial_number'] instanceof String)) {
150
+ throw new Error("Expected the field `serial_number` to be a primitive type in the JSON string but got " + data['serial_number']);
151
+ }
152
+ // validate the optional field `contact`
153
+ if (data['contact']) {
154
+ // data not null
155
+ _Contact["default"].validateJSON(data['contact']);
156
+ }
157
+ // ensure the json data is a string
158
+ if (data['product_uid'] && !(typeof data['product_uid'] === 'string' || data['product_uid'] instanceof String)) {
159
+ throw new Error("Expected the field `product_uid` to be a primitive type in the JSON string but got " + data['product_uid']);
160
+ }
161
+ // ensure the json data is an array
162
+ if (!Array.isArray(data['fleet_uids'])) {
163
+ throw new Error("Expected the field `fleet_uids` to be an array in the JSON data but got " + data['fleet_uids']);
164
+ }
165
+ // validate the optional field `tower_info`
166
+ if (data['tower_info']) {
167
+ // data not null
168
+ _DeviceTowerInfo["default"].validateJSON(data['tower_info']);
169
+ }
170
+ // validate the optional field `tower_location`
171
+ if (data['tower_location']) {
172
+ // data not null
173
+ _Location["default"].validateJSON(data['tower_location']);
174
+ }
175
+ // validate the optional field `gps_location`
176
+ if (data['gps_location']) {
177
+ // data not null
178
+ _Location["default"].validateJSON(data['gps_location']);
179
+ }
180
+ // validate the optional field `triangulated_location`
181
+ if (data['triangulated_location']) {
182
+ // data not null
183
+ _Location["default"].validateJSON(data['triangulated_location']);
184
+ }
185
+ // validate the optional field `dfu`
186
+ if (data['dfu']) {
187
+ // data not null
188
+ _DFUEnv["default"].validateJSON(data['dfu']);
189
+ }
190
+ return true;
191
+ }
192
+ }]);
193
+ return Device;
194
+ }();
195
+ Device.RequiredProperties = ["uid", "serial_number", "provisioned", "product_uid", "fleet_uids", "voltage", "temperature"];
196
+
197
+ /**
198
+ * @member {String} uid
199
+ */
200
+ Device.prototype['uid'] = undefined;
201
+
202
+ /**
203
+ * @member {String} serial_number
204
+ */
205
+ Device.prototype['serial_number'] = undefined;
206
+
207
+ /**
208
+ * @member {Date} provisioned
209
+ */
210
+ Device.prototype['provisioned'] = undefined;
211
+
212
+ /**
213
+ * @member {Date} last_activity
214
+ */
215
+ Device.prototype['last_activity'] = undefined;
216
+
217
+ /**
218
+ * @member {module:model/Contact} contact
219
+ */
220
+ Device.prototype['contact'] = undefined;
221
+
222
+ /**
223
+ * @member {String} product_uid
224
+ */
225
+ Device.prototype['product_uid'] = undefined;
226
+
227
+ /**
228
+ * @member {Array.<String>} fleet_uids
229
+ */
230
+ Device.prototype['fleet_uids'] = undefined;
231
+
232
+ /**
233
+ * @member {module:model/DeviceTowerInfo} tower_info
234
+ */
235
+ Device.prototype['tower_info'] = undefined;
236
+
237
+ /**
238
+ * @member {module:model/Location} tower_location
239
+ */
240
+ Device.prototype['tower_location'] = undefined;
241
+
242
+ /**
243
+ * @member {module:model/Location} gps_location
244
+ */
245
+ Device.prototype['gps_location'] = undefined;
246
+
247
+ /**
248
+ * @member {module:model/Location} triangulated_location
249
+ */
250
+ Device.prototype['triangulated_location'] = undefined;
251
+
252
+ /**
253
+ * @member {Number} voltage
254
+ */
255
+ Device.prototype['voltage'] = undefined;
256
+
257
+ /**
258
+ * @member {Number} temperature
259
+ */
260
+ Device.prototype['temperature'] = undefined;
261
+
262
+ /**
263
+ * @member {module:model/DFUEnv} dfu
264
+ */
265
+ Device.prototype['dfu'] = undefined;
266
+ var _default = Device;
267
+ exports["default"] = _default;