@blues-inc/notehub-js 3.0.0 → 4.0.0-beta.1

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 (146) hide show
  1. package/README.md +247 -247
  2. package/dist/ApiClient.js +150 -155
  3. package/dist/api/AlertApi.js +22 -22
  4. package/dist/api/AuthorizationApi.js +31 -31
  5. package/dist/api/BillingAccountApi.js +14 -14
  6. package/dist/api/DeviceApi.js +471 -511
  7. package/dist/api/EventApi.js +118 -118
  8. package/dist/api/ExternalDevicesApi.js +41 -41
  9. package/dist/api/MonitorApi.js +52 -52
  10. package/dist/api/ProjectApi.js +381 -381
  11. package/dist/api/RouteApi.js +77 -77
  12. package/dist/api/UsageApi.js +117 -51
  13. package/dist/api/WebhookApi.js +51 -51
  14. package/dist/index.js +21 -14
  15. package/dist/model/AddDeviceToFleetsRequest.js +8 -8
  16. package/dist/model/Alert.js +76 -74
  17. package/dist/model/AlertDataInner.js +35 -35
  18. package/dist/model/AlertNotificationsInner.js +18 -18
  19. package/dist/model/AwsRoute.js +65 -65
  20. package/dist/model/AzureRoute.js +43 -43
  21. package/dist/model/BillingAccount.js +21 -21
  22. package/dist/model/BillingAccountRole.js +9 -9
  23. package/dist/model/BlynkRoute.js +28 -28
  24. package/dist/model/Body.js +5 -5
  25. package/dist/model/CellularPlan.js +34 -34
  26. package/dist/model/CloneProjectRequest.js +20 -20
  27. package/dist/model/Contact.js +22 -22
  28. package/dist/model/CreateFleetRequest.js +25 -17
  29. package/dist/model/CreateMonitor.js +126 -125
  30. package/dist/model/CreateProductRequest.js +22 -22
  31. package/dist/model/CreateProjectRequest.js +16 -16
  32. package/dist/model/CreateUpdateRepository.js +17 -17
  33. package/dist/model/CurrentFirmware.js +12 -12
  34. package/dist/model/DFUEnv.js +12 -12
  35. package/dist/model/DFUState.js +65 -65
  36. package/dist/model/DataField.js +7 -7
  37. package/dist/model/DataSetField.js +19 -19
  38. package/dist/model/DataUsage.js +14 -14
  39. package/dist/model/DatacakeRoute.js +35 -35
  40. package/dist/model/DeleteDeviceFromFleetsRequest.js +8 -8
  41. package/dist/model/DeleteNotefilesRequest.js +7 -7
  42. package/dist/model/Device.js +115 -101
  43. package/dist/model/DeviceDfuHistory.js +20 -19
  44. package/dist/model/DeviceDfuHistoryCurrent.js +32 -32
  45. package/dist/model/DeviceDfuHistoryPage.js +13 -12
  46. package/dist/model/DeviceDfuStateMachine.js +25 -24
  47. package/dist/model/DeviceDfuStateMachineNode.js +22 -22
  48. package/dist/model/DeviceDfuStatus.js +20 -20
  49. package/dist/model/DeviceDfuStatusPage.js +13 -12
  50. package/dist/model/DeviceSession.js +221 -221
  51. package/dist/model/DeviceTowerInfo.js +14 -14
  52. package/dist/model/DeviceUsage.js +32 -32
  53. package/dist/model/DfuActionRequest.js +7 -7
  54. package/dist/model/EmailNotification.js +7 -7
  55. package/dist/model/EnvTreeJsonNode.js +69 -67
  56. package/dist/model/EnvVar.js +18 -18
  57. package/dist/model/EnvironmentVariables.js +8 -8
  58. package/dist/model/Error.js +31 -31
  59. package/dist/model/Event.js +248 -248
  60. package/dist/model/Filter.js +16 -16
  61. package/dist/model/Firmware.js +49 -49
  62. package/dist/model/FirmwareInfo.js +60 -60
  63. package/dist/model/Fleet.js +43 -35
  64. package/dist/model/FleetConnectivityAssurance.js +8 -31
  65. package/dist/model/GetAlerts200Response.js +15 -14
  66. package/dist/model/GetBillingAccounts200Response.js +10 -9
  67. package/dist/model/GetDataUsage200Response.js +10 -9
  68. package/dist/model/GetDataUsage200ResponseDataInner.js +41 -40
  69. package/dist/model/GetDbNote200Response.js +13 -13
  70. package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +16 -16
  71. package/dist/model/GetDeviceFleets200Response.js +12 -11
  72. package/dist/model/GetDeviceHealthLog200Response.js +12 -11
  73. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +19 -19
  74. package/dist/model/GetDeviceLatestEvents200Response.js +10 -9
  75. package/dist/model/GetDevicePlans200Response.js +10 -9
  76. package/dist/model/GetDevicePublicKey200Response.js +16 -16
  77. package/dist/model/GetDevicePublicKeys200Response.js +17 -16
  78. package/dist/model/GetDevicePublicKeys200ResponseDevicePublicKeysInner.js +12 -12
  79. package/dist/model/GetDeviceSessions200Response.js +17 -16
  80. package/dist/model/GetDevices200Response.js +17 -16
  81. package/dist/model/GetEvents200Response.js +21 -20
  82. package/dist/model/GetEventsByCursor200Response.js +24 -23
  83. package/dist/model/GetNotefile200Response.js +11 -11
  84. package/dist/model/GetProducts200Response.js +10 -9
  85. package/dist/model/GetProjectMembers200Response.js +12 -11
  86. package/dist/model/GetProjects200Response.js +10 -9
  87. package/dist/model/GetRouteLogsUsage200Response.js +132 -0
  88. package/dist/model/GetSessionsUsage200Response.js +12 -11
  89. package/dist/model/GetWebhooks200Response.js +10 -9
  90. package/dist/model/GoogleRoute.js +33 -33
  91. package/dist/model/HttpRoute.js +35 -35
  92. package/dist/model/Location.js +40 -40
  93. package/dist/model/Login200Response.js +7 -7
  94. package/dist/model/LoginRequest.js +12 -12
  95. package/dist/model/Monitor.js +100 -99
  96. package/dist/model/MonitorAlertRoutesInner.js +9 -10
  97. package/dist/model/MqttRoute.js +68 -68
  98. package/dist/model/Note.js +95 -15
  99. package/dist/model/{ListNotefiles200Response.js → NoteInput.js} +30 -37
  100. package/dist/model/Notefile.js +159 -0
  101. package/dist/model/NotefileSchema.js +19 -18
  102. package/dist/model/NotehubRoute.js +103 -103
  103. package/dist/model/NotehubRouteSummary.js +23 -23
  104. package/dist/model/OAuth2Error.js +20 -20
  105. package/dist/model/OAuth2TokenResponse.js +23 -23
  106. package/dist/model/PersonalAccessToken.js +34 -34
  107. package/dist/model/PersonalAccessTokenCreatedBy.js +17 -17
  108. package/dist/model/PersonalAccessTokenInfo.js +18 -18
  109. package/dist/model/PersonalAccessTokenSecret.js +12 -12
  110. package/dist/model/Product.js +26 -26
  111. package/dist/model/Project.js +34 -34
  112. package/dist/model/ProjectMember.js +22 -22
  113. package/dist/model/ProvisionDeviceRequest.js +18 -18
  114. package/dist/model/ProxyRoute.js +29 -29
  115. package/dist/model/QubitroRoute.js +33 -33
  116. package/dist/model/RadRoute.js +31 -31
  117. package/dist/model/Repository.js +22 -22
  118. package/dist/model/Role.js +9 -9
  119. package/dist/model/RouteLog.js +38 -38
  120. package/dist/model/RouteTransformSettings.js +18 -18
  121. package/dist/model/S3ArchiveRoute.js +79 -79
  122. package/dist/model/SatellitePlan.js +26 -26
  123. package/dist/model/SchemaProperty.js +38 -36
  124. package/dist/model/SignalDevice200Response.js +5 -5
  125. package/dist/model/SimUsage.js +19 -19
  126. package/dist/model/SlackBearerNotification.js +25 -25
  127. package/dist/model/SlackRoute.js +48 -48
  128. package/dist/model/SlackWebHookNotification.js +20 -20
  129. package/dist/model/SnowflakeRoute.js +45 -45
  130. package/dist/model/SnowpipeStreamingRoute.js +60 -60
  131. package/dist/model/ThingworxRoute.js +33 -33
  132. package/dist/model/TowerLocation.js +54 -54
  133. package/dist/model/TwilioRoute.js +43 -43
  134. package/dist/model/UpdateFleetRequest.js +38 -30
  135. package/dist/model/UploadMetadata.js +64 -64
  136. package/dist/model/UsageData.js +18 -18
  137. package/dist/model/UsageEventsData.js +48 -37
  138. package/dist/model/UsageEventsResponse.js +12 -11
  139. package/dist/model/UsageRouteLogsData.js +27 -27
  140. package/dist/model/UsageSessionsData.js +41 -31
  141. package/dist/model/UserDfuStateMachine.js +20 -20
  142. package/dist/model/UserDfuStateMachineStatus.js +20 -20
  143. package/dist/model/UserFirmwareInfo.js +12 -12
  144. package/dist/model/WebhookSettings.js +15 -15
  145. package/package.json +3 -3
  146. package/dist/model/ListPendingNotefiles200Response.js +0 -115
@@ -15,7 +15,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
15
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
16
  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); } /**
17
17
  * Notehub API
18
- * The OpenAPI definition for the Notehub.io API.
18
+ * The OpenAPI definition for the Notehub.io API.
19
19
  *
20
20
  * The version of the OpenAPI document: 1.2.0
21
21
  * Contact: engineering@blues.io
@@ -28,7 +28,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
28
28
  /**
29
29
  * The MqttRoute model module.
30
30
  * @module model/MqttRoute
31
- * @version 3.0.0
31
+ * @version 4.0.0-beta.1
32
32
  */
33
33
  var MqttRoute = /*#__PURE__*/function () {
34
34
  /**
@@ -61,47 +61,47 @@ var MqttRoute = /*#__PURE__*/function () {
61
61
  value: function constructFromObject(data, obj) {
62
62
  if (data) {
63
63
  obj = obj || new MqttRoute();
64
- if (data.hasOwnProperty("broker")) {
65
- obj["broker"] = _ApiClient["default"].convertToType(data["broker"], "String");
64
+ if (data.hasOwnProperty('broker')) {
65
+ obj['broker'] = _ApiClient["default"].convertToType(data['broker'], 'String');
66
66
  }
67
- if (data.hasOwnProperty("certificate")) {
68
- obj["certificate"] = _ApiClient["default"].convertToType(data["certificate"], "String");
67
+ if (data.hasOwnProperty('certificate')) {
68
+ obj['certificate'] = _ApiClient["default"].convertToType(data['certificate'], 'String');
69
69
  }
70
- if (data.hasOwnProperty("certificate_name")) {
71
- obj["certificate_name"] = _ApiClient["default"].convertToType(data["certificate_name"], "String");
70
+ if (data.hasOwnProperty('certificate_name')) {
71
+ obj['certificate_name'] = _ApiClient["default"].convertToType(data['certificate_name'], 'String');
72
72
  }
73
- if (data.hasOwnProperty("filter")) {
74
- obj["filter"] = _Filter["default"].constructFromObject(data["filter"]);
73
+ if (data.hasOwnProperty('filter')) {
74
+ obj['filter'] = _Filter["default"].constructFromObject(data['filter']);
75
75
  }
76
- if (data.hasOwnProperty("fleets")) {
77
- obj["fleets"] = _ApiClient["default"].convertToType(data["fleets"], ["String"]);
76
+ if (data.hasOwnProperty('fleets')) {
77
+ obj['fleets'] = _ApiClient["default"].convertToType(data['fleets'], ['String']);
78
78
  }
79
- if (data.hasOwnProperty("key")) {
80
- obj["key"] = _ApiClient["default"].convertToType(data["key"], "String");
79
+ if (data.hasOwnProperty('key')) {
80
+ obj['key'] = _ApiClient["default"].convertToType(data['key'], 'String');
81
81
  }
82
- if (data.hasOwnProperty("password")) {
83
- obj["password"] = _ApiClient["default"].convertToType(data["password"], "String");
82
+ if (data.hasOwnProperty('password')) {
83
+ obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
84
84
  }
85
- if (data.hasOwnProperty("port")) {
86
- obj["port"] = _ApiClient["default"].convertToType(data["port"], "String");
85
+ if (data.hasOwnProperty('port')) {
86
+ obj['port'] = _ApiClient["default"].convertToType(data['port'], 'String');
87
87
  }
88
- if (data.hasOwnProperty("private_key_name")) {
89
- obj["private_key_name"] = _ApiClient["default"].convertToType(data["private_key_name"], "String");
88
+ if (data.hasOwnProperty('private_key_name')) {
89
+ obj['private_key_name'] = _ApiClient["default"].convertToType(data['private_key_name'], 'String');
90
90
  }
91
- if (data.hasOwnProperty("throttle_ms")) {
92
- obj["throttle_ms"] = _ApiClient["default"].convertToType(data["throttle_ms"], "Number");
91
+ if (data.hasOwnProperty('throttle_ms')) {
92
+ obj['throttle_ms'] = _ApiClient["default"].convertToType(data['throttle_ms'], 'Number');
93
93
  }
94
- if (data.hasOwnProperty("timeout")) {
95
- obj["timeout"] = _ApiClient["default"].convertToType(data["timeout"], "Number");
94
+ if (data.hasOwnProperty('timeout')) {
95
+ obj['timeout'] = _ApiClient["default"].convertToType(data['timeout'], 'Number');
96
96
  }
97
- if (data.hasOwnProperty("topic")) {
98
- obj["topic"] = _ApiClient["default"].convertToType(data["topic"], "String");
97
+ if (data.hasOwnProperty('topic')) {
98
+ obj['topic'] = _ApiClient["default"].convertToType(data['topic'], 'String');
99
99
  }
100
- if (data.hasOwnProperty("transform")) {
101
- obj["transform"] = _RouteTransformSettings["default"].constructFromObject(data["transform"]);
100
+ if (data.hasOwnProperty('transform')) {
101
+ obj['transform'] = _RouteTransformSettings["default"].constructFromObject(data['transform']);
102
102
  }
103
- if (data.hasOwnProperty("username")) {
104
- obj["username"] = _ApiClient["default"].convertToType(data["username"], "String");
103
+ if (data.hasOwnProperty('username')) {
104
+ obj['username'] = _ApiClient["default"].convertToType(data['username'], 'String');
105
105
  }
106
106
  } else if (data === null) {
107
107
  return null;
@@ -118,54 +118,54 @@ var MqttRoute = /*#__PURE__*/function () {
118
118
  key: "validateJSON",
119
119
  value: function validateJSON(data) {
120
120
  // ensure the json data is a string
121
- if (data["broker"] && !(typeof data["broker"] === "string" || data["broker"] instanceof String)) {
122
- throw new Error("Expected the field `broker` to be a primitive type in the JSON string but got " + data["broker"]);
121
+ if (data['broker'] && !(typeof data['broker'] === 'string' || data['broker'] instanceof String)) {
122
+ throw new Error("Expected the field `broker` to be a primitive type in the JSON string but got " + data['broker']);
123
123
  }
124
124
  // ensure the json data is a string
125
- if (data["certificate"] && !(typeof data["certificate"] === "string" || data["certificate"] instanceof String)) {
126
- throw new Error("Expected the field `certificate` to be a primitive type in the JSON string but got " + data["certificate"]);
125
+ if (data['certificate'] && !(typeof data['certificate'] === 'string' || data['certificate'] instanceof String)) {
126
+ throw new Error("Expected the field `certificate` to be a primitive type in the JSON string but got " + data['certificate']);
127
127
  }
128
128
  // ensure the json data is a string
129
- if (data["certificate_name"] && !(typeof data["certificate_name"] === "string" || data["certificate_name"] instanceof String)) {
130
- throw new Error("Expected the field `certificate_name` to be a primitive type in the JSON string but got " + data["certificate_name"]);
129
+ if (data['certificate_name'] && !(typeof data['certificate_name'] === 'string' || data['certificate_name'] instanceof String)) {
130
+ throw new Error("Expected the field `certificate_name` to be a primitive type in the JSON string but got " + data['certificate_name']);
131
131
  }
132
132
  // validate the optional field `filter`
133
- if (data["filter"]) {
133
+ if (data['filter']) {
134
134
  // data not null
135
- _Filter["default"].validateJSON(data["filter"]);
135
+ _Filter["default"].validateJSON(data['filter']);
136
136
  }
137
137
  // ensure the json data is an array
138
- if (!Array.isArray(data["fleets"])) {
139
- throw new Error("Expected the field `fleets` to be an array in the JSON data but got " + data["fleets"]);
138
+ if (!Array.isArray(data['fleets'])) {
139
+ throw new Error("Expected the field `fleets` to be an array in the JSON data but got " + data['fleets']);
140
140
  }
141
141
  // ensure the json data is a string
142
- if (data["key"] && !(typeof data["key"] === "string" || data["key"] instanceof String)) {
143
- throw new Error("Expected the field `key` to be a primitive type in the JSON string but got " + data["key"]);
142
+ if (data['key'] && !(typeof data['key'] === 'string' || data['key'] instanceof String)) {
143
+ throw new Error("Expected the field `key` to be a primitive type in the JSON string but got " + data['key']);
144
144
  }
145
145
  // ensure the json data is a string
146
- if (data["password"] && !(typeof data["password"] === "string" || data["password"] instanceof String)) {
147
- throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data["password"]);
146
+ if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
147
+ throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
148
148
  }
149
149
  // ensure the json data is a string
150
- if (data["port"] && !(typeof data["port"] === "string" || data["port"] instanceof String)) {
151
- throw new Error("Expected the field `port` to be a primitive type in the JSON string but got " + data["port"]);
150
+ if (data['port'] && !(typeof data['port'] === 'string' || data['port'] instanceof String)) {
151
+ throw new Error("Expected the field `port` to be a primitive type in the JSON string but got " + data['port']);
152
152
  }
153
153
  // ensure the json data is a string
154
- if (data["private_key_name"] && !(typeof data["private_key_name"] === "string" || data["private_key_name"] instanceof String)) {
155
- throw new Error("Expected the field `private_key_name` to be a primitive type in the JSON string but got " + data["private_key_name"]);
154
+ if (data['private_key_name'] && !(typeof data['private_key_name'] === 'string' || data['private_key_name'] instanceof String)) {
155
+ throw new Error("Expected the field `private_key_name` to be a primitive type in the JSON string but got " + data['private_key_name']);
156
156
  }
157
157
  // ensure the json data is a string
158
- if (data["topic"] && !(typeof data["topic"] === "string" || data["topic"] instanceof String)) {
159
- throw new Error("Expected the field `topic` to be a primitive type in the JSON string but got " + data["topic"]);
158
+ if (data['topic'] && !(typeof data['topic'] === 'string' || data['topic'] instanceof String)) {
159
+ throw new Error("Expected the field `topic` to be a primitive type in the JSON string but got " + data['topic']);
160
160
  }
161
161
  // validate the optional field `transform`
162
- if (data["transform"]) {
162
+ if (data['transform']) {
163
163
  // data not null
164
- _RouteTransformSettings["default"].validateJSON(data["transform"]);
164
+ _RouteTransformSettings["default"].validateJSON(data['transform']);
165
165
  }
166
166
  // ensure the json data is a string
167
- if (data["username"] && !(typeof data["username"] === "string" || data["username"] instanceof String)) {
168
- throw new Error("Expected the field `username` to be a primitive type in the JSON string but got " + data["username"]);
167
+ if (data['username'] && !(typeof data['username'] === 'string' || data['username'] instanceof String)) {
168
+ throw new Error("Expected the field `username` to be a primitive type in the JSON string but got " + data['username']);
169
169
  }
170
170
  return true;
171
171
  }
@@ -174,70 +174,70 @@ var MqttRoute = /*#__PURE__*/function () {
174
174
  /**
175
175
  * @member {String} broker
176
176
  */
177
- MqttRoute.prototype["broker"] = undefined;
177
+ MqttRoute.prototype['broker'] = undefined;
178
178
 
179
179
  /**
180
180
  * @member {String} certificate
181
181
  */
182
- MqttRoute.prototype["certificate"] = undefined;
182
+ MqttRoute.prototype['certificate'] = undefined;
183
183
 
184
184
  /**
185
185
  * @member {String} certificate_name
186
186
  */
187
- MqttRoute.prototype["certificate_name"] = undefined;
187
+ MqttRoute.prototype['certificate_name'] = undefined;
188
188
 
189
189
  /**
190
190
  * @member {module:model/Filter} filter
191
191
  */
192
- MqttRoute.prototype["filter"] = undefined;
192
+ MqttRoute.prototype['filter'] = undefined;
193
193
 
194
194
  /**
195
195
  * @member {Array.<String>} fleets
196
196
  */
197
- MqttRoute.prototype["fleets"] = undefined;
197
+ MqttRoute.prototype['fleets'] = undefined;
198
198
 
199
199
  /**
200
200
  * @member {String} key
201
201
  */
202
- MqttRoute.prototype["key"] = undefined;
202
+ MqttRoute.prototype['key'] = undefined;
203
203
 
204
204
  /**
205
205
  * @member {String} password
206
206
  */
207
- MqttRoute.prototype["password"] = undefined;
207
+ MqttRoute.prototype['password'] = undefined;
208
208
 
209
209
  /**
210
210
  * @member {String} port
211
211
  */
212
- MqttRoute.prototype["port"] = undefined;
212
+ MqttRoute.prototype['port'] = undefined;
213
213
 
214
214
  /**
215
215
  * @member {String} private_key_name
216
216
  */
217
- MqttRoute.prototype["private_key_name"] = undefined;
217
+ MqttRoute.prototype['private_key_name'] = undefined;
218
218
 
219
219
  /**
220
220
  * @member {Number} throttle_ms
221
221
  */
222
- MqttRoute.prototype["throttle_ms"] = undefined;
222
+ MqttRoute.prototype['throttle_ms'] = undefined;
223
223
 
224
224
  /**
225
225
  * @member {Number} timeout
226
226
  */
227
- MqttRoute.prototype["timeout"] = undefined;
227
+ MqttRoute.prototype['timeout'] = undefined;
228
228
 
229
229
  /**
230
230
  * @member {String} topic
231
231
  */
232
- MqttRoute.prototype["topic"] = undefined;
232
+ MqttRoute.prototype['topic'] = undefined;
233
233
 
234
234
  /**
235
235
  * @member {module:model/RouteTransformSettings} transform
236
236
  */
237
- MqttRoute.prototype["transform"] = undefined;
237
+ MqttRoute.prototype['transform'] = undefined;
238
238
 
239
239
  /**
240
240
  * @member {String} username
241
241
  */
242
- MqttRoute.prototype["username"] = undefined;
242
+ MqttRoute.prototype['username'] = undefined;
243
243
  var _default = exports["default"] = MqttRoute;
@@ -7,13 +7,16 @@ exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
9
  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); }
10
+ 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; } } }; }
11
+ 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; } }
12
+ 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; }
10
13
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
14
  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); } }
12
15
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
17
  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); } /**
15
18
  * Notehub API
16
- * The OpenAPI definition for the Notehub.io API.
19
+ * The OpenAPI definition for the Notehub.io API.
17
20
  *
18
21
  * The version of the OpenAPI document: 1.2.0
19
22
  * Contact: engineering@blues.io
@@ -26,16 +29,19 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
26
29
  /**
27
30
  * The Note model module.
28
31
  * @module model/Note
29
- * @version 3.0.0
32
+ * @version 4.0.0-beta.1
30
33
  */
31
34
  var Note = /*#__PURE__*/function () {
32
35
  /**
33
36
  * Constructs a new <code>Note</code>.
34
37
  * @alias module:model/Note
38
+ * @param body {Object.<String, Object>} Arbitrary user-defined JSON for the note.
39
+ * @param id {String} Note name/identifier (e.g., \"1:435\", \"my_note\").
40
+ * @param time {Number} Unix epoch seconds.
35
41
  */
36
- function Note() {
42
+ function Note(body, id, time) {
37
43
  _classCallCheck(this, Note);
38
- Note.initialize(this);
44
+ Note.initialize(this, body, id, time);
39
45
  }
40
46
 
41
47
  /**
@@ -45,7 +51,11 @@ var Note = /*#__PURE__*/function () {
45
51
  */
46
52
  return _createClass(Note, null, [{
47
53
  key: "initialize",
48
- value: function initialize(obj) {}
54
+ value: function initialize(obj, body, id, time) {
55
+ obj['body'] = body;
56
+ obj['id'] = id;
57
+ obj['time'] = time;
58
+ }
49
59
 
50
60
  /**
51
61
  * Constructs a <code>Note</code> from a plain JavaScript object, optionally creating a new instance.
@@ -59,11 +69,28 @@ var Note = /*#__PURE__*/function () {
59
69
  value: function constructFromObject(data, obj) {
60
70
  if (data) {
61
71
  obj = obj || new Note();
62
- if (data.hasOwnProperty("body")) {
63
- obj["body"] = _ApiClient["default"].convertToType(data["body"], Object);
72
+ if (data.hasOwnProperty('body')) {
73
+ obj['body'] = _ApiClient["default"].convertToType(data['body'], {
74
+ 'String': Object
75
+ });
76
+ }
77
+ if (data.hasOwnProperty('edge')) {
78
+ obj['edge'] = _ApiClient["default"].convertToType(data['edge'], 'Boolean');
79
+ }
80
+ if (data.hasOwnProperty('id')) {
81
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('payload')) {
84
+ obj['payload'] = _ApiClient["default"].convertToType(data['payload'], 'Blob');
64
85
  }
65
- if (data.hasOwnProperty("payload")) {
66
- obj["payload"] = _ApiClient["default"].convertToType(data["payload"], "String");
86
+ if (data.hasOwnProperty('pending')) {
87
+ obj['pending'] = _ApiClient["default"].convertToType(data['pending'], 'Boolean');
88
+ }
89
+ if (data.hasOwnProperty('time')) {
90
+ obj['time'] = _ApiClient["default"].convertToType(data['time'], 'Number');
91
+ }
92
+ if (data.hasOwnProperty('where')) {
93
+ obj['where'] = _ApiClient["default"].convertToType(data['where'], 'String');
67
94
  }
68
95
  } else if (data === null) {
69
96
  return null;
@@ -79,21 +106,74 @@ var Note = /*#__PURE__*/function () {
79
106
  }, {
80
107
  key: "validateJSON",
81
108
  value: function validateJSON(data) {
109
+ // check to make sure all required properties are present in the JSON string
110
+ var _iterator = _createForOfIteratorHelper(Note.RequiredProperties),
111
+ _step;
112
+ try {
113
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
114
+ var property = _step.value;
115
+ if (!data[property]) {
116
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
117
+ }
118
+ }
119
+ // ensure the json data is a string
120
+ } catch (err) {
121
+ _iterator.e(err);
122
+ } finally {
123
+ _iterator.f();
124
+ }
125
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
126
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
127
+ }
82
128
  // ensure the json data is a string
83
- if (data["payload"] && !(typeof data["payload"] === "string" || data["payload"] instanceof String)) {
84
- throw new Error("Expected the field `payload` to be a primitive type in the JSON string but got " + data["payload"]);
129
+ if (data['where'] && !(typeof data['where'] === 'string' || data['where'] instanceof String)) {
130
+ throw new Error("Expected the field `where` to be a primitive type in the JSON string but got " + data['where']);
85
131
  }
86
132
  return true;
87
133
  }
88
134
  }]);
89
135
  }();
136
+ Note.RequiredProperties = ["body", "id", "time"];
137
+
138
+ /**
139
+ * Arbitrary user-defined JSON for the note.
140
+ * @member {Object.<String, Object>} body
141
+ */
142
+ Note.prototype['body'] = undefined;
143
+
144
+ /**
145
+ * True if originated from an edge source.
146
+ * @member {Boolean} edge
147
+ */
148
+ Note.prototype['edge'] = undefined;
149
+
150
+ /**
151
+ * Note name/identifier (e.g., \"1:435\", \"my_note\").
152
+ * @member {String} id
153
+ */
154
+ Note.prototype['id'] = undefined;
155
+
156
+ /**
157
+ * Optional base64-encoded payload.
158
+ * @member {Blob} payload
159
+ */
160
+ Note.prototype['payload'] = undefined;
161
+
162
+ /**
163
+ * True if the note is pending delivery or processing.
164
+ * @member {Boolean} pending
165
+ */
166
+ Note.prototype['pending'] = undefined;
167
+
90
168
  /**
91
- * @member {Object} body
169
+ * Unix epoch seconds.
170
+ * @member {Number} time
92
171
  */
93
- Note.prototype["body"] = undefined;
172
+ Note.prototype['time'] = undefined;
94
173
 
95
174
  /**
96
- * @member {String} payload
175
+ * Optional location/metadata string.
176
+ * @member {String} where
97
177
  */
98
- Note.prototype["payload"] = undefined;
178
+ Note.prototype['where'] = undefined;
99
179
  var _default = exports["default"] = Note;
@@ -13,7 +13,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
14
  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); } /**
15
15
  * Notehub API
16
- * The OpenAPI definition for the Notehub.io API.
16
+ * The OpenAPI definition for the Notehub.io API.
17
17
  *
18
18
  * The version of the OpenAPI document: 1.2.0
19
19
  * Contact: engineering@blues.io
@@ -24,18 +24,18 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
24
24
  *
25
25
  */
26
26
  /**
27
- * The ListNotefiles200Response model module.
28
- * @module model/ListNotefiles200Response
29
- * @version 3.0.0
27
+ * The NoteInput model module.
28
+ * @module model/NoteInput
29
+ * @version 4.0.0-beta.1
30
30
  */
31
- var ListNotefiles200Response = /*#__PURE__*/function () {
31
+ var NoteInput = /*#__PURE__*/function () {
32
32
  /**
33
- * Constructs a new <code>ListNotefiles200Response</code>.
34
- * @alias module:model/ListNotefiles200Response
33
+ * Constructs a new <code>NoteInput</code>.
34
+ * @alias module:model/NoteInput
35
35
  */
36
- function ListNotefiles200Response() {
37
- _classCallCheck(this, ListNotefiles200Response);
38
- ListNotefiles200Response.initialize(this);
36
+ function NoteInput() {
37
+ _classCallCheck(this, NoteInput);
38
+ NoteInput.initialize(this);
39
39
  }
40
40
 
41
41
  /**
@@ -43,30 +43,29 @@ var ListNotefiles200Response = /*#__PURE__*/function () {
43
43
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
44
  * Only for internal use.
45
45
  */
46
- return _createClass(ListNotefiles200Response, null, [{
46
+ return _createClass(NoteInput, null, [{
47
47
  key: "initialize",
48
48
  value: function initialize(obj) {}
49
49
 
50
50
  /**
51
- * Constructs a <code>ListNotefiles200Response</code> from a plain JavaScript object, optionally creating a new instance.
51
+ * Constructs a <code>NoteInput</code> from a plain JavaScript object, optionally creating a new instance.
52
52
  * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
53
  * @param {Object} data The plain JavaScript object bearing properties of interest.
54
- * @param {module:model/ListNotefiles200Response} obj Optional instance to populate.
55
- * @return {module:model/ListNotefiles200Response} The populated <code>ListNotefiles200Response</code> instance.
54
+ * @param {module:model/NoteInput} obj Optional instance to populate.
55
+ * @return {module:model/NoteInput} The populated <code>NoteInput</code> instance.
56
56
  */
57
57
  }, {
58
58
  key: "constructFromObject",
59
59
  value: function constructFromObject(data, obj) {
60
60
  if (data) {
61
- obj = obj || new ListNotefiles200Response();
62
- if (data.hasOwnProperty("changes")) {
63
- obj["changes"] = _ApiClient["default"].convertToType(data["changes"], "Number");
61
+ obj = obj || new NoteInput();
62
+ if (data.hasOwnProperty('body')) {
63
+ obj['body'] = _ApiClient["default"].convertToType(data['body'], {
64
+ 'String': Object
65
+ });
64
66
  }
65
- if (data.hasOwnProperty("info")) {
66
- obj["info"] = _ApiClient["default"].convertToType(data["info"], Object);
67
- }
68
- if (data.hasOwnProperty("total")) {
69
- obj["total"] = _ApiClient["default"].convertToType(data["total"], "Number");
67
+ if (data.hasOwnProperty('payload')) {
68
+ obj['payload'] = _ApiClient["default"].convertToType(data['payload'], 'Blob');
70
69
  }
71
70
  } else if (data === null) {
72
71
  return null;
@@ -75,9 +74,9 @@ var ListNotefiles200Response = /*#__PURE__*/function () {
75
74
  }
76
75
 
77
76
  /**
78
- * Validates the JSON data with respect to <code>ListNotefiles200Response</code>.
77
+ * Validates the JSON data with respect to <code>NoteInput</code>.
79
78
  * @param {Object} data The plain JavaScript object bearing properties of interest.
80
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ListNotefiles200Response</code>.
79
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>NoteInput</code>.
81
80
  */
82
81
  }, {
83
82
  key: "validateJSON",
@@ -87,20 +86,14 @@ var ListNotefiles200Response = /*#__PURE__*/function () {
87
86
  }]);
88
87
  }();
89
88
  /**
90
- * The number of pending changes in the Notefile.
91
- * @member {Number} changes
92
- */
93
- ListNotefiles200Response.prototype["changes"] = undefined;
94
-
95
- /**
96
- * An object with a key for each Notefile that matched the request parameters, and value object with the changes and total for each file.
97
- * @member {Object} info
89
+ * Arbitrary user-defined JSON for the note.
90
+ * @member {Object.<String, Object>} body
98
91
  */
99
- ListNotefiles200Response.prototype["info"] = undefined;
92
+ NoteInput.prototype['body'] = undefined;
100
93
 
101
94
  /**
102
- * The total number of files.
103
- * @member {Number} total
95
+ * Optional base64-encoded payload.
96
+ * @member {Blob} payload
104
97
  */
105
- ListNotefiles200Response.prototype["total"] = undefined;
106
- var _default = exports["default"] = ListNotefiles200Response;
98
+ NoteInput.prototype['payload'] = undefined;
99
+ var _default = exports["default"] = NoteInput;