@pescheckit/pescheck-client-js 0.0.5

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 (47) hide show
  1. package/README.md +220 -0
  2. package/dist/ApiClient.js +730 -0
  3. package/dist/api/AuthenticationApi.js +159 -0
  4. package/dist/api/ChecksApi.js +120 -0
  5. package/dist/api/DivisionsApi.js +257 -0
  6. package/dist/api/OAuthApi.js +153 -0
  7. package/dist/api/ProfilesApi.js +301 -0
  8. package/dist/api/ScreeningsApi.js +213 -0
  9. package/dist/api/WebhooksApi.js +210 -0
  10. package/dist/index.js +314 -0
  11. package/dist/model/CustomTokenObtainPair.js +127 -0
  12. package/dist/model/DivisionReadOnly.js +266 -0
  13. package/dist/model/DivisionWrite.js +246 -0
  14. package/dist/model/JWTGeneration.js +155 -0
  15. package/dist/model/JWTResponse.js +184 -0
  16. package/dist/model/OAuthApplication.js +221 -0
  17. package/dist/model/OAuthApplicationResponse.js +252 -0
  18. package/dist/model/PaginatedDivisionReadOnlyList.js +168 -0
  19. package/dist/model/PaginatedV2ProfileListItemList.js +168 -0
  20. package/dist/model/PaginatedV2ScreeningListItemList.js +168 -0
  21. package/dist/model/PatchedDivisionWrite.js +209 -0
  22. package/dist/model/PatchedV2ProfilePartialUpdate.js +102 -0
  23. package/dist/model/TokenRefresh.js +124 -0
  24. package/dist/model/V2Candidate.js +1474 -0
  25. package/dist/model/V2CheckField.js +168 -0
  26. package/dist/model/V2CheckInfo.js +316 -0
  27. package/dist/model/V2Document.js +302 -0
  28. package/dist/model/V2DocumentContent.js +126 -0
  29. package/dist/model/V2Money.js +126 -0
  30. package/dist/model/V2ProfileCheck.js +222 -0
  31. package/dist/model/V2ProfileCheckEntry.js +311 -0
  32. package/dist/model/V2ProfileCreate.js +158 -0
  33. package/dist/model/V2ProfileDetail.js +258 -0
  34. package/dist/model/V2ProfileListItem.js +182 -0
  35. package/dist/model/V2ProfileUpdate.js +159 -0
  36. package/dist/model/V2ProfileUpdateCheck.js +254 -0
  37. package/dist/model/V2ScreeningCheck.js +243 -0
  38. package/dist/model/V2ScreeningCheckEntry.js +338 -0
  39. package/dist/model/V2ScreeningCheckListItem.js +260 -0
  40. package/dist/model/V2ScreeningCreate.js +158 -0
  41. package/dist/model/V2ScreeningDetail.js +240 -0
  42. package/dist/model/V2ScreeningDetailProfile.js +101 -0
  43. package/dist/model/V2ScreeningListItem.js +237 -0
  44. package/dist/model/VerifyWebhook.js +114 -0
  45. package/dist/model/Webhook.js +221 -0
  46. package/dist/model/WebhookResponse.js +215 -0
  47. package/package.json +54 -0
@@ -0,0 +1,266 @@
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(e) { return e && e.__esModule ? e : { "default": e }; }
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 _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ 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); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
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
+ * Pescheck API
19
+ * Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
20
+ *
21
+ * The version of the OpenAPI document: 2.0.0
22
+ *
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
+ */
29
+ /**
30
+ * The DivisionReadOnly model module.
31
+ * @module model/DivisionReadOnly
32
+ * @version 0.0.5
33
+ */
34
+ var DivisionReadOnly = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>DivisionReadOnly</code>.
37
+ * @alias module:model/DivisionReadOnly
38
+ * @param id {String}
39
+ * @param parent {String}
40
+ * @param createdAt {Date}
41
+ * @param updatedAt {Date}
42
+ */
43
+ function DivisionReadOnly(id, parent, createdAt, updatedAt) {
44
+ _classCallCheck(this, DivisionReadOnly);
45
+ DivisionReadOnly.initialize(this, id, parent, createdAt, updatedAt);
46
+ }
47
+
48
+ /**
49
+ * Initializes the fields of this object.
50
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
+ * Only for internal use.
52
+ */
53
+ return _createClass(DivisionReadOnly, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, id, parent, createdAt, updatedAt) {
56
+ obj['id'] = id;
57
+ obj['parent'] = parent;
58
+ obj['created_at'] = createdAt;
59
+ obj['updated_at'] = updatedAt;
60
+ }
61
+
62
+ /**
63
+ * Constructs a <code>DivisionReadOnly</code> from a plain JavaScript object, optionally creating a new instance.
64
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
65
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
66
+ * @param {module:model/DivisionReadOnly} obj Optional instance to populate.
67
+ * @return {module:model/DivisionReadOnly} The populated <code>DivisionReadOnly</code> instance.
68
+ */
69
+ }, {
70
+ key: "constructFromObject",
71
+ value: function constructFromObject(data, obj) {
72
+ if (data) {
73
+ obj = obj || new DivisionReadOnly();
74
+ if (data.hasOwnProperty('id')) {
75
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('name')) {
78
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('parent')) {
81
+ obj['parent'] = _ApiClient["default"].convertToType(data['parent'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('created_at')) {
84
+ obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Date');
85
+ }
86
+ if (data.hasOwnProperty('updated_at')) {
87
+ obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'Date');
88
+ }
89
+ if (data.hasOwnProperty('city')) {
90
+ obj['city'] = _ApiClient["default"].convertToType(data['city'], 'String');
91
+ }
92
+ if (data.hasOwnProperty('address')) {
93
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
94
+ }
95
+ if (data.hasOwnProperty('postal')) {
96
+ obj['postal'] = _ApiClient["default"].convertToType(data['postal'], 'String');
97
+ }
98
+ if (data.hasOwnProperty('phone')) {
99
+ obj['phone'] = _ApiClient["default"].convertToType(data['phone'], 'String');
100
+ }
101
+ if (data.hasOwnProperty('contact_name')) {
102
+ obj['contact_name'] = _ApiClient["default"].convertToType(data['contact_name'], 'String');
103
+ }
104
+ if (data.hasOwnProperty('contact_email')) {
105
+ obj['contact_email'] = _ApiClient["default"].convertToType(data['contact_email'], 'String');
106
+ }
107
+ if (data.hasOwnProperty('invoice_email')) {
108
+ obj['invoice_email'] = _ApiClient["default"].convertToType(data['invoice_email'], 'String');
109
+ }
110
+ if (data.hasOwnProperty('use_parent_on_email')) {
111
+ obj['use_parent_on_email'] = _ApiClient["default"].convertToType(data['use_parent_on_email'], 'Boolean');
112
+ }
113
+ if (data.hasOwnProperty('use_parent_on_billing')) {
114
+ obj['use_parent_on_billing'] = _ApiClient["default"].convertToType(data['use_parent_on_billing'], 'Boolean');
115
+ }
116
+ if (data.hasOwnProperty('use_parent_on_report')) {
117
+ obj['use_parent_on_report'] = _ApiClient["default"].convertToType(data['use_parent_on_report'], 'Boolean');
118
+ }
119
+ }
120
+ return obj;
121
+ }
122
+
123
+ /**
124
+ * Validates the JSON data with respect to <code>DivisionReadOnly</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>DivisionReadOnly</code>.
127
+ */
128
+ }, {
129
+ key: "validateJSON",
130
+ value: function validateJSON(data) {
131
+ // check to make sure all required properties are present in the JSON string
132
+ var _iterator = _createForOfIteratorHelper(DivisionReadOnly.RequiredProperties),
133
+ _step;
134
+ try {
135
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
136
+ var property = _step.value;
137
+ if (!data.hasOwnProperty(property)) {
138
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
139
+ }
140
+ }
141
+ // ensure the json data is a string
142
+ } catch (err) {
143
+ _iterator.e(err);
144
+ } finally {
145
+ _iterator.f();
146
+ }
147
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
148
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
149
+ }
150
+ // ensure the json data is a string
151
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
152
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
153
+ }
154
+ // ensure the json data is a string
155
+ if (data['parent'] && !(typeof data['parent'] === 'string' || data['parent'] instanceof String)) {
156
+ throw new Error("Expected the field `parent` to be a primitive type in the JSON string but got " + data['parent']);
157
+ }
158
+ // ensure the json data is a string
159
+ if (data['city'] && !(typeof data['city'] === 'string' || data['city'] instanceof String)) {
160
+ throw new Error("Expected the field `city` to be a primitive type in the JSON string but got " + data['city']);
161
+ }
162
+ // ensure the json data is a string
163
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
164
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
165
+ }
166
+ // ensure the json data is a string
167
+ if (data['postal'] && !(typeof data['postal'] === 'string' || data['postal'] instanceof String)) {
168
+ throw new Error("Expected the field `postal` to be a primitive type in the JSON string but got " + data['postal']);
169
+ }
170
+ // ensure the json data is a string
171
+ if (data['phone'] && !(typeof data['phone'] === 'string' || data['phone'] instanceof String)) {
172
+ throw new Error("Expected the field `phone` to be a primitive type in the JSON string but got " + data['phone']);
173
+ }
174
+ // ensure the json data is a string
175
+ if (data['contact_name'] && !(typeof data['contact_name'] === 'string' || data['contact_name'] instanceof String)) {
176
+ throw new Error("Expected the field `contact_name` to be a primitive type in the JSON string but got " + data['contact_name']);
177
+ }
178
+ // ensure the json data is a string
179
+ if (data['contact_email'] && !(typeof data['contact_email'] === 'string' || data['contact_email'] instanceof String)) {
180
+ throw new Error("Expected the field `contact_email` to be a primitive type in the JSON string but got " + data['contact_email']);
181
+ }
182
+ // ensure the json data is a string
183
+ if (data['invoice_email'] && !(typeof data['invoice_email'] === 'string' || data['invoice_email'] instanceof String)) {
184
+ throw new Error("Expected the field `invoice_email` to be a primitive type in the JSON string but got " + data['invoice_email']);
185
+ }
186
+ return true;
187
+ }
188
+ }]);
189
+ }();
190
+ DivisionReadOnly.RequiredProperties = ["id", "parent", "created_at", "updated_at"];
191
+
192
+ /**
193
+ * @member {String} id
194
+ */
195
+ DivisionReadOnly.prototype['id'] = undefined;
196
+
197
+ /**
198
+ * @member {String} name
199
+ */
200
+ DivisionReadOnly.prototype['name'] = undefined;
201
+
202
+ /**
203
+ * @member {String} parent
204
+ */
205
+ DivisionReadOnly.prototype['parent'] = undefined;
206
+
207
+ /**
208
+ * @member {Date} created_at
209
+ */
210
+ DivisionReadOnly.prototype['created_at'] = undefined;
211
+
212
+ /**
213
+ * @member {Date} updated_at
214
+ */
215
+ DivisionReadOnly.prototype['updated_at'] = undefined;
216
+
217
+ /**
218
+ * @member {String} city
219
+ */
220
+ DivisionReadOnly.prototype['city'] = undefined;
221
+
222
+ /**
223
+ * @member {String} address
224
+ */
225
+ DivisionReadOnly.prototype['address'] = undefined;
226
+
227
+ /**
228
+ * @member {String} postal
229
+ */
230
+ DivisionReadOnly.prototype['postal'] = undefined;
231
+
232
+ /**
233
+ * @member {String} phone
234
+ */
235
+ DivisionReadOnly.prototype['phone'] = undefined;
236
+
237
+ /**
238
+ * @member {String} contact_name
239
+ */
240
+ DivisionReadOnly.prototype['contact_name'] = undefined;
241
+
242
+ /**
243
+ * @member {String} contact_email
244
+ */
245
+ DivisionReadOnly.prototype['contact_email'] = undefined;
246
+
247
+ /**
248
+ * @member {String} invoice_email
249
+ */
250
+ DivisionReadOnly.prototype['invoice_email'] = undefined;
251
+
252
+ /**
253
+ * @member {Boolean} use_parent_on_email
254
+ */
255
+ DivisionReadOnly.prototype['use_parent_on_email'] = undefined;
256
+
257
+ /**
258
+ * @member {Boolean} use_parent_on_billing
259
+ */
260
+ DivisionReadOnly.prototype['use_parent_on_billing'] = undefined;
261
+
262
+ /**
263
+ * @member {Boolean} use_parent_on_report
264
+ */
265
+ DivisionReadOnly.prototype['use_parent_on_report'] = undefined;
266
+ var _default = exports["default"] = DivisionReadOnly;
@@ -0,0 +1,246 @@
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(e) { return e && e.__esModule ? e : { "default": e }; }
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 _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ 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); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
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
+ * Pescheck API
19
+ * Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
20
+ *
21
+ * The version of the OpenAPI document: 2.0.0
22
+ *
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
+ */
29
+ /**
30
+ * The DivisionWrite model module.
31
+ * @module model/DivisionWrite
32
+ * @version 0.0.5
33
+ */
34
+ var DivisionWrite = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>DivisionWrite</code>.
37
+ * @alias module:model/DivisionWrite
38
+ * @param name {String}
39
+ * @param city {String}
40
+ * @param address {String}
41
+ * @param postal {String}
42
+ * @param phone {String}
43
+ * @param contactName {String}
44
+ * @param contactEmail {String}
45
+ * @param invoiceEmail {String}
46
+ */
47
+ function DivisionWrite(name, city, address, postal, phone, contactName, contactEmail, invoiceEmail) {
48
+ _classCallCheck(this, DivisionWrite);
49
+ DivisionWrite.initialize(this, name, city, address, postal, phone, contactName, contactEmail, invoiceEmail);
50
+ }
51
+
52
+ /**
53
+ * Initializes the fields of this object.
54
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
55
+ * Only for internal use.
56
+ */
57
+ return _createClass(DivisionWrite, null, [{
58
+ key: "initialize",
59
+ value: function initialize(obj, name, city, address, postal, phone, contactName, contactEmail, invoiceEmail) {
60
+ obj['name'] = name;
61
+ obj['city'] = city;
62
+ obj['address'] = address;
63
+ obj['postal'] = postal;
64
+ obj['phone'] = phone;
65
+ obj['contact_name'] = contactName;
66
+ obj['contact_email'] = contactEmail;
67
+ obj['invoice_email'] = invoiceEmail;
68
+ }
69
+
70
+ /**
71
+ * Constructs a <code>DivisionWrite</code> from a plain JavaScript object, optionally creating a new instance.
72
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
73
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
74
+ * @param {module:model/DivisionWrite} obj Optional instance to populate.
75
+ * @return {module:model/DivisionWrite} The populated <code>DivisionWrite</code> instance.
76
+ */
77
+ }, {
78
+ key: "constructFromObject",
79
+ value: function constructFromObject(data, obj) {
80
+ if (data) {
81
+ obj = obj || new DivisionWrite();
82
+ if (data.hasOwnProperty('id')) {
83
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
84
+ }
85
+ if (data.hasOwnProperty('name')) {
86
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
87
+ }
88
+ if (data.hasOwnProperty('city')) {
89
+ obj['city'] = _ApiClient["default"].convertToType(data['city'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('address')) {
92
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
93
+ }
94
+ if (data.hasOwnProperty('postal')) {
95
+ obj['postal'] = _ApiClient["default"].convertToType(data['postal'], 'String');
96
+ }
97
+ if (data.hasOwnProperty('phone')) {
98
+ obj['phone'] = _ApiClient["default"].convertToType(data['phone'], 'String');
99
+ }
100
+ if (data.hasOwnProperty('contact_name')) {
101
+ obj['contact_name'] = _ApiClient["default"].convertToType(data['contact_name'], 'String');
102
+ }
103
+ if (data.hasOwnProperty('contact_email')) {
104
+ obj['contact_email'] = _ApiClient["default"].convertToType(data['contact_email'], 'String');
105
+ }
106
+ if (data.hasOwnProperty('invoice_email')) {
107
+ obj['invoice_email'] = _ApiClient["default"].convertToType(data['invoice_email'], 'String');
108
+ }
109
+ if (data.hasOwnProperty('use_parent_on_email')) {
110
+ obj['use_parent_on_email'] = _ApiClient["default"].convertToType(data['use_parent_on_email'], 'Boolean');
111
+ }
112
+ if (data.hasOwnProperty('use_parent_on_billing')) {
113
+ obj['use_parent_on_billing'] = _ApiClient["default"].convertToType(data['use_parent_on_billing'], 'Boolean');
114
+ }
115
+ if (data.hasOwnProperty('use_parent_on_report')) {
116
+ obj['use_parent_on_report'] = _ApiClient["default"].convertToType(data['use_parent_on_report'], 'Boolean');
117
+ }
118
+ }
119
+ return obj;
120
+ }
121
+
122
+ /**
123
+ * Validates the JSON data with respect to <code>DivisionWrite</code>.
124
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
125
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DivisionWrite</code>.
126
+ */
127
+ }, {
128
+ key: "validateJSON",
129
+ value: function validateJSON(data) {
130
+ // check to make sure all required properties are present in the JSON string
131
+ var _iterator = _createForOfIteratorHelper(DivisionWrite.RequiredProperties),
132
+ _step;
133
+ try {
134
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
135
+ var property = _step.value;
136
+ if (!data.hasOwnProperty(property)) {
137
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
138
+ }
139
+ }
140
+ // ensure the json data is a string
141
+ } catch (err) {
142
+ _iterator.e(err);
143
+ } finally {
144
+ _iterator.f();
145
+ }
146
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
147
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
148
+ }
149
+ // ensure the json data is a string
150
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
151
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
152
+ }
153
+ // ensure the json data is a string
154
+ if (data['city'] && !(typeof data['city'] === 'string' || data['city'] instanceof String)) {
155
+ throw new Error("Expected the field `city` to be a primitive type in the JSON string but got " + data['city']);
156
+ }
157
+ // ensure the json data is a string
158
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
159
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
160
+ }
161
+ // ensure the json data is a string
162
+ if (data['postal'] && !(typeof data['postal'] === 'string' || data['postal'] instanceof String)) {
163
+ throw new Error("Expected the field `postal` to be a primitive type in the JSON string but got " + data['postal']);
164
+ }
165
+ // ensure the json data is a string
166
+ if (data['phone'] && !(typeof data['phone'] === 'string' || data['phone'] instanceof String)) {
167
+ throw new Error("Expected the field `phone` to be a primitive type in the JSON string but got " + data['phone']);
168
+ }
169
+ // ensure the json data is a string
170
+ if (data['contact_name'] && !(typeof data['contact_name'] === 'string' || data['contact_name'] instanceof String)) {
171
+ throw new Error("Expected the field `contact_name` to be a primitive type in the JSON string but got " + data['contact_name']);
172
+ }
173
+ // ensure the json data is a string
174
+ if (data['contact_email'] && !(typeof data['contact_email'] === 'string' || data['contact_email'] instanceof String)) {
175
+ throw new Error("Expected the field `contact_email` to be a primitive type in the JSON string but got " + data['contact_email']);
176
+ }
177
+ // ensure the json data is a string
178
+ if (data['invoice_email'] && !(typeof data['invoice_email'] === 'string' || data['invoice_email'] instanceof String)) {
179
+ throw new Error("Expected the field `invoice_email` to be a primitive type in the JSON string but got " + data['invoice_email']);
180
+ }
181
+ return true;
182
+ }
183
+ }]);
184
+ }();
185
+ DivisionWrite.RequiredProperties = ["name", "city", "address", "postal", "phone", "contact_name", "contact_email", "invoice_email"];
186
+
187
+ /**
188
+ * @member {String} id
189
+ */
190
+ DivisionWrite.prototype['id'] = undefined;
191
+
192
+ /**
193
+ * @member {String} name
194
+ */
195
+ DivisionWrite.prototype['name'] = undefined;
196
+
197
+ /**
198
+ * @member {String} city
199
+ */
200
+ DivisionWrite.prototype['city'] = undefined;
201
+
202
+ /**
203
+ * @member {String} address
204
+ */
205
+ DivisionWrite.prototype['address'] = undefined;
206
+
207
+ /**
208
+ * @member {String} postal
209
+ */
210
+ DivisionWrite.prototype['postal'] = undefined;
211
+
212
+ /**
213
+ * @member {String} phone
214
+ */
215
+ DivisionWrite.prototype['phone'] = undefined;
216
+
217
+ /**
218
+ * @member {String} contact_name
219
+ */
220
+ DivisionWrite.prototype['contact_name'] = undefined;
221
+
222
+ /**
223
+ * @member {String} contact_email
224
+ */
225
+ DivisionWrite.prototype['contact_email'] = undefined;
226
+
227
+ /**
228
+ * @member {String} invoice_email
229
+ */
230
+ DivisionWrite.prototype['invoice_email'] = undefined;
231
+
232
+ /**
233
+ * @member {Boolean} use_parent_on_email
234
+ */
235
+ DivisionWrite.prototype['use_parent_on_email'] = undefined;
236
+
237
+ /**
238
+ * @member {Boolean} use_parent_on_billing
239
+ */
240
+ DivisionWrite.prototype['use_parent_on_billing'] = undefined;
241
+
242
+ /**
243
+ * @member {Boolean} use_parent_on_report
244
+ */
245
+ DivisionWrite.prototype['use_parent_on_report'] = undefined;
246
+ var _default = exports["default"] = DivisionWrite;
@@ -0,0 +1,155 @@
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(e) { return e && e.__esModule ? e : { "default": e }; }
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 _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ 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); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
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
+ * Pescheck API
19
+ * Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
20
+ *
21
+ * The version of the OpenAPI document: 2.0.0
22
+ *
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
+ */
29
+ /**
30
+ * The JWTGeneration model module.
31
+ * @module model/JWTGeneration
32
+ * @version 0.0.5
33
+ */
34
+ var JWTGeneration = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>JWTGeneration</code>.
37
+ * Serializer for JWT token generation for API users
38
+ * @alias module:model/JWTGeneration
39
+ * @param email {String} Email address of the API user
40
+ * @param password {String} Password for the API user
41
+ */
42
+ function JWTGeneration(email, password) {
43
+ _classCallCheck(this, JWTGeneration);
44
+ JWTGeneration.initialize(this, email, password);
45
+ }
46
+
47
+ /**
48
+ * Initializes the fields of this object.
49
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
50
+ * Only for internal use.
51
+ */
52
+ return _createClass(JWTGeneration, null, [{
53
+ key: "initialize",
54
+ value: function initialize(obj, email, password) {
55
+ obj['email'] = email;
56
+ obj['password'] = password;
57
+ }
58
+
59
+ /**
60
+ * Constructs a <code>JWTGeneration</code> from a plain JavaScript object, optionally creating a new instance.
61
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
62
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
63
+ * @param {module:model/JWTGeneration} obj Optional instance to populate.
64
+ * @return {module:model/JWTGeneration} The populated <code>JWTGeneration</code> instance.
65
+ */
66
+ }, {
67
+ key: "constructFromObject",
68
+ value: function constructFromObject(data, obj) {
69
+ if (data) {
70
+ obj = obj || new JWTGeneration();
71
+ if (data.hasOwnProperty('email')) {
72
+ obj['email'] = _ApiClient["default"].convertToType(data['email'], 'String');
73
+ }
74
+ if (data.hasOwnProperty('password')) {
75
+ obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('organisation_id')) {
78
+ obj['organisation_id'] = _ApiClient["default"].convertToType(data['organisation_id'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('division_id')) {
81
+ obj['division_id'] = _ApiClient["default"].convertToType(data['division_id'], 'String');
82
+ }
83
+ }
84
+ return obj;
85
+ }
86
+
87
+ /**
88
+ * Validates the JSON data with respect to <code>JWTGeneration</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>JWTGeneration</code>.
91
+ */
92
+ }, {
93
+ key: "validateJSON",
94
+ value: function validateJSON(data) {
95
+ // check to make sure all required properties are present in the JSON string
96
+ var _iterator = _createForOfIteratorHelper(JWTGeneration.RequiredProperties),
97
+ _step;
98
+ try {
99
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
100
+ var property = _step.value;
101
+ if (!data.hasOwnProperty(property)) {
102
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
103
+ }
104
+ }
105
+ // ensure the json data is a string
106
+ } catch (err) {
107
+ _iterator.e(err);
108
+ } finally {
109
+ _iterator.f();
110
+ }
111
+ if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) {
112
+ throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']);
113
+ }
114
+ // ensure the json data is a string
115
+ if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
116
+ throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
117
+ }
118
+ // ensure the json data is a string
119
+ if (data['organisation_id'] && !(typeof data['organisation_id'] === 'string' || data['organisation_id'] instanceof String)) {
120
+ throw new Error("Expected the field `organisation_id` to be a primitive type in the JSON string but got " + data['organisation_id']);
121
+ }
122
+ // ensure the json data is a string
123
+ if (data['division_id'] && !(typeof data['division_id'] === 'string' || data['division_id'] instanceof String)) {
124
+ throw new Error("Expected the field `division_id` to be a primitive type in the JSON string but got " + data['division_id']);
125
+ }
126
+ return true;
127
+ }
128
+ }]);
129
+ }();
130
+ JWTGeneration.RequiredProperties = ["email", "password"];
131
+
132
+ /**
133
+ * Email address of the API user
134
+ * @member {String} email
135
+ */
136
+ JWTGeneration.prototype['email'] = undefined;
137
+
138
+ /**
139
+ * Password for the API user
140
+ * @member {String} password
141
+ */
142
+ JWTGeneration.prototype['password'] = undefined;
143
+
144
+ /**
145
+ * Organization ID to generate token for
146
+ * @member {String} organisation_id
147
+ */
148
+ JWTGeneration.prototype['organisation_id'] = undefined;
149
+
150
+ /**
151
+ * Division ID to generate token for (optional)
152
+ * @member {String} division_id
153
+ */
154
+ JWTGeneration.prototype['division_id'] = undefined;
155
+ var _default = exports["default"] = JWTGeneration;