@blues-inc/notehub-js 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +86 -95
  2. package/dist/ApiClient.js +18 -9
  3. package/dist/api/AlertApi.js +95 -0
  4. package/dist/api/AuthorizationApi.js +18 -9
  5. package/dist/api/BillingAccountApi.js +18 -9
  6. package/dist/api/DeviceApi.js +904 -182
  7. package/dist/api/EventApi.js +69 -16
  8. package/dist/api/FirmwareApi.js +109 -0
  9. package/dist/api/MonitorApi.js +275 -0
  10. package/dist/api/ProjectApi.js +471 -282
  11. package/dist/api/RouteApi.js +96 -9
  12. package/dist/index.js +76 -41
  13. package/dist/model/Alert.js +259 -0
  14. package/dist/model/AlertDataInner.js +184 -0
  15. package/dist/model/AlertNotificationsInner.js +132 -0
  16. package/dist/model/Aws.js +17 -8
  17. package/dist/model/Azure.js +17 -8
  18. package/dist/model/BillingAccount.js +17 -8
  19. package/dist/model/BillingAccountRole.js +29 -8
  20. package/dist/model/Body.js +17 -8
  21. package/dist/model/CloneProjectRequest.js +17 -8
  22. package/dist/model/Contact.js +17 -8
  23. package/dist/model/CreateFleetRequest.js +17 -8
  24. package/dist/model/CreateMonitor.js +428 -0
  25. package/dist/model/CreateProductRequest.js +17 -8
  26. package/dist/model/CreateProjectRequest.js +17 -8
  27. package/dist/model/DFUEnv.js +17 -8
  28. package/dist/model/DFUState.js +17 -8
  29. package/dist/model/DeleteDeviceFleetsRequest.js +17 -8
  30. package/dist/model/Device.js +21 -14
  31. package/dist/model/DeviceSession.js +17 -8
  32. package/dist/model/DeviceTowerInfo.js +17 -8
  33. package/dist/model/DeviceUsage.js +17 -8
  34. package/dist/model/EnvironmentVariables.js +17 -8
  35. package/dist/model/Error.js +17 -8
  36. package/dist/model/Event.js +17 -8
  37. package/dist/model/FirmwareInfo.js +231 -0
  38. package/dist/model/Fleet.js +17 -8
  39. package/dist/model/GetAlerts200Response.js +143 -0
  40. package/dist/model/GetBillingAccounts200Response.js +17 -8
  41. package/dist/model/GetDeviceEnvironmentVariables200Response.js +17 -8
  42. package/dist/model/GetDeviceHealthLog200Response.js +17 -8
  43. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +17 -8
  44. package/dist/model/GetDeviceLatest200Response.js +17 -8
  45. package/dist/model/GetDevicePublicKey200Response.js +17 -8
  46. package/dist/model/GetDeviceSessions200Response.js +17 -8
  47. package/dist/model/GetProjectDevicePublicKeys200Response.js +17 -8
  48. package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +17 -8
  49. package/dist/model/GetProjectDevices200Response.js +17 -8
  50. package/dist/model/GetProjectEvents200Response.js +21 -27
  51. package/dist/model/GetProjectEventsByCursor200Response.js +17 -8
  52. package/dist/model/GetProjectFleets200Response.js +17 -8
  53. package/dist/model/GetProjectMembers200Response.js +17 -8
  54. package/dist/model/GetProjectProducts200Response.js +17 -8
  55. package/dist/model/GetProjects200Response.js +17 -8
  56. package/dist/model/GetRouteLogsByRoute200ResponseInner.js +17 -8
  57. package/dist/model/Google.js +17 -8
  58. package/dist/model/HandleNoteChanges200Response.js +17 -8
  59. package/dist/model/HandleNoteGet200Response.js +17 -8
  60. package/dist/model/HandleNoteSignal200Response.js +17 -8
  61. package/dist/model/HandleNotefileChanges200Response.js +17 -8
  62. package/dist/model/HandleNotefileChangesPending200Response.js +17 -8
  63. package/dist/model/HandleNotefileDeleteRequest.js +17 -8
  64. package/dist/model/Http.js +17 -8
  65. package/dist/model/HttpFilter.js +17 -8
  66. package/dist/model/HttpTransform.js +17 -8
  67. package/dist/model/Location.js +17 -8
  68. package/dist/model/Login200Response.js +17 -8
  69. package/dist/model/LoginRequest.js +17 -8
  70. package/dist/model/Monitor.js +328 -0
  71. package/dist/model/MonitorAlertRoutesInner.js +92 -0
  72. package/dist/model/MonitorThresholds.js +88 -0
  73. package/dist/model/Mqtt.js +17 -8
  74. package/dist/model/Note.js +17 -8
  75. package/dist/model/PostProvisionProjectDeviceRequest.js +17 -8
  76. package/dist/model/Product.js +17 -8
  77. package/dist/model/Project.js +17 -8
  78. package/dist/model/ProjectMember.js +17 -8
  79. package/dist/model/Proxy.js +17 -8
  80. package/dist/model/PutDeviceFleetsRequest.js +17 -8
  81. package/dist/model/Radresponder.js +17 -8
  82. package/dist/model/Role.js +37 -8
  83. package/dist/model/Route.js +17 -8
  84. package/dist/model/RouteSchema.js +29 -14
  85. package/dist/model/Slack.js +17 -8
  86. package/dist/model/Snowflake.js +17 -8
  87. package/dist/model/SnowflakeTransform.js +17 -8
  88. package/dist/model/Thingworx.js +17 -8
  89. package/dist/model/TowerLocation.js +17 -8
  90. package/dist/model/Twilio.js +17 -8
  91. package/dist/model/UpdateFleetRequest.js +17 -8
  92. package/dist/model/UserDbRoute.js +17 -8
  93. package/package.json +1 -1
  94. package/dist/api/DevicesApi.js +0 -346
  95. package/dist/api/EnvironmentVariablesApi.js +0 -567
  96. package/dist/api/FilesApi.js +0 -193
  97. package/dist/api/FleetApi.js +0 -736
  98. package/dist/api/NotesApi.js +0 -435
  99. package/dist/api/ProductApi.js +0 -163
  100. package/dist/api/RouteLogsApi.js +0 -160
@@ -6,16 +6,27 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15
+ * Notehub API
16
+ * The OpenAPI definition for the Notehub.io API.
17
+ *
18
+ * The version of the OpenAPI document: 1.0.0
19
+ * Contact: engineering@blues.io
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
15
26
  /**
16
27
  * The Login200Response model module.
17
28
  * @module model/Login200Response
18
- * @version 1.0.18
29
+ * @version 1.0.20
19
30
  */
20
31
  var Login200Response = /*#__PURE__*/function () {
21
32
  /**
@@ -32,7 +43,7 @@ var Login200Response = /*#__PURE__*/function () {
32
43
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
33
44
  * Only for internal use.
34
45
  */
35
- _createClass(Login200Response, null, [{
46
+ return _createClass(Login200Response, null, [{
36
47
  key: "initialize",
37
48
  value: function initialize(obj) {}
38
49
 
@@ -72,11 +83,9 @@ var Login200Response = /*#__PURE__*/function () {
72
83
  return true;
73
84
  }
74
85
  }]);
75
- return Login200Response;
76
86
  }();
77
87
  /**
78
88
  * @member {String} session_token
79
89
  */
80
90
  Login200Response.prototype["session_token"] = undefined;
81
- var _default = Login200Response;
82
- exports["default"] = _default;
91
+ var _default = exports["default"] = Login200Response;
@@ -6,16 +6,27 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15
+ * Notehub API
16
+ * The OpenAPI definition for the Notehub.io API.
17
+ *
18
+ * The version of the OpenAPI document: 1.0.0
19
+ * Contact: engineering@blues.io
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
15
26
  /**
16
27
  * The LoginRequest model module.
17
28
  * @module model/LoginRequest
18
- * @version 1.0.18
29
+ * @version 1.0.20
19
30
  */
20
31
  var LoginRequest = /*#__PURE__*/function () {
21
32
  /**
@@ -32,7 +43,7 @@ var LoginRequest = /*#__PURE__*/function () {
32
43
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
33
44
  * Only for internal use.
34
45
  */
35
- _createClass(LoginRequest, null, [{
46
+ return _createClass(LoginRequest, null, [{
36
47
  key: "initialize",
37
48
  value: function initialize(obj) {}
38
49
 
@@ -79,7 +90,6 @@ var LoginRequest = /*#__PURE__*/function () {
79
90
  return true;
80
91
  }
81
92
  }]);
82
- return LoginRequest;
83
93
  }();
84
94
  /**
85
95
  * @member {String} username
@@ -90,5 +100,4 @@ LoginRequest.prototype["username"] = undefined;
90
100
  * @member {String} password
91
101
  */
92
102
  LoginRequest.prototype["password"] = undefined;
93
- var _default = LoginRequest;
94
- exports["default"] = _default;
103
+ var _default = exports["default"] = LoginRequest;
@@ -0,0 +1,328 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _MonitorAlertRoutesInner = _interopRequireDefault(require("./MonitorAlertRoutesInner"));
9
+ var _MonitorThresholds = _interopRequireDefault(require("./MonitorThresholds"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
17
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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
+ * Notehub API
21
+ * The OpenAPI definition for the Notehub.io API.
22
+ *
23
+ * The version of the OpenAPI document: 1.0.0
24
+ * Contact: engineering@blues.io
25
+ *
26
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
27
+ * https://openapi-generator.tech
28
+ * Do not edit the class manually.
29
+ *
30
+ */
31
+ /**
32
+ * The Monitor model module.
33
+ * @module model/Monitor
34
+ * @version 1.0.20
35
+ */
36
+ var Monitor = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>Monitor</code>.
39
+ * @alias module:model/Monitor
40
+ */
41
+ function Monitor() {
42
+ _classCallCheck(this, Monitor);
43
+ Monitor.initialize(this);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(Monitor, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj) {}
54
+
55
+ /**
56
+ * Constructs a <code>Monitor</code> from a plain JavaScript object, optionally creating a new instance.
57
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
58
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
59
+ * @param {module:model/Monitor} obj Optional instance to populate.
60
+ * @return {module:model/Monitor} The populated <code>Monitor</code> instance.
61
+ */
62
+ }, {
63
+ key: "constructFromObject",
64
+ value: function constructFromObject(data, obj) {
65
+ if (data) {
66
+ obj = obj || new Monitor();
67
+ if (data.hasOwnProperty("uid")) {
68
+ obj["uid"] = _ApiClient["default"].convertToType(data["uid"], "String");
69
+ }
70
+ if (data.hasOwnProperty("name")) {
71
+ obj["name"] = _ApiClient["default"].convertToType(data["name"], "String");
72
+ }
73
+ if (data.hasOwnProperty("description")) {
74
+ obj["description"] = _ApiClient["default"].convertToType(data["description"], "String");
75
+ }
76
+ if (data.hasOwnProperty("source_type")) {
77
+ obj["source_type"] = _ApiClient["default"].convertToType(data["source_type"], "String");
78
+ }
79
+ if (data.hasOwnProperty("disabled")) {
80
+ obj["disabled"] = _ApiClient["default"].convertToType(data["disabled"], "Boolean");
81
+ }
82
+ if (data.hasOwnProperty("alert")) {
83
+ obj["alert"] = _ApiClient["default"].convertToType(data["alert"], "Boolean");
84
+ }
85
+ if (data.hasOwnProperty("notefile_filter")) {
86
+ obj["notefile_filter"] = _ApiClient["default"].convertToType(data["notefile_filter"], ["String"]);
87
+ }
88
+ if (data.hasOwnProperty("fleet_filter")) {
89
+ obj["fleet_filter"] = _ApiClient["default"].convertToType(data["fleet_filter"], ["String"]);
90
+ }
91
+ if (data.hasOwnProperty("source_selector")) {
92
+ obj["source_selector"] = _ApiClient["default"].convertToType(data["source_selector"], "String");
93
+ }
94
+ if (data.hasOwnProperty("condition_type")) {
95
+ obj["condition_type"] = _ApiClient["default"].convertToType(data["condition_type"], "String");
96
+ }
97
+ if (data.hasOwnProperty("thresholds")) {
98
+ obj["thresholds"] = _MonitorThresholds["default"].constructFromObject(data["thresholds"]);
99
+ }
100
+ if (data.hasOwnProperty("alert_routes")) {
101
+ obj["alert_routes"] = _ApiClient["default"].convertToType(data["alert_routes"], [_MonitorAlertRoutesInner["default"]]);
102
+ }
103
+ if (data.hasOwnProperty("last_routed_at")) {
104
+ obj["last_routed_at"] = _ApiClient["default"].convertToType(data["last_routed_at"], "String");
105
+ }
106
+ if (data.hasOwnProperty("silenced")) {
107
+ obj["silenced"] = _ApiClient["default"].convertToType(data["silenced"], "Boolean");
108
+ }
109
+ if (data.hasOwnProperty("routing_cooldown_period")) {
110
+ obj["routing_cooldown_period"] = _ApiClient["default"].convertToType(data["routing_cooldown_period"], "String");
111
+ }
112
+ } else if (data === null) {
113
+ return null;
114
+ }
115
+ return obj;
116
+ }
117
+
118
+ /**
119
+ * Validates the JSON data with respect to <code>Monitor</code>.
120
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
121
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Monitor</code>.
122
+ */
123
+ }, {
124
+ key: "validateJSON",
125
+ value: function validateJSON(data) {
126
+ // ensure the json data is a string
127
+ if (data["uid"] && !(typeof data["uid"] === "string" || data["uid"] instanceof String)) {
128
+ throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data["uid"]);
129
+ }
130
+ // ensure the json data is a string
131
+ if (data["name"] && !(typeof data["name"] === "string" || data["name"] instanceof String)) {
132
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data["name"]);
133
+ }
134
+ // ensure the json data is a string
135
+ if (data["description"] && !(typeof data["description"] === "string" || data["description"] instanceof String)) {
136
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data["description"]);
137
+ }
138
+ // ensure the json data is a string
139
+ if (data["source_type"] && !(typeof data["source_type"] === "string" || data["source_type"] instanceof String)) {
140
+ throw new Error("Expected the field `source_type` to be a primitive type in the JSON string but got " + data["source_type"]);
141
+ }
142
+ // ensure the json data is an array
143
+ if (!Array.isArray(data["notefile_filter"])) {
144
+ throw new Error("Expected the field `notefile_filter` to be an array in the JSON data but got " + data["notefile_filter"]);
145
+ }
146
+ // ensure the json data is an array
147
+ if (!Array.isArray(data["fleet_filter"])) {
148
+ throw new Error("Expected the field `fleet_filter` to be an array in the JSON data but got " + data["fleet_filter"]);
149
+ }
150
+ // ensure the json data is a string
151
+ if (data["source_selector"] && !(typeof data["source_selector"] === "string" || data["source_selector"] instanceof String)) {
152
+ throw new Error("Expected the field `source_selector` to be a primitive type in the JSON string but got " + data["source_selector"]);
153
+ }
154
+ // ensure the json data is a string
155
+ if (data["condition_type"] && !(typeof data["condition_type"] === "string" || data["condition_type"] instanceof String)) {
156
+ throw new Error("Expected the field `condition_type` to be a primitive type in the JSON string but got " + data["condition_type"]);
157
+ }
158
+ // validate the optional field `thresholds`
159
+ if (data["thresholds"]) {
160
+ // data not null
161
+ _MonitorThresholds["default"].validateJSON(data["thresholds"]);
162
+ }
163
+ if (data["alert_routes"]) {
164
+ // data not null
165
+ // ensure the json data is an array
166
+ if (!Array.isArray(data["alert_routes"])) {
167
+ throw new Error("Expected the field `alert_routes` to be an array in the JSON data but got " + data["alert_routes"]);
168
+ }
169
+ // validate the optional field `alert_routes` (array)
170
+ var _iterator = _createForOfIteratorHelper(data["alert_routes"]),
171
+ _step;
172
+ try {
173
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
174
+ var item = _step.value;
175
+ _MonitorAlertRoutesInner["default"].validateJsonObject(item);
176
+ }
177
+ } catch (err) {
178
+ _iterator.e(err);
179
+ } finally {
180
+ _iterator.f();
181
+ }
182
+ }
183
+ // ensure the json data is a string
184
+ if (data["last_routed_at"] && !(typeof data["last_routed_at"] === "string" || data["last_routed_at"] instanceof String)) {
185
+ throw new Error("Expected the field `last_routed_at` to be a primitive type in the JSON string but got " + data["last_routed_at"]);
186
+ }
187
+ // ensure the json data is a string
188
+ if (data["routing_cooldown_period"] && !(typeof data["routing_cooldown_period"] === "string" || data["routing_cooldown_period"] instanceof String)) {
189
+ throw new Error("Expected the field `routing_cooldown_period` to be a primitive type in the JSON string but got " + data["routing_cooldown_period"]);
190
+ }
191
+ return true;
192
+ }
193
+ }]);
194
+ }();
195
+ /**
196
+ * @member {String} uid
197
+ */
198
+ Monitor.prototype["uid"] = undefined;
199
+
200
+ /**
201
+ * @member {String} name
202
+ */
203
+ Monitor.prototype["name"] = undefined;
204
+
205
+ /**
206
+ * @member {String} description
207
+ */
208
+ Monitor.prototype["description"] = undefined;
209
+
210
+ /**
211
+ * The type of source to monitor. Currently only \"event\" is supported.
212
+ * @member {module:model/Monitor.SourceTypeEnum} source_type
213
+ */
214
+ Monitor.prototype["source_type"] = undefined;
215
+
216
+ /**
217
+ * If true, the monitor will not be evaluated.
218
+ * @member {Boolean} disabled
219
+ */
220
+ Monitor.prototype["disabled"] = undefined;
221
+
222
+ /**
223
+ * If true, the monitor is in alert state.
224
+ * @member {Boolean} alert
225
+ */
226
+ Monitor.prototype["alert"] = undefined;
227
+
228
+ /**
229
+ * @member {Array.<String>} notefile_filter
230
+ */
231
+ Monitor.prototype["notefile_filter"] = undefined;
232
+
233
+ /**
234
+ * @member {Array.<String>} fleet_filter
235
+ */
236
+ Monitor.prototype["fleet_filter"] = undefined;
237
+
238
+ /**
239
+ * A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.
240
+ * @member {String} source_selector
241
+ */
242
+ Monitor.prototype["source_selector"] = undefined;
243
+
244
+ /**
245
+ * The type of condition to apply to the value selected by the source_selector
246
+ * @member {module:model/Monitor.ConditionTypeEnum} condition_type
247
+ */
248
+ Monitor.prototype["condition_type"] = undefined;
249
+
250
+ /**
251
+ * @member {module:model/MonitorThresholds} thresholds
252
+ */
253
+ Monitor.prototype["thresholds"] = undefined;
254
+
255
+ /**
256
+ * @member {Array.<module:model/MonitorAlertRoutesInner>} alert_routes
257
+ */
258
+ Monitor.prototype["alert_routes"] = undefined;
259
+
260
+ /**
261
+ * The last time the monitor was evaluated and routed.
262
+ * @member {String} last_routed_at
263
+ */
264
+ Monitor.prototype["last_routed_at"] = undefined;
265
+
266
+ /**
267
+ * If true, alerts will be created, but no notifications will be sent.
268
+ * @member {Boolean} silenced
269
+ */
270
+ Monitor.prototype["silenced"] = undefined;
271
+
272
+ /**
273
+ * 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.
274
+ * @member {String} routing_cooldown_period
275
+ */
276
+ Monitor.prototype["routing_cooldown_period"] = undefined;
277
+
278
+ /**
279
+ * Allowed values for the <code>source_type</code> property.
280
+ * @enum {String}
281
+ * @readonly
282
+ */
283
+ Monitor["SourceTypeEnum"] = {
284
+ /**
285
+ * value: "event"
286
+ * @const
287
+ */
288
+ event: "event"
289
+ };
290
+
291
+ /**
292
+ * Allowed values for the <code>condition_type</code> property.
293
+ * @enum {String}
294
+ * @readonly
295
+ */
296
+ Monitor["ConditionTypeEnum"] = {
297
+ /**
298
+ * value: "greater_than"
299
+ * @const
300
+ */
301
+ greater_than: "greater_than",
302
+ /**
303
+ * value: "greater_than_or_equal_to"
304
+ * @const
305
+ */
306
+ greater_than_or_equal_to: "greater_than_or_equal_to",
307
+ /**
308
+ * value: "less_than"
309
+ * @const
310
+ */
311
+ less_than: "less_than",
312
+ /**
313
+ * value: "less_than_or_equal_to"
314
+ * @const
315
+ */
316
+ less_than_or_equal_to: "less_than_or_equal_to",
317
+ /**
318
+ * value: "equal_to"
319
+ * @const
320
+ */
321
+ equal_to: "equal_to",
322
+ /**
323
+ * value: "not_equal_to"
324
+ * @const
325
+ */
326
+ not_equal_to: "not_equal_to"
327
+ };
328
+ var _default = exports["default"] = Monitor;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15
+ * Notehub API
16
+ * The OpenAPI definition for the Notehub.io API.
17
+ *
18
+ * The version of the OpenAPI document: 1.0.0
19
+ * Contact: engineering@blues.io
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
26
+ /**
27
+ * The MonitorAlertRoutesInner model module.
28
+ * @module model/MonitorAlertRoutesInner
29
+ * @version 1.0.20
30
+ */
31
+ var MonitorAlertRoutesInner = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>MonitorAlertRoutesInner</code>.
34
+ * @alias module:model/MonitorAlertRoutesInner
35
+ */
36
+ function MonitorAlertRoutesInner() {
37
+ _classCallCheck(this, MonitorAlertRoutesInner);
38
+ MonitorAlertRoutesInner.initialize(this);
39
+ }
40
+
41
+ /**
42
+ * Initializes the fields of this object.
43
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
+ * Only for internal use.
45
+ */
46
+ return _createClass(MonitorAlertRoutesInner, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>MonitorAlertRoutesInner</code> from a plain JavaScript object, optionally creating a new instance.
52
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
54
+ * @param {module:model/MonitorAlertRoutesInner} obj Optional instance to populate.
55
+ * @return {module:model/MonitorAlertRoutesInner} The populated <code>MonitorAlertRoutesInner</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new MonitorAlertRoutesInner();
62
+ if (data.hasOwnProperty("email_addresses")) {
63
+ obj["email_addresses"] = _ApiClient["default"].convertToType(data["email_addresses"], ["String"]);
64
+ }
65
+ } else if (data === null) {
66
+ return null;
67
+ }
68
+ return obj;
69
+ }
70
+
71
+ /**
72
+ * Validates the JSON data with respect to <code>MonitorAlertRoutesInner</code>.
73
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
74
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>MonitorAlertRoutesInner</code>.
75
+ */
76
+ }, {
77
+ key: "validateJSON",
78
+ value: function validateJSON(data) {
79
+ // ensure the json data is an array
80
+ if (!Array.isArray(data["email_addresses"])) {
81
+ throw new Error("Expected the field `email_addresses` to be an array in the JSON data but got " + data["email_addresses"]);
82
+ }
83
+ return true;
84
+ }
85
+ }]);
86
+ }();
87
+ /**
88
+ * List of email addresses in the project that will receive alerts.
89
+ * @member {Array.<String>} email_addresses
90
+ */
91
+ MonitorAlertRoutesInner.prototype["email_addresses"] = undefined;
92
+ var _default = exports["default"] = MonitorAlertRoutesInner;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15
+ * Notehub API
16
+ * The OpenAPI definition for the Notehub.io API.
17
+ *
18
+ * The version of the OpenAPI document: 1.0.0
19
+ * Contact: engineering@blues.io
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
26
+ /**
27
+ * The MonitorThresholds model module.
28
+ * @module model/MonitorThresholds
29
+ * @version 1.0.20
30
+ */
31
+ var MonitorThresholds = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>MonitorThresholds</code>.
34
+ * @alias module:model/MonitorThresholds
35
+ */
36
+ function MonitorThresholds() {
37
+ _classCallCheck(this, MonitorThresholds);
38
+ MonitorThresholds.initialize(this);
39
+ }
40
+
41
+ /**
42
+ * Initializes the fields of this object.
43
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
+ * Only for internal use.
45
+ */
46
+ return _createClass(MonitorThresholds, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>MonitorThresholds</code> from a plain JavaScript object, optionally creating a new instance.
52
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
54
+ * @param {module:model/MonitorThresholds} obj Optional instance to populate.
55
+ * @return {module:model/MonitorThresholds} The populated <code>MonitorThresholds</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new MonitorThresholds();
62
+ if (data.hasOwnProperty("alarm")) {
63
+ obj["alarm"] = _ApiClient["default"].convertToType(data["alarm"], "Number");
64
+ }
65
+ } else if (data === null) {
66
+ return null;
67
+ }
68
+ return obj;
69
+ }
70
+
71
+ /**
72
+ * Validates the JSON data with respect to <code>MonitorThresholds</code>.
73
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
74
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>MonitorThresholds</code>.
75
+ */
76
+ }, {
77
+ key: "validateJSON",
78
+ value: function validateJSON(data) {
79
+ return true;
80
+ }
81
+ }]);
82
+ }();
83
+ /**
84
+ * The value that triggers the monitor at an alarm level
85
+ * @member {Number} alarm
86
+ */
87
+ MonitorThresholds.prototype["alarm"] = undefined;
88
+ var _default = exports["default"] = MonitorThresholds;