@blues-inc/notehub-js 1.0.19 → 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 -96
  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 +68 -9
  8. package/dist/api/FirmwareApi.js +109 -0
  9. package/dist/api/MonitorApi.js +275 -0
  10. package/dist/api/ProjectApi.js +435 -286
  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,19 +6,30 @@ 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 _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; } } }; }
11
11
  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); }
12
12
  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; }
13
13
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
14
  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); } }
15
15
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
- 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); }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18
+ * Notehub API
19
+ * The OpenAPI definition for the Notehub.io API.
20
+ *
21
+ * The version of the OpenAPI document: 1.0.0
22
+ * Contact: engineering@blues.io
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
18
29
  /**
19
30
  * The CloneProjectRequest model module.
20
31
  * @module model/CloneProjectRequest
21
- * @version 1.0.19
32
+ * @version 1.0.20
22
33
  */
23
34
  var CloneProjectRequest = /*#__PURE__*/function () {
24
35
  /**
@@ -37,7 +48,7 @@ var CloneProjectRequest = /*#__PURE__*/function () {
37
48
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
38
49
  * Only for internal use.
39
50
  */
40
- _createClass(CloneProjectRequest, null, [{
51
+ return _createClass(CloneProjectRequest, null, [{
41
52
  key: "initialize",
42
53
  value: function initialize(obj, label, billingAccountUid) {
43
54
  obj["label"] = label;
@@ -108,7 +119,6 @@ var CloneProjectRequest = /*#__PURE__*/function () {
108
119
  return true;
109
120
  }
110
121
  }]);
111
- return CloneProjectRequest;
112
122
  }();
113
123
  CloneProjectRequest.RequiredProperties = ["label", "billing_account_uid"];
114
124
 
@@ -135,5 +145,4 @@ CloneProjectRequest.prototype["disable_clone_routes"] = undefined;
135
145
  * @member {Boolean} disable_clone_fleets
136
146
  */
137
147
  CloneProjectRequest.prototype["disable_clone_fleets"] = undefined;
138
- var _default = CloneProjectRequest;
139
- exports["default"] = _default;
148
+ var _default = exports["default"] = CloneProjectRequest;
@@ -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 Contact model module.
17
28
  * @module model/Contact
18
- * @version 1.0.19
29
+ * @version 1.0.20
19
30
  */
20
31
  var Contact = /*#__PURE__*/function () {
21
32
  /**
@@ -32,7 +43,7 @@ var Contact = /*#__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(Contact, null, [{
46
+ return _createClass(Contact, null, [{
36
47
  key: "initialize",
37
48
  value: function initialize(obj) {}
38
49
 
@@ -93,7 +104,6 @@ var Contact = /*#__PURE__*/function () {
93
104
  return true;
94
105
  }
95
106
  }]);
96
- return Contact;
97
107
  }();
98
108
  /**
99
109
  * @member {String} name
@@ -114,5 +124,4 @@ Contact.prototype["role"] = undefined;
114
124
  * @member {String} organization
115
125
  */
116
126
  Contact.prototype["organization"] = undefined;
117
- var _default = Contact;
118
- exports["default"] = _default;
127
+ var _default = exports["default"] = Contact;
@@ -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 CreateFleetRequest model module.
17
28
  * @module model/CreateFleetRequest
18
- * @version 1.0.19
29
+ * @version 1.0.20
19
30
  */
20
31
  var CreateFleetRequest = /*#__PURE__*/function () {
21
32
  /**
@@ -32,7 +43,7 @@ var CreateFleetRequest = /*#__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(CreateFleetRequest, null, [{
46
+ return _createClass(CreateFleetRequest, null, [{
36
47
  key: "initialize",
37
48
  value: function initialize(obj) {}
38
49
 
@@ -72,12 +83,10 @@ var CreateFleetRequest = /*#__PURE__*/function () {
72
83
  return true;
73
84
  }
74
85
  }]);
75
- return CreateFleetRequest;
76
86
  }();
77
87
  /**
78
88
  * The label for the Fleet.
79
89
  * @member {String} label
80
90
  */
81
91
  CreateFleetRequest.prototype["label"] = undefined;
82
- var _default = CreateFleetRequest;
83
- exports["default"] = _default;
92
+ var _default = exports["default"] = CreateFleetRequest;
@@ -0,0 +1,428 @@
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 _Monitor = _interopRequireDefault(require("./Monitor"));
9
+ var _MonitorAlertRoutesInner = _interopRequireDefault(require("./MonitorAlertRoutesInner"));
10
+ var _MonitorThresholds = _interopRequireDefault(require("./MonitorThresholds"));
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+ 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); }
13
+ 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; } } }; }
14
+ 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); }
15
+ 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; }
16
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
+ 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); } }
18
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
20
+ 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); } /**
21
+ * Notehub API
22
+ * The OpenAPI definition for the Notehub.io API.
23
+ *
24
+ * The version of the OpenAPI document: 1.0.0
25
+ * Contact: engineering@blues.io
26
+ *
27
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
28
+ * https://openapi-generator.tech
29
+ * Do not edit the class manually.
30
+ *
31
+ */
32
+ /**
33
+ * The CreateMonitor model module.
34
+ * @module model/CreateMonitor
35
+ * @version 1.0.20
36
+ */
37
+ var CreateMonitor = /*#__PURE__*/function () {
38
+ /**
39
+ * Constructs a new <code>CreateMonitor</code>.
40
+ * @alias module:model/CreateMonitor
41
+ * @implements module:model/Monitor
42
+ * @param name {String}
43
+ * @param description {String}
44
+ * @param notefileFilter {Array.<String>}
45
+ * @param alertRoutes {Array.<module:model/MonitorAlertRoutesInner>}
46
+ */
47
+ function CreateMonitor(name, description, notefileFilter, alertRoutes) {
48
+ _classCallCheck(this, CreateMonitor);
49
+ _Monitor["default"].initialize(this);
50
+ CreateMonitor.initialize(this, name, description, notefileFilter, alertRoutes);
51
+ }
52
+
53
+ /**
54
+ * Initializes the fields of this object.
55
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
56
+ * Only for internal use.
57
+ */
58
+ return _createClass(CreateMonitor, null, [{
59
+ key: "initialize",
60
+ value: function initialize(obj, name, description, notefileFilter, alertRoutes) {
61
+ obj["name"] = name;
62
+ obj["description"] = description;
63
+ obj["notefile_filter"] = notefileFilter;
64
+ obj["alert_routes"] = alertRoutes;
65
+ }
66
+
67
+ /**
68
+ * Constructs a <code>CreateMonitor</code> from a plain JavaScript object, optionally creating a new instance.
69
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
70
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
71
+ * @param {module:model/CreateMonitor} obj Optional instance to populate.
72
+ * @return {module:model/CreateMonitor} The populated <code>CreateMonitor</code> instance.
73
+ */
74
+ }, {
75
+ key: "constructFromObject",
76
+ value: function constructFromObject(data, obj) {
77
+ if (data) {
78
+ obj = obj || new CreateMonitor();
79
+ _Monitor["default"].constructFromObject(data, obj);
80
+ if (data.hasOwnProperty("uid")) {
81
+ obj["uid"] = _ApiClient["default"].convertToType(data["uid"], "String");
82
+ }
83
+ if (data.hasOwnProperty("name")) {
84
+ obj["name"] = _ApiClient["default"].convertToType(data["name"], "String");
85
+ }
86
+ if (data.hasOwnProperty("description")) {
87
+ obj["description"] = _ApiClient["default"].convertToType(data["description"], "String");
88
+ }
89
+ if (data.hasOwnProperty("source_type")) {
90
+ obj["source_type"] = _ApiClient["default"].convertToType(data["source_type"], "String");
91
+ }
92
+ if (data.hasOwnProperty("disabled")) {
93
+ obj["disabled"] = _ApiClient["default"].convertToType(data["disabled"], "Boolean");
94
+ }
95
+ if (data.hasOwnProperty("alert")) {
96
+ obj["alert"] = _ApiClient["default"].convertToType(data["alert"], "Boolean");
97
+ }
98
+ if (data.hasOwnProperty("notefile_filter")) {
99
+ obj["notefile_filter"] = _ApiClient["default"].convertToType(data["notefile_filter"], ["String"]);
100
+ }
101
+ if (data.hasOwnProperty("fleet_filter")) {
102
+ obj["fleet_filter"] = _ApiClient["default"].convertToType(data["fleet_filter"], ["String"]);
103
+ }
104
+ if (data.hasOwnProperty("source_selector")) {
105
+ obj["source_selector"] = _ApiClient["default"].convertToType(data["source_selector"], "String");
106
+ }
107
+ if (data.hasOwnProperty("condition_type")) {
108
+ obj["condition_type"] = _ApiClient["default"].convertToType(data["condition_type"], "String");
109
+ }
110
+ if (data.hasOwnProperty("thresholds")) {
111
+ obj["thresholds"] = _MonitorThresholds["default"].constructFromObject(data["thresholds"]);
112
+ }
113
+ if (data.hasOwnProperty("alert_routes")) {
114
+ obj["alert_routes"] = _ApiClient["default"].convertToType(data["alert_routes"], [_MonitorAlertRoutesInner["default"]]);
115
+ }
116
+ if (data.hasOwnProperty("last_routed_at")) {
117
+ obj["last_routed_at"] = _ApiClient["default"].convertToType(data["last_routed_at"], "String");
118
+ }
119
+ if (data.hasOwnProperty("silenced")) {
120
+ obj["silenced"] = _ApiClient["default"].convertToType(data["silenced"], "Boolean");
121
+ }
122
+ if (data.hasOwnProperty("routing_cooldown_period")) {
123
+ obj["routing_cooldown_period"] = _ApiClient["default"].convertToType(data["routing_cooldown_period"], "String");
124
+ }
125
+ } else if (data === null) {
126
+ return null;
127
+ }
128
+ return obj;
129
+ }
130
+
131
+ /**
132
+ * Validates the JSON data with respect to <code>CreateMonitor</code>.
133
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
134
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateMonitor</code>.
135
+ */
136
+ }, {
137
+ key: "validateJSON",
138
+ value: function validateJSON(data) {
139
+ // check to make sure all required properties are present in the JSON string
140
+ var _iterator = _createForOfIteratorHelper(CreateMonitor.RequiredProperties),
141
+ _step;
142
+ try {
143
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
144
+ var property = _step.value;
145
+ if (!data[property]) {
146
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
147
+ }
148
+ }
149
+ // ensure the json data is a string
150
+ } catch (err) {
151
+ _iterator.e(err);
152
+ } finally {
153
+ _iterator.f();
154
+ }
155
+ if (data["uid"] && !(typeof data["uid"] === "string" || data["uid"] instanceof String)) {
156
+ throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data["uid"]);
157
+ }
158
+ // ensure the json data is a string
159
+ if (data["name"] && !(typeof data["name"] === "string" || data["name"] instanceof String)) {
160
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data["name"]);
161
+ }
162
+ // ensure the json data is a string
163
+ if (data["description"] && !(typeof data["description"] === "string" || data["description"] instanceof String)) {
164
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data["description"]);
165
+ }
166
+ // ensure the json data is a string
167
+ if (data["source_type"] && !(typeof data["source_type"] === "string" || data["source_type"] instanceof String)) {
168
+ throw new Error("Expected the field `source_type` to be a primitive type in the JSON string but got " + data["source_type"]);
169
+ }
170
+ // ensure the json data is an array
171
+ if (!Array.isArray(data["notefile_filter"])) {
172
+ throw new Error("Expected the field `notefile_filter` to be an array in the JSON data but got " + data["notefile_filter"]);
173
+ }
174
+ // ensure the json data is an array
175
+ if (!Array.isArray(data["fleet_filter"])) {
176
+ throw new Error("Expected the field `fleet_filter` to be an array in the JSON data but got " + data["fleet_filter"]);
177
+ }
178
+ // ensure the json data is a string
179
+ if (data["source_selector"] && !(typeof data["source_selector"] === "string" || data["source_selector"] instanceof String)) {
180
+ throw new Error("Expected the field `source_selector` to be a primitive type in the JSON string but got " + data["source_selector"]);
181
+ }
182
+ // ensure the json data is a string
183
+ if (data["condition_type"] && !(typeof data["condition_type"] === "string" || data["condition_type"] instanceof String)) {
184
+ throw new Error("Expected the field `condition_type` to be a primitive type in the JSON string but got " + data["condition_type"]);
185
+ }
186
+ // validate the optional field `thresholds`
187
+ if (data["thresholds"]) {
188
+ // data not null
189
+ _MonitorThresholds["default"].validateJSON(data["thresholds"]);
190
+ }
191
+ if (data["alert_routes"]) {
192
+ // data not null
193
+ // ensure the json data is an array
194
+ if (!Array.isArray(data["alert_routes"])) {
195
+ throw new Error("Expected the field `alert_routes` to be an array in the JSON data but got " + data["alert_routes"]);
196
+ }
197
+ // validate the optional field `alert_routes` (array)
198
+ var _iterator2 = _createForOfIteratorHelper(data["alert_routes"]),
199
+ _step2;
200
+ try {
201
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
202
+ var item = _step2.value;
203
+ _MonitorAlertRoutesInner["default"].validateJsonObject(item);
204
+ }
205
+ } catch (err) {
206
+ _iterator2.e(err);
207
+ } finally {
208
+ _iterator2.f();
209
+ }
210
+ }
211
+ // ensure the json data is a string
212
+ if (data["last_routed_at"] && !(typeof data["last_routed_at"] === "string" || data["last_routed_at"] instanceof String)) {
213
+ throw new Error("Expected the field `last_routed_at` to be a primitive type in the JSON string but got " + data["last_routed_at"]);
214
+ }
215
+ // ensure the json data is a string
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"]);
218
+ }
219
+ return true;
220
+ }
221
+ }]);
222
+ }();
223
+ CreateMonitor.RequiredProperties = ["name", "description", "notefile_filter", "alert_routes"];
224
+
225
+ /**
226
+ * @member {String} uid
227
+ */
228
+ CreateMonitor.prototype["uid"] = undefined;
229
+
230
+ /**
231
+ * @member {String} name
232
+ */
233
+ CreateMonitor.prototype["name"] = undefined;
234
+
235
+ /**
236
+ * @member {String} description
237
+ */
238
+ CreateMonitor.prototype["description"] = undefined;
239
+
240
+ /**
241
+ * The type of source to monitor. Currently only \"event\" is supported.
242
+ * @member {module:model/CreateMonitor.SourceTypeEnum} source_type
243
+ */
244
+ CreateMonitor.prototype["source_type"] = undefined;
245
+
246
+ /**
247
+ * If true, the monitor will not be evaluated.
248
+ * @member {Boolean} disabled
249
+ */
250
+ CreateMonitor.prototype["disabled"] = undefined;
251
+
252
+ /**
253
+ * If true, the monitor is in alert state.
254
+ * @member {Boolean} alert
255
+ */
256
+ CreateMonitor.prototype["alert"] = undefined;
257
+
258
+ /**
259
+ * @member {Array.<String>} notefile_filter
260
+ */
261
+ CreateMonitor.prototype["notefile_filter"] = undefined;
262
+
263
+ /**
264
+ * @member {Array.<String>} fleet_filter
265
+ */
266
+ CreateMonitor.prototype["fleet_filter"] = undefined;
267
+
268
+ /**
269
+ * A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.
270
+ * @member {String} source_selector
271
+ */
272
+ CreateMonitor.prototype["source_selector"] = undefined;
273
+
274
+ /**
275
+ * The type of condition to apply to the value selected by the source_selector
276
+ * @member {module:model/CreateMonitor.ConditionTypeEnum} condition_type
277
+ */
278
+ CreateMonitor.prototype["condition_type"] = undefined;
279
+
280
+ /**
281
+ * @member {module:model/MonitorThresholds} thresholds
282
+ */
283
+ CreateMonitor.prototype["thresholds"] = undefined;
284
+
285
+ /**
286
+ * @member {Array.<module:model/MonitorAlertRoutesInner>} alert_routes
287
+ */
288
+ CreateMonitor.prototype["alert_routes"] = undefined;
289
+
290
+ /**
291
+ * The last time the monitor was evaluated and routed.
292
+ * @member {String} last_routed_at
293
+ */
294
+ CreateMonitor.prototype["last_routed_at"] = undefined;
295
+
296
+ /**
297
+ * If true, alerts will be created, but no notifications will be sent.
298
+ * @member {Boolean} silenced
299
+ */
300
+ CreateMonitor.prototype["silenced"] = undefined;
301
+
302
+ /**
303
+ * 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.
304
+ * @member {String} routing_cooldown_period
305
+ */
306
+ CreateMonitor.prototype["routing_cooldown_period"] = undefined;
307
+
308
+ // Implement Monitor interface:
309
+ /**
310
+ * @member {String} uid
311
+ */
312
+ _Monitor["default"].prototype["uid"] = undefined;
313
+ /**
314
+ * @member {String} name
315
+ */
316
+ _Monitor["default"].prototype["name"] = undefined;
317
+ /**
318
+ * @member {String} description
319
+ */
320
+ _Monitor["default"].prototype["description"] = undefined;
321
+ /**
322
+ * The type of source to monitor. Currently only \"event\" is supported.
323
+ * @member {module:model/Monitor.SourceTypeEnum} source_type
324
+ */
325
+ _Monitor["default"].prototype["source_type"] = undefined;
326
+ /**
327
+ * If true, the monitor will not be evaluated.
328
+ * @member {Boolean} disabled
329
+ */
330
+ _Monitor["default"].prototype["disabled"] = undefined;
331
+ /**
332
+ * If true, the monitor is in alert state.
333
+ * @member {Boolean} alert
334
+ */
335
+ _Monitor["default"].prototype["alert"] = undefined;
336
+ /**
337
+ * @member {Array.<String>} notefile_filter
338
+ */
339
+ _Monitor["default"].prototype["notefile_filter"] = undefined;
340
+ /**
341
+ * @member {Array.<String>} fleet_filter
342
+ */
343
+ _Monitor["default"].prototype["fleet_filter"] = undefined;
344
+ /**
345
+ * A valid JSONata expression that selects the value to monitor from the source. | It should return a single, numeric value.
346
+ * @member {String} source_selector
347
+ */
348
+ _Monitor["default"].prototype["source_selector"] = undefined;
349
+ /**
350
+ * The type of condition to apply to the value selected by the source_selector
351
+ * @member {module:model/Monitor.ConditionTypeEnum} condition_type
352
+ */
353
+ _Monitor["default"].prototype["condition_type"] = undefined;
354
+ /**
355
+ * @member {module:model/MonitorThresholds} thresholds
356
+ */
357
+ _Monitor["default"].prototype["thresholds"] = undefined;
358
+ /**
359
+ * @member {Array.<module:model/MonitorAlertRoutesInner>} alert_routes
360
+ */
361
+ _Monitor["default"].prototype["alert_routes"] = undefined;
362
+ /**
363
+ * The last time the monitor was evaluated and routed.
364
+ * @member {String} last_routed_at
365
+ */
366
+ _Monitor["default"].prototype["last_routed_at"] = undefined;
367
+ /**
368
+ * If true, alerts will be created, but no notifications will be sent.
369
+ * @member {Boolean} silenced
370
+ */
371
+ _Monitor["default"].prototype["silenced"] = undefined;
372
+ /**
373
+ * 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.
374
+ * @member {String} routing_cooldown_period
375
+ */
376
+ _Monitor["default"].prototype["routing_cooldown_period"] = undefined;
377
+
378
+ /**
379
+ * Allowed values for the <code>source_type</code> property.
380
+ * @enum {String}
381
+ * @readonly
382
+ */
383
+ CreateMonitor["SourceTypeEnum"] = {
384
+ /**
385
+ * value: "event"
386
+ * @const
387
+ */
388
+ event: "event"
389
+ };
390
+
391
+ /**
392
+ * Allowed values for the <code>condition_type</code> property.
393
+ * @enum {String}
394
+ * @readonly
395
+ */
396
+ CreateMonitor["ConditionTypeEnum"] = {
397
+ /**
398
+ * value: "greater_than"
399
+ * @const
400
+ */
401
+ greater_than: "greater_than",
402
+ /**
403
+ * value: "greater_than_or_equal_to"
404
+ * @const
405
+ */
406
+ greater_than_or_equal_to: "greater_than_or_equal_to",
407
+ /**
408
+ * value: "less_than"
409
+ * @const
410
+ */
411
+ less_than: "less_than",
412
+ /**
413
+ * value: "less_than_or_equal_to"
414
+ * @const
415
+ */
416
+ less_than_or_equal_to: "less_than_or_equal_to",
417
+ /**
418
+ * value: "equal_to"
419
+ * @const
420
+ */
421
+ equal_to: "equal_to",
422
+ /**
423
+ * value: "not_equal_to"
424
+ * @const
425
+ */
426
+ not_equal_to: "not_equal_to"
427
+ };
428
+ var _default = exports["default"] = CreateMonitor;