@blues-inc/notehub-js 1.0.4

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 (83) hide show
  1. package/README.md +297 -0
  2. package/dist/ApiClient.js +699 -0
  3. package/dist/api/AuthorizationApi.js +74 -0
  4. package/dist/api/BillingAccountApi.js +68 -0
  5. package/dist/api/DeviceApi.js +784 -0
  6. package/dist/api/DevicesApi.js +293 -0
  7. package/dist/api/EnvironmentVariablesApi.js +567 -0
  8. package/dist/api/EventApi.js +284 -0
  9. package/dist/api/FilesApi.js +193 -0
  10. package/dist/api/FleetApi.js +715 -0
  11. package/dist/api/NotesApi.js +435 -0
  12. package/dist/api/ProductApi.js +163 -0
  13. package/dist/api/ProjectApi.js +716 -0
  14. package/dist/api/RouteApi.js +266 -0
  15. package/dist/index.js +566 -0
  16. package/dist/model/Aws.js +233 -0
  17. package/dist/model/Azure.js +166 -0
  18. package/dist/model/BillingAccount.js +130 -0
  19. package/dist/model/BillingAccountRole.js +42 -0
  20. package/dist/model/Body.js +78 -0
  21. package/dist/model/Contact.js +118 -0
  22. package/dist/model/CreateFleetRequest.js +83 -0
  23. package/dist/model/CreateProductRequest.js +142 -0
  24. package/dist/model/CreateProjectRequest.js +119 -0
  25. package/dist/model/DFUEnv.js +97 -0
  26. package/dist/model/DFUState.js +276 -0
  27. package/dist/model/DeleteDeviceFleetsRequest.js +106 -0
  28. package/dist/model/Device.js +267 -0
  29. package/dist/model/DeviceSession.js +537 -0
  30. package/dist/model/DeviceTowerInfo.js +102 -0
  31. package/dist/model/DeviceUsage.js +150 -0
  32. package/dist/model/EnvironmentVariables.js +103 -0
  33. package/dist/model/Error.js +164 -0
  34. package/dist/model/Event.js +676 -0
  35. package/dist/model/Fleet.js +129 -0
  36. package/dist/model/GetBillingAccounts200Response.js +103 -0
  37. package/dist/model/GetDeviceEnvironmentVariables200Response.js +117 -0
  38. package/dist/model/GetDeviceHealthLog200Response.js +123 -0
  39. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +125 -0
  40. package/dist/model/GetDeviceLatest200Response.js +104 -0
  41. package/dist/model/GetDevicePublicKey200Response.js +119 -0
  42. package/dist/model/GetDeviceSessions200Response.js +133 -0
  43. package/dist/model/GetProjectDevicePublicKeys200Response.js +133 -0
  44. package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +94 -0
  45. package/dist/model/GetProjectDevices200Response.js +133 -0
  46. package/dist/model/GetProjectEvents200Response.js +149 -0
  47. package/dist/model/GetProjectEventsByCursor200Response.js +149 -0
  48. package/dist/model/GetProjectFleets200Response.js +123 -0
  49. package/dist/model/GetProjectMembers200Response.js +123 -0
  50. package/dist/model/GetProjectProducts200Response.js +103 -0
  51. package/dist/model/GetProjects200Response.js +103 -0
  52. package/dist/model/Google.js +142 -0
  53. package/dist/model/HandleNoteChanges200Response.js +97 -0
  54. package/dist/model/HandleNoteGet200Response.js +101 -0
  55. package/dist/model/HandleNoteSignal200Response.js +79 -0
  56. package/dist/model/HandleNotefileChanges200Response.js +97 -0
  57. package/dist/model/HandleNotefileChangesPending200Response.js +106 -0
  58. package/dist/model/HandleNotefileDeleteRequest.js +83 -0
  59. package/dist/model/Http.js +163 -0
  60. package/dist/model/HttpFilter.js +128 -0
  61. package/dist/model/HttpTransform.js +139 -0
  62. package/dist/model/Location.js +167 -0
  63. package/dist/model/Login200Response.js +82 -0
  64. package/dist/model/LoginRequest.js +94 -0
  65. package/dist/model/Mqtt.js +240 -0
  66. package/dist/model/Note.js +90 -0
  67. package/dist/model/Product.js +141 -0
  68. package/dist/model/Project.js +165 -0
  69. package/dist/model/ProjectMember.js +131 -0
  70. package/dist/model/Proxy.js +128 -0
  71. package/dist/model/PutDeviceFleetsRequest.js +106 -0
  72. package/dist/model/Radresponder.js +130 -0
  73. package/dist/model/Role.js +43 -0
  74. package/dist/model/Route.js +245 -0
  75. package/dist/model/RouteSchema.js +427 -0
  76. package/dist/model/Snowflake.js +185 -0
  77. package/dist/model/SnowflakeTransform.js +97 -0
  78. package/dist/model/Thingworx.js +154 -0
  79. package/dist/model/TowerLocation.js +204 -0
  80. package/dist/model/Twilio.js +181 -0
  81. package/dist/model/UpdateFleetRequest.js +109 -0
  82. package/dist/model/UserDbRoute.js +131 -0
  83. package/package.json +49 -0
@@ -0,0 +1,150 @@
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(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); }
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(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); }
15
+ /**
16
+ * The DeviceUsage model module.
17
+ * @module model/DeviceUsage
18
+ * @version 1.0.4
19
+ */
20
+ var DeviceUsage = /*#__PURE__*/function () {
21
+ /**
22
+ * Constructs a new <code>DeviceUsage</code>.
23
+ * @alias module:model/DeviceUsage
24
+ */
25
+ function DeviceUsage() {
26
+ _classCallCheck(this, DeviceUsage);
27
+ DeviceUsage.initialize(this);
28
+ }
29
+
30
+ /**
31
+ * Initializes the fields of this object.
32
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
33
+ * Only for internal use.
34
+ */
35
+ _createClass(DeviceUsage, null, [{
36
+ key: "initialize",
37
+ value: function initialize(obj) {}
38
+
39
+ /**
40
+ * Constructs a <code>DeviceUsage</code> from a plain JavaScript object, optionally creating a new instance.
41
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
42
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
43
+ * @param {module:model/DeviceUsage} obj Optional instance to populate.
44
+ * @return {module:model/DeviceUsage} The populated <code>DeviceUsage</code> instance.
45
+ */
46
+ }, {
47
+ key: "constructFromObject",
48
+ value: function constructFromObject(data, obj) {
49
+ if (data) {
50
+ obj = obj || new DeviceUsage();
51
+ if (data.hasOwnProperty('since')) {
52
+ obj['since'] = _ApiClient["default"].convertToType(data['since'], 'Number');
53
+ }
54
+ if (data.hasOwnProperty('duration')) {
55
+ obj['duration'] = _ApiClient["default"].convertToType(data['duration'], 'Number');
56
+ }
57
+ if (data.hasOwnProperty('bytes_rcvd')) {
58
+ obj['bytes_rcvd'] = _ApiClient["default"].convertToType(data['bytes_rcvd'], 'Number');
59
+ }
60
+ if (data.hasOwnProperty('bytes_sent')) {
61
+ obj['bytes_sent'] = _ApiClient["default"].convertToType(data['bytes_sent'], 'Number');
62
+ }
63
+ if (data.hasOwnProperty('bytes_rcvd_secondary')) {
64
+ obj['bytes_rcvd_secondary'] = _ApiClient["default"].convertToType(data['bytes_rcvd_secondary'], 'Number');
65
+ }
66
+ if (data.hasOwnProperty('bytes_sent_secondary')) {
67
+ obj['bytes_sent_secondary'] = _ApiClient["default"].convertToType(data['bytes_sent_secondary'], 'Number');
68
+ }
69
+ if (data.hasOwnProperty('sessions_tcp')) {
70
+ obj['sessions_tcp'] = _ApiClient["default"].convertToType(data['sessions_tcp'], 'Number');
71
+ }
72
+ if (data.hasOwnProperty('sessions_tls')) {
73
+ obj['sessions_tls'] = _ApiClient["default"].convertToType(data['sessions_tls'], 'Number');
74
+ }
75
+ if (data.hasOwnProperty('notes_rcvd')) {
76
+ obj['notes_rcvd'] = _ApiClient["default"].convertToType(data['notes_rcvd'], 'Number');
77
+ }
78
+ if (data.hasOwnProperty('note_sent')) {
79
+ obj['note_sent'] = _ApiClient["default"].convertToType(data['note_sent'], 'Number');
80
+ }
81
+ } else if (data === null) {
82
+ return null;
83
+ }
84
+ return obj;
85
+ }
86
+
87
+ /**
88
+ * Validates the JSON data with respect to <code>DeviceUsage</code>.
89
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
90
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DeviceUsage</code>.
91
+ */
92
+ }, {
93
+ key: "validateJSON",
94
+ value: function validateJSON(data) {
95
+ return true;
96
+ }
97
+ }]);
98
+ return DeviceUsage;
99
+ }();
100
+ /**
101
+ * @member {Number} since
102
+ */
103
+ DeviceUsage.prototype['since'] = undefined;
104
+
105
+ /**
106
+ * @member {Number} duration
107
+ */
108
+ DeviceUsage.prototype['duration'] = undefined;
109
+
110
+ /**
111
+ * @member {Number} bytes_rcvd
112
+ */
113
+ DeviceUsage.prototype['bytes_rcvd'] = undefined;
114
+
115
+ /**
116
+ * @member {Number} bytes_sent
117
+ */
118
+ DeviceUsage.prototype['bytes_sent'] = undefined;
119
+
120
+ /**
121
+ * @member {Number} bytes_rcvd_secondary
122
+ */
123
+ DeviceUsage.prototype['bytes_rcvd_secondary'] = undefined;
124
+
125
+ /**
126
+ * @member {Number} bytes_sent_secondary
127
+ */
128
+ DeviceUsage.prototype['bytes_sent_secondary'] = undefined;
129
+
130
+ /**
131
+ * @member {Number} sessions_tcp
132
+ */
133
+ DeviceUsage.prototype['sessions_tcp'] = undefined;
134
+
135
+ /**
136
+ * @member {Number} sessions_tls
137
+ */
138
+ DeviceUsage.prototype['sessions_tls'] = undefined;
139
+
140
+ /**
141
+ * @member {Number} notes_rcvd
142
+ */
143
+ DeviceUsage.prototype['notes_rcvd'] = undefined;
144
+
145
+ /**
146
+ * @member {Number} note_sent
147
+ */
148
+ DeviceUsage.prototype['note_sent'] = undefined;
149
+ var _default = DeviceUsage;
150
+ exports["default"] = _default;
@@ -0,0 +1,103 @@
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(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); }
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
+ 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
+ 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
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ 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); }
18
+ /**
19
+ * The EnvironmentVariables model module.
20
+ * @module model/EnvironmentVariables
21
+ * @version 1.0.4
22
+ */
23
+ var EnvironmentVariables = /*#__PURE__*/function () {
24
+ /**
25
+ * Constructs a new <code>EnvironmentVariables</code>.
26
+ * @alias module:model/EnvironmentVariables
27
+ * @param environmentVariables {Object.<String, String>}
28
+ */
29
+ function EnvironmentVariables(environmentVariables) {
30
+ _classCallCheck(this, EnvironmentVariables);
31
+ EnvironmentVariables.initialize(this, environmentVariables);
32
+ }
33
+
34
+ /**
35
+ * Initializes the fields of this object.
36
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
37
+ * Only for internal use.
38
+ */
39
+ _createClass(EnvironmentVariables, null, [{
40
+ key: "initialize",
41
+ value: function initialize(obj, environmentVariables) {
42
+ obj['environment_variables'] = environmentVariables;
43
+ }
44
+
45
+ /**
46
+ * Constructs a <code>EnvironmentVariables</code> from a plain JavaScript object, optionally creating a new instance.
47
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
48
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
49
+ * @param {module:model/EnvironmentVariables} obj Optional instance to populate.
50
+ * @return {module:model/EnvironmentVariables} The populated <code>EnvironmentVariables</code> instance.
51
+ */
52
+ }, {
53
+ key: "constructFromObject",
54
+ value: function constructFromObject(data, obj) {
55
+ if (data) {
56
+ obj = obj || new EnvironmentVariables();
57
+ if (data.hasOwnProperty('environment_variables')) {
58
+ obj['environment_variables'] = _ApiClient["default"].convertToType(data['environment_variables'], {
59
+ 'String': 'String'
60
+ });
61
+ }
62
+ } else if (data === null) {
63
+ return null;
64
+ }
65
+ return obj;
66
+ }
67
+
68
+ /**
69
+ * Validates the JSON data with respect to <code>EnvironmentVariables</code>.
70
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
71
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>EnvironmentVariables</code>.
72
+ */
73
+ }, {
74
+ key: "validateJSON",
75
+ value: function validateJSON(data) {
76
+ // check to make sure all required properties are present in the JSON string
77
+ var _iterator = _createForOfIteratorHelper(EnvironmentVariables.RequiredProperties),
78
+ _step;
79
+ try {
80
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
81
+ var property = _step.value;
82
+ if (!data[property]) {
83
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
84
+ }
85
+ }
86
+ } catch (err) {
87
+ _iterator.e(err);
88
+ } finally {
89
+ _iterator.f();
90
+ }
91
+ return true;
92
+ }
93
+ }]);
94
+ return EnvironmentVariables;
95
+ }();
96
+ EnvironmentVariables.RequiredProperties = ["environment_variables"];
97
+
98
+ /**
99
+ * @member {Object.<String, String>} environment_variables
100
+ */
101
+ EnvironmentVariables.prototype['environment_variables'] = undefined;
102
+ var _default = EnvironmentVariables;
103
+ exports["default"] = _default;
@@ -0,0 +1,164 @@
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(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); }
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
+ 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
+ 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
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ 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); }
18
+ /**
19
+ * The Error model module.
20
+ * @module model/Error
21
+ * @version 1.0.4
22
+ */
23
+ var Error = /*#__PURE__*/function () {
24
+ /**
25
+ * Constructs a new <code>Error</code>.
26
+ * @alias module:model/Error
27
+ * @param err {String} Human readable error message.
28
+ * @param code {Number} The HTTP error code associated with the error.
29
+ * @param status {String} Machine readable representation of the HTTP error code.
30
+ */
31
+ function Error(err, code, status) {
32
+ _classCallCheck(this, Error);
33
+ Error.initialize(this, err, code, status);
34
+ }
35
+
36
+ /**
37
+ * Initializes the fields of this object.
38
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
39
+ * Only for internal use.
40
+ */
41
+ _createClass(Error, null, [{
42
+ key: "initialize",
43
+ value: function initialize(obj, err, code, status) {
44
+ obj['err'] = err;
45
+ obj['code'] = code;
46
+ obj['status'] = status;
47
+ }
48
+
49
+ /**
50
+ * Constructs a <code>Error</code> from a plain JavaScript object, optionally creating a new instance.
51
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
52
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
53
+ * @param {module:model/Error} obj Optional instance to populate.
54
+ * @return {module:model/Error} The populated <code>Error</code> instance.
55
+ */
56
+ }, {
57
+ key: "constructFromObject",
58
+ value: function constructFromObject(data, obj) {
59
+ if (data) {
60
+ obj = obj || new Error();
61
+ if (data.hasOwnProperty('err')) {
62
+ obj['err'] = _ApiClient["default"].convertToType(data['err'], 'String');
63
+ }
64
+ if (data.hasOwnProperty('code')) {
65
+ obj['code'] = _ApiClient["default"].convertToType(data['code'], 'Number');
66
+ }
67
+ if (data.hasOwnProperty('status')) {
68
+ obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
69
+ }
70
+ if (data.hasOwnProperty('request')) {
71
+ obj['request'] = _ApiClient["default"].convertToType(data['request'], 'String');
72
+ }
73
+ if (data.hasOwnProperty('details')) {
74
+ obj['details'] = _ApiClient["default"].convertToType(data['details'], Object);
75
+ }
76
+ if (data.hasOwnProperty('debug')) {
77
+ obj['debug'] = _ApiClient["default"].convertToType(data['debug'], 'String');
78
+ }
79
+ } else if (data === null) {
80
+ return null;
81
+ }
82
+ return obj;
83
+ }
84
+
85
+ /**
86
+ * Validates the JSON data with respect to <code>Error</code>.
87
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
88
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Error</code>.
89
+ */
90
+ }, {
91
+ key: "validateJSON",
92
+ value: function validateJSON(data) {
93
+ // check to make sure all required properties are present in the JSON string
94
+ var _iterator = _createForOfIteratorHelper(Error.RequiredProperties),
95
+ _step;
96
+ try {
97
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
98
+ var property = _step.value;
99
+ if (!data[property]) {
100
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
101
+ }
102
+ }
103
+ // ensure the json data is a string
104
+ } catch (err) {
105
+ _iterator.e(err);
106
+ } finally {
107
+ _iterator.f();
108
+ }
109
+ if (data['err'] && !(typeof data['err'] === 'string' || data['err'] instanceof String)) {
110
+ throw new Error("Expected the field `err` to be a primitive type in the JSON string but got " + data['err']);
111
+ }
112
+ // ensure the json data is a string
113
+ if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
114
+ throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
115
+ }
116
+ // ensure the json data is a string
117
+ if (data['request'] && !(typeof data['request'] === 'string' || data['request'] instanceof String)) {
118
+ throw new Error("Expected the field `request` to be a primitive type in the JSON string but got " + data['request']);
119
+ }
120
+ // ensure the json data is a string
121
+ if (data['debug'] && !(typeof data['debug'] === 'string' || data['debug'] instanceof String)) {
122
+ throw new Error("Expected the field `debug` to be a primitive type in the JSON string but got " + data['debug']);
123
+ }
124
+ return true;
125
+ }
126
+ }]);
127
+ return Error;
128
+ }();
129
+ Error.RequiredProperties = ["err", "code", "status"];
130
+
131
+ /**
132
+ * Human readable error message.
133
+ * @member {String} err
134
+ */
135
+ Error.prototype['err'] = undefined;
136
+
137
+ /**
138
+ * The HTTP error code associated with the error.
139
+ * @member {Number} code
140
+ */
141
+ Error.prototype['code'] = undefined;
142
+
143
+ /**
144
+ * Machine readable representation of the HTTP error code.
145
+ * @member {String} status
146
+ */
147
+ Error.prototype['status'] = undefined;
148
+
149
+ /**
150
+ * @member {String} request
151
+ */
152
+ Error.prototype['request'] = undefined;
153
+
154
+ /**
155
+ * @member {Object} details
156
+ */
157
+ Error.prototype['details'] = undefined;
158
+
159
+ /**
160
+ * @member {String} debug
161
+ */
162
+ Error.prototype['debug'] = undefined;
163
+ var _default = Error;
164
+ exports["default"] = _default;