@blues-inc/notehub-js 2.1.0-beta.9 → 2.2.0
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.
- package/README.md +238 -246
- package/dist/ApiClient.js +154 -154
- package/dist/api/AlertApi.js +22 -22
- package/dist/api/AuthorizationApi.js +31 -31
- package/dist/api/BillingAccountApi.js +14 -14
- package/dist/api/DeviceApi.js +374 -374
- package/dist/api/EventApi.js +118 -118
- package/dist/api/ExternalDevicesApi.js +41 -41
- package/dist/api/MonitorApi.js +52 -52
- package/dist/api/ProjectApi.js +381 -381
- package/dist/api/RouteApi.js +77 -77
- package/dist/api/UsageApi.js +50 -41
- package/dist/api/WebhookApi.js +51 -51
- package/dist/model/Alert.js +74 -76
- package/dist/model/AlertDataInner.js +35 -35
- package/dist/model/AlertNotificationsInner.js +18 -18
- package/dist/model/Aws.js +65 -65
- package/dist/model/AwsFilter.js +19 -19
- package/dist/model/AwsTransform.js +20 -20
- package/dist/model/Azure.js +43 -43
- package/dist/model/BillingAccount.js +21 -21
- package/dist/model/BillingAccountRole.js +9 -9
- package/dist/model/Body.js +5 -5
- package/dist/model/CellularPlan.js +34 -34
- package/dist/model/CloneProjectRequest.js +20 -20
- package/dist/model/Contact.js +22 -22
- package/dist/model/CreateFleetRequest.js +12 -12
- package/dist/model/CreateMonitor.js +125 -126
- package/dist/model/CreateProductRequest.js +22 -22
- package/dist/model/CreateProjectRequest.js +16 -16
- package/dist/model/CreateUpdateRepository.js +17 -17
- package/dist/model/CurrentFirmware.js +12 -12
- package/dist/model/DFUEnv.js +12 -12
- package/dist/model/DFUState.js +65 -65
- package/dist/model/DataField.js +7 -7
- package/dist/model/DataSetField.js +19 -19
- package/dist/model/DataUsage.js +14 -14
- package/dist/model/DeleteDeviceFleetsRequest.js +8 -8
- package/dist/model/Device.js +101 -102
- package/dist/model/DeviceDfuHistory.js +19 -20
- package/dist/model/DeviceDfuHistoryCurrent.js +32 -32
- package/dist/model/DeviceDfuHistoryPage.js +12 -13
- package/dist/model/DeviceDfuStateMachine.js +24 -25
- package/dist/model/DeviceDfuStateMachineNode.js +22 -22
- package/dist/model/DeviceDfuStatus.js +20 -20
- package/dist/model/DeviceDfuStatusPage.js +12 -13
- package/dist/model/DeviceSession.js +221 -221
- package/dist/model/DeviceTowerInfo.js +14 -14
- package/dist/model/DeviceUsage.js +32 -32
- package/dist/model/DfuActionRequest.js +7 -7
- package/dist/model/EmailNotification.js +7 -7
- package/dist/model/EnvTreeJsonNode.js +67 -69
- package/dist/model/EnvVar.js +18 -18
- package/dist/model/EnvironmentVariables.js +8 -8
- package/dist/model/Error.js +31 -31
- package/dist/model/Event.js +248 -248
- package/dist/model/Firmware.js +49 -49
- package/dist/model/FirmwareInfo.js +60 -60
- package/dist/model/Fleet.js +30 -30
- package/dist/model/GetAlerts200Response.js +14 -15
- package/dist/model/GetBillingAccounts200Response.js +9 -10
- package/dist/model/GetDataUsage200Response.js +9 -10
- package/dist/model/GetDataUsage200ResponseDataInner.js +53 -43
- package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +16 -16
- package/dist/model/GetDeviceFleets200Response.js +11 -12
- package/dist/model/GetDeviceHealthLog200Response.js +11 -12
- package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +19 -19
- package/dist/model/GetDeviceLatest200Response.js +9 -10
- package/dist/model/GetDevicePlans200Response.js +9 -10
- package/dist/model/GetDevicePublicKey200Response.js +16 -16
- package/dist/model/GetDeviceSessions200Response.js +16 -17
- package/dist/model/GetProducts200Response.js +9 -10
- package/dist/model/GetProjectDevicePublicKeys200Response.js +16 -17
- package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +12 -12
- package/dist/model/GetProjectDevices200Response.js +16 -17
- package/dist/model/GetProjectEvents200Response.js +20 -21
- package/dist/model/GetProjectEventsByCursor200Response.js +23 -24
- package/dist/model/GetProjectMembers200Response.js +11 -12
- package/dist/model/GetProjects200Response.js +9 -10
- package/dist/model/GetSessionsUsage200Response.js +11 -12
- package/dist/model/GetWebhooks200Response.js +9 -10
- package/dist/model/Google.js +33 -33
- package/dist/model/HandleNoteChanges200Response.js +11 -11
- package/dist/model/HandleNoteGet200Response.js +13 -13
- package/dist/model/HandleNoteSignal200Response.js +5 -5
- package/dist/model/HandleNotefileChanges200Response.js +11 -11
- package/dist/model/HandleNotefileChangesPending200Response.js +14 -14
- package/dist/model/HandleNotefileDeleteRequest.js +7 -7
- package/dist/model/Http.js +35 -35
- package/dist/model/Location.js +40 -40
- package/dist/model/Login200Response.js +7 -7
- package/dist/model/LoginRequest.js +12 -12
- package/dist/model/Monitor.js +99 -100
- package/dist/model/MonitorAlertRoutesInner.js +10 -9
- package/dist/model/Mqtt.js +66 -66
- package/dist/model/Note.js +10 -10
- package/dist/model/NotefileSchema.js +18 -19
- package/dist/model/NotehubRoute.js +36 -36
- package/dist/model/NotehubRouteSchema.js +46 -45
- package/dist/model/OAuth2Error.js +20 -20
- package/dist/model/OAuth2TokenResponse.js +23 -23
- package/dist/model/PersonalAccessToken.js +34 -34
- package/dist/model/PersonalAccessTokenCreatedBy.js +17 -17
- package/dist/model/PersonalAccessTokenInfo.js +18 -18
- package/dist/model/PersonalAccessTokenSecret.js +12 -12
- package/dist/model/PostProvisionProjectDeviceRequest.js +18 -18
- package/dist/model/Product.js +26 -26
- package/dist/model/Project.js +34 -34
- package/dist/model/ProjectMember.js +22 -22
- package/dist/model/Proxy.js +24 -24
- package/dist/model/PutDeviceFleetsRequest.js +8 -8
- package/dist/model/Radresponder.js +25 -25
- package/dist/model/Repository.js +22 -22
- package/dist/model/Role.js +9 -9
- package/dist/model/RouteLog.js +38 -38
- package/dist/model/SatellitePlan.js +26 -26
- package/dist/model/SchemaProperty.js +36 -38
- package/dist/model/SimUsage.js +19 -19
- package/dist/model/Slack.js +53 -53
- package/dist/model/SlackBearerNotification.js +25 -25
- package/dist/model/SlackTransform.js +12 -12
- package/dist/model/SlackWebHookNotification.js +20 -20
- package/dist/model/Snowflake.js +45 -45
- package/dist/model/Thingworx.js +33 -33
- package/dist/model/TowerLocation.js +54 -54
- package/dist/model/Twilio.js +43 -43
- package/dist/model/UpdateFleetRequest.js +25 -25
- package/dist/model/UploadMetadata.js +64 -64
- package/dist/model/UsageData.js +18 -18
- package/dist/model/UsageEventsData.js +38 -28
- package/dist/model/UsageEventsResponse.js +11 -12
- package/dist/model/UsageRouteLogsData.js +35 -36
- package/dist/model/UsageSessionsData.js +38 -28
- package/dist/model/UserDbRoute.js +25 -25
- package/dist/model/UserDfuStateMachine.js +20 -20
- package/dist/model/UserDfuStateMachineStatus.js +20 -20
- package/dist/model/UserFirmwareInfo.js +12 -12
- package/dist/model/WebhookSettings.js +15 -15
- package/package.json +3 -3
package/dist/api/WebhookApi.js
CHANGED
|
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
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); } /**
|
|
18
18
|
* Notehub API
|
|
19
|
-
* The OpenAPI definition for the Notehub.io API.
|
|
19
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
20
20
|
*
|
|
21
21
|
* The version of the OpenAPI document: 1.2.0
|
|
22
22
|
* Contact: engineering@blues.io
|
|
@@ -27,18 +27,18 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
30
|
-
* Webhook service.
|
|
31
|
-
* @module api/WebhookApi
|
|
32
|
-
* @version 2.
|
|
33
|
-
*/
|
|
30
|
+
* Webhook service.
|
|
31
|
+
* @module api/WebhookApi
|
|
32
|
+
* @version 2.2.0
|
|
33
|
+
*/
|
|
34
34
|
var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
* Constructs a new WebhookApi.
|
|
37
|
+
* @alias module:api/WebhookApi
|
|
38
|
+
* @class
|
|
39
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
40
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
41
|
+
*/
|
|
42
42
|
function WebhookApi(apiClient) {
|
|
43
43
|
_classCallCheck(this, WebhookApi);
|
|
44
44
|
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
@@ -46,9 +46,9 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Creates a webhook for the specified product with the given name. The name | must be unique within the project.
|
|
49
|
-
* @param {String} projectOrProductUID
|
|
49
|
+
* @param {String} projectOrProductUID
|
|
50
50
|
* @param {String} webhookUID Webhook UID
|
|
51
|
-
* @param {module:model/WebhookSettings} webhookSettings
|
|
51
|
+
* @param {module:model/WebhookSettings} webhookSettings
|
|
52
52
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
53
53
|
*/
|
|
54
54
|
return _createClass(WebhookApi, [{
|
|
@@ -68,24 +68,24 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
68
68
|
throw new _Error["default"]("Missing the required parameter 'webhookSettings' when calling createWebhook");
|
|
69
69
|
}
|
|
70
70
|
var pathParams = {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
projectOrProductUID: projectOrProductUID,
|
|
72
|
+
webhookUID: webhookUID
|
|
73
73
|
};
|
|
74
74
|
var queryParams = {};
|
|
75
75
|
var headerParams = {};
|
|
76
76
|
var formParams = {};
|
|
77
|
-
var authNames = [
|
|
78
|
-
var contentTypes = [
|
|
79
|
-
var accepts = [
|
|
77
|
+
var authNames = ["personalAccessToken"];
|
|
78
|
+
var contentTypes = ["application/json"];
|
|
79
|
+
var accepts = ["application/json"];
|
|
80
80
|
var returnType = null;
|
|
81
|
-
return this.apiClient.callApi(
|
|
81
|
+
return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", "POST", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Creates a webhook for the specified product with the given name. The name | must be unique within the project.
|
|
86
|
-
* @param {String} projectOrProductUID
|
|
86
|
+
* @param {String} projectOrProductUID
|
|
87
87
|
* @param {String} webhookUID Webhook UID
|
|
88
|
-
* @param {module:model/WebhookSettings} webhookSettings
|
|
88
|
+
* @param {module:model/WebhookSettings} webhookSettings
|
|
89
89
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
90
90
|
*/
|
|
91
91
|
}, {
|
|
@@ -98,7 +98,7 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* Deletes the specified webhook
|
|
101
|
-
* @param {String} projectOrProductUID
|
|
101
|
+
* @param {String} projectOrProductUID
|
|
102
102
|
* @param {String} webhookUID Webhook UID
|
|
103
103
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
104
104
|
*/
|
|
@@ -115,22 +115,22 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
115
115
|
throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling deleteWebhook");
|
|
116
116
|
}
|
|
117
117
|
var pathParams = {
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
projectOrProductUID: projectOrProductUID,
|
|
119
|
+
webhookUID: webhookUID
|
|
120
120
|
};
|
|
121
121
|
var queryParams = {};
|
|
122
122
|
var headerParams = {};
|
|
123
123
|
var formParams = {};
|
|
124
|
-
var authNames = [
|
|
124
|
+
var authNames = ["personalAccessToken"];
|
|
125
125
|
var contentTypes = [];
|
|
126
|
-
var accepts = [
|
|
126
|
+
var accepts = ["application/json"];
|
|
127
127
|
var returnType = null;
|
|
128
|
-
return this.apiClient.callApi(
|
|
128
|
+
return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", "DELETE", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Deletes the specified webhook
|
|
133
|
-
* @param {String} projectOrProductUID
|
|
133
|
+
* @param {String} projectOrProductUID
|
|
134
134
|
* @param {String} webhookUID Webhook UID
|
|
135
135
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
136
136
|
*/
|
|
@@ -144,7 +144,7 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* Retrieves the configuration settings for the specified webhook
|
|
147
|
-
* @param {String} projectOrProductUID
|
|
147
|
+
* @param {String} projectOrProductUID
|
|
148
148
|
* @param {String} webhookUID Webhook UID
|
|
149
149
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WebhookSettings} and HTTP response
|
|
150
150
|
*/
|
|
@@ -161,22 +161,22 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
161
161
|
throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling getWebhook");
|
|
162
162
|
}
|
|
163
163
|
var pathParams = {
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
projectOrProductUID: projectOrProductUID,
|
|
165
|
+
webhookUID: webhookUID
|
|
166
166
|
};
|
|
167
167
|
var queryParams = {};
|
|
168
168
|
var headerParams = {};
|
|
169
169
|
var formParams = {};
|
|
170
|
-
var authNames = [
|
|
170
|
+
var authNames = ["personalAccessToken"];
|
|
171
171
|
var contentTypes = [];
|
|
172
|
-
var accepts = [
|
|
172
|
+
var accepts = ["application/json"];
|
|
173
173
|
var returnType = _WebhookSettings["default"];
|
|
174
|
-
return this.apiClient.callApi(
|
|
174
|
+
return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", "GET", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* Retrieves the configuration settings for the specified webhook
|
|
179
|
-
* @param {String} projectOrProductUID
|
|
179
|
+
* @param {String} projectOrProductUID
|
|
180
180
|
* @param {String} webhookUID Webhook UID
|
|
181
181
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/WebhookSettings}
|
|
182
182
|
*/
|
|
@@ -190,7 +190,7 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* Retrieves all webhooks for the specified project
|
|
193
|
-
* @param {String} projectOrProductUID
|
|
193
|
+
* @param {String} projectOrProductUID
|
|
194
194
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetWebhooks200Response} and HTTP response
|
|
195
195
|
*/
|
|
196
196
|
}, {
|
|
@@ -202,21 +202,21 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
202
202
|
throw new _Error["default"]("Missing the required parameter 'projectOrProductUID' when calling getWebhooks");
|
|
203
203
|
}
|
|
204
204
|
var pathParams = {
|
|
205
|
-
|
|
205
|
+
projectOrProductUID: projectOrProductUID
|
|
206
206
|
};
|
|
207
207
|
var queryParams = {};
|
|
208
208
|
var headerParams = {};
|
|
209
209
|
var formParams = {};
|
|
210
|
-
var authNames = [
|
|
210
|
+
var authNames = ["personalAccessToken"];
|
|
211
211
|
var contentTypes = [];
|
|
212
|
-
var accepts = [
|
|
212
|
+
var accepts = ["application/json"];
|
|
213
213
|
var returnType = _GetWebhooks200Response["default"];
|
|
214
|
-
return this.apiClient.callApi(
|
|
214
|
+
return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks", "GET", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* Retrieves all webhooks for the specified project
|
|
219
|
-
* @param {String} projectOrProductUID
|
|
219
|
+
* @param {String} projectOrProductUID
|
|
220
220
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetWebhooks200Response}
|
|
221
221
|
*/
|
|
222
222
|
}, {
|
|
@@ -229,9 +229,9 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
231
|
* Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings.
|
|
232
|
-
* @param {String} projectOrProductUID
|
|
232
|
+
* @param {String} projectOrProductUID
|
|
233
233
|
* @param {String} webhookUID Webhook UID
|
|
234
|
-
* @param {module:model/WebhookSettings} webhookSettings
|
|
234
|
+
* @param {module:model/WebhookSettings} webhookSettings
|
|
235
235
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
236
236
|
*/
|
|
237
237
|
}, {
|
|
@@ -251,24 +251,24 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
251
251
|
throw new _Error["default"]("Missing the required parameter 'webhookSettings' when calling updateWebhook");
|
|
252
252
|
}
|
|
253
253
|
var pathParams = {
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
projectOrProductUID: projectOrProductUID,
|
|
255
|
+
webhookUID: webhookUID
|
|
256
256
|
};
|
|
257
257
|
var queryParams = {};
|
|
258
258
|
var headerParams = {};
|
|
259
259
|
var formParams = {};
|
|
260
|
-
var authNames = [
|
|
261
|
-
var contentTypes = [
|
|
262
|
-
var accepts = [
|
|
260
|
+
var authNames = ["personalAccessToken"];
|
|
261
|
+
var contentTypes = ["application/json"];
|
|
262
|
+
var accepts = ["application/json"];
|
|
263
263
|
var returnType = null;
|
|
264
|
-
return this.apiClient.callApi(
|
|
264
|
+
return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", "PUT", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings.
|
|
269
|
-
* @param {String} projectOrProductUID
|
|
269
|
+
* @param {String} projectOrProductUID
|
|
270
270
|
* @param {String} webhookUID Webhook UID
|
|
271
|
-
* @param {module:model/WebhookSettings} webhookSettings
|
|
271
|
+
* @param {module:model/WebhookSettings} webhookSettings
|
|
272
272
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
273
273
|
*/
|
|
274
274
|
}, {
|
package/dist/model/Alert.js
CHANGED
|
@@ -18,7 +18,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
19
|
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); } /**
|
|
20
20
|
* Notehub API
|
|
21
|
-
* The OpenAPI definition for the Notehub.io API.
|
|
21
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
22
22
|
*
|
|
23
23
|
* The version of the OpenAPI document: 1.2.0
|
|
24
24
|
* Contact: engineering@blues.io
|
|
@@ -31,7 +31,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
31
31
|
/**
|
|
32
32
|
* The Alert model module.
|
|
33
33
|
* @module model/Alert
|
|
34
|
-
* @version 2.
|
|
34
|
+
* @version 2.2.0
|
|
35
35
|
*/
|
|
36
36
|
var Alert = /*#__PURE__*/function () {
|
|
37
37
|
/**
|
|
@@ -64,47 +64,47 @@ var Alert = /*#__PURE__*/function () {
|
|
|
64
64
|
value: function constructFromObject(data, obj) {
|
|
65
65
|
if (data) {
|
|
66
66
|
obj = obj || new Alert();
|
|
67
|
-
if (data.hasOwnProperty(
|
|
68
|
-
obj[
|
|
67
|
+
if (data.hasOwnProperty("alert_source")) {
|
|
68
|
+
obj["alert_source"] = _ApiClient["default"].convertToType(data["alert_source"], "String");
|
|
69
69
|
}
|
|
70
|
-
if (data.hasOwnProperty(
|
|
71
|
-
obj[
|
|
70
|
+
if (data.hasOwnProperty("created_at")) {
|
|
71
|
+
obj["created_at"] = _ApiClient["default"].convertToType(data["created_at"], "Number");
|
|
72
72
|
}
|
|
73
|
-
if (data.hasOwnProperty(
|
|
74
|
-
obj[
|
|
73
|
+
if (data.hasOwnProperty("data")) {
|
|
74
|
+
obj["data"] = _ApiClient["default"].convertToType(data["data"], [_AlertDataInner["default"]]);
|
|
75
75
|
}
|
|
76
|
-
if (data.hasOwnProperty(
|
|
77
|
-
obj[
|
|
76
|
+
if (data.hasOwnProperty("device_uid")) {
|
|
77
|
+
obj["device_uid"] = _ApiClient["default"].convertToType(data["device_uid"], "String");
|
|
78
78
|
}
|
|
79
|
-
if (data.hasOwnProperty(
|
|
80
|
-
obj[
|
|
79
|
+
if (data.hasOwnProperty("field_name")) {
|
|
80
|
+
obj["field_name"] = _ApiClient["default"].convertToType(data["field_name"], "String");
|
|
81
81
|
}
|
|
82
|
-
if (data.hasOwnProperty(
|
|
83
|
-
obj[
|
|
82
|
+
if (data.hasOwnProperty("monitor_name")) {
|
|
83
|
+
obj["monitor_name"] = _ApiClient["default"].convertToType(data["monitor_name"], "String");
|
|
84
84
|
}
|
|
85
|
-
if (data.hasOwnProperty(
|
|
86
|
-
obj[
|
|
85
|
+
if (data.hasOwnProperty("monitor_type")) {
|
|
86
|
+
obj["monitor_type"] = _ApiClient["default"].convertToType(data["monitor_type"], "String");
|
|
87
87
|
}
|
|
88
|
-
if (data.hasOwnProperty(
|
|
89
|
-
obj[
|
|
88
|
+
if (data.hasOwnProperty("monitor_uid")) {
|
|
89
|
+
obj["monitor_uid"] = _ApiClient["default"].convertToType(data["monitor_uid"], "String");
|
|
90
90
|
}
|
|
91
|
-
if (data.hasOwnProperty(
|
|
92
|
-
obj[
|
|
91
|
+
if (data.hasOwnProperty("notifications")) {
|
|
92
|
+
obj["notifications"] = _ApiClient["default"].convertToType(data["notifications"], [_AlertNotificationsInner["default"]]);
|
|
93
93
|
}
|
|
94
|
-
if (data.hasOwnProperty(
|
|
95
|
-
obj[
|
|
94
|
+
if (data.hasOwnProperty("resolved")) {
|
|
95
|
+
obj["resolved"] = _ApiClient["default"].convertToType(data["resolved"], "Boolean");
|
|
96
96
|
}
|
|
97
|
-
if (data.hasOwnProperty(
|
|
98
|
-
obj[
|
|
97
|
+
if (data.hasOwnProperty("source")) {
|
|
98
|
+
obj["source"] = _ApiClient["default"].convertToType(data["source"], "String");
|
|
99
99
|
}
|
|
100
|
-
if (data.hasOwnProperty(
|
|
101
|
-
obj[
|
|
100
|
+
if (data.hasOwnProperty("uid")) {
|
|
101
|
+
obj["uid"] = _ApiClient["default"].convertToType(data["uid"], "String");
|
|
102
102
|
}
|
|
103
|
-
if (data.hasOwnProperty(
|
|
104
|
-
obj[
|
|
103
|
+
if (data.hasOwnProperty("value")) {
|
|
104
|
+
obj["value"] = _ApiClient["default"].convertToType(data["value"], "Number");
|
|
105
105
|
}
|
|
106
|
-
if (data.hasOwnProperty(
|
|
107
|
-
obj[
|
|
106
|
+
if (data.hasOwnProperty("version")) {
|
|
107
|
+
obj["version"] = _ApiClient["default"].convertToType(data["version"], "Number");
|
|
108
108
|
}
|
|
109
109
|
} else if (data === null) {
|
|
110
110
|
return null;
|
|
@@ -121,17 +121,17 @@ var Alert = /*#__PURE__*/function () {
|
|
|
121
121
|
key: "validateJSON",
|
|
122
122
|
value: function validateJSON(data) {
|
|
123
123
|
// ensure the json data is a string
|
|
124
|
-
if (data[
|
|
125
|
-
throw new Error("Expected the field `alert_source` to be a primitive type in the JSON string but got " + data[
|
|
124
|
+
if (data["alert_source"] && !(typeof data["alert_source"] === "string" || data["alert_source"] instanceof String)) {
|
|
125
|
+
throw new Error("Expected the field `alert_source` to be a primitive type in the JSON string but got " + data["alert_source"]);
|
|
126
126
|
}
|
|
127
|
-
if (data[
|
|
127
|
+
if (data["data"]) {
|
|
128
128
|
// data not null
|
|
129
129
|
// ensure the json data is an array
|
|
130
|
-
if (!Array.isArray(data[
|
|
131
|
-
throw new Error("Expected the field `data` to be an array in the JSON data but got " + data[
|
|
130
|
+
if (!Array.isArray(data["data"])) {
|
|
131
|
+
throw new Error("Expected the field `data` to be an array in the JSON data but got " + data["data"]);
|
|
132
132
|
}
|
|
133
133
|
// validate the optional field `data` (array)
|
|
134
|
-
var _iterator = _createForOfIteratorHelper(data[
|
|
134
|
+
var _iterator = _createForOfIteratorHelper(data["data"]),
|
|
135
135
|
_step;
|
|
136
136
|
try {
|
|
137
137
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -143,36 +143,35 @@ var Alert = /*#__PURE__*/function () {
|
|
|
143
143
|
} finally {
|
|
144
144
|
_iterator.f();
|
|
145
145
|
}
|
|
146
|
-
;
|
|
147
146
|
}
|
|
148
147
|
// ensure the json data is a string
|
|
149
|
-
if (data[
|
|
150
|
-
throw new Error("Expected the field `device_uid` to be a primitive type in the JSON string but got " + data[
|
|
148
|
+
if (data["device_uid"] && !(typeof data["device_uid"] === "string" || data["device_uid"] instanceof String)) {
|
|
149
|
+
throw new Error("Expected the field `device_uid` to be a primitive type in the JSON string but got " + data["device_uid"]);
|
|
151
150
|
}
|
|
152
151
|
// ensure the json data is a string
|
|
153
|
-
if (data[
|
|
154
|
-
throw new Error("Expected the field `field_name` to be a primitive type in the JSON string but got " + data[
|
|
152
|
+
if (data["field_name"] && !(typeof data["field_name"] === "string" || data["field_name"] instanceof String)) {
|
|
153
|
+
throw new Error("Expected the field `field_name` to be a primitive type in the JSON string but got " + data["field_name"]);
|
|
155
154
|
}
|
|
156
155
|
// ensure the json data is a string
|
|
157
|
-
if (data[
|
|
158
|
-
throw new Error("Expected the field `monitor_name` to be a primitive type in the JSON string but got " + data[
|
|
156
|
+
if (data["monitor_name"] && !(typeof data["monitor_name"] === "string" || data["monitor_name"] instanceof String)) {
|
|
157
|
+
throw new Error("Expected the field `monitor_name` to be a primitive type in the JSON string but got " + data["monitor_name"]);
|
|
159
158
|
}
|
|
160
159
|
// ensure the json data is a string
|
|
161
|
-
if (data[
|
|
162
|
-
throw new Error("Expected the field `monitor_type` to be a primitive type in the JSON string but got " + data[
|
|
160
|
+
if (data["monitor_type"] && !(typeof data["monitor_type"] === "string" || data["monitor_type"] instanceof String)) {
|
|
161
|
+
throw new Error("Expected the field `monitor_type` to be a primitive type in the JSON string but got " + data["monitor_type"]);
|
|
163
162
|
}
|
|
164
163
|
// ensure the json data is a string
|
|
165
|
-
if (data[
|
|
166
|
-
throw new Error("Expected the field `monitor_uid` to be a primitive type in the JSON string but got " + data[
|
|
164
|
+
if (data["monitor_uid"] && !(typeof data["monitor_uid"] === "string" || data["monitor_uid"] instanceof String)) {
|
|
165
|
+
throw new Error("Expected the field `monitor_uid` to be a primitive type in the JSON string but got " + data["monitor_uid"]);
|
|
167
166
|
}
|
|
168
|
-
if (data[
|
|
167
|
+
if (data["notifications"]) {
|
|
169
168
|
// data not null
|
|
170
169
|
// ensure the json data is an array
|
|
171
|
-
if (!Array.isArray(data[
|
|
172
|
-
throw new Error("Expected the field `notifications` to be an array in the JSON data but got " + data[
|
|
170
|
+
if (!Array.isArray(data["notifications"])) {
|
|
171
|
+
throw new Error("Expected the field `notifications` to be an array in the JSON data but got " + data["notifications"]);
|
|
173
172
|
}
|
|
174
173
|
// validate the optional field `notifications` (array)
|
|
175
|
-
var _iterator2 = _createForOfIteratorHelper(data[
|
|
174
|
+
var _iterator2 = _createForOfIteratorHelper(data["notifications"]),
|
|
176
175
|
_step2;
|
|
177
176
|
try {
|
|
178
177
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -184,15 +183,14 @@ var Alert = /*#__PURE__*/function () {
|
|
|
184
183
|
} finally {
|
|
185
184
|
_iterator2.f();
|
|
186
185
|
}
|
|
187
|
-
;
|
|
188
186
|
}
|
|
189
187
|
// ensure the json data is a string
|
|
190
|
-
if (data[
|
|
191
|
-
throw new Error("Expected the field `source` to be a primitive type in the JSON string but got " + data[
|
|
188
|
+
if (data["source"] && !(typeof data["source"] === "string" || data["source"] instanceof String)) {
|
|
189
|
+
throw new Error("Expected the field `source` to be a primitive type in the JSON string but got " + data["source"]);
|
|
192
190
|
}
|
|
193
191
|
// ensure the json data is a string
|
|
194
|
-
if (data[
|
|
195
|
-
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data[
|
|
192
|
+
if (data["uid"] && !(typeof data["uid"] === "string" || data["uid"] instanceof String)) {
|
|
193
|
+
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data["uid"]);
|
|
196
194
|
}
|
|
197
195
|
return true;
|
|
198
196
|
}
|
|
@@ -202,100 +200,100 @@ var Alert = /*#__PURE__*/function () {
|
|
|
202
200
|
* The source of the alert
|
|
203
201
|
* @member {module:model/Alert.AlertSourceEnum} alert_source
|
|
204
202
|
*/
|
|
205
|
-
Alert.prototype[
|
|
203
|
+
Alert.prototype["alert_source"] = undefined;
|
|
206
204
|
|
|
207
205
|
/**
|
|
208
206
|
* The time the alert was created
|
|
209
207
|
* @member {Number} created_at
|
|
210
208
|
*/
|
|
211
|
-
Alert.prototype[
|
|
209
|
+
Alert.prototype["created_at"] = undefined;
|
|
212
210
|
|
|
213
211
|
/**
|
|
214
212
|
* @member {Array.<module:model/AlertDataInner>} data
|
|
215
213
|
*/
|
|
216
|
-
Alert.prototype[
|
|
214
|
+
Alert.prototype["data"] = undefined;
|
|
217
215
|
|
|
218
216
|
/**
|
|
219
217
|
* Device UID
|
|
220
218
|
* @member {String} device_uid
|
|
221
219
|
*/
|
|
222
|
-
Alert.prototype[
|
|
220
|
+
Alert.prototype["device_uid"] = undefined;
|
|
223
221
|
|
|
224
222
|
/**
|
|
225
223
|
* The field name that triggered the alert
|
|
226
224
|
* @member {String} field_name
|
|
227
225
|
*/
|
|
228
|
-
Alert.prototype[
|
|
226
|
+
Alert.prototype["field_name"] = undefined;
|
|
229
227
|
|
|
230
228
|
/**
|
|
231
229
|
* Monitor Name
|
|
232
230
|
* @member {String} monitor_name
|
|
233
231
|
*/
|
|
234
|
-
Alert.prototype[
|
|
232
|
+
Alert.prototype["monitor_name"] = undefined;
|
|
235
233
|
|
|
236
234
|
/**
|
|
237
235
|
* The type of monitor that triggered the alert
|
|
238
236
|
* @member {module:model/Alert.MonitorTypeEnum} monitor_type
|
|
239
237
|
*/
|
|
240
|
-
Alert.prototype[
|
|
238
|
+
Alert.prototype["monitor_type"] = undefined;
|
|
241
239
|
|
|
242
240
|
/**
|
|
243
241
|
* Monitor UID
|
|
244
242
|
* @member {String} monitor_uid
|
|
245
243
|
*/
|
|
246
|
-
Alert.prototype[
|
|
244
|
+
Alert.prototype["monitor_uid"] = undefined;
|
|
247
245
|
|
|
248
246
|
/**
|
|
249
247
|
* @member {Array.<module:model/AlertNotificationsInner>} notifications
|
|
250
248
|
*/
|
|
251
|
-
Alert.prototype[
|
|
249
|
+
Alert.prototype["notifications"] = undefined;
|
|
252
250
|
|
|
253
251
|
/**
|
|
254
252
|
* If true, the alert has been resolved
|
|
255
253
|
* @member {Boolean} resolved
|
|
256
254
|
*/
|
|
257
|
-
Alert.prototype[
|
|
255
|
+
Alert.prototype["resolved"] = undefined;
|
|
258
256
|
|
|
259
257
|
/**
|
|
260
258
|
* The UID of the source of the alert
|
|
261
259
|
* @member {String} source
|
|
262
260
|
*/
|
|
263
|
-
Alert.prototype[
|
|
261
|
+
Alert.prototype["source"] = undefined;
|
|
264
262
|
|
|
265
263
|
/**
|
|
266
264
|
* Alert UID
|
|
267
265
|
* @member {String} uid
|
|
268
266
|
*/
|
|
269
|
-
Alert.prototype[
|
|
267
|
+
Alert.prototype["uid"] = undefined;
|
|
270
268
|
|
|
271
269
|
/**
|
|
272
270
|
* The value that triggered the alert
|
|
273
271
|
* @member {Number} value
|
|
274
272
|
*/
|
|
275
|
-
Alert.prototype[
|
|
273
|
+
Alert.prototype["value"] = undefined;
|
|
276
274
|
|
|
277
275
|
/**
|
|
278
276
|
* The version of the alert
|
|
279
277
|
* @member {Number} version
|
|
280
278
|
*/
|
|
281
|
-
Alert.prototype[
|
|
279
|
+
Alert.prototype["version"] = undefined;
|
|
282
280
|
|
|
283
281
|
/**
|
|
284
282
|
* Allowed values for the <code>alert_source</code> property.
|
|
285
283
|
* @enum {String}
|
|
286
284
|
* @readonly
|
|
287
285
|
*/
|
|
288
|
-
Alert[
|
|
286
|
+
Alert["AlertSourceEnum"] = {
|
|
289
287
|
/**
|
|
290
288
|
* value: "app"
|
|
291
289
|
* @const
|
|
292
290
|
*/
|
|
293
|
-
|
|
291
|
+
app: "app",
|
|
294
292
|
/**
|
|
295
293
|
* value: "device"
|
|
296
294
|
* @const
|
|
297
295
|
*/
|
|
298
|
-
|
|
296
|
+
device: "device"
|
|
299
297
|
};
|
|
300
298
|
|
|
301
299
|
/**
|
|
@@ -303,16 +301,16 @@ Alert['AlertSourceEnum'] = {
|
|
|
303
301
|
* @enum {String}
|
|
304
302
|
* @readonly
|
|
305
303
|
*/
|
|
306
|
-
Alert[
|
|
304
|
+
Alert["MonitorTypeEnum"] = {
|
|
307
305
|
/**
|
|
308
306
|
* value: "event"
|
|
309
307
|
* @const
|
|
310
308
|
*/
|
|
311
|
-
|
|
309
|
+
event: "event",
|
|
312
310
|
/**
|
|
313
311
|
* value: "device"
|
|
314
312
|
* @const
|
|
315
313
|
*/
|
|
316
|
-
|
|
314
|
+
device: "device"
|
|
317
315
|
};
|
|
318
316
|
var _default = exports["default"] = Alert;
|