@blues-inc/notehub-js 1.0.37 → 1.0.38-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.
- package/README.md +245 -234
- package/dist/ApiClient.js +154 -156
- package/dist/api/AlertApi.js +22 -22
- package/dist/api/AuthorizationApi.js +79 -16
- package/dist/api/BillingAccountApi.js +14 -14
- package/dist/api/DeviceApi.js +369 -369
- package/dist/api/EventApi.js +118 -118
- package/dist/api/ExternalDevicesApi.js +41 -41
- package/dist/api/MonitorApi.js +61 -61
- package/dist/api/ProjectApi.js +383 -383
- package/dist/api/RouteApi.js +77 -77
- package/dist/api/UsageApi.js +285 -0
- package/dist/api/WebhookApi.js +51 -51
- package/dist/index.js +106 -99
- package/dist/model/Alert.js +114 -112
- package/dist/model/AlertDataInner.js +39 -39
- package/dist/model/AlertNotificationsInner.js +22 -22
- package/dist/model/Aws.js +95 -95
- package/dist/model/{HttpFilter.js → AwsFilter.js} +40 -40
- package/dist/model/{HttpTransform.js → AwsTransform.js} +37 -37
- package/dist/model/Azure.js +61 -61
- package/dist/model/BillingAccount.js +28 -28
- package/dist/model/BillingAccountRole.js +9 -9
- package/dist/model/Body.js +5 -5
- package/dist/model/CloneProjectRequest.js +31 -31
- package/dist/model/Contact.js +26 -26
- package/dist/model/CreateFleetRequest.js +12 -12
- package/dist/model/CreateMonitor.js +216 -215
- package/dist/model/CreateProductRequest.js +36 -36
- package/dist/model/CreateProjectRequest.js +23 -23
- package/dist/model/CreateUpdateRepository.js +22 -22
- package/dist/model/CurrentFirmware.js +16 -16
- package/dist/model/DFUEnv.js +12 -12
- package/dist/model/DFUState.js +97 -97
- package/dist/model/DataField.js +7 -7
- package/dist/model/DataSetField.js +24 -24
- package/dist/model/DeleteDeviceFleetsRequest.js +8 -8
- package/dist/model/Device.js +153 -152
- package/dist/model/DeviceDfuHistory.js +26 -25
- package/dist/model/{DeviceDfuStatusCurrent.js → DeviceDfuHistoryCurrent.js} +58 -58
- package/dist/model/DeviceDfuHistoryPage.js +13 -12
- package/dist/model/DeviceDfuStateMachine.js +30 -29
- package/dist/model/DeviceDfuStateMachineNode.js +30 -30
- package/dist/model/DeviceDfuStatus.js +27 -27
- package/dist/model/DeviceDfuStatusPage.js +13 -12
- package/dist/model/DeviceSession.js +300 -300
- package/dist/model/DeviceTowerInfo.js +18 -18
- package/dist/model/DeviceUsage.js +44 -44
- package/dist/model/DfuActionRequest.js +7 -7
- package/dist/model/EmailNotification.js +7 -7
- package/dist/model/EnvTreeJsonNode.js +100 -98
- package/dist/model/EnvVar.js +20 -20
- package/dist/model/EnvironmentVariables.js +8 -8
- package/dist/model/Error.js +45 -45
- package/dist/model/Event.js +365 -365
- package/dist/model/Firmware.js +59 -59
- package/dist/model/FirmwareInfo.js +83 -83
- package/dist/model/Fleet.js +47 -47
- package/dist/model/GetAlerts200Response.js +15 -14
- package/dist/model/GetBillingAccounts200Response.js +10 -9
- package/dist/model/{GetDeviceEnvironmentVariables200Response.js → GetDeviceEnvironmentVariablesByPin200Response.js} +38 -38
- package/dist/model/{GetProjectFleets200Response.js → GetDeviceFleets200Response.js} +30 -29
- package/dist/model/GetDeviceHealthLog200Response.js +12 -11
- package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +26 -26
- package/dist/model/GetDeviceLatest200Response.js +10 -9
- package/dist/model/GetDevicePublicKey200Response.js +22 -22
- package/dist/model/GetDeviceSessions200Response.js +23 -22
- package/dist/model/GetProjectDevicePublicKeys200Response.js +17 -16
- package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +14 -14
- package/dist/model/GetProjectDevices200Response.js +17 -16
- package/dist/model/GetProjectEvents200Response.js +21 -20
- package/dist/model/GetProjectEventsByCursor200Response.js +31 -30
- package/dist/model/GetProjectMembers200Response.js +12 -11
- package/dist/model/GetProjectProducts200Response.js +10 -9
- package/dist/model/GetProjects200Response.js +10 -9
- package/dist/model/GetWebhooks200Response.js +10 -9
- package/dist/model/Google.js +50 -50
- package/dist/model/HandleNoteChanges200Response.js +16 -16
- package/dist/model/HandleNoteGet200Response.js +13 -13
- package/dist/model/HandleNoteSignal200Response.js +5 -5
- package/dist/model/HandleNotefileChanges200Response.js +16 -16
- package/dist/model/HandleNotefileChangesPending200Response.js +20 -20
- package/dist/model/HandleNotefileDeleteRequest.js +7 -7
- package/dist/model/Http.js +54 -54
- package/dist/model/Location.js +50 -50
- package/dist/model/Login200Response.js +7 -7
- package/dist/model/LoginRequest.js +14 -14
- package/dist/model/Monitor.js +159 -158
- package/dist/model/MonitorAlertRoutesInner.js +18 -19
- package/dist/model/Mqtt.js +98 -98
- package/dist/model/Note.js +10 -10
- package/dist/model/NotefileSchema.js +19 -18
- package/dist/model/NotehubRoute.js +49 -49
- package/dist/model/NotehubRouteSchema.js +100 -101
- package/dist/model/{QuestionDataResponseMap.js → OAuth2Error.js} +66 -43
- package/dist/model/OAuth2TokenResponse.js +154 -0
- package/dist/model/PersonalAccessToken.js +49 -49
- package/dist/model/PersonalAccessTokenCreatedBy.js +20 -20
- package/dist/model/PersonalAccessTokenInfo.js +22 -22
- package/dist/model/PersonalAccessTokenSecret.js +16 -16
- package/dist/model/PostProvisionProjectDeviceRequest.js +25 -25
- package/dist/model/Product.js +36 -36
- package/dist/model/Project.js +47 -47
- package/dist/model/ProjectMember.js +28 -28
- package/dist/model/Proxy.js +34 -34
- package/dist/model/PutDeviceFleetsRequest.js +8 -8
- package/dist/model/Radresponder.js +34 -34
- package/dist/model/Repository.js +28 -28
- package/dist/model/Role.js +9 -9
- package/dist/model/RouteLog.js +48 -48
- package/dist/model/SchemaProperty.js +54 -54
- package/dist/model/SimUsage.js +27 -27
- package/dist/model/Slack.js +82 -82
- package/dist/model/SlackBearerNotification.js +30 -30
- package/dist/model/{SnowflakeTransform.js → SlackTransform.js} +28 -28
- package/dist/model/SlackWebHookNotification.js +25 -25
- package/dist/model/Snowflake.js +66 -66
- package/dist/model/Thingworx.js +48 -48
- package/dist/model/TowerLocation.js +75 -75
- package/dist/model/Twilio.js +65 -65
- package/dist/model/UpdateFleetRequest.js +31 -31
- package/dist/model/UploadMetadata.js +75 -75
- package/dist/model/{AnalyticsEventsData.js → UsageData.js} +45 -39
- package/dist/model/{AnalyticsRouteLogsData.js → UsageEventsData.js} +49 -45
- package/dist/model/{AnalyticsEventsResponse.js → UsageEventsResponse.js} +33 -32
- package/dist/model/UsageRouteLogsData.js +154 -0
- package/dist/model/{AnalyticsSessionsResponse.js → UsageRouteLogsResponse.js} +33 -32
- package/dist/model/{AnalyticsSessionsData.js → UsageSessionsData.js} +48 -44
- package/dist/model/{AnalyticsRouteLogsResponse.js → UsageSessionsResponse.js} +33 -32
- package/dist/model/UserDbRoute.js +33 -33
- package/dist/model/UserDfuStateMachine.js +27 -27
- package/dist/model/UserDfuStateMachineStatus.js +23 -23
- package/dist/model/UserFirmwareInfo.js +12 -12
- package/dist/model/WebhookSettings.js +15 -15
- package/package.json +28 -28
- package/dist/model/DataSet.js +0 -163
- package/dist/model/QuestionDataResponseLineChart.js +0 -204
|
@@ -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,22 +31,22 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
31
31
|
/**
|
|
32
32
|
* The CreateMonitor model module.
|
|
33
33
|
* @module model/CreateMonitor
|
|
34
|
-
* @version 1.0.
|
|
34
|
+
* @version 1.0.38-beta.1
|
|
35
35
|
*/
|
|
36
36
|
var CreateMonitor = /*#__PURE__*/function () {
|
|
37
37
|
/**
|
|
38
38
|
* Constructs a new <code>CreateMonitor</code>.
|
|
39
39
|
* @alias module:model/CreateMonitor
|
|
40
40
|
* @implements module:model/Monitor
|
|
41
|
-
* @param
|
|
42
|
-
* @param description {String}
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
41
|
+
* @param alertRoutes {Array.<module:model/MonitorAlertRoutesInner>}
|
|
42
|
+
* @param description {String}
|
|
43
|
+
* @param name {String}
|
|
44
|
+
* @param notefileFilter {Array.<String>}
|
|
45
45
|
*/
|
|
46
|
-
function CreateMonitor(
|
|
46
|
+
function CreateMonitor(alertRoutes, description, name, notefileFilter) {
|
|
47
47
|
_classCallCheck(this, CreateMonitor);
|
|
48
48
|
_Monitor["default"].initialize(this);
|
|
49
|
-
CreateMonitor.initialize(this,
|
|
49
|
+
CreateMonitor.initialize(this, alertRoutes, description, name, notefileFilter);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
@@ -56,11 +56,11 @@ var CreateMonitor = /*#__PURE__*/function () {
|
|
|
56
56
|
*/
|
|
57
57
|
return _createClass(CreateMonitor, null, [{
|
|
58
58
|
key: "initialize",
|
|
59
|
-
value: function initialize(obj,
|
|
60
|
-
obj[
|
|
61
|
-
obj[
|
|
62
|
-
obj[
|
|
63
|
-
obj[
|
|
59
|
+
value: function initialize(obj, alertRoutes, description, name, notefileFilter) {
|
|
60
|
+
obj['alert_routes'] = alertRoutes;
|
|
61
|
+
obj['description'] = description;
|
|
62
|
+
obj['name'] = name;
|
|
63
|
+
obj['notefile_filter'] = notefileFilter;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -76,59 +76,59 @@ var CreateMonitor = /*#__PURE__*/function () {
|
|
|
76
76
|
if (data) {
|
|
77
77
|
obj = obj || new CreateMonitor();
|
|
78
78
|
_Monitor["default"].constructFromObject(data, obj);
|
|
79
|
-
if (data.hasOwnProperty(
|
|
80
|
-
obj[
|
|
79
|
+
if (data.hasOwnProperty('aggregate_function')) {
|
|
80
|
+
obj['aggregate_function'] = _ApiClient["default"].convertToType(data['aggregate_function'], 'String');
|
|
81
81
|
}
|
|
82
|
-
if (data.hasOwnProperty(
|
|
83
|
-
obj[
|
|
82
|
+
if (data.hasOwnProperty('aggregate_window')) {
|
|
83
|
+
obj['aggregate_window'] = _ApiClient["default"].convertToType(data['aggregate_window'], 'String');
|
|
84
84
|
}
|
|
85
|
-
if (data.hasOwnProperty(
|
|
86
|
-
obj[
|
|
85
|
+
if (data.hasOwnProperty('alert')) {
|
|
86
|
+
obj['alert'] = _ApiClient["default"].convertToType(data['alert'], 'Boolean');
|
|
87
87
|
}
|
|
88
|
-
if (data.hasOwnProperty(
|
|
89
|
-
obj[
|
|
88
|
+
if (data.hasOwnProperty('alert_routes')) {
|
|
89
|
+
obj['alert_routes'] = _ApiClient["default"].convertToType(data['alert_routes'], [_MonitorAlertRoutesInner["default"]]);
|
|
90
90
|
}
|
|
91
|
-
if (data.hasOwnProperty(
|
|
92
|
-
obj[
|
|
91
|
+
if (data.hasOwnProperty('condition_type')) {
|
|
92
|
+
obj['condition_type'] = _ApiClient["default"].convertToType(data['condition_type'], 'String');
|
|
93
93
|
}
|
|
94
|
-
if (data.hasOwnProperty(
|
|
95
|
-
obj[
|
|
94
|
+
if (data.hasOwnProperty('description')) {
|
|
95
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
96
96
|
}
|
|
97
|
-
if (data.hasOwnProperty(
|
|
98
|
-
obj[
|
|
97
|
+
if (data.hasOwnProperty('disabled')) {
|
|
98
|
+
obj['disabled'] = _ApiClient["default"].convertToType(data['disabled'], 'Boolean');
|
|
99
99
|
}
|
|
100
|
-
if (data.hasOwnProperty(
|
|
101
|
-
obj[
|
|
100
|
+
if (data.hasOwnProperty('fleet_filter')) {
|
|
101
|
+
obj['fleet_filter'] = _ApiClient["default"].convertToType(data['fleet_filter'], ['String']);
|
|
102
102
|
}
|
|
103
|
-
if (data.hasOwnProperty(
|
|
104
|
-
obj[
|
|
103
|
+
if (data.hasOwnProperty('last_routed_at')) {
|
|
104
|
+
obj['last_routed_at'] = _ApiClient["default"].convertToType(data['last_routed_at'], 'String');
|
|
105
105
|
}
|
|
106
|
-
if (data.hasOwnProperty(
|
|
107
|
-
obj[
|
|
106
|
+
if (data.hasOwnProperty('name')) {
|
|
107
|
+
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
|
|
108
108
|
}
|
|
109
|
-
if (data.hasOwnProperty(
|
|
110
|
-
obj[
|
|
109
|
+
if (data.hasOwnProperty('notefile_filter')) {
|
|
110
|
+
obj['notefile_filter'] = _ApiClient["default"].convertToType(data['notefile_filter'], ['String']);
|
|
111
111
|
}
|
|
112
|
-
if (data.hasOwnProperty(
|
|
113
|
-
obj[
|
|
112
|
+
if (data.hasOwnProperty('per_device')) {
|
|
113
|
+
obj['per_device'] = _ApiClient["default"].convertToType(data['per_device'], 'Boolean');
|
|
114
114
|
}
|
|
115
|
-
if (data.hasOwnProperty(
|
|
116
|
-
obj[
|
|
115
|
+
if (data.hasOwnProperty('routing_cooldown_period')) {
|
|
116
|
+
obj['routing_cooldown_period'] = _ApiClient["default"].convertToType(data['routing_cooldown_period'], 'String');
|
|
117
117
|
}
|
|
118
|
-
if (data.hasOwnProperty(
|
|
119
|
-
obj[
|
|
118
|
+
if (data.hasOwnProperty('silenced')) {
|
|
119
|
+
obj['silenced'] = _ApiClient["default"].convertToType(data['silenced'], 'Boolean');
|
|
120
120
|
}
|
|
121
|
-
if (data.hasOwnProperty(
|
|
122
|
-
obj[
|
|
121
|
+
if (data.hasOwnProperty('source_selector')) {
|
|
122
|
+
obj['source_selector'] = _ApiClient["default"].convertToType(data['source_selector'], 'String');
|
|
123
123
|
}
|
|
124
|
-
if (data.hasOwnProperty(
|
|
125
|
-
obj[
|
|
124
|
+
if (data.hasOwnProperty('source_type')) {
|
|
125
|
+
obj['source_type'] = _ApiClient["default"].convertToType(data['source_type'], 'String');
|
|
126
126
|
}
|
|
127
|
-
if (data.hasOwnProperty(
|
|
128
|
-
obj[
|
|
127
|
+
if (data.hasOwnProperty('threshold')) {
|
|
128
|
+
obj['threshold'] = _ApiClient["default"].convertToType(data['threshold'], 'Number');
|
|
129
129
|
}
|
|
130
|
-
if (data.hasOwnProperty(
|
|
131
|
-
obj[
|
|
130
|
+
if (data.hasOwnProperty('uid')) {
|
|
131
|
+
obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
|
|
132
132
|
}
|
|
133
133
|
} else if (data === null) {
|
|
134
134
|
return null;
|
|
@@ -160,45 +160,21 @@ var CreateMonitor = /*#__PURE__*/function () {
|
|
|
160
160
|
} finally {
|
|
161
161
|
_iterator.f();
|
|
162
162
|
}
|
|
163
|
-
if (data[
|
|
164
|
-
throw new Error("Expected the field `
|
|
163
|
+
if (data['aggregate_function'] && !(typeof data['aggregate_function'] === 'string' || data['aggregate_function'] instanceof String)) {
|
|
164
|
+
throw new Error("Expected the field `aggregate_function` to be a primitive type in the JSON string but got " + data['aggregate_function']);
|
|
165
165
|
}
|
|
166
166
|
// ensure the json data is a string
|
|
167
|
-
if (data[
|
|
168
|
-
throw new Error("Expected the field `
|
|
167
|
+
if (data['aggregate_window'] && !(typeof data['aggregate_window'] === 'string' || data['aggregate_window'] instanceof String)) {
|
|
168
|
+
throw new Error("Expected the field `aggregate_window` to be a primitive type in the JSON string but got " + data['aggregate_window']);
|
|
169
169
|
}
|
|
170
|
-
|
|
171
|
-
if (data["description"] && !(typeof data["description"] === "string" || data["description"] instanceof String)) {
|
|
172
|
-
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data["description"]);
|
|
173
|
-
}
|
|
174
|
-
// ensure the json data is a string
|
|
175
|
-
if (data["source_type"] && !(typeof data["source_type"] === "string" || data["source_type"] instanceof String)) {
|
|
176
|
-
throw new Error("Expected the field `source_type` to be a primitive type in the JSON string but got " + data["source_type"]);
|
|
177
|
-
}
|
|
178
|
-
// ensure the json data is an array
|
|
179
|
-
if (!Array.isArray(data["notefile_filter"])) {
|
|
180
|
-
throw new Error("Expected the field `notefile_filter` to be an array in the JSON data but got " + data["notefile_filter"]);
|
|
181
|
-
}
|
|
182
|
-
// ensure the json data is an array
|
|
183
|
-
if (!Array.isArray(data["fleet_filter"])) {
|
|
184
|
-
throw new Error("Expected the field `fleet_filter` to be an array in the JSON data but got " + data["fleet_filter"]);
|
|
185
|
-
}
|
|
186
|
-
// ensure the json data is a string
|
|
187
|
-
if (data["source_selector"] && !(typeof data["source_selector"] === "string" || data["source_selector"] instanceof String)) {
|
|
188
|
-
throw new Error("Expected the field `source_selector` to be a primitive type in the JSON string but got " + data["source_selector"]);
|
|
189
|
-
}
|
|
190
|
-
// ensure the json data is a string
|
|
191
|
-
if (data["condition_type"] && !(typeof data["condition_type"] === "string" || data["condition_type"] instanceof String)) {
|
|
192
|
-
throw new Error("Expected the field `condition_type` to be a primitive type in the JSON string but got " + data["condition_type"]);
|
|
193
|
-
}
|
|
194
|
-
if (data["alert_routes"]) {
|
|
170
|
+
if (data['alert_routes']) {
|
|
195
171
|
// data not null
|
|
196
172
|
// ensure the json data is an array
|
|
197
|
-
if (!Array.isArray(data[
|
|
198
|
-
throw new Error("Expected the field `alert_routes` to be an array in the JSON data but got " + data[
|
|
173
|
+
if (!Array.isArray(data['alert_routes'])) {
|
|
174
|
+
throw new Error("Expected the field `alert_routes` to be an array in the JSON data but got " + data['alert_routes']);
|
|
199
175
|
}
|
|
200
176
|
// validate the optional field `alert_routes` (array)
|
|
201
|
-
var _iterator2 = _createForOfIteratorHelper(data[
|
|
177
|
+
var _iterator2 = _createForOfIteratorHelper(data['alert_routes']),
|
|
202
178
|
_step2;
|
|
203
179
|
try {
|
|
204
180
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -210,228 +186,273 @@ var CreateMonitor = /*#__PURE__*/function () {
|
|
|
210
186
|
} finally {
|
|
211
187
|
_iterator2.f();
|
|
212
188
|
}
|
|
189
|
+
;
|
|
190
|
+
}
|
|
191
|
+
// ensure the json data is a string
|
|
192
|
+
if (data['condition_type'] && !(typeof data['condition_type'] === 'string' || data['condition_type'] instanceof String)) {
|
|
193
|
+
throw new Error("Expected the field `condition_type` to be a primitive type in the JSON string but got " + data['condition_type']);
|
|
213
194
|
}
|
|
214
195
|
// ensure the json data is a string
|
|
215
|
-
if (data[
|
|
216
|
-
throw new Error("Expected the field `
|
|
196
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
197
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
198
|
+
}
|
|
199
|
+
// ensure the json data is an array
|
|
200
|
+
if (!Array.isArray(data['fleet_filter'])) {
|
|
201
|
+
throw new Error("Expected the field `fleet_filter` to be an array in the JSON data but got " + data['fleet_filter']);
|
|
202
|
+
}
|
|
203
|
+
// ensure the json data is a string
|
|
204
|
+
if (data['last_routed_at'] && !(typeof data['last_routed_at'] === 'string' || data['last_routed_at'] instanceof String)) {
|
|
205
|
+
throw new Error("Expected the field `last_routed_at` to be a primitive type in the JSON string but got " + data['last_routed_at']);
|
|
206
|
+
}
|
|
207
|
+
// ensure the json data is a string
|
|
208
|
+
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
|
|
209
|
+
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
|
|
210
|
+
}
|
|
211
|
+
// ensure the json data is an array
|
|
212
|
+
if (!Array.isArray(data['notefile_filter'])) {
|
|
213
|
+
throw new Error("Expected the field `notefile_filter` to be an array in the JSON data but got " + data['notefile_filter']);
|
|
217
214
|
}
|
|
218
215
|
// ensure the json data is a string
|
|
219
|
-
if (data[
|
|
220
|
-
throw new Error("Expected the field `routing_cooldown_period` to be a primitive type in the JSON string but got " + data[
|
|
216
|
+
if (data['routing_cooldown_period'] && !(typeof data['routing_cooldown_period'] === 'string' || data['routing_cooldown_period'] instanceof String)) {
|
|
217
|
+
throw new Error("Expected the field `routing_cooldown_period` to be a primitive type in the JSON string but got " + data['routing_cooldown_period']);
|
|
221
218
|
}
|
|
222
219
|
// ensure the json data is a string
|
|
223
|
-
if (data[
|
|
224
|
-
throw new Error("Expected the field `
|
|
220
|
+
if (data['source_selector'] && !(typeof data['source_selector'] === 'string' || data['source_selector'] instanceof String)) {
|
|
221
|
+
throw new Error("Expected the field `source_selector` to be a primitive type in the JSON string but got " + data['source_selector']);
|
|
225
222
|
}
|
|
226
223
|
// ensure the json data is a string
|
|
227
|
-
if (data[
|
|
228
|
-
throw new Error("Expected the field `
|
|
224
|
+
if (data['source_type'] && !(typeof data['source_type'] === 'string' || data['source_type'] instanceof String)) {
|
|
225
|
+
throw new Error("Expected the field `source_type` to be a primitive type in the JSON string but got " + data['source_type']);
|
|
226
|
+
}
|
|
227
|
+
// ensure the json data is a string
|
|
228
|
+
if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
|
|
229
|
+
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
|
|
229
230
|
}
|
|
230
231
|
return true;
|
|
231
232
|
}
|
|
232
233
|
}]);
|
|
233
234
|
}();
|
|
234
|
-
CreateMonitor.RequiredProperties = ["
|
|
235
|
+
CreateMonitor.RequiredProperties = ["alert_routes", "description", "name", "notefile_filter"];
|
|
235
236
|
|
|
236
237
|
/**
|
|
237
|
-
*
|
|
238
|
+
* Aggregate function to apply to the selected values before applying the condition. [none, sum, average, max, min]
|
|
239
|
+
* @member {module:model/CreateMonitor.AggregateFunctionEnum} aggregate_function
|
|
238
240
|
*/
|
|
239
|
-
CreateMonitor.prototype[
|
|
241
|
+
CreateMonitor.prototype['aggregate_function'] = undefined;
|
|
240
242
|
|
|
241
243
|
/**
|
|
242
|
-
*
|
|
244
|
+
* The time window to aggregate the selected values. It follows the format of a number followed by a time unit
|
|
245
|
+
* @member {String} aggregate_window
|
|
243
246
|
*/
|
|
244
|
-
CreateMonitor.prototype[
|
|
247
|
+
CreateMonitor.prototype['aggregate_window'] = undefined;
|
|
245
248
|
|
|
246
249
|
/**
|
|
247
|
-
*
|
|
250
|
+
* If true, the monitor is in alert state.
|
|
251
|
+
* @member {Boolean} alert
|
|
248
252
|
*/
|
|
249
|
-
CreateMonitor.prototype[
|
|
253
|
+
CreateMonitor.prototype['alert'] = undefined;
|
|
250
254
|
|
|
251
255
|
/**
|
|
252
|
-
*
|
|
253
|
-
* @member {module:model/CreateMonitor.SourceTypeEnum} source_type
|
|
256
|
+
* @member {Array.<module:model/MonitorAlertRoutesInner>} alert_routes
|
|
254
257
|
*/
|
|
255
|
-
CreateMonitor.prototype[
|
|
258
|
+
CreateMonitor.prototype['alert_routes'] = undefined;
|
|
256
259
|
|
|
257
260
|
/**
|
|
258
|
-
*
|
|
259
|
-
* @member {
|
|
261
|
+
* A comparison operation to apply to the value selected by the source_selector [greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, equal_to, not_equal_to]
|
|
262
|
+
* @member {module:model/CreateMonitor.ConditionTypeEnum} condition_type
|
|
260
263
|
*/
|
|
261
|
-
CreateMonitor.prototype[
|
|
264
|
+
CreateMonitor.prototype['condition_type'] = undefined;
|
|
262
265
|
|
|
263
266
|
/**
|
|
264
|
-
*
|
|
265
|
-
* @member {Boolean} alert
|
|
267
|
+
* @member {String} description
|
|
266
268
|
*/
|
|
267
|
-
CreateMonitor.prototype[
|
|
269
|
+
CreateMonitor.prototype['description'] = undefined;
|
|
268
270
|
|
|
269
271
|
/**
|
|
270
|
-
*
|
|
272
|
+
* If true, the monitor will not be evaluated.
|
|
273
|
+
* @member {Boolean} disabled
|
|
271
274
|
*/
|
|
272
|
-
CreateMonitor.prototype[
|
|
275
|
+
CreateMonitor.prototype['disabled'] = undefined;
|
|
273
276
|
|
|
274
277
|
/**
|
|
275
278
|
* @member {Array.<String>} fleet_filter
|
|
276
279
|
*/
|
|
277
|
-
CreateMonitor.prototype[
|
|
280
|
+
CreateMonitor.prototype['fleet_filter'] = undefined;
|
|
278
281
|
|
|
279
282
|
/**
|
|
280
|
-
*
|
|
281
|
-
* @member {String}
|
|
283
|
+
* The last time the monitor was evaluated and routed.
|
|
284
|
+
* @member {String} last_routed_at
|
|
282
285
|
*/
|
|
283
|
-
CreateMonitor.prototype[
|
|
286
|
+
CreateMonitor.prototype['last_routed_at'] = undefined;
|
|
284
287
|
|
|
285
288
|
/**
|
|
286
|
-
*
|
|
287
|
-
* @member {module:model/CreateMonitor.ConditionTypeEnum} condition_type
|
|
289
|
+
* @member {String} name
|
|
288
290
|
*/
|
|
289
|
-
CreateMonitor.prototype[
|
|
291
|
+
CreateMonitor.prototype['name'] = undefined;
|
|
290
292
|
|
|
291
293
|
/**
|
|
292
|
-
*
|
|
293
|
-
* @member {Number} threshold
|
|
294
|
+
* @member {Array.<String>} notefile_filter
|
|
294
295
|
*/
|
|
295
|
-
CreateMonitor.prototype[
|
|
296
|
+
CreateMonitor.prototype['notefile_filter'] = undefined;
|
|
296
297
|
|
|
297
298
|
/**
|
|
298
|
-
*
|
|
299
|
+
* Only relevant when using an aggregate_function. If true, the monitor will be evaluated per device, | rather than across the set of selected devices. If true then if a single device matches the specified criteria, | and alert will be created, otherwise the aggregate function will be applied across all devices.
|
|
300
|
+
* @member {Boolean} per_device
|
|
299
301
|
*/
|
|
300
|
-
CreateMonitor.prototype[
|
|
302
|
+
CreateMonitor.prototype['per_device'] = undefined;
|
|
301
303
|
|
|
302
304
|
/**
|
|
303
|
-
* The
|
|
304
|
-
* @member {String}
|
|
305
|
+
* The time period to wait before routing another event after the monitor | has been triggered. It follows the format of a number followed by a time unit.
|
|
306
|
+
* @member {String} routing_cooldown_period
|
|
305
307
|
*/
|
|
306
|
-
CreateMonitor.prototype[
|
|
308
|
+
CreateMonitor.prototype['routing_cooldown_period'] = undefined;
|
|
307
309
|
|
|
308
310
|
/**
|
|
309
311
|
* If true, alerts will be created, but no notifications will be sent.
|
|
310
312
|
* @member {Boolean} silenced
|
|
311
313
|
*/
|
|
312
|
-
CreateMonitor.prototype[
|
|
314
|
+
CreateMonitor.prototype['silenced'] = undefined;
|
|
313
315
|
|
|
314
316
|
/**
|
|
315
|
-
*
|
|
316
|
-
* @member {String}
|
|
317
|
+
* A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.
|
|
318
|
+
* @member {String} source_selector
|
|
317
319
|
*/
|
|
318
|
-
CreateMonitor.prototype[
|
|
320
|
+
CreateMonitor.prototype['source_selector'] = undefined;
|
|
319
321
|
|
|
320
322
|
/**
|
|
321
|
-
*
|
|
322
|
-
* @member {module:model/CreateMonitor.
|
|
323
|
+
* The type of source to monitor. Currently only \"event\" is supported.
|
|
324
|
+
* @member {module:model/CreateMonitor.SourceTypeEnum} source_type
|
|
323
325
|
*/
|
|
324
|
-
CreateMonitor.prototype[
|
|
326
|
+
CreateMonitor.prototype['source_type'] = undefined;
|
|
325
327
|
|
|
326
328
|
/**
|
|
327
|
-
* The
|
|
328
|
-
* @member {
|
|
329
|
+
* The type of condition to apply to the value selected by the source_selector
|
|
330
|
+
* @member {Number} threshold
|
|
329
331
|
*/
|
|
330
|
-
CreateMonitor.prototype[
|
|
332
|
+
CreateMonitor.prototype['threshold'] = undefined;
|
|
331
333
|
|
|
332
334
|
/**
|
|
333
|
-
*
|
|
334
|
-
* @member {Boolean} per_device
|
|
335
|
+
* @member {String} uid
|
|
335
336
|
*/
|
|
336
|
-
CreateMonitor.prototype[
|
|
337
|
+
CreateMonitor.prototype['uid'] = undefined;
|
|
337
338
|
|
|
338
339
|
// Implement Monitor interface:
|
|
339
340
|
/**
|
|
340
|
-
*
|
|
341
|
+
* Aggregate function to apply to the selected values before applying the condition. [none, sum, average, max, min]
|
|
342
|
+
* @member {module:model/Monitor.AggregateFunctionEnum} aggregate_function
|
|
341
343
|
*/
|
|
342
|
-
_Monitor["default"].prototype[
|
|
344
|
+
_Monitor["default"].prototype['aggregate_function'] = undefined;
|
|
343
345
|
/**
|
|
344
|
-
*
|
|
346
|
+
* The time window to aggregate the selected values. It follows the format of a number followed by a time unit
|
|
347
|
+
* @member {String} aggregate_window
|
|
345
348
|
*/
|
|
346
|
-
_Monitor["default"].prototype[
|
|
349
|
+
_Monitor["default"].prototype['aggregate_window'] = undefined;
|
|
347
350
|
/**
|
|
348
|
-
*
|
|
351
|
+
* If true, the monitor is in alert state.
|
|
352
|
+
* @member {Boolean} alert
|
|
349
353
|
*/
|
|
350
|
-
_Monitor["default"].prototype[
|
|
354
|
+
_Monitor["default"].prototype['alert'] = undefined;
|
|
351
355
|
/**
|
|
352
|
-
*
|
|
353
|
-
* @member {module:model/Monitor.SourceTypeEnum} source_type
|
|
356
|
+
* @member {Array.<module:model/MonitorAlertRoutesInner>} alert_routes
|
|
354
357
|
*/
|
|
355
|
-
_Monitor["default"].prototype[
|
|
358
|
+
_Monitor["default"].prototype['alert_routes'] = undefined;
|
|
356
359
|
/**
|
|
357
|
-
*
|
|
358
|
-
* @member {
|
|
360
|
+
* A comparison operation to apply to the value selected by the source_selector [greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, equal_to, not_equal_to]
|
|
361
|
+
* @member {module:model/Monitor.ConditionTypeEnum} condition_type
|
|
359
362
|
*/
|
|
360
|
-
_Monitor["default"].prototype[
|
|
363
|
+
_Monitor["default"].prototype['condition_type'] = undefined;
|
|
361
364
|
/**
|
|
362
|
-
*
|
|
363
|
-
* @member {Boolean} alert
|
|
365
|
+
* @member {String} description
|
|
364
366
|
*/
|
|
365
|
-
_Monitor["default"].prototype[
|
|
367
|
+
_Monitor["default"].prototype['description'] = undefined;
|
|
366
368
|
/**
|
|
367
|
-
*
|
|
369
|
+
* If true, the monitor will not be evaluated.
|
|
370
|
+
* @member {Boolean} disabled
|
|
368
371
|
*/
|
|
369
|
-
_Monitor["default"].prototype[
|
|
372
|
+
_Monitor["default"].prototype['disabled'] = undefined;
|
|
370
373
|
/**
|
|
371
374
|
* @member {Array.<String>} fleet_filter
|
|
372
375
|
*/
|
|
373
|
-
_Monitor["default"].prototype[
|
|
376
|
+
_Monitor["default"].prototype['fleet_filter'] = undefined;
|
|
374
377
|
/**
|
|
375
|
-
*
|
|
376
|
-
* @member {String}
|
|
378
|
+
* The last time the monitor was evaluated and routed.
|
|
379
|
+
* @member {String} last_routed_at
|
|
377
380
|
*/
|
|
378
|
-
_Monitor["default"].prototype[
|
|
381
|
+
_Monitor["default"].prototype['last_routed_at'] = undefined;
|
|
379
382
|
/**
|
|
380
|
-
*
|
|
381
|
-
* @member {module:model/Monitor.ConditionTypeEnum} condition_type
|
|
383
|
+
* @member {String} name
|
|
382
384
|
*/
|
|
383
|
-
_Monitor["default"].prototype[
|
|
385
|
+
_Monitor["default"].prototype['name'] = undefined;
|
|
384
386
|
/**
|
|
385
|
-
*
|
|
386
|
-
* @member {Number} threshold
|
|
387
|
+
* @member {Array.<String>} notefile_filter
|
|
387
388
|
*/
|
|
388
|
-
_Monitor["default"].prototype[
|
|
389
|
+
_Monitor["default"].prototype['notefile_filter'] = undefined;
|
|
389
390
|
/**
|
|
390
|
-
*
|
|
391
|
+
* Only relevant when using an aggregate_function. If true, the monitor will be evaluated per device, | rather than across the set of selected devices. If true then if a single device matches the specified criteria, | and alert will be created, otherwise the aggregate function will be applied across all devices.
|
|
392
|
+
* @member {Boolean} per_device
|
|
391
393
|
*/
|
|
392
|
-
_Monitor["default"].prototype[
|
|
394
|
+
_Monitor["default"].prototype['per_device'] = undefined;
|
|
393
395
|
/**
|
|
394
|
-
* The
|
|
395
|
-
* @member {String}
|
|
396
|
+
* The time period to wait before routing another event after the monitor | has been triggered. It follows the format of a number followed by a time unit.
|
|
397
|
+
* @member {String} routing_cooldown_period
|
|
396
398
|
*/
|
|
397
|
-
_Monitor["default"].prototype[
|
|
399
|
+
_Monitor["default"].prototype['routing_cooldown_period'] = undefined;
|
|
398
400
|
/**
|
|
399
401
|
* If true, alerts will be created, but no notifications will be sent.
|
|
400
402
|
* @member {Boolean} silenced
|
|
401
403
|
*/
|
|
402
|
-
_Monitor["default"].prototype[
|
|
404
|
+
_Monitor["default"].prototype['silenced'] = undefined;
|
|
403
405
|
/**
|
|
404
|
-
*
|
|
405
|
-
* @member {String}
|
|
406
|
+
* A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.
|
|
407
|
+
* @member {String} source_selector
|
|
406
408
|
*/
|
|
407
|
-
_Monitor["default"].prototype[
|
|
409
|
+
_Monitor["default"].prototype['source_selector'] = undefined;
|
|
408
410
|
/**
|
|
409
|
-
*
|
|
410
|
-
* @member {module:model/Monitor.
|
|
411
|
+
* The type of source to monitor. Currently only \"event\" is supported.
|
|
412
|
+
* @member {module:model/Monitor.SourceTypeEnum} source_type
|
|
411
413
|
*/
|
|
412
|
-
_Monitor["default"].prototype[
|
|
414
|
+
_Monitor["default"].prototype['source_type'] = undefined;
|
|
413
415
|
/**
|
|
414
|
-
* The
|
|
415
|
-
* @member {
|
|
416
|
+
* The type of condition to apply to the value selected by the source_selector
|
|
417
|
+
* @member {Number} threshold
|
|
416
418
|
*/
|
|
417
|
-
_Monitor["default"].prototype[
|
|
419
|
+
_Monitor["default"].prototype['threshold'] = undefined;
|
|
418
420
|
/**
|
|
419
|
-
*
|
|
420
|
-
* @member {Boolean} per_device
|
|
421
|
+
* @member {String} uid
|
|
421
422
|
*/
|
|
422
|
-
_Monitor["default"].prototype[
|
|
423
|
+
_Monitor["default"].prototype['uid'] = undefined;
|
|
423
424
|
|
|
424
425
|
/**
|
|
425
|
-
* Allowed values for the <code>
|
|
426
|
+
* Allowed values for the <code>aggregate_function</code> property.
|
|
426
427
|
* @enum {String}
|
|
427
428
|
* @readonly
|
|
428
429
|
*/
|
|
429
|
-
CreateMonitor[
|
|
430
|
+
CreateMonitor['AggregateFunctionEnum'] = {
|
|
430
431
|
/**
|
|
431
|
-
* value: "
|
|
432
|
+
* value: "none"
|
|
433
|
+
* @const
|
|
434
|
+
*/
|
|
435
|
+
"none": "none",
|
|
436
|
+
/**
|
|
437
|
+
* value: "sum"
|
|
432
438
|
* @const
|
|
433
439
|
*/
|
|
434
|
-
|
|
440
|
+
"sum": "sum",
|
|
441
|
+
/**
|
|
442
|
+
* value: "average"
|
|
443
|
+
* @const
|
|
444
|
+
*/
|
|
445
|
+
"average": "average",
|
|
446
|
+
/**
|
|
447
|
+
* value: "max"
|
|
448
|
+
* @const
|
|
449
|
+
*/
|
|
450
|
+
"max": "max",
|
|
451
|
+
/**
|
|
452
|
+
* value: "min"
|
|
453
|
+
* @const
|
|
454
|
+
*/
|
|
455
|
+
"min": "min"
|
|
435
456
|
};
|
|
436
457
|
|
|
437
458
|
/**
|
|
@@ -439,69 +460,49 @@ CreateMonitor["SourceTypeEnum"] = {
|
|
|
439
460
|
* @enum {String}
|
|
440
461
|
* @readonly
|
|
441
462
|
*/
|
|
442
|
-
CreateMonitor[
|
|
463
|
+
CreateMonitor['ConditionTypeEnum'] = {
|
|
443
464
|
/**
|
|
444
465
|
* value: "greater_than"
|
|
445
466
|
* @const
|
|
446
467
|
*/
|
|
447
|
-
greater_than: "greater_than",
|
|
468
|
+
"greater_than": "greater_than",
|
|
448
469
|
/**
|
|
449
470
|
* value: "greater_than_or_equal_to"
|
|
450
471
|
* @const
|
|
451
472
|
*/
|
|
452
|
-
greater_than_or_equal_to: "greater_than_or_equal_to",
|
|
473
|
+
"greater_than_or_equal_to": "greater_than_or_equal_to",
|
|
453
474
|
/**
|
|
454
475
|
* value: "less_than"
|
|
455
476
|
* @const
|
|
456
477
|
*/
|
|
457
|
-
less_than: "less_than",
|
|
478
|
+
"less_than": "less_than",
|
|
458
479
|
/**
|
|
459
480
|
* value: "less_than_or_equal_to"
|
|
460
481
|
* @const
|
|
461
482
|
*/
|
|
462
|
-
less_than_or_equal_to: "less_than_or_equal_to",
|
|
483
|
+
"less_than_or_equal_to": "less_than_or_equal_to",
|
|
463
484
|
/**
|
|
464
485
|
* value: "equal_to"
|
|
465
486
|
* @const
|
|
466
487
|
*/
|
|
467
|
-
equal_to: "equal_to",
|
|
488
|
+
"equal_to": "equal_to",
|
|
468
489
|
/**
|
|
469
490
|
* value: "not_equal_to"
|
|
470
491
|
* @const
|
|
471
492
|
*/
|
|
472
|
-
not_equal_to: "not_equal_to"
|
|
493
|
+
"not_equal_to": "not_equal_to"
|
|
473
494
|
};
|
|
474
495
|
|
|
475
496
|
/**
|
|
476
|
-
* Allowed values for the <code>
|
|
497
|
+
* Allowed values for the <code>source_type</code> property.
|
|
477
498
|
* @enum {String}
|
|
478
499
|
* @readonly
|
|
479
500
|
*/
|
|
480
|
-
CreateMonitor[
|
|
481
|
-
/**
|
|
482
|
-
* value: "none"
|
|
483
|
-
* @const
|
|
484
|
-
*/
|
|
485
|
-
none: "none",
|
|
486
|
-
/**
|
|
487
|
-
* value: "sum"
|
|
488
|
-
* @const
|
|
489
|
-
*/
|
|
490
|
-
sum: "sum",
|
|
501
|
+
CreateMonitor['SourceTypeEnum'] = {
|
|
491
502
|
/**
|
|
492
|
-
* value: "
|
|
493
|
-
* @const
|
|
494
|
-
*/
|
|
495
|
-
average: "average",
|
|
496
|
-
/**
|
|
497
|
-
* value: "max"
|
|
498
|
-
* @const
|
|
499
|
-
*/
|
|
500
|
-
max: "max",
|
|
501
|
-
/**
|
|
502
|
-
* value: "min"
|
|
503
|
+
* value: "event"
|
|
503
504
|
* @const
|
|
504
505
|
*/
|
|
505
|
-
|
|
506
|
+
"event": "event"
|
|
506
507
|
};
|
|
507
508
|
var _default = exports["default"] = CreateMonitor;
|