@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,676 @@
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 Event model module.
17
+ * @module model/Event
18
+ * @version 1.0.4
19
+ */
20
+ var Event = /*#__PURE__*/function () {
21
+ /**
22
+ * Constructs a new <code>Event</code>.
23
+ * @alias module:model/Event
24
+ */
25
+ function Event() {
26
+ _classCallCheck(this, Event);
27
+ Event.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(Event, null, [{
36
+ key: "initialize",
37
+ value: function initialize(obj) {}
38
+
39
+ /**
40
+ * Constructs a <code>Event</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/Event} obj Optional instance to populate.
44
+ * @return {module:model/Event} The populated <code>Event</code> instance.
45
+ */
46
+ }, {
47
+ key: "constructFromObject",
48
+ value: function constructFromObject(data, obj) {
49
+ if (data) {
50
+ obj = obj || new Event();
51
+ if (data.hasOwnProperty('event')) {
52
+ obj['event'] = _ApiClient["default"].convertToType(data['event'], 'String');
53
+ }
54
+ if (data.hasOwnProperty('session')) {
55
+ obj['session'] = _ApiClient["default"].convertToType(data['session'], 'String');
56
+ }
57
+ if (data.hasOwnProperty('tls')) {
58
+ obj['tls'] = _ApiClient["default"].convertToType(data['tls'], 'Boolean');
59
+ }
60
+ if (data.hasOwnProperty('best_id')) {
61
+ obj['best_id'] = _ApiClient["default"].convertToType(data['best_id'], 'String');
62
+ }
63
+ if (data.hasOwnProperty('device')) {
64
+ obj['device'] = _ApiClient["default"].convertToType(data['device'], 'String');
65
+ }
66
+ if (data.hasOwnProperty('sn')) {
67
+ obj['sn'] = _ApiClient["default"].convertToType(data['sn'], 'String');
68
+ }
69
+ if (data.hasOwnProperty('product')) {
70
+ obj['product'] = _ApiClient["default"].convertToType(data['product'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('app')) {
73
+ obj['app'] = _ApiClient["default"].convertToType(data['app'], 'String');
74
+ }
75
+ if (data.hasOwnProperty('received')) {
76
+ obj['received'] = _ApiClient["default"].convertToType(data['received'], 'Number');
77
+ }
78
+ if (data.hasOwnProperty('req')) {
79
+ obj['req'] = _ApiClient["default"].convertToType(data['req'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('when')) {
82
+ obj['when'] = _ApiClient["default"].convertToType(data['when'], 'Number');
83
+ }
84
+ if (data.hasOwnProperty('file')) {
85
+ obj['file'] = _ApiClient["default"].convertToType(data['file'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('note')) {
88
+ obj['note'] = _ApiClient["default"].convertToType(data['note'], 'String');
89
+ }
90
+ if (data.hasOwnProperty('updates')) {
91
+ obj['updates'] = _ApiClient["default"].convertToType(data['updates'], 'Number');
92
+ }
93
+ if (data.hasOwnProperty('body')) {
94
+ obj['body'] = _ApiClient["default"].convertToType(data['body'], Object);
95
+ }
96
+ if (data.hasOwnProperty('payload')) {
97
+ obj['payload'] = _ApiClient["default"].convertToType(data['payload'], 'String');
98
+ }
99
+ if (data.hasOwnProperty('best_location_type')) {
100
+ obj['best_location_type'] = _ApiClient["default"].convertToType(data['best_location_type'], 'String');
101
+ }
102
+ if (data.hasOwnProperty('best_location_when')) {
103
+ obj['best_location_when'] = _ApiClient["default"].convertToType(data['best_location_when'], 'Number');
104
+ }
105
+ if (data.hasOwnProperty('best_lat')) {
106
+ obj['best_lat'] = _ApiClient["default"].convertToType(data['best_lat'], 'Number');
107
+ }
108
+ if (data.hasOwnProperty('best_lon')) {
109
+ obj['best_lon'] = _ApiClient["default"].convertToType(data['best_lon'], 'Number');
110
+ }
111
+ if (data.hasOwnProperty('best_location')) {
112
+ obj['best_location'] = _ApiClient["default"].convertToType(data['best_location'], 'String');
113
+ }
114
+ if (data.hasOwnProperty('best_country')) {
115
+ obj['best_country'] = _ApiClient["default"].convertToType(data['best_country'], 'String');
116
+ }
117
+ if (data.hasOwnProperty('best_timezone')) {
118
+ obj['best_timezone'] = _ApiClient["default"].convertToType(data['best_timezone'], 'String');
119
+ }
120
+ if (data.hasOwnProperty('where_olc')) {
121
+ obj['where_olc'] = _ApiClient["default"].convertToType(data['where_olc'], 'String');
122
+ }
123
+ if (data.hasOwnProperty('where_when')) {
124
+ obj['where_when'] = _ApiClient["default"].convertToType(data['where_when'], 'Number');
125
+ }
126
+ if (data.hasOwnProperty('where_lat')) {
127
+ obj['where_lat'] = _ApiClient["default"].convertToType(data['where_lat'], 'Number');
128
+ }
129
+ if (data.hasOwnProperty('where_lon')) {
130
+ obj['where_lon'] = _ApiClient["default"].convertToType(data['where_lon'], 'Number');
131
+ }
132
+ if (data.hasOwnProperty('where_location')) {
133
+ obj['where_location'] = _ApiClient["default"].convertToType(data['where_location'], 'String');
134
+ }
135
+ if (data.hasOwnProperty('where_country')) {
136
+ obj['where_country'] = _ApiClient["default"].convertToType(data['where_country'], 'String');
137
+ }
138
+ if (data.hasOwnProperty('where_timezone')) {
139
+ obj['where_timezone'] = _ApiClient["default"].convertToType(data['where_timezone'], 'String');
140
+ }
141
+ if (data.hasOwnProperty('tower_when')) {
142
+ obj['tower_when'] = _ApiClient["default"].convertToType(data['tower_when'], 'Number');
143
+ }
144
+ if (data.hasOwnProperty('tower_lat')) {
145
+ obj['tower_lat'] = _ApiClient["default"].convertToType(data['tower_lat'], 'Number');
146
+ }
147
+ if (data.hasOwnProperty('tower_lon')) {
148
+ obj['tower_lon'] = _ApiClient["default"].convertToType(data['tower_lon'], 'Number');
149
+ }
150
+ if (data.hasOwnProperty('tower_country')) {
151
+ obj['tower_country'] = _ApiClient["default"].convertToType(data['tower_country'], 'String');
152
+ }
153
+ if (data.hasOwnProperty('tower_location')) {
154
+ obj['tower_location'] = _ApiClient["default"].convertToType(data['tower_location'], 'String');
155
+ }
156
+ if (data.hasOwnProperty('tower_timezone')) {
157
+ obj['tower_timezone'] = _ApiClient["default"].convertToType(data['tower_timezone'], 'String');
158
+ }
159
+ if (data.hasOwnProperty('tower_id')) {
160
+ obj['tower_id'] = _ApiClient["default"].convertToType(data['tower_id'], 'String');
161
+ }
162
+ if (data.hasOwnProperty('tri_when')) {
163
+ obj['tri_when'] = _ApiClient["default"].convertToType(data['tri_when'], 'Number');
164
+ }
165
+ if (data.hasOwnProperty('tri_lat')) {
166
+ obj['tri_lat'] = _ApiClient["default"].convertToType(data['tri_lat'], 'Number');
167
+ }
168
+ if (data.hasOwnProperty('tri_lon')) {
169
+ obj['tri_lon'] = _ApiClient["default"].convertToType(data['tri_lon'], 'Number');
170
+ }
171
+ if (data.hasOwnProperty('tri_location')) {
172
+ obj['tri_location'] = _ApiClient["default"].convertToType(data['tri_location'], 'String');
173
+ }
174
+ if (data.hasOwnProperty('tri_country')) {
175
+ obj['tri_country'] = _ApiClient["default"].convertToType(data['tri_country'], 'String');
176
+ }
177
+ if (data.hasOwnProperty('tri_timezone')) {
178
+ obj['tri_timezone'] = _ApiClient["default"].convertToType(data['tri_timezone'], 'String');
179
+ }
180
+ if (data.hasOwnProperty('tri_points')) {
181
+ obj['tri_points'] = _ApiClient["default"].convertToType(data['tri_points'], 'Number');
182
+ }
183
+ if (data.hasOwnProperty('moved')) {
184
+ obj['moved'] = _ApiClient["default"].convertToType(data['moved'], 'Number');
185
+ }
186
+ if (data.hasOwnProperty('orientation')) {
187
+ obj['orientation'] = _ApiClient["default"].convertToType(data['orientation'], 'String');
188
+ }
189
+ if (data.hasOwnProperty('rssi')) {
190
+ obj['rssi'] = _ApiClient["default"].convertToType(data['rssi'], 'Number');
191
+ }
192
+ if (data.hasOwnProperty('sinr')) {
193
+ obj['sinr'] = _ApiClient["default"].convertToType(data['sinr'], 'Number');
194
+ }
195
+ if (data.hasOwnProperty('rsrp')) {
196
+ obj['rsrp'] = _ApiClient["default"].convertToType(data['rsrp'], 'Number');
197
+ }
198
+ if (data.hasOwnProperty('rsrq')) {
199
+ obj['rsrq'] = _ApiClient["default"].convertToType(data['rsrq'], 'Number');
200
+ }
201
+ if (data.hasOwnProperty('rat')) {
202
+ obj['rat'] = _ApiClient["default"].convertToType(data['rat'], 'String');
203
+ }
204
+ if (data.hasOwnProperty('bars')) {
205
+ obj['bars'] = _ApiClient["default"].convertToType(data['bars'], 'Number');
206
+ }
207
+ if (data.hasOwnProperty('voltage')) {
208
+ obj['voltage'] = _ApiClient["default"].convertToType(data['voltage'], 'Number');
209
+ }
210
+ if (data.hasOwnProperty('temp')) {
211
+ obj['temp'] = _ApiClient["default"].convertToType(data['temp'], 'Number');
212
+ }
213
+ if (data.hasOwnProperty('environment')) {
214
+ obj['environment'] = _ApiClient["default"].convertToType(data['environment'], Object);
215
+ }
216
+ } else if (data === null) {
217
+ return null;
218
+ }
219
+ return obj;
220
+ }
221
+
222
+ /**
223
+ * Validates the JSON data with respect to <code>Event</code>.
224
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
225
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Event</code>.
226
+ */
227
+ }, {
228
+ key: "validateJSON",
229
+ value: function validateJSON(data) {
230
+ // ensure the json data is a string
231
+ if (data['event'] && !(typeof data['event'] === 'string' || data['event'] instanceof String)) {
232
+ throw new Error("Expected the field `event` to be a primitive type in the JSON string but got " + data['event']);
233
+ }
234
+ // ensure the json data is a string
235
+ if (data['session'] && !(typeof data['session'] === 'string' || data['session'] instanceof String)) {
236
+ throw new Error("Expected the field `session` to be a primitive type in the JSON string but got " + data['session']);
237
+ }
238
+ // ensure the json data is a string
239
+ if (data['best_id'] && !(typeof data['best_id'] === 'string' || data['best_id'] instanceof String)) {
240
+ throw new Error("Expected the field `best_id` to be a primitive type in the JSON string but got " + data['best_id']);
241
+ }
242
+ // ensure the json data is a string
243
+ if (data['device'] && !(typeof data['device'] === 'string' || data['device'] instanceof String)) {
244
+ throw new Error("Expected the field `device` to be a primitive type in the JSON string but got " + data['device']);
245
+ }
246
+ // ensure the json data is a string
247
+ if (data['sn'] && !(typeof data['sn'] === 'string' || data['sn'] instanceof String)) {
248
+ throw new Error("Expected the field `sn` to be a primitive type in the JSON string but got " + data['sn']);
249
+ }
250
+ // ensure the json data is a string
251
+ if (data['product'] && !(typeof data['product'] === 'string' || data['product'] instanceof String)) {
252
+ throw new Error("Expected the field `product` to be a primitive type in the JSON string but got " + data['product']);
253
+ }
254
+ // ensure the json data is a string
255
+ if (data['app'] && !(typeof data['app'] === 'string' || data['app'] instanceof String)) {
256
+ throw new Error("Expected the field `app` to be a primitive type in the JSON string but got " + data['app']);
257
+ }
258
+ // ensure the json data is a string
259
+ if (data['req'] && !(typeof data['req'] === 'string' || data['req'] instanceof String)) {
260
+ throw new Error("Expected the field `req` to be a primitive type in the JSON string but got " + data['req']);
261
+ }
262
+ // ensure the json data is a string
263
+ if (data['file'] && !(typeof data['file'] === 'string' || data['file'] instanceof String)) {
264
+ throw new Error("Expected the field `file` to be a primitive type in the JSON string but got " + data['file']);
265
+ }
266
+ // ensure the json data is a string
267
+ if (data['note'] && !(typeof data['note'] === 'string' || data['note'] instanceof String)) {
268
+ throw new Error("Expected the field `note` to be a primitive type in the JSON string but got " + data['note']);
269
+ }
270
+ // ensure the json data is a string
271
+ if (data['payload'] && !(typeof data['payload'] === 'string' || data['payload'] instanceof String)) {
272
+ throw new Error("Expected the field `payload` to be a primitive type in the JSON string but got " + data['payload']);
273
+ }
274
+ // ensure the json data is a string
275
+ if (data['best_location_type'] && !(typeof data['best_location_type'] === 'string' || data['best_location_type'] instanceof String)) {
276
+ throw new Error("Expected the field `best_location_type` to be a primitive type in the JSON string but got " + data['best_location_type']);
277
+ }
278
+ // ensure the json data is a string
279
+ if (data['best_location'] && !(typeof data['best_location'] === 'string' || data['best_location'] instanceof String)) {
280
+ throw new Error("Expected the field `best_location` to be a primitive type in the JSON string but got " + data['best_location']);
281
+ }
282
+ // ensure the json data is a string
283
+ if (data['best_country'] && !(typeof data['best_country'] === 'string' || data['best_country'] instanceof String)) {
284
+ throw new Error("Expected the field `best_country` to be a primitive type in the JSON string but got " + data['best_country']);
285
+ }
286
+ // ensure the json data is a string
287
+ if (data['best_timezone'] && !(typeof data['best_timezone'] === 'string' || data['best_timezone'] instanceof String)) {
288
+ throw new Error("Expected the field `best_timezone` to be a primitive type in the JSON string but got " + data['best_timezone']);
289
+ }
290
+ // ensure the json data is a string
291
+ if (data['where_olc'] && !(typeof data['where_olc'] === 'string' || data['where_olc'] instanceof String)) {
292
+ throw new Error("Expected the field `where_olc` to be a primitive type in the JSON string but got " + data['where_olc']);
293
+ }
294
+ // ensure the json data is a string
295
+ if (data['where_location'] && !(typeof data['where_location'] === 'string' || data['where_location'] instanceof String)) {
296
+ throw new Error("Expected the field `where_location` to be a primitive type in the JSON string but got " + data['where_location']);
297
+ }
298
+ // ensure the json data is a string
299
+ if (data['where_country'] && !(typeof data['where_country'] === 'string' || data['where_country'] instanceof String)) {
300
+ throw new Error("Expected the field `where_country` to be a primitive type in the JSON string but got " + data['where_country']);
301
+ }
302
+ // ensure the json data is a string
303
+ if (data['where_timezone'] && !(typeof data['where_timezone'] === 'string' || data['where_timezone'] instanceof String)) {
304
+ throw new Error("Expected the field `where_timezone` to be a primitive type in the JSON string but got " + data['where_timezone']);
305
+ }
306
+ // ensure the json data is a string
307
+ if (data['tower_country'] && !(typeof data['tower_country'] === 'string' || data['tower_country'] instanceof String)) {
308
+ throw new Error("Expected the field `tower_country` to be a primitive type in the JSON string but got " + data['tower_country']);
309
+ }
310
+ // ensure the json data is a string
311
+ if (data['tower_location'] && !(typeof data['tower_location'] === 'string' || data['tower_location'] instanceof String)) {
312
+ throw new Error("Expected the field `tower_location` to be a primitive type in the JSON string but got " + data['tower_location']);
313
+ }
314
+ // ensure the json data is a string
315
+ if (data['tower_timezone'] && !(typeof data['tower_timezone'] === 'string' || data['tower_timezone'] instanceof String)) {
316
+ throw new Error("Expected the field `tower_timezone` to be a primitive type in the JSON string but got " + data['tower_timezone']);
317
+ }
318
+ // ensure the json data is a string
319
+ if (data['tower_id'] && !(typeof data['tower_id'] === 'string' || data['tower_id'] instanceof String)) {
320
+ throw new Error("Expected the field `tower_id` to be a primitive type in the JSON string but got " + data['tower_id']);
321
+ }
322
+ // ensure the json data is a string
323
+ if (data['tri_location'] && !(typeof data['tri_location'] === 'string' || data['tri_location'] instanceof String)) {
324
+ throw new Error("Expected the field `tri_location` to be a primitive type in the JSON string but got " + data['tri_location']);
325
+ }
326
+ // ensure the json data is a string
327
+ if (data['tri_country'] && !(typeof data['tri_country'] === 'string' || data['tri_country'] instanceof String)) {
328
+ throw new Error("Expected the field `tri_country` to be a primitive type in the JSON string but got " + data['tri_country']);
329
+ }
330
+ // ensure the json data is a string
331
+ if (data['tri_timezone'] && !(typeof data['tri_timezone'] === 'string' || data['tri_timezone'] instanceof String)) {
332
+ throw new Error("Expected the field `tri_timezone` to be a primitive type in the JSON string but got " + data['tri_timezone']);
333
+ }
334
+ // ensure the json data is a string
335
+ if (data['orientation'] && !(typeof data['orientation'] === 'string' || data['orientation'] instanceof String)) {
336
+ throw new Error("Expected the field `orientation` to be a primitive type in the JSON string but got " + data['orientation']);
337
+ }
338
+ // ensure the json data is a string
339
+ if (data['rat'] && !(typeof data['rat'] === 'string' || data['rat'] instanceof String)) {
340
+ throw new Error("Expected the field `rat` to be a primitive type in the JSON string but got " + data['rat']);
341
+ }
342
+ return true;
343
+ }
344
+ }]);
345
+ return Event;
346
+ }();
347
+ /**
348
+ * Event UID (globally unique)
349
+ * @member {String} event
350
+ */
351
+ Event.prototype['event'] = undefined;
352
+
353
+ /**
354
+ * Session UID (globally unique)
355
+ * @member {String} session
356
+ */
357
+ Event.prototype['session'] = undefined;
358
+
359
+ /**
360
+ * Whether TLS was used on the connection between the device and notehub. Only available on _session.qo events.
361
+ * @member {Boolean} tls
362
+ */
363
+ Event.prototype['tls'] = undefined;
364
+
365
+ /**
366
+ * The device serial number, or the DeviceUID if the serial number is not set
367
+ * @member {String} best_id
368
+ */
369
+ Event.prototype['best_id'] = undefined;
370
+
371
+ /**
372
+ * Device UID (globally unique)
373
+ * @member {String} device
374
+ */
375
+ Event.prototype['device'] = undefined;
376
+
377
+ /**
378
+ * The device serial number
379
+ * @member {String} sn
380
+ */
381
+ Event.prototype['sn'] = undefined;
382
+
383
+ /**
384
+ * Product UID (globally unique)
385
+ * @member {String} product
386
+ */
387
+ Event.prototype['product'] = undefined;
388
+
389
+ /**
390
+ * App UID (globally unique)
391
+ * @member {String} app
392
+ */
393
+ Event.prototype['app'] = undefined;
394
+
395
+ /**
396
+ * The unix timestamp when the event was received
397
+ * @member {Number} received
398
+ */
399
+ Event.prototype['received'] = undefined;
400
+
401
+ /**
402
+ * The notecard request
403
+ * @member {String} req
404
+ */
405
+ Event.prototype['req'] = undefined;
406
+
407
+ /**
408
+ * When the event was captured on the device
409
+ * @member {Number} when
410
+ */
411
+ Event.prototype['when'] = undefined;
412
+
413
+ /**
414
+ * The notefile associated with this event
415
+ * @member {String} file
416
+ */
417
+ Event.prototype['file'] = undefined;
418
+
419
+ /**
420
+ * The note ID in the notefile
421
+ * @member {String} note
422
+ */
423
+ Event.prototype['note'] = undefined;
424
+
425
+ /**
426
+ * @member {Number} updates
427
+ */
428
+ Event.prototype['updates'] = undefined;
429
+
430
+ /**
431
+ * A JSON object containing event details
432
+ * @member {Object} body
433
+ */
434
+ Event.prototype['body'] = undefined;
435
+
436
+ /**
437
+ * A base64-encoded binary payload
438
+ * @member {String} payload
439
+ */
440
+ Event.prototype['payload'] = undefined;
441
+
442
+ /**
443
+ * One of \"gps\", \"triangulated\", or \"tower\"
444
+ * @member {String} best_location_type
445
+ */
446
+ Event.prototype['best_location_type'] = undefined;
447
+
448
+ /**
449
+ * Unix timestamp
450
+ * @member {Number} best_location_when
451
+ */
452
+ Event.prototype['best_location_when'] = undefined;
453
+
454
+ /**
455
+ * Latitude
456
+ * @member {Number} best_lat
457
+ */
458
+ Event.prototype['best_lat'] = undefined;
459
+
460
+ /**
461
+ * Longitude
462
+ * @member {Number} best_lon
463
+ */
464
+ Event.prototype['best_lon'] = undefined;
465
+
466
+ /**
467
+ * Location
468
+ * @member {String} best_location
469
+ */
470
+ Event.prototype['best_location'] = undefined;
471
+
472
+ /**
473
+ * Country
474
+ * @member {String} best_country
475
+ */
476
+ Event.prototype['best_country'] = undefined;
477
+
478
+ /**
479
+ * Timezone
480
+ * @member {String} best_timezone
481
+ */
482
+ Event.prototype['best_timezone'] = undefined;
483
+
484
+ /**
485
+ * Open Location Code
486
+ * @member {String} where_olc
487
+ */
488
+ Event.prototype['where_olc'] = undefined;
489
+
490
+ /**
491
+ * Unix timestamp
492
+ * @member {Number} where_when
493
+ */
494
+ Event.prototype['where_when'] = undefined;
495
+
496
+ /**
497
+ * Latitude
498
+ * @member {Number} where_lat
499
+ */
500
+ Event.prototype['where_lat'] = undefined;
501
+
502
+ /**
503
+ * Longitude
504
+ * @member {Number} where_lon
505
+ */
506
+ Event.prototype['where_lon'] = undefined;
507
+
508
+ /**
509
+ * Location
510
+ * @member {String} where_location
511
+ */
512
+ Event.prototype['where_location'] = undefined;
513
+
514
+ /**
515
+ * Country
516
+ * @member {String} where_country
517
+ */
518
+ Event.prototype['where_country'] = undefined;
519
+
520
+ /**
521
+ * Timezone
522
+ * @member {String} where_timezone
523
+ */
524
+ Event.prototype['where_timezone'] = undefined;
525
+
526
+ /**
527
+ * Unix timestamp
528
+ * @member {Number} tower_when
529
+ */
530
+ Event.prototype['tower_when'] = undefined;
531
+
532
+ /**
533
+ * Latitude
534
+ * @member {Number} tower_lat
535
+ */
536
+ Event.prototype['tower_lat'] = undefined;
537
+
538
+ /**
539
+ * Longitude
540
+ * @member {Number} tower_lon
541
+ */
542
+ Event.prototype['tower_lon'] = undefined;
543
+
544
+ /**
545
+ * Country
546
+ * @member {String} tower_country
547
+ */
548
+ Event.prototype['tower_country'] = undefined;
549
+
550
+ /**
551
+ * Location
552
+ * @member {String} tower_location
553
+ */
554
+ Event.prototype['tower_location'] = undefined;
555
+
556
+ /**
557
+ * Timezone
558
+ * @member {String} tower_timezone
559
+ */
560
+ Event.prototype['tower_timezone'] = undefined;
561
+
562
+ /**
563
+ * Tower ID
564
+ * @member {String} tower_id
565
+ */
566
+ Event.prototype['tower_id'] = undefined;
567
+
568
+ /**
569
+ * Unix timestamp
570
+ * @member {Number} tri_when
571
+ */
572
+ Event.prototype['tri_when'] = undefined;
573
+
574
+ /**
575
+ * Latitude
576
+ * @member {Number} tri_lat
577
+ */
578
+ Event.prototype['tri_lat'] = undefined;
579
+
580
+ /**
581
+ * Longitude
582
+ * @member {Number} tri_lon
583
+ */
584
+ Event.prototype['tri_lon'] = undefined;
585
+
586
+ /**
587
+ * Location
588
+ * @member {String} tri_location
589
+ */
590
+ Event.prototype['tri_location'] = undefined;
591
+
592
+ /**
593
+ * Country
594
+ * @member {String} tri_country
595
+ */
596
+ Event.prototype['tri_country'] = undefined;
597
+
598
+ /**
599
+ * Timezone
600
+ * @member {String} tri_timezone
601
+ */
602
+ Event.prototype['tri_timezone'] = undefined;
603
+
604
+ /**
605
+ * Triangulation points
606
+ * @member {Number} tri_points
607
+ */
608
+ Event.prototype['tri_points'] = undefined;
609
+
610
+ /**
611
+ * The number of times the device was sensed to have moved between the last session and this session. Only available on _session.qo events.
612
+ * @member {Number} moved
613
+ */
614
+ Event.prototype['moved'] = undefined;
615
+
616
+ /**
617
+ * The orientation of the device. Only available on _session.qo events.
618
+ * @member {String} orientation
619
+ */
620
+ Event.prototype['orientation'] = undefined;
621
+
622
+ /**
623
+ * Received Signal Strength Indicator (RSSI) is an estimated measurement of how well a device can receive signals. Only available on _session.qo events.
624
+ * @member {Number} rssi
625
+ */
626
+ Event.prototype['rssi'] = undefined;
627
+
628
+ /**
629
+ * SINR. Only available on _session.qo events.
630
+ * @member {Number} sinr
631
+ */
632
+ Event.prototype['sinr'] = undefined;
633
+
634
+ /**
635
+ * RSRP. Only available on _session.qo events.
636
+ * @member {Number} rsrp
637
+ */
638
+ Event.prototype['rsrp'] = undefined;
639
+
640
+ /**
641
+ * RSRQ. Only available on _session.qo events.
642
+ * @member {Number} rsrq
643
+ */
644
+ Event.prototype['rsrq'] = undefined;
645
+
646
+ /**
647
+ * Rat. Only available on _session.qo events.
648
+ * @member {String} rat
649
+ */
650
+ Event.prototype['rat'] = undefined;
651
+
652
+ /**
653
+ * Bars. Only available on _session.qo events.
654
+ * @member {Number} bars
655
+ */
656
+ Event.prototype['bars'] = undefined;
657
+
658
+ /**
659
+ * Device voltage. Only available on _session.qo events.
660
+ * @member {Number} voltage
661
+ */
662
+ Event.prototype['voltage'] = undefined;
663
+
664
+ /**
665
+ * Device temperature. Only available on _session.qo events.
666
+ * @member {Number} temp
667
+ */
668
+ Event.prototype['temp'] = undefined;
669
+
670
+ /**
671
+ * Routed environment variables beginning with \"$\". Only available on _session.qo events.
672
+ * @member {Object} environment
673
+ */
674
+ Event.prototype['environment'] = undefined;
675
+ var _default = Event;
676
+ exports["default"] = _default;