@blues-inc/notehub-js 4.0.0 → 5.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.
- package/README.md +246 -248
- package/dist/ApiClient.js +150 -155
- 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 +369 -453
- 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 +387 -381
- package/dist/api/RouteApi.js +83 -77
- package/dist/api/UsageApi.js +65 -62
- package/dist/api/WebhookApi.js +51 -51
- package/dist/index.js +7 -0
- package/dist/model/AddDeviceToFleetsRequest.js +8 -8
- package/dist/model/Alert.js +76 -74
- package/dist/model/AlertDataInner.js +40 -35
- package/dist/model/AlertNotificationsInner.js +18 -18
- package/dist/model/AwsRoute.js +65 -65
- package/dist/model/AzureRoute.js +43 -43
- package/dist/model/BillingAccount.js +21 -21
- package/dist/model/BillingAccountRole.js +9 -9
- package/dist/model/BlynkRoute.js +28 -28
- 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 +20 -20
- package/dist/model/CreateMonitor.js +139 -131
- 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/DatacakeRoute.js +35 -35
- package/dist/model/DeleteDeviceFromFleetsRequest.js +8 -8
- package/dist/model/DeleteNotefilesRequest.js +7 -7
- package/dist/model/Device.js +107 -106
- package/dist/model/DeviceDfuHistory.js +20 -19
- package/dist/model/DeviceDfuHistoryCurrent.js +32 -32
- package/dist/model/DeviceDfuHistoryPage.js +13 -12
- package/dist/model/DeviceDfuStateMachine.js +25 -24
- package/dist/model/DeviceDfuStateMachineNode.js +22 -22
- package/dist/model/DeviceDfuStatus.js +20 -20
- package/dist/model/DeviceDfuStatusPage.js +13 -12
- 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 +69 -67
- 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/Filter.js +16 -16
- package/dist/model/Firmware.js +49 -49
- package/dist/model/FirmwareInfo.js +60 -60
- package/dist/model/Fleet.js +38 -38
- package/dist/model/FleetConnectivityAssurance.js +5 -5
- package/dist/model/GetAlerts200Response.js +15 -14
- package/dist/model/GetBillingAccounts200Response.js +10 -9
- package/dist/model/GetDataUsage200Response.js +10 -9
- package/dist/model/GetDataUsage200ResponseDataInner.js +52 -42
- package/dist/model/GetDbNote200Response.js +13 -13
- package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +16 -16
- package/dist/model/GetDeviceFleets200Response.js +12 -11
- package/dist/model/GetDeviceHealthLog200Response.js +12 -11
- package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +19 -19
- package/dist/model/GetDeviceLatestEvents200Response.js +10 -9
- package/dist/model/GetDevicePlans200Response.js +10 -9
- package/dist/model/GetDevicePublicKey200Response.js +16 -16
- package/dist/model/GetDevicePublicKeys200Response.js +17 -16
- package/dist/model/GetDevicePublicKeys200ResponseDevicePublicKeysInner.js +12 -12
- package/dist/model/GetDeviceSessions200Response.js +17 -16
- package/dist/model/GetDevices200Response.js +17 -16
- package/dist/model/GetEvents200Response.js +21 -20
- package/dist/model/GetEventsByCursor200Response.js +24 -23
- package/dist/model/GetNotefile200Response.js +11 -11
- package/dist/model/GetProducts200Response.js +10 -9
- package/dist/model/GetProjectMembers200Response.js +12 -11
- package/dist/model/GetProjects200Response.js +10 -9
- package/dist/model/GetRouteLogsUsage200Response.js +12 -11
- package/dist/model/GetSessionsUsage200Response.js +12 -11
- package/dist/model/GetWebhooks200Response.js +10 -9
- package/dist/model/GoogleRoute.js +33 -33
- package/dist/model/HttpRoute.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 +106 -100
- package/dist/model/MonitorAlertRoutesInner.js +9 -10
- package/dist/model/MqttRoute.js +68 -68
- package/dist/model/Note.js +31 -31
- package/dist/model/NoteInput.js +9 -9
- package/dist/model/Notefile.js +23 -22
- package/dist/model/NotefileSchema.js +19 -18
- package/dist/model/NotehubRoute.js +103 -103
- package/dist/model/NotehubRouteSummary.js +23 -23
- 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/Product.js +26 -26
- package/dist/model/Project.js +34 -34
- package/dist/model/ProjectMember.js +22 -22
- package/dist/model/ProvisionDeviceRequest.js +18 -18
- package/dist/model/ProxyRoute.js +29 -29
- package/dist/model/QubitroRoute.js +33 -33
- package/dist/model/RadRoute.js +31 -31
- package/dist/model/Repository.js +22 -22
- package/dist/model/Role.js +9 -9
- package/dist/model/RouteLog.js +38 -38
- package/dist/model/RouteTransformSettings.js +18 -18
- package/dist/model/S3ArchiveRoute.js +79 -79
- package/dist/model/SatelliteDataUsage.js +144 -0
- package/dist/model/SatellitePlan.js +42 -33
- package/dist/model/SchemaProperty.js +38 -36
- package/dist/model/SignalDevice200Response.js +5 -5
- package/dist/model/SimUsage.js +19 -19
- package/dist/model/SlackBearerNotification.js +25 -25
- package/dist/model/SlackRoute.js +48 -48
- package/dist/model/SlackWebHookNotification.js +20 -20
- package/dist/model/SnowflakeRoute.js +45 -45
- package/dist/model/SnowpipeStreamingRoute.js +60 -60
- package/dist/model/ThingworxRoute.js +33 -33
- package/dist/model/TowerLocation.js +54 -54
- package/dist/model/TwilioRoute.js +43 -43
- package/dist/model/UpdateFleetRequest.js +33 -33
- package/dist/model/UploadMetadata.js +64 -64
- package/dist/model/UsageData.js +63 -18
- package/dist/model/UsageEventsData.js +37 -37
- package/dist/model/UsageEventsResponse.js +12 -11
- package/dist/model/UsageRouteLogsData.js +27 -27
- package/dist/model/UsageSessionsData.js +32 -32
- 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
|
@@ -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,23 @@ 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
|
|
34
|
+
* @version 5.0.0-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 alertRoutes {Array.<module:model/MonitorAlertRoutesInner>}
|
|
42
|
-
* @param description {String}
|
|
43
|
-
* @param name {String}
|
|
44
|
-
* @param
|
|
41
|
+
* @param alertRoutes {Array.<module:model/MonitorAlertRoutesInner>}
|
|
42
|
+
* @param description {String}
|
|
43
|
+
* @param name {String}
|
|
44
|
+
* @param sourceType {module:model/CreateMonitor.SourceTypeEnum} The type of source to monitor. Supported values are \"event\" and \"heartbeat\".
|
|
45
|
+
* @param threshold {Number} The type of condition to apply to the value selected by the source_selector
|
|
45
46
|
*/
|
|
46
|
-
function CreateMonitor(alertRoutes, description, name,
|
|
47
|
+
function CreateMonitor(alertRoutes, description, name, sourceType, threshold) {
|
|
47
48
|
_classCallCheck(this, CreateMonitor);
|
|
48
49
|
_Monitor["default"].initialize(this);
|
|
49
|
-
CreateMonitor.initialize(this, alertRoutes, description, name,
|
|
50
|
+
CreateMonitor.initialize(this, alertRoutes, description, name, sourceType, threshold);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
/**
|
|
@@ -56,11 +57,12 @@ var CreateMonitor = /*#__PURE__*/function () {
|
|
|
56
57
|
*/
|
|
57
58
|
return _createClass(CreateMonitor, null, [{
|
|
58
59
|
key: "initialize",
|
|
59
|
-
value: function initialize(obj, alertRoutes, description, name,
|
|
60
|
-
obj[
|
|
61
|
-
obj[
|
|
62
|
-
obj[
|
|
63
|
-
obj[
|
|
60
|
+
value: function initialize(obj, alertRoutes, description, name, sourceType, threshold) {
|
|
61
|
+
obj['alert_routes'] = alertRoutes;
|
|
62
|
+
obj['description'] = description;
|
|
63
|
+
obj['name'] = name;
|
|
64
|
+
obj['source_type'] = sourceType;
|
|
65
|
+
obj['threshold'] = threshold;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
/**
|
|
@@ -76,59 +78,59 @@ var CreateMonitor = /*#__PURE__*/function () {
|
|
|
76
78
|
if (data) {
|
|
77
79
|
obj = obj || new CreateMonitor();
|
|
78
80
|
_Monitor["default"].constructFromObject(data, obj);
|
|
79
|
-
if (data.hasOwnProperty(
|
|
80
|
-
obj[
|
|
81
|
+
if (data.hasOwnProperty('aggregate_function')) {
|
|
82
|
+
obj['aggregate_function'] = _ApiClient["default"].convertToType(data['aggregate_function'], 'String');
|
|
81
83
|
}
|
|
82
|
-
if (data.hasOwnProperty(
|
|
83
|
-
obj[
|
|
84
|
+
if (data.hasOwnProperty('aggregate_window')) {
|
|
85
|
+
obj['aggregate_window'] = _ApiClient["default"].convertToType(data['aggregate_window'], 'String');
|
|
84
86
|
}
|
|
85
|
-
if (data.hasOwnProperty(
|
|
86
|
-
obj[
|
|
87
|
+
if (data.hasOwnProperty('alert')) {
|
|
88
|
+
obj['alert'] = _ApiClient["default"].convertToType(data['alert'], 'Boolean');
|
|
87
89
|
}
|
|
88
|
-
if (data.hasOwnProperty(
|
|
89
|
-
obj[
|
|
90
|
+
if (data.hasOwnProperty('alert_routes')) {
|
|
91
|
+
obj['alert_routes'] = _ApiClient["default"].convertToType(data['alert_routes'], [_MonitorAlertRoutesInner["default"]]);
|
|
90
92
|
}
|
|
91
|
-
if (data.hasOwnProperty(
|
|
92
|
-
obj[
|
|
93
|
+
if (data.hasOwnProperty('condition_type')) {
|
|
94
|
+
obj['condition_type'] = _ApiClient["default"].convertToType(data['condition_type'], 'String');
|
|
93
95
|
}
|
|
94
|
-
if (data.hasOwnProperty(
|
|
95
|
-
obj[
|
|
96
|
+
if (data.hasOwnProperty('description')) {
|
|
97
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
96
98
|
}
|
|
97
|
-
if (data.hasOwnProperty(
|
|
98
|
-
obj[
|
|
99
|
+
if (data.hasOwnProperty('disabled')) {
|
|
100
|
+
obj['disabled'] = _ApiClient["default"].convertToType(data['disabled'], 'Boolean');
|
|
99
101
|
}
|
|
100
|
-
if (data.hasOwnProperty(
|
|
101
|
-
obj[
|
|
102
|
+
if (data.hasOwnProperty('fleet_filter')) {
|
|
103
|
+
obj['fleet_filter'] = _ApiClient["default"].convertToType(data['fleet_filter'], ['String']);
|
|
102
104
|
}
|
|
103
|
-
if (data.hasOwnProperty(
|
|
104
|
-
obj[
|
|
105
|
+
if (data.hasOwnProperty('last_routed_at')) {
|
|
106
|
+
obj['last_routed_at'] = _ApiClient["default"].convertToType(data['last_routed_at'], 'String');
|
|
105
107
|
}
|
|
106
|
-
if (data.hasOwnProperty(
|
|
107
|
-
obj[
|
|
108
|
+
if (data.hasOwnProperty('name')) {
|
|
109
|
+
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
|
|
108
110
|
}
|
|
109
|
-
if (data.hasOwnProperty(
|
|
110
|
-
obj[
|
|
111
|
+
if (data.hasOwnProperty('notefile_filter')) {
|
|
112
|
+
obj['notefile_filter'] = _ApiClient["default"].convertToType(data['notefile_filter'], ['String']);
|
|
111
113
|
}
|
|
112
|
-
if (data.hasOwnProperty(
|
|
113
|
-
obj[
|
|
114
|
+
if (data.hasOwnProperty('per_device')) {
|
|
115
|
+
obj['per_device'] = _ApiClient["default"].convertToType(data['per_device'], 'Boolean');
|
|
114
116
|
}
|
|
115
|
-
if (data.hasOwnProperty(
|
|
116
|
-
obj[
|
|
117
|
+
if (data.hasOwnProperty('routing_cooldown_period')) {
|
|
118
|
+
obj['routing_cooldown_period'] = _ApiClient["default"].convertToType(data['routing_cooldown_period'], 'String');
|
|
117
119
|
}
|
|
118
|
-
if (data.hasOwnProperty(
|
|
119
|
-
obj[
|
|
120
|
+
if (data.hasOwnProperty('silenced')) {
|
|
121
|
+
obj['silenced'] = _ApiClient["default"].convertToType(data['silenced'], 'Boolean');
|
|
120
122
|
}
|
|
121
|
-
if (data.hasOwnProperty(
|
|
122
|
-
obj[
|
|
123
|
+
if (data.hasOwnProperty('source_selector')) {
|
|
124
|
+
obj['source_selector'] = _ApiClient["default"].convertToType(data['source_selector'], 'String');
|
|
123
125
|
}
|
|
124
|
-
if (data.hasOwnProperty(
|
|
125
|
-
obj[
|
|
126
|
+
if (data.hasOwnProperty('source_type')) {
|
|
127
|
+
obj['source_type'] = _ApiClient["default"].convertToType(data['source_type'], 'String');
|
|
126
128
|
}
|
|
127
|
-
if (data.hasOwnProperty(
|
|
128
|
-
obj[
|
|
129
|
+
if (data.hasOwnProperty('threshold')) {
|
|
130
|
+
obj['threshold'] = _ApiClient["default"].convertToType(data['threshold'], 'Number');
|
|
129
131
|
}
|
|
130
|
-
if (data.hasOwnProperty(
|
|
131
|
-
obj[
|
|
132
|
+
if (data.hasOwnProperty('uid')) {
|
|
133
|
+
obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
|
|
132
134
|
}
|
|
133
135
|
} else if (data === null) {
|
|
134
136
|
return null;
|
|
@@ -160,21 +162,21 @@ var CreateMonitor = /*#__PURE__*/function () {
|
|
|
160
162
|
} finally {
|
|
161
163
|
_iterator.f();
|
|
162
164
|
}
|
|
163
|
-
if (data[
|
|
164
|
-
throw new Error("Expected the field `aggregate_function` to be a primitive type in the JSON string but got " + data[
|
|
165
|
+
if (data['aggregate_function'] && !(typeof data['aggregate_function'] === 'string' || data['aggregate_function'] instanceof String)) {
|
|
166
|
+
throw new Error("Expected the field `aggregate_function` to be a primitive type in the JSON string but got " + data['aggregate_function']);
|
|
165
167
|
}
|
|
166
168
|
// ensure the json data is a string
|
|
167
|
-
if (data[
|
|
168
|
-
throw new Error("Expected the field `aggregate_window` to be a primitive type in the JSON string but got " + data[
|
|
169
|
+
if (data['aggregate_window'] && !(typeof data['aggregate_window'] === 'string' || data['aggregate_window'] instanceof String)) {
|
|
170
|
+
throw new Error("Expected the field `aggregate_window` to be a primitive type in the JSON string but got " + data['aggregate_window']);
|
|
169
171
|
}
|
|
170
|
-
if (data[
|
|
172
|
+
if (data['alert_routes']) {
|
|
171
173
|
// data not null
|
|
172
174
|
// ensure the json data is an array
|
|
173
|
-
if (!Array.isArray(data[
|
|
174
|
-
throw new Error("Expected the field `alert_routes` to be an array in the JSON data but got " + data[
|
|
175
|
+
if (!Array.isArray(data['alert_routes'])) {
|
|
176
|
+
throw new Error("Expected the field `alert_routes` to be an array in the JSON data but got " + data['alert_routes']);
|
|
175
177
|
}
|
|
176
178
|
// validate the optional field `alert_routes` (array)
|
|
177
|
-
var _iterator2 = _createForOfIteratorHelper(data[
|
|
179
|
+
var _iterator2 = _createForOfIteratorHelper(data['alert_routes']),
|
|
178
180
|
_step2;
|
|
179
181
|
try {
|
|
180
182
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -186,272 +188,273 @@ var CreateMonitor = /*#__PURE__*/function () {
|
|
|
186
188
|
} finally {
|
|
187
189
|
_iterator2.f();
|
|
188
190
|
}
|
|
191
|
+
;
|
|
189
192
|
}
|
|
190
193
|
// ensure the json data is a string
|
|
191
|
-
if (data[
|
|
192
|
-
throw new Error("Expected the field `condition_type` to be a primitive type in the JSON string but got " + data[
|
|
194
|
+
if (data['condition_type'] && !(typeof data['condition_type'] === 'string' || data['condition_type'] instanceof String)) {
|
|
195
|
+
throw new Error("Expected the field `condition_type` to be a primitive type in the JSON string but got " + data['condition_type']);
|
|
193
196
|
}
|
|
194
197
|
// ensure the json data is a string
|
|
195
|
-
if (data[
|
|
196
|
-
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data[
|
|
198
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
199
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
197
200
|
}
|
|
198
201
|
// ensure the json data is an array
|
|
199
|
-
if (!Array.isArray(data[
|
|
200
|
-
throw new Error("Expected the field `fleet_filter` to be an array in the JSON data but got " + data[
|
|
202
|
+
if (!Array.isArray(data['fleet_filter'])) {
|
|
203
|
+
throw new Error("Expected the field `fleet_filter` to be an array in the JSON data but got " + data['fleet_filter']);
|
|
201
204
|
}
|
|
202
205
|
// ensure the json data is a string
|
|
203
|
-
if (data[
|
|
204
|
-
throw new Error("Expected the field `last_routed_at` to be a primitive type in the JSON string but got " + data[
|
|
206
|
+
if (data['last_routed_at'] && !(typeof data['last_routed_at'] === 'string' || data['last_routed_at'] instanceof String)) {
|
|
207
|
+
throw new Error("Expected the field `last_routed_at` to be a primitive type in the JSON string but got " + data['last_routed_at']);
|
|
205
208
|
}
|
|
206
209
|
// ensure the json data is a string
|
|
207
|
-
if (data[
|
|
208
|
-
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data[
|
|
210
|
+
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
|
|
211
|
+
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
|
|
209
212
|
}
|
|
210
213
|
// ensure the json data is an array
|
|
211
|
-
if (!Array.isArray(data[
|
|
212
|
-
throw new Error("Expected the field `notefile_filter` to be an array in the JSON data but got " + data[
|
|
214
|
+
if (!Array.isArray(data['notefile_filter'])) {
|
|
215
|
+
throw new Error("Expected the field `notefile_filter` to be an array in the JSON data but got " + data['notefile_filter']);
|
|
213
216
|
}
|
|
214
217
|
// ensure the json data is a string
|
|
215
|
-
if (data[
|
|
216
|
-
throw new Error("Expected the field `routing_cooldown_period` to be a primitive type in the JSON string but got " + data[
|
|
218
|
+
if (data['routing_cooldown_period'] && !(typeof data['routing_cooldown_period'] === 'string' || data['routing_cooldown_period'] instanceof String)) {
|
|
219
|
+
throw new Error("Expected the field `routing_cooldown_period` to be a primitive type in the JSON string but got " + data['routing_cooldown_period']);
|
|
217
220
|
}
|
|
218
221
|
// ensure the json data is a string
|
|
219
|
-
if (data[
|
|
220
|
-
throw new Error("Expected the field `source_selector` to be a primitive type in the JSON string but got " + data[
|
|
222
|
+
if (data['source_selector'] && !(typeof data['source_selector'] === 'string' || data['source_selector'] instanceof String)) {
|
|
223
|
+
throw new Error("Expected the field `source_selector` to be a primitive type in the JSON string but got " + data['source_selector']);
|
|
221
224
|
}
|
|
222
225
|
// ensure the json data is a string
|
|
223
|
-
if (data[
|
|
224
|
-
throw new Error("Expected the field `source_type` to be a primitive type in the JSON string but got " + data[
|
|
226
|
+
if (data['source_type'] && !(typeof data['source_type'] === 'string' || data['source_type'] instanceof String)) {
|
|
227
|
+
throw new Error("Expected the field `source_type` to be a primitive type in the JSON string but got " + data['source_type']);
|
|
225
228
|
}
|
|
226
229
|
// ensure the json data is a string
|
|
227
|
-
if (data[
|
|
228
|
-
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data[
|
|
230
|
+
if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
|
|
231
|
+
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
|
|
229
232
|
}
|
|
230
233
|
return true;
|
|
231
234
|
}
|
|
232
235
|
}]);
|
|
233
236
|
}();
|
|
234
|
-
CreateMonitor.RequiredProperties = ["alert_routes", "description", "name", "
|
|
237
|
+
CreateMonitor.RequiredProperties = ["alert_routes", "description", "name", "source_type", "threshold"];
|
|
235
238
|
|
|
236
239
|
/**
|
|
237
240
|
* Aggregate function to apply to the selected values before applying the condition. [none, sum, average, max, min]
|
|
238
241
|
* @member {module:model/CreateMonitor.AggregateFunctionEnum} aggregate_function
|
|
239
242
|
*/
|
|
240
|
-
CreateMonitor.prototype[
|
|
243
|
+
CreateMonitor.prototype['aggregate_function'] = undefined;
|
|
241
244
|
|
|
242
245
|
/**
|
|
243
246
|
* The time window to aggregate the selected values. It follows the format of a number followed by a time unit
|
|
244
247
|
* @member {String} aggregate_window
|
|
245
248
|
*/
|
|
246
|
-
CreateMonitor.prototype[
|
|
249
|
+
CreateMonitor.prototype['aggregate_window'] = undefined;
|
|
247
250
|
|
|
248
251
|
/**
|
|
249
252
|
* If true, the monitor is in alert state.
|
|
250
253
|
* @member {Boolean} alert
|
|
251
254
|
*/
|
|
252
|
-
CreateMonitor.prototype[
|
|
255
|
+
CreateMonitor.prototype['alert'] = undefined;
|
|
253
256
|
|
|
254
257
|
/**
|
|
255
258
|
* @member {Array.<module:model/MonitorAlertRoutesInner>} alert_routes
|
|
256
259
|
*/
|
|
257
|
-
CreateMonitor.prototype[
|
|
260
|
+
CreateMonitor.prototype['alert_routes'] = undefined;
|
|
258
261
|
|
|
259
262
|
/**
|
|
260
263
|
* 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]
|
|
261
264
|
* @member {module:model/CreateMonitor.ConditionTypeEnum} condition_type
|
|
262
265
|
*/
|
|
263
|
-
CreateMonitor.prototype[
|
|
266
|
+
CreateMonitor.prototype['condition_type'] = undefined;
|
|
264
267
|
|
|
265
268
|
/**
|
|
266
269
|
* @member {String} description
|
|
267
270
|
*/
|
|
268
|
-
CreateMonitor.prototype[
|
|
271
|
+
CreateMonitor.prototype['description'] = undefined;
|
|
269
272
|
|
|
270
273
|
/**
|
|
271
274
|
* If true, the monitor will not be evaluated.
|
|
272
275
|
* @member {Boolean} disabled
|
|
273
276
|
*/
|
|
274
|
-
CreateMonitor.prototype[
|
|
277
|
+
CreateMonitor.prototype['disabled'] = undefined;
|
|
275
278
|
|
|
276
279
|
/**
|
|
277
280
|
* @member {Array.<String>} fleet_filter
|
|
278
281
|
*/
|
|
279
|
-
CreateMonitor.prototype[
|
|
282
|
+
CreateMonitor.prototype['fleet_filter'] = undefined;
|
|
280
283
|
|
|
281
284
|
/**
|
|
282
285
|
* The last time the monitor was evaluated and routed.
|
|
283
286
|
* @member {String} last_routed_at
|
|
284
287
|
*/
|
|
285
|
-
CreateMonitor.prototype[
|
|
288
|
+
CreateMonitor.prototype['last_routed_at'] = undefined;
|
|
286
289
|
|
|
287
290
|
/**
|
|
288
291
|
* @member {String} name
|
|
289
292
|
*/
|
|
290
|
-
CreateMonitor.prototype[
|
|
293
|
+
CreateMonitor.prototype['name'] = undefined;
|
|
291
294
|
|
|
292
295
|
/**
|
|
293
296
|
* @member {Array.<String>} notefile_filter
|
|
294
297
|
*/
|
|
295
|
-
CreateMonitor.prototype[
|
|
298
|
+
CreateMonitor.prototype['notefile_filter'] = undefined;
|
|
296
299
|
|
|
297
300
|
/**
|
|
298
301
|
* 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.
|
|
299
302
|
* @member {Boolean} per_device
|
|
300
303
|
*/
|
|
301
|
-
CreateMonitor.prototype[
|
|
304
|
+
CreateMonitor.prototype['per_device'] = undefined;
|
|
302
305
|
|
|
303
306
|
/**
|
|
304
307
|
* 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.
|
|
305
308
|
* @member {String} routing_cooldown_period
|
|
306
309
|
*/
|
|
307
|
-
CreateMonitor.prototype[
|
|
310
|
+
CreateMonitor.prototype['routing_cooldown_period'] = undefined;
|
|
308
311
|
|
|
309
312
|
/**
|
|
310
313
|
* If true, alerts will be created, but no notifications will be sent.
|
|
311
314
|
* @member {Boolean} silenced
|
|
312
315
|
*/
|
|
313
|
-
CreateMonitor.prototype[
|
|
316
|
+
CreateMonitor.prototype['silenced'] = undefined;
|
|
314
317
|
|
|
315
318
|
/**
|
|
316
319
|
* A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.
|
|
317
320
|
* @member {String} source_selector
|
|
318
321
|
*/
|
|
319
|
-
CreateMonitor.prototype[
|
|
322
|
+
CreateMonitor.prototype['source_selector'] = undefined;
|
|
320
323
|
|
|
321
324
|
/**
|
|
322
|
-
* The type of source to monitor.
|
|
325
|
+
* The type of source to monitor. Supported values are \"event\" and \"heartbeat\".
|
|
323
326
|
* @member {module:model/CreateMonitor.SourceTypeEnum} source_type
|
|
324
327
|
*/
|
|
325
|
-
CreateMonitor.prototype[
|
|
328
|
+
CreateMonitor.prototype['source_type'] = undefined;
|
|
326
329
|
|
|
327
330
|
/**
|
|
328
331
|
* The type of condition to apply to the value selected by the source_selector
|
|
329
332
|
* @member {Number} threshold
|
|
330
333
|
*/
|
|
331
|
-
CreateMonitor.prototype[
|
|
334
|
+
CreateMonitor.prototype['threshold'] = undefined;
|
|
332
335
|
|
|
333
336
|
/**
|
|
334
337
|
* @member {String} uid
|
|
335
338
|
*/
|
|
336
|
-
CreateMonitor.prototype[
|
|
339
|
+
CreateMonitor.prototype['uid'] = undefined;
|
|
337
340
|
|
|
338
341
|
// Implement Monitor interface:
|
|
339
342
|
/**
|
|
340
343
|
* Aggregate function to apply to the selected values before applying the condition. [none, sum, average, max, min]
|
|
341
344
|
* @member {module:model/Monitor.AggregateFunctionEnum} aggregate_function
|
|
342
345
|
*/
|
|
343
|
-
_Monitor["default"].prototype[
|
|
346
|
+
_Monitor["default"].prototype['aggregate_function'] = undefined;
|
|
344
347
|
/**
|
|
345
348
|
* The time window to aggregate the selected values. It follows the format of a number followed by a time unit
|
|
346
349
|
* @member {String} aggregate_window
|
|
347
350
|
*/
|
|
348
|
-
_Monitor["default"].prototype[
|
|
351
|
+
_Monitor["default"].prototype['aggregate_window'] = undefined;
|
|
349
352
|
/**
|
|
350
353
|
* If true, the monitor is in alert state.
|
|
351
354
|
* @member {Boolean} alert
|
|
352
355
|
*/
|
|
353
|
-
_Monitor["default"].prototype[
|
|
356
|
+
_Monitor["default"].prototype['alert'] = undefined;
|
|
354
357
|
/**
|
|
355
358
|
* @member {Array.<module:model/MonitorAlertRoutesInner>} alert_routes
|
|
356
359
|
*/
|
|
357
|
-
_Monitor["default"].prototype[
|
|
360
|
+
_Monitor["default"].prototype['alert_routes'] = undefined;
|
|
358
361
|
/**
|
|
359
362
|
* 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]
|
|
360
363
|
* @member {module:model/Monitor.ConditionTypeEnum} condition_type
|
|
361
364
|
*/
|
|
362
|
-
_Monitor["default"].prototype[
|
|
365
|
+
_Monitor["default"].prototype['condition_type'] = undefined;
|
|
363
366
|
/**
|
|
364
367
|
* @member {String} description
|
|
365
368
|
*/
|
|
366
|
-
_Monitor["default"].prototype[
|
|
369
|
+
_Monitor["default"].prototype['description'] = undefined;
|
|
367
370
|
/**
|
|
368
371
|
* If true, the monitor will not be evaluated.
|
|
369
372
|
* @member {Boolean} disabled
|
|
370
373
|
*/
|
|
371
|
-
_Monitor["default"].prototype[
|
|
374
|
+
_Monitor["default"].prototype['disabled'] = undefined;
|
|
372
375
|
/**
|
|
373
376
|
* @member {Array.<String>} fleet_filter
|
|
374
377
|
*/
|
|
375
|
-
_Monitor["default"].prototype[
|
|
378
|
+
_Monitor["default"].prototype['fleet_filter'] = undefined;
|
|
376
379
|
/**
|
|
377
380
|
* The last time the monitor was evaluated and routed.
|
|
378
381
|
* @member {String} last_routed_at
|
|
379
382
|
*/
|
|
380
|
-
_Monitor["default"].prototype[
|
|
383
|
+
_Monitor["default"].prototype['last_routed_at'] = undefined;
|
|
381
384
|
/**
|
|
382
385
|
* @member {String} name
|
|
383
386
|
*/
|
|
384
|
-
_Monitor["default"].prototype[
|
|
387
|
+
_Monitor["default"].prototype['name'] = undefined;
|
|
385
388
|
/**
|
|
386
389
|
* @member {Array.<String>} notefile_filter
|
|
387
390
|
*/
|
|
388
|
-
_Monitor["default"].prototype[
|
|
391
|
+
_Monitor["default"].prototype['notefile_filter'] = undefined;
|
|
389
392
|
/**
|
|
390
393
|
* 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.
|
|
391
394
|
* @member {Boolean} per_device
|
|
392
395
|
*/
|
|
393
|
-
_Monitor["default"].prototype[
|
|
396
|
+
_Monitor["default"].prototype['per_device'] = undefined;
|
|
394
397
|
/**
|
|
395
398
|
* 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.
|
|
396
399
|
* @member {String} routing_cooldown_period
|
|
397
400
|
*/
|
|
398
|
-
_Monitor["default"].prototype[
|
|
401
|
+
_Monitor["default"].prototype['routing_cooldown_period'] = undefined;
|
|
399
402
|
/**
|
|
400
403
|
* If true, alerts will be created, but no notifications will be sent.
|
|
401
404
|
* @member {Boolean} silenced
|
|
402
405
|
*/
|
|
403
|
-
_Monitor["default"].prototype[
|
|
406
|
+
_Monitor["default"].prototype['silenced'] = undefined;
|
|
404
407
|
/**
|
|
405
408
|
* A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.
|
|
406
409
|
* @member {String} source_selector
|
|
407
410
|
*/
|
|
408
|
-
_Monitor["default"].prototype[
|
|
411
|
+
_Monitor["default"].prototype['source_selector'] = undefined;
|
|
409
412
|
/**
|
|
410
|
-
* The type of source to monitor.
|
|
413
|
+
* The type of source to monitor. Supported values are \"event\" and \"heartbeat\".
|
|
411
414
|
* @member {module:model/Monitor.SourceTypeEnum} source_type
|
|
412
415
|
*/
|
|
413
|
-
_Monitor["default"].prototype[
|
|
416
|
+
_Monitor["default"].prototype['source_type'] = undefined;
|
|
414
417
|
/**
|
|
415
418
|
* The type of condition to apply to the value selected by the source_selector
|
|
416
419
|
* @member {Number} threshold
|
|
417
420
|
*/
|
|
418
|
-
_Monitor["default"].prototype[
|
|
421
|
+
_Monitor["default"].prototype['threshold'] = undefined;
|
|
419
422
|
/**
|
|
420
423
|
* @member {String} uid
|
|
421
424
|
*/
|
|
422
|
-
_Monitor["default"].prototype[
|
|
425
|
+
_Monitor["default"].prototype['uid'] = undefined;
|
|
423
426
|
|
|
424
427
|
/**
|
|
425
428
|
* Allowed values for the <code>aggregate_function</code> property.
|
|
426
429
|
* @enum {String}
|
|
427
430
|
* @readonly
|
|
428
431
|
*/
|
|
429
|
-
CreateMonitor[
|
|
432
|
+
CreateMonitor['AggregateFunctionEnum'] = {
|
|
430
433
|
/**
|
|
431
434
|
* value: "none"
|
|
432
435
|
* @const
|
|
433
436
|
*/
|
|
434
|
-
none: "none",
|
|
437
|
+
"none": "none",
|
|
435
438
|
/**
|
|
436
439
|
* value: "sum"
|
|
437
440
|
* @const
|
|
438
441
|
*/
|
|
439
|
-
sum: "sum",
|
|
442
|
+
"sum": "sum",
|
|
440
443
|
/**
|
|
441
444
|
* value: "average"
|
|
442
445
|
* @const
|
|
443
446
|
*/
|
|
444
|
-
average: "average",
|
|
447
|
+
"average": "average",
|
|
445
448
|
/**
|
|
446
449
|
* value: "max"
|
|
447
450
|
* @const
|
|
448
451
|
*/
|
|
449
|
-
max: "max",
|
|
452
|
+
"max": "max",
|
|
450
453
|
/**
|
|
451
454
|
* value: "min"
|
|
452
455
|
* @const
|
|
453
456
|
*/
|
|
454
|
-
min: "min"
|
|
457
|
+
"min": "min"
|
|
455
458
|
};
|
|
456
459
|
|
|
457
460
|
/**
|
|
@@ -459,37 +462,37 @@ CreateMonitor["AggregateFunctionEnum"] = {
|
|
|
459
462
|
* @enum {String}
|
|
460
463
|
* @readonly
|
|
461
464
|
*/
|
|
462
|
-
CreateMonitor[
|
|
465
|
+
CreateMonitor['ConditionTypeEnum'] = {
|
|
463
466
|
/**
|
|
464
467
|
* value: "greater_than"
|
|
465
468
|
* @const
|
|
466
469
|
*/
|
|
467
|
-
greater_than: "greater_than",
|
|
470
|
+
"greater_than": "greater_than",
|
|
468
471
|
/**
|
|
469
472
|
* value: "greater_than_or_equal_to"
|
|
470
473
|
* @const
|
|
471
474
|
*/
|
|
472
|
-
greater_than_or_equal_to: "greater_than_or_equal_to",
|
|
475
|
+
"greater_than_or_equal_to": "greater_than_or_equal_to",
|
|
473
476
|
/**
|
|
474
477
|
* value: "less_than"
|
|
475
478
|
* @const
|
|
476
479
|
*/
|
|
477
|
-
less_than: "less_than",
|
|
480
|
+
"less_than": "less_than",
|
|
478
481
|
/**
|
|
479
482
|
* value: "less_than_or_equal_to"
|
|
480
483
|
* @const
|
|
481
484
|
*/
|
|
482
|
-
less_than_or_equal_to: "less_than_or_equal_to",
|
|
485
|
+
"less_than_or_equal_to": "less_than_or_equal_to",
|
|
483
486
|
/**
|
|
484
487
|
* value: "equal_to"
|
|
485
488
|
* @const
|
|
486
489
|
*/
|
|
487
|
-
equal_to: "equal_to",
|
|
490
|
+
"equal_to": "equal_to",
|
|
488
491
|
/**
|
|
489
492
|
* value: "not_equal_to"
|
|
490
493
|
* @const
|
|
491
494
|
*/
|
|
492
|
-
not_equal_to: "not_equal_to"
|
|
495
|
+
"not_equal_to": "not_equal_to"
|
|
493
496
|
};
|
|
494
497
|
|
|
495
498
|
/**
|
|
@@ -497,11 +500,16 @@ CreateMonitor["ConditionTypeEnum"] = {
|
|
|
497
500
|
* @enum {String}
|
|
498
501
|
* @readonly
|
|
499
502
|
*/
|
|
500
|
-
CreateMonitor[
|
|
503
|
+
CreateMonitor['SourceTypeEnum'] = {
|
|
501
504
|
/**
|
|
502
505
|
* value: "event"
|
|
503
506
|
* @const
|
|
504
507
|
*/
|
|
505
|
-
event: "event"
|
|
508
|
+
"event": "event",
|
|
509
|
+
/**
|
|
510
|
+
* value: "heartbeat"
|
|
511
|
+
* @const
|
|
512
|
+
*/
|
|
513
|
+
"heartbeat": "heartbeat"
|
|
506
514
|
};
|
|
507
515
|
var _default = exports["default"] = CreateMonitor;
|