@blues-inc/notehub-js 1.0.37-beta.4 → 1.0.37-beta.6

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 (132) hide show
  1. package/README.md +10 -7
  2. package/dist/ApiClient.js +2 -2
  3. package/dist/api/AlertApi.js +1 -1
  4. package/dist/api/AuthorizationApi.js +1 -1
  5. package/dist/api/BillingAccountApi.js +1 -1
  6. package/dist/api/DeviceApi.js +8 -8
  7. package/dist/api/EventApi.js +1 -1
  8. package/dist/api/ExternalDevicesApi.js +1 -1
  9. package/dist/api/MonitorApi.js +10 -10
  10. package/dist/api/ProjectApi.js +14 -14
  11. package/dist/api/RouteApi.js +1 -1
  12. package/dist/api/WebhookApi.js +1 -1
  13. package/dist/index.js +59 -38
  14. package/dist/model/Alert.js +91 -91
  15. package/dist/model/AlertDataInner.js +10 -10
  16. package/dist/model/AlertNotificationsInner.js +10 -10
  17. package/dist/model/AnalyticsEventsData.js +14 -14
  18. package/dist/model/AnalyticsEventsResponse.js +1 -1
  19. package/dist/model/AnalyticsRouteLogsData.js +15 -15
  20. package/dist/model/AnalyticsRouteLogsResponse.js +1 -1
  21. package/dist/model/AnalyticsSessionsData.js +14 -14
  22. package/dist/model/AnalyticsSessionsResponse.js +1 -1
  23. package/dist/model/Aws.js +86 -86
  24. package/dist/model/Azure.js +51 -51
  25. package/dist/model/BillingAccount.js +19 -19
  26. package/dist/model/Body.js +1 -1
  27. package/dist/model/CloneProjectRequest.js +25 -25
  28. package/dist/model/Contact.js +19 -19
  29. package/dist/model/CreateFleetRequest.js +1 -1
  30. package/dist/model/CreateMonitor.js +186 -186
  31. package/dist/model/CreateProductRequest.js +30 -30
  32. package/dist/model/CreateProjectRequest.js +20 -20
  33. package/dist/model/CreateUpdateRepository.js +18 -18
  34. package/dist/model/CurrentFirmware.js +12 -12
  35. package/dist/model/DFUEnv.js +1 -1
  36. package/dist/model/DFUState.js +60 -60
  37. package/dist/model/DataField.js +1 -1
  38. package/dist/model/DataSet.js +164 -0
  39. package/dist/model/DataSetField.js +14 -14
  40. package/dist/model/DeleteDeviceFleetsRequest.js +1 -1
  41. package/dist/model/Device.js +134 -134
  42. package/dist/model/DeviceDfuHistory.js +15 -15
  43. package/dist/model/DeviceDfuHistoryPage.js +1 -1
  44. package/dist/model/DeviceDfuStateMachine.js +14 -14
  45. package/dist/model/DeviceDfuStateMachineNode.js +27 -27
  46. package/dist/model/DeviceDfuStatus.js +15 -15
  47. package/dist/model/{DeviceDfuHistoryCurrent.js → DeviceDfuStatusCurrent.js} +52 -52
  48. package/dist/model/DeviceDfuStatusPage.js +1 -1
  49. package/dist/model/DeviceSession.js +278 -278
  50. package/dist/model/DeviceTowerInfo.js +15 -15
  51. package/dist/model/DeviceUsage.js +36 -36
  52. package/dist/model/DfuActionRequest.js +1 -1
  53. package/dist/model/EmailNotification.js +1 -1
  54. package/dist/model/EnvTreeJsonNode.js +76 -76
  55. package/dist/model/EnvVar.js +9 -9
  56. package/dist/model/EnvironmentVariables.js +1 -1
  57. package/dist/model/Error.js +38 -38
  58. package/dist/model/Event.js +340 -340
  59. package/dist/model/Firmware.js +45 -45
  60. package/dist/model/FirmwareInfo.js +71 -71
  61. package/dist/model/Fleet.js +31 -31
  62. package/dist/model/GetAlerts200Response.js +1 -1
  63. package/dist/model/GetBillingAccounts200Response.js +1 -1
  64. package/dist/model/{GetDeviceEnvironmentVariablesByPin200Response.js → GetDeviceEnvironmentVariables200Response.js} +30 -30
  65. package/dist/model/GetDeviceHealthLog200Response.js +1 -1
  66. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +15 -15
  67. package/dist/model/GetDeviceLatest200Response.js +1 -1
  68. package/dist/model/GetDevicePublicKey200Response.js +18 -18
  69. package/dist/model/GetDeviceSessions200Response.js +14 -14
  70. package/dist/model/GetProjectDevicePublicKeys200Response.js +1 -1
  71. package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +12 -12
  72. package/dist/model/GetProjectDevices200Response.js +1 -1
  73. package/dist/model/GetProjectEvents200Response.js +1 -1
  74. package/dist/model/GetProjectEventsByCursor200Response.js +16 -16
  75. package/dist/model/{GetDeviceFleets200Response.js → GetProjectFleets200Response.js} +20 -20
  76. package/dist/model/GetProjectMembers200Response.js +1 -1
  77. package/dist/model/GetProjectProducts200Response.js +1 -1
  78. package/dist/model/GetProjects200Response.js +1 -1
  79. package/dist/model/GetWebhooks200Response.js +1 -1
  80. package/dist/model/Google.js +35 -35
  81. package/dist/model/HandleNoteChanges200Response.js +10 -10
  82. package/dist/model/HandleNoteGet200Response.js +1 -1
  83. package/dist/model/HandleNoteSignal200Response.js +1 -1
  84. package/dist/model/HandleNotefileChanges200Response.js +10 -10
  85. package/dist/model/HandleNotefileChangesPending200Response.js +15 -15
  86. package/dist/model/HandleNotefileDeleteRequest.js +1 -1
  87. package/dist/model/Http.js +43 -43
  88. package/dist/model/{AwsFilter.js → HttpFilter.js} +32 -32
  89. package/dist/model/{AwsTransform.js → HttpTransform.js} +21 -21
  90. package/dist/model/Location.js +38 -38
  91. package/dist/model/Login200Response.js +1 -1
  92. package/dist/model/LoginRequest.js +12 -12
  93. package/dist/model/Monitor.js +135 -135
  94. package/dist/model/MonitorAlertRoutesInner.js +12 -12
  95. package/dist/model/Mqtt.js +91 -91
  96. package/dist/model/Note.js +1 -1
  97. package/dist/model/NotefileSchema.js +1 -1
  98. package/dist/model/NotehubRoute.js +30 -30
  99. package/dist/model/NotehubRouteSchema.js +80 -80
  100. package/dist/model/PersonalAccessToken.js +37 -37
  101. package/dist/model/PersonalAccessTokenCreatedBy.js +13 -13
  102. package/dist/model/PersonalAccessTokenInfo.js +13 -13
  103. package/dist/model/PersonalAccessTokenSecret.js +14 -14
  104. package/dist/model/PostProvisionProjectDeviceRequest.js +14 -14
  105. package/dist/model/Product.js +29 -29
  106. package/dist/model/Project.js +35 -35
  107. package/dist/model/ProjectMember.js +19 -19
  108. package/dist/model/Proxy.js +21 -21
  109. package/dist/model/PutDeviceFleetsRequest.js +1 -1
  110. package/dist/model/QuestionDataResponseLineChart.js +204 -0
  111. package/dist/model/QuestionDataResponseMap.js +143 -0
  112. package/dist/model/Radresponder.js +28 -28
  113. package/dist/model/Repository.js +22 -22
  114. package/dist/model/RouteLog.js +28 -28
  115. package/dist/model/SchemaProperty.js +36 -34
  116. package/dist/model/SimUsage.js +72 -19
  117. package/dist/model/Slack.js +71 -71
  118. package/dist/model/SlackBearerNotification.js +14 -14
  119. package/dist/model/SlackWebHookNotification.js +14 -14
  120. package/dist/model/Snowflake.js +57 -57
  121. package/dist/model/{SlackTransform.js → SnowflakeTransform.js} +19 -19
  122. package/dist/model/Thingworx.js +36 -36
  123. package/dist/model/TowerLocation.js +58 -58
  124. package/dist/model/Twilio.js +46 -46
  125. package/dist/model/UpdateFleetRequest.js +14 -14
  126. package/dist/model/UploadMetadata.js +68 -68
  127. package/dist/model/UserDbRoute.js +26 -26
  128. package/dist/model/UserDfuStateMachine.js +14 -14
  129. package/dist/model/UserDfuStateMachineStatus.js +9 -9
  130. package/dist/model/UserFirmwareInfo.js +1 -1
  131. package/dist/model/WebhookSettings.js +1 -1
  132. package/package.json +1 -1
@@ -0,0 +1,164 @@
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 _DataSetField = _interopRequireDefault(require("./DataSetField"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ * Notehub API
20
+ * The OpenAPI definition for the Notehub.io API.
21
+ *
22
+ * The version of the OpenAPI document: 1.2.0
23
+ * Contact: engineering@blues.io
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The DataSet model module.
32
+ * @module model/DataSet
33
+ * @version 1.0.37-beta.6
34
+ */
35
+ var DataSet = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>DataSet</code>.
38
+ * @alias module:model/DataSet
39
+ */
40
+ function DataSet() {
41
+ _classCallCheck(this, DataSet);
42
+ DataSet.initialize(this);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(DataSet, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj) {}
53
+
54
+ /**
55
+ * Constructs a <code>DataSet</code> from a plain JavaScript object, optionally creating a new instance.
56
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
57
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
58
+ * @param {module:model/DataSet} obj Optional instance to populate.
59
+ * @return {module:model/DataSet} The populated <code>DataSet</code> instance.
60
+ */
61
+ }, {
62
+ key: "constructFromObject",
63
+ value: function constructFromObject(data, obj) {
64
+ if (data) {
65
+ obj = obj || new DataSet();
66
+ if (data.hasOwnProperty('name')) {
67
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
68
+ }
69
+ if (data.hasOwnProperty('time')) {
70
+ obj['time'] = _ApiClient["default"].convertToType(data['time'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('lat')) {
73
+ obj['lat'] = _ApiClient["default"].convertToType(data['lat'], 'String');
74
+ }
75
+ if (data.hasOwnProperty('lon')) {
76
+ obj['lon'] = _ApiClient["default"].convertToType(data['lon'], 'String');
77
+ }
78
+ if (data.hasOwnProperty('fields')) {
79
+ obj['fields'] = _ApiClient["default"].convertToType(data['fields'], [_DataSetField["default"]]);
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>DataSet</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>DataSet</code>.
91
+ */
92
+ }, {
93
+ key: "validateJSON",
94
+ value: function validateJSON(data) {
95
+ // ensure the json data is a string
96
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
97
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
98
+ }
99
+ // ensure the json data is a string
100
+ if (data['time'] && !(typeof data['time'] === 'string' || data['time'] instanceof String)) {
101
+ throw new Error("Expected the field `time` to be a primitive type in the JSON string but got " + data['time']);
102
+ }
103
+ // ensure the json data is a string
104
+ if (data['lat'] && !(typeof data['lat'] === 'string' || data['lat'] instanceof String)) {
105
+ throw new Error("Expected the field `lat` to be a primitive type in the JSON string but got " + data['lat']);
106
+ }
107
+ // ensure the json data is a string
108
+ if (data['lon'] && !(typeof data['lon'] === 'string' || data['lon'] instanceof String)) {
109
+ throw new Error("Expected the field `lon` to be a primitive type in the JSON string but got " + data['lon']);
110
+ }
111
+ if (data['fields']) {
112
+ // data not null
113
+ // ensure the json data is an array
114
+ if (!Array.isArray(data['fields'])) {
115
+ throw new Error("Expected the field `fields` to be an array in the JSON data but got " + data['fields']);
116
+ }
117
+ // validate the optional field `fields` (array)
118
+ var _iterator = _createForOfIteratorHelper(data['fields']),
119
+ _step;
120
+ try {
121
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
122
+ var item = _step.value;
123
+ _DataSetField["default"].validateJsonObject(item);
124
+ }
125
+ } catch (err) {
126
+ _iterator.e(err);
127
+ } finally {
128
+ _iterator.f();
129
+ }
130
+ ;
131
+ }
132
+ return true;
133
+ }
134
+ }]);
135
+ }();
136
+ /**
137
+ * The name of the data set
138
+ * @member {String} name
139
+ */
140
+ DataSet.prototype['name'] = undefined;
141
+
142
+ /**
143
+ * JSONata expression resulting in the relevant time field
144
+ * @member {String} time
145
+ */
146
+ DataSet.prototype['time'] = undefined;
147
+
148
+ /**
149
+ * JSONata expression resulting in the latitude field
150
+ * @member {String} lat
151
+ */
152
+ DataSet.prototype['lat'] = undefined;
153
+
154
+ /**
155
+ * JSONata expression resulting in the Longitude field
156
+ * @member {String} lon
157
+ */
158
+ DataSet.prototype['lon'] = undefined;
159
+
160
+ /**
161
+ * @member {Array.<module:model/DataSetField>} fields
162
+ */
163
+ DataSet.prototype['fields'] = undefined;
164
+ var _default = exports["default"] = DataSet;
@@ -26,7 +26,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
26
26
  /**
27
27
  * The DataSetField model module.
28
28
  * @module model/DataSetField
29
- * @version 1.0.37-beta.4
29
+ * @version 1.0.37-beta.6
30
30
  */
31
31
  var DataSetField = /*#__PURE__*/function () {
32
32
  /**
@@ -59,15 +59,15 @@ var DataSetField = /*#__PURE__*/function () {
59
59
  value: function constructFromObject(data, obj) {
60
60
  if (data) {
61
61
  obj = obj || new DataSetField();
62
+ if (data.hasOwnProperty('name')) {
63
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
64
+ }
62
65
  if (data.hasOwnProperty('datatype')) {
63
66
  obj['datatype'] = _ApiClient["default"].convertToType(data['datatype'], 'Number');
64
67
  }
65
68
  if (data.hasOwnProperty('jsonata')) {
66
69
  obj['jsonata'] = _ApiClient["default"].convertToType(data['jsonata'], 'String');
67
70
  }
68
- if (data.hasOwnProperty('name')) {
69
- obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
70
- }
71
71
  } else if (data === null) {
72
72
  return null;
73
73
  }
@@ -82,18 +82,24 @@ var DataSetField = /*#__PURE__*/function () {
82
82
  }, {
83
83
  key: "validateJSON",
84
84
  value: function validateJSON(data) {
85
- // ensure the json data is a string
86
- if (data['jsonata'] && !(typeof data['jsonata'] === 'string' || data['jsonata'] instanceof String)) {
87
- throw new Error("Expected the field `jsonata` to be a primitive type in the JSON string but got " + data['jsonata']);
88
- }
89
85
  // ensure the json data is a string
90
86
  if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
91
87
  throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
92
88
  }
89
+ // ensure the json data is a string
90
+ if (data['jsonata'] && !(typeof data['jsonata'] === 'string' || data['jsonata'] instanceof String)) {
91
+ throw new Error("Expected the field `jsonata` to be a primitive type in the JSON string but got " + data['jsonata']);
92
+ }
93
93
  return true;
94
94
  }
95
95
  }]);
96
96
  }();
97
+ /**
98
+ * The name of the field
99
+ * @member {String} name
100
+ */
101
+ DataSetField.prototype['name'] = undefined;
102
+
97
103
  /**
98
104
  * The datatype of the field
99
105
  * @member {module:model/DataSetField.DatatypeEnum} datatype
@@ -106,12 +112,6 @@ DataSetField.prototype['datatype'] = undefined;
106
112
  */
107
113
  DataSetField.prototype['jsonata'] = undefined;
108
114
 
109
- /**
110
- * The name of the field
111
- * @member {String} name
112
- */
113
- DataSetField.prototype['name'] = undefined;
114
-
115
115
  /**
116
116
  * Allowed values for the <code>datatype</code> property.
117
117
  * @enum {Number}
@@ -29,7 +29,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
29
29
  /**
30
30
  * The DeleteDeviceFleetsRequest model module.
31
31
  * @module model/DeleteDeviceFleetsRequest
32
- * @version 1.0.37-beta.4
32
+ * @version 1.0.37-beta.6
33
33
  */
34
34
  var DeleteDeviceFleetsRequest = /*#__PURE__*/function () {
35
35
  /**
@@ -34,22 +34,22 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
34
34
  /**
35
35
  * The Device model module.
36
36
  * @module model/Device
37
- * @version 1.0.37-beta.4
37
+ * @version 1.0.37-beta.6
38
38
  */
39
39
  var Device = /*#__PURE__*/function () {
40
40
  /**
41
41
  * Constructs a new <code>Device</code>.
42
42
  * @alias module:model/Device
43
- * @param fleetUids {Array.<String>}
44
- * @param productUid {String}
45
- * @param provisioned {Date}
46
- * @param temperature {Number}
47
43
  * @param uid {String}
44
+ * @param provisioned {Date}
45
+ * @param productUid {String}
46
+ * @param fleetUids {Array.<String>}
48
47
  * @param voltage {Number}
48
+ * @param temperature {Number}
49
49
  */
50
- function Device(fleetUids, productUid, provisioned, temperature, uid, voltage) {
50
+ function Device(uid, provisioned, productUid, fleetUids, voltage, temperature) {
51
51
  _classCallCheck(this, Device);
52
- Device.initialize(this, fleetUids, productUid, provisioned, temperature, uid, voltage);
52
+ Device.initialize(this, uid, provisioned, productUid, fleetUids, voltage, temperature);
53
53
  }
54
54
 
55
55
  /**
@@ -59,13 +59,13 @@ var Device = /*#__PURE__*/function () {
59
59
  */
60
60
  return _createClass(Device, null, [{
61
61
  key: "initialize",
62
- value: function initialize(obj, fleetUids, productUid, provisioned, temperature, uid, voltage) {
63
- obj['fleet_uids'] = fleetUids;
64
- obj['product_uid'] = productUid;
65
- obj['provisioned'] = provisioned;
66
- obj['temperature'] = temperature;
62
+ value: function initialize(obj, uid, provisioned, productUid, fleetUids, voltage, temperature) {
67
63
  obj['uid'] = uid;
64
+ obj['provisioned'] = provisioned;
65
+ obj['product_uid'] = productUid;
66
+ obj['fleet_uids'] = fleetUids;
68
67
  obj['voltage'] = voltage;
68
+ obj['temperature'] = temperature;
69
69
  }
70
70
 
71
71
  /**
@@ -80,47 +80,26 @@ var Device = /*#__PURE__*/function () {
80
80
  value: function constructFromObject(data, obj) {
81
81
  if (data) {
82
82
  obj = obj || new Device();
83
- if (data.hasOwnProperty('cellular_usage')) {
84
- obj['cellular_usage'] = _ApiClient["default"].convertToType(data['cellular_usage'], [_SimUsage["default"]]);
85
- }
86
- if (data.hasOwnProperty('contact')) {
87
- obj['contact'] = _Contact["default"].constructFromObject(data['contact']);
88
- }
89
- if (data.hasOwnProperty('dfu')) {
90
- obj['dfu'] = _DFUEnv["default"].constructFromObject(data['dfu']);
91
- }
92
- if (data.hasOwnProperty('disabled')) {
93
- obj['disabled'] = _ApiClient["default"].convertToType(data['disabled'], 'Boolean');
94
- }
95
- if (data.hasOwnProperty('firmware_host')) {
96
- obj['firmware_host'] = _ApiClient["default"].convertToType(data['firmware_host'], 'String');
97
- }
98
- if (data.hasOwnProperty('firmware_notecard')) {
99
- obj['firmware_notecard'] = _ApiClient["default"].convertToType(data['firmware_notecard'], 'String');
83
+ if (data.hasOwnProperty('uid')) {
84
+ obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
100
85
  }
101
- if (data.hasOwnProperty('fleet_uids')) {
102
- obj['fleet_uids'] = _ApiClient["default"].convertToType(data['fleet_uids'], ['String']);
86
+ if (data.hasOwnProperty('serial_number')) {
87
+ obj['serial_number'] = _ApiClient["default"].convertToType(data['serial_number'], 'String');
103
88
  }
104
- if (data.hasOwnProperty('gps_location')) {
105
- obj['gps_location'] = _Location["default"].constructFromObject(data['gps_location']);
89
+ if (data.hasOwnProperty('provisioned')) {
90
+ obj['provisioned'] = _ApiClient["default"].convertToType(data['provisioned'], 'Date');
106
91
  }
107
92
  if (data.hasOwnProperty('last_activity')) {
108
93
  obj['last_activity'] = _ApiClient["default"].convertToType(data['last_activity'], 'Date');
109
94
  }
95
+ if (data.hasOwnProperty('contact')) {
96
+ obj['contact'] = _Contact["default"].constructFromObject(data['contact']);
97
+ }
110
98
  if (data.hasOwnProperty('product_uid')) {
111
99
  obj['product_uid'] = _ApiClient["default"].convertToType(data['product_uid'], 'String');
112
100
  }
113
- if (data.hasOwnProperty('provisioned')) {
114
- obj['provisioned'] = _ApiClient["default"].convertToType(data['provisioned'], 'Date');
115
- }
116
- if (data.hasOwnProperty('serial_number')) {
117
- obj['serial_number'] = _ApiClient["default"].convertToType(data['serial_number'], 'String');
118
- }
119
- if (data.hasOwnProperty('sku')) {
120
- obj['sku'] = _ApiClient["default"].convertToType(data['sku'], 'String');
121
- }
122
- if (data.hasOwnProperty('temperature')) {
123
- obj['temperature'] = _ApiClient["default"].convertToType(data['temperature'], 'Number');
101
+ if (data.hasOwnProperty('fleet_uids')) {
102
+ obj['fleet_uids'] = _ApiClient["default"].convertToType(data['fleet_uids'], ['String']);
124
103
  }
125
104
  if (data.hasOwnProperty('tower_info')) {
126
105
  obj['tower_info'] = _DeviceTowerInfo["default"].constructFromObject(data['tower_info']);
@@ -128,15 +107,36 @@ var Device = /*#__PURE__*/function () {
128
107
  if (data.hasOwnProperty('tower_location')) {
129
108
  obj['tower_location'] = _Location["default"].constructFromObject(data['tower_location']);
130
109
  }
110
+ if (data.hasOwnProperty('gps_location')) {
111
+ obj['gps_location'] = _Location["default"].constructFromObject(data['gps_location']);
112
+ }
131
113
  if (data.hasOwnProperty('triangulated_location')) {
132
114
  obj['triangulated_location'] = _Location["default"].constructFromObject(data['triangulated_location']);
133
115
  }
134
- if (data.hasOwnProperty('uid')) {
135
- obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
136
- }
137
116
  if (data.hasOwnProperty('voltage')) {
138
117
  obj['voltage'] = _ApiClient["default"].convertToType(data['voltage'], 'Number');
139
118
  }
119
+ if (data.hasOwnProperty('temperature')) {
120
+ obj['temperature'] = _ApiClient["default"].convertToType(data['temperature'], 'Number');
121
+ }
122
+ if (data.hasOwnProperty('dfu')) {
123
+ obj['dfu'] = _DFUEnv["default"].constructFromObject(data['dfu']);
124
+ }
125
+ if (data.hasOwnProperty('firmware_host')) {
126
+ obj['firmware_host'] = _ApiClient["default"].convertToType(data['firmware_host'], 'String');
127
+ }
128
+ if (data.hasOwnProperty('firmware_notecard')) {
129
+ obj['firmware_notecard'] = _ApiClient["default"].convertToType(data['firmware_notecard'], 'String');
130
+ }
131
+ if (data.hasOwnProperty('sku')) {
132
+ obj['sku'] = _ApiClient["default"].convertToType(data['sku'], 'String');
133
+ }
134
+ if (data.hasOwnProperty('disabled')) {
135
+ obj['disabled'] = _ApiClient["default"].convertToType(data['disabled'], 'Boolean');
136
+ }
137
+ if (data.hasOwnProperty('cellular_usage')) {
138
+ obj['cellular_usage'] = _ApiClient["default"].convertToType(data['cellular_usage'], [_SimUsage["default"]]);
139
+ }
140
140
  } else if (data === null) {
141
141
  return null;
142
142
  }
@@ -161,71 +161,32 @@ var Device = /*#__PURE__*/function () {
161
161
  throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
162
162
  }
163
163
  }
164
+ // ensure the json data is a string
164
165
  } catch (err) {
165
166
  _iterator.e(err);
166
167
  } finally {
167
168
  _iterator.f();
168
169
  }
169
- if (data['cellular_usage']) {
170
- // data not null
171
- // ensure the json data is an array
172
- if (!Array.isArray(data['cellular_usage'])) {
173
- throw new Error("Expected the field `cellular_usage` to be an array in the JSON data but got " + data['cellular_usage']);
174
- }
175
- // validate the optional field `cellular_usage` (array)
176
- var _iterator2 = _createForOfIteratorHelper(data['cellular_usage']),
177
- _step2;
178
- try {
179
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
180
- var item = _step2.value;
181
- _SimUsage["default"].validateJsonObject(item);
182
- }
183
- } catch (err) {
184
- _iterator2.e(err);
185
- } finally {
186
- _iterator2.f();
187
- }
188
- ;
170
+ if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
171
+ throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
172
+ }
173
+ // ensure the json data is a string
174
+ if (data['serial_number'] && !(typeof data['serial_number'] === 'string' || data['serial_number'] instanceof String)) {
175
+ throw new Error("Expected the field `serial_number` to be a primitive type in the JSON string but got " + data['serial_number']);
189
176
  }
190
177
  // validate the optional field `contact`
191
178
  if (data['contact']) {
192
179
  // data not null
193
180
  _Contact["default"].validateJSON(data['contact']);
194
181
  }
195
- // validate the optional field `dfu`
196
- if (data['dfu']) {
197
- // data not null
198
- _DFUEnv["default"].validateJSON(data['dfu']);
199
- }
200
- // ensure the json data is a string
201
- if (data['firmware_host'] && !(typeof data['firmware_host'] === 'string' || data['firmware_host'] instanceof String)) {
202
- throw new Error("Expected the field `firmware_host` to be a primitive type in the JSON string but got " + data['firmware_host']);
203
- }
204
182
  // ensure the json data is a string
205
- if (data['firmware_notecard'] && !(typeof data['firmware_notecard'] === 'string' || data['firmware_notecard'] instanceof String)) {
206
- throw new Error("Expected the field `firmware_notecard` to be a primitive type in the JSON string but got " + data['firmware_notecard']);
183
+ if (data['product_uid'] && !(typeof data['product_uid'] === 'string' || data['product_uid'] instanceof String)) {
184
+ throw new Error("Expected the field `product_uid` to be a primitive type in the JSON string but got " + data['product_uid']);
207
185
  }
208
186
  // ensure the json data is an array
209
187
  if (!Array.isArray(data['fleet_uids'])) {
210
188
  throw new Error("Expected the field `fleet_uids` to be an array in the JSON data but got " + data['fleet_uids']);
211
189
  }
212
- // validate the optional field `gps_location`
213
- if (data['gps_location']) {
214
- // data not null
215
- _Location["default"].validateJSON(data['gps_location']);
216
- }
217
- // ensure the json data is a string
218
- if (data['product_uid'] && !(typeof data['product_uid'] === 'string' || data['product_uid'] instanceof String)) {
219
- throw new Error("Expected the field `product_uid` to be a primitive type in the JSON string but got " + data['product_uid']);
220
- }
221
- // ensure the json data is a string
222
- if (data['serial_number'] && !(typeof data['serial_number'] === 'string' || data['serial_number'] instanceof String)) {
223
- throw new Error("Expected the field `serial_number` to be a primitive type in the JSON string but got " + data['serial_number']);
224
- }
225
- // ensure the json data is a string
226
- if (data['sku'] && !(typeof data['sku'] === 'string' || data['sku'] instanceof String)) {
227
- throw new Error("Expected the field `sku` to be a primitive type in the JSON string but got " + data['sku']);
228
- }
229
190
  // validate the optional field `tower_info`
230
191
  if (data['tower_info']) {
231
192
  // data not null
@@ -236,50 +197,89 @@ var Device = /*#__PURE__*/function () {
236
197
  // data not null
237
198
  _Location["default"].validateJSON(data['tower_location']);
238
199
  }
200
+ // validate the optional field `gps_location`
201
+ if (data['gps_location']) {
202
+ // data not null
203
+ _Location["default"].validateJSON(data['gps_location']);
204
+ }
239
205
  // validate the optional field `triangulated_location`
240
206
  if (data['triangulated_location']) {
241
207
  // data not null
242
208
  _Location["default"].validateJSON(data['triangulated_location']);
243
209
  }
210
+ // validate the optional field `dfu`
211
+ if (data['dfu']) {
212
+ // data not null
213
+ _DFUEnv["default"].validateJSON(data['dfu']);
214
+ }
244
215
  // ensure the json data is a string
245
- if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
246
- throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
216
+ if (data['firmware_host'] && !(typeof data['firmware_host'] === 'string' || data['firmware_host'] instanceof String)) {
217
+ throw new Error("Expected the field `firmware_host` to be a primitive type in the JSON string but got " + data['firmware_host']);
218
+ }
219
+ // ensure the json data is a string
220
+ if (data['firmware_notecard'] && !(typeof data['firmware_notecard'] === 'string' || data['firmware_notecard'] instanceof String)) {
221
+ throw new Error("Expected the field `firmware_notecard` to be a primitive type in the JSON string but got " + data['firmware_notecard']);
222
+ }
223
+ // ensure the json data is a string
224
+ if (data['sku'] && !(typeof data['sku'] === 'string' || data['sku'] instanceof String)) {
225
+ throw new Error("Expected the field `sku` to be a primitive type in the JSON string but got " + data['sku']);
226
+ }
227
+ if (data['cellular_usage']) {
228
+ // data not null
229
+ // ensure the json data is an array
230
+ if (!Array.isArray(data['cellular_usage'])) {
231
+ throw new Error("Expected the field `cellular_usage` to be an array in the JSON data but got " + data['cellular_usage']);
232
+ }
233
+ // validate the optional field `cellular_usage` (array)
234
+ var _iterator2 = _createForOfIteratorHelper(data['cellular_usage']),
235
+ _step2;
236
+ try {
237
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
238
+ var item = _step2.value;
239
+ _SimUsage["default"].validateJsonObject(item);
240
+ }
241
+ } catch (err) {
242
+ _iterator2.e(err);
243
+ } finally {
244
+ _iterator2.f();
245
+ }
246
+ ;
247
247
  }
248
248
  return true;
249
249
  }
250
250
  }]);
251
251
  }();
252
- Device.RequiredProperties = ["fleet_uids", "product_uid", "provisioned", "temperature", "uid", "voltage"];
252
+ Device.RequiredProperties = ["uid", "provisioned", "product_uid", "fleet_uids", "voltage", "temperature"];
253
253
 
254
254
  /**
255
- * @member {Array.<module:model/SimUsage>} cellular_usage
255
+ * @member {String} uid
256
256
  */
257
- Device.prototype['cellular_usage'] = undefined;
257
+ Device.prototype['uid'] = undefined;
258
258
 
259
259
  /**
260
- * @member {module:model/Contact} contact
260
+ * @member {String} serial_number
261
261
  */
262
- Device.prototype['contact'] = undefined;
262
+ Device.prototype['serial_number'] = undefined;
263
263
 
264
264
  /**
265
- * @member {module:model/DFUEnv} dfu
265
+ * @member {Date} provisioned
266
266
  */
267
- Device.prototype['dfu'] = undefined;
267
+ Device.prototype['provisioned'] = undefined;
268
268
 
269
269
  /**
270
- * @member {Boolean} disabled
270
+ * @member {Date} last_activity
271
271
  */
272
- Device.prototype['disabled'] = undefined;
272
+ Device.prototype['last_activity'] = undefined;
273
273
 
274
274
  /**
275
- * @member {String} firmware_host
275
+ * @member {module:model/Contact} contact
276
276
  */
277
- Device.prototype['firmware_host'] = undefined;
277
+ Device.prototype['contact'] = undefined;
278
278
 
279
279
  /**
280
- * @member {String} firmware_notecard
280
+ * @member {String} product_uid
281
281
  */
282
- Device.prototype['firmware_notecard'] = undefined;
282
+ Device.prototype['product_uid'] = undefined;
283
283
 
284
284
  /**
285
285
  * @member {Array.<String>} fleet_uids
@@ -287,62 +287,62 @@ Device.prototype['firmware_notecard'] = undefined;
287
287
  Device.prototype['fleet_uids'] = undefined;
288
288
 
289
289
  /**
290
- * @member {module:model/Location} gps_location
290
+ * @member {module:model/DeviceTowerInfo} tower_info
291
291
  */
292
- Device.prototype['gps_location'] = undefined;
292
+ Device.prototype['tower_info'] = undefined;
293
293
 
294
294
  /**
295
- * @member {Date} last_activity
295
+ * @member {module:model/Location} tower_location
296
296
  */
297
- Device.prototype['last_activity'] = undefined;
297
+ Device.prototype['tower_location'] = undefined;
298
298
 
299
299
  /**
300
- * @member {String} product_uid
300
+ * @member {module:model/Location} gps_location
301
301
  */
302
- Device.prototype['product_uid'] = undefined;
302
+ Device.prototype['gps_location'] = undefined;
303
303
 
304
304
  /**
305
- * @member {Date} provisioned
305
+ * @member {module:model/Location} triangulated_location
306
306
  */
307
- Device.prototype['provisioned'] = undefined;
307
+ Device.prototype['triangulated_location'] = undefined;
308
308
 
309
309
  /**
310
- * @member {String} serial_number
310
+ * @member {Number} voltage
311
311
  */
312
- Device.prototype['serial_number'] = undefined;
312
+ Device.prototype['voltage'] = undefined;
313
313
 
314
314
  /**
315
- * @member {String} sku
315
+ * @member {Number} temperature
316
316
  */
317
- Device.prototype['sku'] = undefined;
317
+ Device.prototype['temperature'] = undefined;
318
318
 
319
319
  /**
320
- * @member {Number} temperature
320
+ * @member {module:model/DFUEnv} dfu
321
321
  */
322
- Device.prototype['temperature'] = undefined;
322
+ Device.prototype['dfu'] = undefined;
323
323
 
324
324
  /**
325
- * @member {module:model/DeviceTowerInfo} tower_info
325
+ * @member {String} firmware_host
326
326
  */
327
- Device.prototype['tower_info'] = undefined;
327
+ Device.prototype['firmware_host'] = undefined;
328
328
 
329
329
  /**
330
- * @member {module:model/Location} tower_location
330
+ * @member {String} firmware_notecard
331
331
  */
332
- Device.prototype['tower_location'] = undefined;
332
+ Device.prototype['firmware_notecard'] = undefined;
333
333
 
334
334
  /**
335
- * @member {module:model/Location} triangulated_location
335
+ * @member {String} sku
336
336
  */
337
- Device.prototype['triangulated_location'] = undefined;
337
+ Device.prototype['sku'] = undefined;
338
338
 
339
339
  /**
340
- * @member {String} uid
340
+ * @member {Boolean} disabled
341
341
  */
342
- Device.prototype['uid'] = undefined;
342
+ Device.prototype['disabled'] = undefined;
343
343
 
344
344
  /**
345
- * @member {Number} voltage
345
+ * @member {Array.<module:model/SimUsage>} cellular_usage
346
346
  */
347
- Device.prototype['voltage'] = undefined;
347
+ Device.prototype['cellular_usage'] = undefined;
348
348
  var _default = exports["default"] = Device;