@blues-inc/notehub-js 1.0.20 → 1.0.22

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 +34 -18
  2. package/dist/ApiClient.js +7 -7
  3. package/dist/api/AlertApi.js +10 -7
  4. package/dist/api/AuthorizationApi.js +6 -6
  5. package/dist/api/BillingAccountApi.js +6 -6
  6. package/dist/api/DeviceApi.js +8 -8
  7. package/dist/api/EventApi.js +74 -33
  8. package/dist/api/MonitorApi.js +6 -6
  9. package/dist/api/ProjectApi.js +177 -6
  10. package/dist/api/RouteApi.js +9 -9
  11. package/dist/index.js +55 -13
  12. package/dist/model/Alert.js +22 -9
  13. package/dist/model/AlertDataInner.js +6 -6
  14. package/dist/model/AlertNotificationsInner.js +6 -6
  15. package/dist/model/Aws.js +6 -6
  16. package/dist/model/Azure.js +6 -6
  17. package/dist/model/BillingAccount.js +9 -9
  18. package/dist/model/BillingAccountRole.js +15 -15
  19. package/dist/model/Body.js +6 -6
  20. package/dist/model/CloneProjectRequest.js +9 -9
  21. package/dist/model/Contact.js +6 -6
  22. package/dist/model/CreateFleetRequest.js +6 -6
  23. package/dist/model/CreateMonitor.js +102 -23
  24. package/dist/model/CreateProductRequest.js +9 -9
  25. package/dist/model/CreateProjectRequest.js +9 -9
  26. package/dist/model/DFUEnv.js +6 -6
  27. package/dist/model/DFUState.js +6 -6
  28. package/dist/model/DeleteDeviceFleetsRequest.js +9 -9
  29. package/dist/model/Device.js +9 -9
  30. package/dist/model/DeviceSession.js +6 -6
  31. package/dist/model/DeviceTowerInfo.js +6 -6
  32. package/dist/model/DeviceUsage.js +6 -6
  33. package/dist/model/{MonitorThresholds.js → EmailNotification.js} +31 -27
  34. package/dist/model/EnvironmentVariables.js +9 -9
  35. package/dist/model/Error.js +9 -9
  36. package/dist/model/Event.js +6 -6
  37. package/dist/model/FirmwareInfo.js +6 -6
  38. package/dist/model/FirmwareStatus.js +144 -0
  39. package/dist/model/Fleet.js +9 -9
  40. package/dist/model/GetAlerts200Response.js +9 -9
  41. package/dist/model/GetBillingAccounts200Response.js +9 -9
  42. package/dist/model/GetDeviceEnvironmentVariables200Response.js +9 -9
  43. package/dist/model/GetDeviceHealthLog200Response.js +9 -9
  44. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +9 -9
  45. package/dist/model/GetDeviceLatest200Response.js +9 -9
  46. package/dist/model/GetDevicePublicKey200Response.js +9 -9
  47. package/dist/model/GetDeviceSessions200Response.js +9 -9
  48. package/dist/model/GetProjectDevicePublicKeys200Response.js +9 -9
  49. package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +6 -6
  50. package/dist/model/GetProjectDevices200Response.js +9 -9
  51. package/dist/model/GetProjectEvents200Response.js +22 -9
  52. package/dist/model/GetProjectEventsByCursor200Response.js +9 -9
  53. package/dist/model/GetProjectFleets200Response.js +9 -9
  54. package/dist/model/GetProjectMembers200Response.js +9 -9
  55. package/dist/model/GetProjectProducts200Response.js +9 -9
  56. package/dist/model/GetProjects200Response.js +9 -9
  57. package/dist/model/GetRouteLogsByRoute200ResponseInner.js +6 -6
  58. package/dist/model/Google.js +6 -6
  59. package/dist/model/HandleNoteChanges200Response.js +6 -6
  60. package/dist/model/HandleNoteGet200Response.js +6 -6
  61. package/dist/model/HandleNoteSignal200Response.js +6 -6
  62. package/dist/model/HandleNotefileChanges200Response.js +6 -6
  63. package/dist/model/HandleNotefileChangesPending200Response.js +6 -6
  64. package/dist/model/HandleNotefileDeleteRequest.js +6 -6
  65. package/dist/model/Http.js +6 -6
  66. package/dist/model/HttpFilter.js +6 -6
  67. package/dist/model/HttpTransform.js +6 -6
  68. package/dist/model/Location.js +9 -9
  69. package/dist/model/Login200Response.js +6 -6
  70. package/dist/model/LoginRequest.js +6 -6
  71. package/dist/model/Monitor.js +83 -20
  72. package/dist/model/MonitorAlertRoutesInner.js +145 -44
  73. package/dist/model/Mqtt.js +6 -6
  74. package/dist/model/Note.js +6 -6
  75. package/dist/model/OTAStatus.js +306 -0
  76. package/dist/model/OTAStatusList.js +120 -0
  77. package/dist/model/OTAUpdateRequest.js +214 -0
  78. package/dist/model/OTAUpdateStatus.js +118 -0
  79. package/dist/model/PostProvisionProjectDeviceRequest.js +9 -9
  80. package/dist/model/Product.js +9 -9
  81. package/dist/model/Project.js +9 -9
  82. package/dist/model/ProjectMember.js +9 -9
  83. package/dist/model/Proxy.js +6 -6
  84. package/dist/model/PutDeviceFleetsRequest.js +9 -9
  85. package/dist/model/Radresponder.js +6 -6
  86. package/dist/model/Role.js +6 -6
  87. package/dist/model/Route.js +6 -6
  88. package/dist/model/RouteSchema.js +7 -7
  89. package/dist/model/Slack.js +6 -6
  90. package/dist/model/SlackBearerNotification.js +149 -0
  91. package/dist/model/SlackWebHookNotification.js +136 -0
  92. package/dist/model/Snowflake.js +6 -6
  93. package/dist/model/SnowflakeTransform.js +6 -6
  94. package/dist/model/Thingworx.js +6 -6
  95. package/dist/model/TowerLocation.js +6 -6
  96. package/dist/model/Twilio.js +6 -6
  97. package/dist/model/UpdateFleetRequest.js +6 -6
  98. package/dist/model/UserDbRoute.js +6 -6
  99. package/package.json +1 -1
  100. package/dist/api/FirmwareApi.js +0 -109
@@ -5,17 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
+ var _EmailNotification = _interopRequireDefault(require("./EmailNotification"));
9
+ var _SlackBearerNotification = _interopRequireDefault(require("./SlackBearerNotification"));
10
+ var _SlackWebHookNotification = _interopRequireDefault(require("./SlackWebHookNotification"));
11
+ var _MonitorAlertRoutesInner;
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
13
  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; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
18
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
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); } /**
15
20
  * Notehub API
16
21
  * The OpenAPI definition for the Notehub.io API.
17
22
  *
18
- * The version of the OpenAPI document: 1.0.0
23
+ * The version of the OpenAPI document: 1.1.0
19
24
  * Contact: engineering@blues.io
20
25
  *
21
26
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -26,67 +31,163 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
26
31
  /**
27
32
  * The MonitorAlertRoutesInner model module.
28
33
  * @module model/MonitorAlertRoutesInner
29
- * @version 1.0.20
34
+ * @version 1.0.22
30
35
  */
31
36
  var MonitorAlertRoutesInner = /*#__PURE__*/function () {
32
37
  /**
33
38
  * Constructs a new <code>MonitorAlertRoutesInner</code>.
34
39
  * @alias module:model/MonitorAlertRoutesInner
40
+ * @param {(module:model/EmailNotification|module:model/SlackBearerNotification|module:model/SlackWebHookNotification)} instance The actual instance to initialize MonitorAlertRoutesInner.
35
41
  */
36
42
  function MonitorAlertRoutesInner() {
43
+ var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
37
44
  _classCallCheck(this, MonitorAlertRoutesInner);
38
- MonitorAlertRoutesInner.initialize(this);
45
+ /**
46
+ * Returns the JSON representation of the actual intance.
47
+ * @return {string}
48
+ */
49
+ _defineProperty(this, "toJSON", function () {
50
+ return this.getActualInstance();
51
+ });
52
+ if (instance === null) {
53
+ this.actualInstance = null;
54
+ return;
55
+ }
56
+ var match = 0;
57
+ var errorMessages = [];
58
+ try {
59
+ if (typeof instance === "SlackWebHookNotification") {
60
+ this.actualInstance = instance;
61
+ } else {
62
+ // plain JS object
63
+ // validate the object
64
+ _SlackWebHookNotification["default"].validateJSON(instance); // throw an exception if no match
65
+ // create SlackWebHookNotification from JS object
66
+ this.actualInstance = _SlackWebHookNotification["default"].constructFromObject(instance);
67
+ }
68
+ match++;
69
+ } catch (err) {
70
+ // json data failed to deserialize into SlackWebHookNotification
71
+ errorMessages.push("Failed to construct SlackWebHookNotification: " + err);
72
+ }
73
+ try {
74
+ if (typeof instance === "SlackBearerNotification") {
75
+ this.actualInstance = instance;
76
+ } else {
77
+ // plain JS object
78
+ // validate the object
79
+ _SlackBearerNotification["default"].validateJSON(instance); // throw an exception if no match
80
+ // create SlackBearerNotification from JS object
81
+ this.actualInstance = _SlackBearerNotification["default"].constructFromObject(instance);
82
+ }
83
+ match++;
84
+ } catch (err) {
85
+ // json data failed to deserialize into SlackBearerNotification
86
+ errorMessages.push("Failed to construct SlackBearerNotification: " + err);
87
+ }
88
+ try {
89
+ if (typeof instance === "EmailNotification") {
90
+ this.actualInstance = instance;
91
+ } else {
92
+ // plain JS object
93
+ // validate the object
94
+ _EmailNotification["default"].validateJSON(instance); // throw an exception if no match
95
+ // create EmailNotification from JS object
96
+ this.actualInstance = _EmailNotification["default"].constructFromObject(instance);
97
+ }
98
+ match++;
99
+ } catch (err) {
100
+ // json data failed to deserialize into EmailNotification
101
+ errorMessages.push("Failed to construct EmailNotification: " + err);
102
+ }
103
+ if (match > 1) {
104
+ throw new Error("Multiple matches found constructing `MonitorAlertRoutesInner` with oneOf schemas EmailNotification, SlackBearerNotification, SlackWebHookNotification. Input: " + JSON.stringify(instance));
105
+ } else if (match === 0) {
106
+ this.actualInstance = null; // clear the actual instance in case there are multiple matches
107
+ throw new Error("No match found constructing `MonitorAlertRoutesInner` with oneOf schemas EmailNotification, SlackBearerNotification, SlackWebHookNotification. Details: " + errorMessages.join(", "));
108
+ } else {
109
+ // only 1 match
110
+ // the input is valid
111
+ }
39
112
  }
40
113
 
41
114
  /**
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.
115
+ * Constructs a <code>MonitorAlertRoutesInner</code> from a plain JavaScript object, optionally creating a new instance.
116
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
117
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
118
+ * @param {module:model/MonitorAlertRoutesInner} obj Optional instance to populate.
119
+ * @return {module:model/MonitorAlertRoutesInner} The populated <code>MonitorAlertRoutesInner</code> instance.
45
120
  */
46
- return _createClass(MonitorAlertRoutesInner, null, [{
47
- key: "initialize",
48
- value: function initialize(obj) {}
49
-
121
+ return _createClass(MonitorAlertRoutesInner, [{
122
+ key: "getActualInstance",
123
+ value:
50
124
  /**
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.
125
+ * Gets the actaul instance, which can be <code>EmailNotification</code>, <code>SlackBearerNotification</code>, <code>SlackWebHookNotification</code>.
126
+ * @return {(module:model/EmailNotification|module:model/SlackBearerNotification|module:model/SlackWebHookNotification)} The actual instance.
56
127
  */
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;
128
+ function getActualInstance() {
129
+ return this.actualInstance;
69
130
  }
70
131
 
71
132
  /**
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>.
133
+ * Sets the actaul instance, which can be <code>EmailNotification</code>, <code>SlackBearerNotification</code>, <code>SlackWebHookNotification</code>.
134
+ * @param {(module:model/EmailNotification|module:model/SlackBearerNotification|module:model/SlackWebHookNotification)} obj The actual instance.
75
135
  */
76
136
  }, {
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;
137
+ key: "setActualInstance",
138
+ value: function setActualInstance(obj) {
139
+ this.actualInstance = MonitorAlertRoutesInner.constructFromObject(obj).getActualInstance();
140
+ }
141
+ }], [{
142
+ key: "constructFromObject",
143
+ value: function constructFromObject(data, obj) {
144
+ return new MonitorAlertRoutesInner(data);
84
145
  }
85
146
  }]);
86
147
  }();
87
148
  /**
88
- * List of email addresses in the project that will receive alerts.
89
- * @member {Array.<String>} email_addresses
149
+ * The URL of the Slack webhook.
150
+ * @member {String} url
151
+ */
152
+ _MonitorAlertRoutesInner = MonitorAlertRoutesInner;
153
+ /**
154
+ * Create an instance of MonitorAlertRoutesInner from a JSON string.
155
+ * @param {string} json_string JSON string.
156
+ * @return {module:model/MonitorAlertRoutesInner} An instance of MonitorAlertRoutesInner.
157
+ */
158
+ _defineProperty(MonitorAlertRoutesInner, "fromJSON", function (json_string) {
159
+ return _MonitorAlertRoutesInner.constructFromObject(JSON.parse(json_string));
160
+ });
161
+ MonitorAlertRoutesInner.prototype["url"] = undefined;
162
+
163
+ /**
164
+ * text or blocks
165
+ * @member {module:model/MonitorAlertRoutesInner.MessageTypeEnum} message_type
166
+ */
167
+ MonitorAlertRoutesInner.prototype["message_type"] = undefined;
168
+
169
+ /**
170
+ * The text of the message, or the blocks definition
171
+ * @member {String} text
172
+ */
173
+ MonitorAlertRoutesInner.prototype["text"] = undefined;
174
+
175
+ /**
176
+ * The bearer token for the Slack app.
177
+ * @member {String} token
178
+ */
179
+ MonitorAlertRoutesInner.prototype["token"] = undefined;
180
+
181
+ /**
182
+ * The channel to send the message to.
183
+ * @member {String} channel
184
+ */
185
+ MonitorAlertRoutesInner.prototype["channel"] = undefined;
186
+
187
+ /**
188
+ * Email Address
189
+ * @member {String} email
90
190
  */
91
- MonitorAlertRoutesInner.prototype["email_addresses"] = undefined;
191
+ MonitorAlertRoutesInner.prototype["email"] = undefined;
192
+ MonitorAlertRoutesInner.OneOf = ["EmailNotification", "SlackBearerNotification", "SlackWebHookNotification"];
92
193
  var _default = exports["default"] = MonitorAlertRoutesInner;
@@ -7,17 +7,17 @@ exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _HttpFilter = _interopRequireDefault(require("./HttpFilter"));
9
9
  var _HttpTransform = _interopRequireDefault(require("./HttpTransform"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
- 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); } }
14
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
16
  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); } /**
17
17
  * Notehub API
18
18
  * The OpenAPI definition for the Notehub.io API.
19
19
  *
20
- * The version of the OpenAPI document: 1.0.0
20
+ * The version of the OpenAPI document: 1.1.0
21
21
  * Contact: engineering@blues.io
22
22
  *
23
23
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,7 +28,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
28
28
  /**
29
29
  * The Mqtt model module.
30
30
  * @module model/Mqtt
31
- * @version 1.0.20
31
+ * @version 1.0.22
32
32
  */
33
33
  var Mqtt = /*#__PURE__*/function () {
34
34
  /**
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
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; }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
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
15
  * Notehub API
16
16
  * The OpenAPI definition for the Notehub.io API.
17
17
  *
18
- * The version of the OpenAPI document: 1.0.0
18
+ * The version of the OpenAPI document: 1.1.0
19
19
  * Contact: engineering@blues.io
20
20
  *
21
21
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -26,7 +26,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
26
26
  /**
27
27
  * The Note model module.
28
28
  * @module model/Note
29
- * @version 1.0.20
29
+ * @version 1.0.22
30
30
  */
31
31
  var Note = /*#__PURE__*/function () {
32
32
  /**
@@ -0,0 +1,306 @@
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 _FirmwareStatus = _interopRequireDefault(require("./FirmwareStatus"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); } /**
16
+ * Notehub API
17
+ * The OpenAPI definition for the Notehub.io API.
18
+ *
19
+ * The version of the OpenAPI document: 1.1.0
20
+ * Contact: engineering@blues.io
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * The OTAStatus model module.
29
+ * @module model/OTAStatus
30
+ * @version 1.0.22
31
+ */
32
+ var OTAStatus = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>OTAStatus</code>.
35
+ * @alias module:model/OTAStatus
36
+ */
37
+ function OTAStatus() {
38
+ _classCallCheck(this, OTAStatus);
39
+ OTAStatus.initialize(this);
40
+ }
41
+
42
+ /**
43
+ * Initializes the fields of this object.
44
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45
+ * Only for internal use.
46
+ */
47
+ return _createClass(OTAStatus, null, [{
48
+ key: "initialize",
49
+ value: function initialize(obj) {}
50
+
51
+ /**
52
+ * Constructs a <code>OTAStatus</code> from a plain JavaScript object, optionally creating a new instance.
53
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
54
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
55
+ * @param {module:model/OTAStatus} obj Optional instance to populate.
56
+ * @return {module:model/OTAStatus} The populated <code>OTAStatus</code> instance.
57
+ */
58
+ }, {
59
+ key: "constructFromObject",
60
+ value: function constructFromObject(data, obj) {
61
+ if (data) {
62
+ obj = obj || new OTAStatus();
63
+ if (data.hasOwnProperty("device_uid")) {
64
+ obj["device_uid"] = _ApiClient["default"].convertToType(data["device_uid"], "String");
65
+ }
66
+ if (data.hasOwnProperty("tags")) {
67
+ obj["tags"] = _ApiClient["default"].convertToType(data["tags"], "String");
68
+ }
69
+ if (data.hasOwnProperty("notecard_current_firmware")) {
70
+ obj["notecard_current_firmware"] = _FirmwareStatus["default"].constructFromObject(data["notecard_current_firmware"]);
71
+ }
72
+ if (data.hasOwnProperty("notecard_dfu_began_at")) {
73
+ obj["notecard_dfu_began_at"] = _ApiClient["default"].convertToType(data["notecard_dfu_began_at"], "String");
74
+ }
75
+ if (data.hasOwnProperty("notecard_dfu_status")) {
76
+ obj["notecard_dfu_status"] = _ApiClient["default"].convertToType(data["notecard_dfu_status"], "String");
77
+ }
78
+ if (data.hasOwnProperty("notecard_requested_firmware")) {
79
+ obj["notecard_requested_firmware"] = _FirmwareStatus["default"].constructFromObject(data["notecard_requested_firmware"]);
80
+ }
81
+ if (data.hasOwnProperty("notecard_requested_at")) {
82
+ obj["notecard_requested_at"] = _ApiClient["default"].convertToType(data["notecard_requested_at"], "String");
83
+ }
84
+ if (data.hasOwnProperty("notecard_requested_scope")) {
85
+ obj["notecard_requested_scope"] = _ApiClient["default"].convertToType(data["notecard_requested_scope"], "String");
86
+ }
87
+ if (data.hasOwnProperty("notecard_requested_show_details")) {
88
+ obj["notecard_requested_show_details"] = _ApiClient["default"].convertToType(data["notecard_requested_show_details"], "Boolean");
89
+ }
90
+ if (data.hasOwnProperty("notecard_requested_status")) {
91
+ obj["notecard_requested_status"] = _ApiClient["default"].convertToType(data["notecard_requested_status"], "String");
92
+ }
93
+ if (data.hasOwnProperty("host_current_firmware")) {
94
+ obj["host_current_firmware"] = _FirmwareStatus["default"].constructFromObject(data["host_current_firmware"]);
95
+ }
96
+ if (data.hasOwnProperty("host_dfu_began_at")) {
97
+ obj["host_dfu_began_at"] = _ApiClient["default"].convertToType(data["host_dfu_began_at"], "String");
98
+ }
99
+ if (data.hasOwnProperty("host_dfu_status")) {
100
+ obj["host_dfu_status"] = _ApiClient["default"].convertToType(data["host_dfu_status"], "String");
101
+ }
102
+ if (data.hasOwnProperty("host_requested_firmware")) {
103
+ obj["host_requested_firmware"] = _FirmwareStatus["default"].constructFromObject(data["host_requested_firmware"]);
104
+ }
105
+ if (data.hasOwnProperty("host_requested_at")) {
106
+ obj["host_requested_at"] = _ApiClient["default"].convertToType(data["host_requested_at"], "String");
107
+ }
108
+ if (data.hasOwnProperty("host_requested_scope")) {
109
+ obj["host_requested_scope"] = _ApiClient["default"].convertToType(data["host_requested_scope"], "String");
110
+ }
111
+ if (data.hasOwnProperty("host_requested_show_details")) {
112
+ obj["host_requested_show_details"] = _ApiClient["default"].convertToType(data["host_requested_show_details"], "Boolean");
113
+ }
114
+ if (data.hasOwnProperty("host_requested_status")) {
115
+ obj["host_requested_status"] = _ApiClient["default"].convertToType(data["host_requested_status"], "String");
116
+ }
117
+ } else if (data === null) {
118
+ return null;
119
+ }
120
+ return obj;
121
+ }
122
+
123
+ /**
124
+ * Validates the JSON data with respect to <code>OTAStatus</code>.
125
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
126
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>OTAStatus</code>.
127
+ */
128
+ }, {
129
+ key: "validateJSON",
130
+ value: function validateJSON(data) {
131
+ // ensure the json data is a string
132
+ if (data["device_uid"] && !(typeof data["device_uid"] === "string" || data["device_uid"] instanceof String)) {
133
+ throw new Error("Expected the field `device_uid` to be a primitive type in the JSON string but got " + data["device_uid"]);
134
+ }
135
+ // ensure the json data is a string
136
+ if (data["tags"] && !(typeof data["tags"] === "string" || data["tags"] instanceof String)) {
137
+ throw new Error("Expected the field `tags` to be a primitive type in the JSON string but got " + data["tags"]);
138
+ }
139
+ // validate the optional field `notecard_current_firmware`
140
+ if (data["notecard_current_firmware"]) {
141
+ // data not null
142
+ _FirmwareStatus["default"].validateJSON(data["notecard_current_firmware"]);
143
+ }
144
+ // ensure the json data is a string
145
+ if (data["notecard_dfu_began_at"] && !(typeof data["notecard_dfu_began_at"] === "string" || data["notecard_dfu_began_at"] instanceof String)) {
146
+ throw new Error("Expected the field `notecard_dfu_began_at` to be a primitive type in the JSON string but got " + data["notecard_dfu_began_at"]);
147
+ }
148
+ // ensure the json data is a string
149
+ if (data["notecard_dfu_status"] && !(typeof data["notecard_dfu_status"] === "string" || data["notecard_dfu_status"] instanceof String)) {
150
+ throw new Error("Expected the field `notecard_dfu_status` to be a primitive type in the JSON string but got " + data["notecard_dfu_status"]);
151
+ }
152
+ // validate the optional field `notecard_requested_firmware`
153
+ if (data["notecard_requested_firmware"]) {
154
+ // data not null
155
+ _FirmwareStatus["default"].validateJSON(data["notecard_requested_firmware"]);
156
+ }
157
+ // ensure the json data is a string
158
+ if (data["notecard_requested_at"] && !(typeof data["notecard_requested_at"] === "string" || data["notecard_requested_at"] instanceof String)) {
159
+ throw new Error("Expected the field `notecard_requested_at` to be a primitive type in the JSON string but got " + data["notecard_requested_at"]);
160
+ }
161
+ // ensure the json data is a string
162
+ if (data["notecard_requested_scope"] && !(typeof data["notecard_requested_scope"] === "string" || data["notecard_requested_scope"] instanceof String)) {
163
+ throw new Error("Expected the field `notecard_requested_scope` to be a primitive type in the JSON string but got " + data["notecard_requested_scope"]);
164
+ }
165
+ // ensure the json data is a string
166
+ if (data["notecard_requested_status"] && !(typeof data["notecard_requested_status"] === "string" || data["notecard_requested_status"] instanceof String)) {
167
+ throw new Error("Expected the field `notecard_requested_status` to be a primitive type in the JSON string but got " + data["notecard_requested_status"]);
168
+ }
169
+ // validate the optional field `host_current_firmware`
170
+ if (data["host_current_firmware"]) {
171
+ // data not null
172
+ _FirmwareStatus["default"].validateJSON(data["host_current_firmware"]);
173
+ }
174
+ // ensure the json data is a string
175
+ if (data["host_dfu_began_at"] && !(typeof data["host_dfu_began_at"] === "string" || data["host_dfu_began_at"] instanceof String)) {
176
+ throw new Error("Expected the field `host_dfu_began_at` to be a primitive type in the JSON string but got " + data["host_dfu_began_at"]);
177
+ }
178
+ // ensure the json data is a string
179
+ if (data["host_dfu_status"] && !(typeof data["host_dfu_status"] === "string" || data["host_dfu_status"] instanceof String)) {
180
+ throw new Error("Expected the field `host_dfu_status` to be a primitive type in the JSON string but got " + data["host_dfu_status"]);
181
+ }
182
+ // validate the optional field `host_requested_firmware`
183
+ if (data["host_requested_firmware"]) {
184
+ // data not null
185
+ _FirmwareStatus["default"].validateJSON(data["host_requested_firmware"]);
186
+ }
187
+ // ensure the json data is a string
188
+ if (data["host_requested_at"] && !(typeof data["host_requested_at"] === "string" || data["host_requested_at"] instanceof String)) {
189
+ throw new Error("Expected the field `host_requested_at` to be a primitive type in the JSON string but got " + data["host_requested_at"]);
190
+ }
191
+ // ensure the json data is a string
192
+ if (data["host_requested_scope"] && !(typeof data["host_requested_scope"] === "string" || data["host_requested_scope"] instanceof String)) {
193
+ throw new Error("Expected the field `host_requested_scope` to be a primitive type in the JSON string but got " + data["host_requested_scope"]);
194
+ }
195
+ // ensure the json data is a string
196
+ if (data["host_requested_status"] && !(typeof data["host_requested_status"] === "string" || data["host_requested_status"] instanceof String)) {
197
+ throw new Error("Expected the field `host_requested_status` to be a primitive type in the JSON string but got " + data["host_requested_status"]);
198
+ }
199
+ return true;
200
+ }
201
+ }]);
202
+ }();
203
+ /**
204
+ * The device UID
205
+ * @member {String} device_uid
206
+ */
207
+ OTAStatus.prototype["device_uid"] = undefined;
208
+
209
+ /**
210
+ * The tags associated with the device
211
+ * @member {String} tags
212
+ */
213
+ OTAStatus.prototype["tags"] = undefined;
214
+
215
+ /**
216
+ * @member {module:model/FirmwareStatus} notecard_current_firmware
217
+ */
218
+ OTAStatus.prototype["notecard_current_firmware"] = undefined;
219
+
220
+ /**
221
+ * The time the Notecard DFU began
222
+ * @member {String} notecard_dfu_began_at
223
+ */
224
+ OTAStatus.prototype["notecard_dfu_began_at"] = undefined;
225
+
226
+ /**
227
+ * The status of the Notecard DFU
228
+ * @member {String} notecard_dfu_status
229
+ */
230
+ OTAStatus.prototype["notecard_dfu_status"] = undefined;
231
+
232
+ /**
233
+ * @member {module:model/FirmwareStatus} notecard_requested_firmware
234
+ */
235
+ OTAStatus.prototype["notecard_requested_firmware"] = undefined;
236
+
237
+ /**
238
+ * The time the Notecard firmware was requested
239
+ * @member {String} notecard_requested_at
240
+ */
241
+ OTAStatus.prototype["notecard_requested_at"] = undefined;
242
+
243
+ /**
244
+ * The scope of the Notecard firmware request
245
+ * @member {String} notecard_requested_scope
246
+ */
247
+ OTAStatus.prototype["notecard_requested_scope"] = undefined;
248
+
249
+ /**
250
+ * Whether to show details of the Notecard firmware request
251
+ * @member {Boolean} notecard_requested_show_details
252
+ */
253
+ OTAStatus.prototype["notecard_requested_show_details"] = undefined;
254
+
255
+ /**
256
+ * The status of the Notecard firmware request
257
+ * @member {String} notecard_requested_status
258
+ */
259
+ OTAStatus.prototype["notecard_requested_status"] = undefined;
260
+
261
+ /**
262
+ * @member {module:model/FirmwareStatus} host_current_firmware
263
+ */
264
+ OTAStatus.prototype["host_current_firmware"] = undefined;
265
+
266
+ /**
267
+ * The time the host DFU began
268
+ * @member {String} host_dfu_began_at
269
+ */
270
+ OTAStatus.prototype["host_dfu_began_at"] = undefined;
271
+
272
+ /**
273
+ * The status of the host DFU
274
+ * @member {String} host_dfu_status
275
+ */
276
+ OTAStatus.prototype["host_dfu_status"] = undefined;
277
+
278
+ /**
279
+ * @member {module:model/FirmwareStatus} host_requested_firmware
280
+ */
281
+ OTAStatus.prototype["host_requested_firmware"] = undefined;
282
+
283
+ /**
284
+ * The time the host firmware was requested
285
+ * @member {String} host_requested_at
286
+ */
287
+ OTAStatus.prototype["host_requested_at"] = undefined;
288
+
289
+ /**
290
+ * The scope of the host firmware request
291
+ * @member {String} host_requested_scope
292
+ */
293
+ OTAStatus.prototype["host_requested_scope"] = undefined;
294
+
295
+ /**
296
+ * Whether to show details of the host firmware request
297
+ * @member {Boolean} host_requested_show_details
298
+ */
299
+ OTAStatus.prototype["host_requested_show_details"] = undefined;
300
+
301
+ /**
302
+ * The status of the host firmware request
303
+ * @member {String} host_requested_status
304
+ */
305
+ OTAStatus.prototype["host_requested_status"] = undefined;
306
+ var _default = exports["default"] = OTAStatus;