@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,158 @@
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 _V2ProfileCheck = _interopRequireDefault(require("./V2ProfileCheck"));
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 _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; } } }; }
12
+ 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; } }
13
+ 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; }
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 _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ 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); } /**
19
+ * Pescheck API
20
+ * 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.
21
+ *
22
+ * The version of the OpenAPI document: 2.0.0
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The V2ProfileCreate model module.
32
+ * @module model/V2ProfileCreate
33
+ * @version 0.0.5
34
+ */
35
+ var V2ProfileCreate = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>V2ProfileCreate</code>.
38
+ * @alias module:model/V2ProfileCreate
39
+ * @param name {String}
40
+ * @param checks {Array.<module:model/V2ProfileCheck>}
41
+ */
42
+ function V2ProfileCreate(name, checks) {
43
+ _classCallCheck(this, V2ProfileCreate);
44
+ V2ProfileCreate.initialize(this, name, checks);
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(V2ProfileCreate, null, [{
53
+ key: "initialize",
54
+ value: function initialize(obj, name, checks) {
55
+ obj['name'] = name;
56
+ obj['description'] = '';
57
+ obj['checks'] = checks;
58
+ }
59
+
60
+ /**
61
+ * Constructs a <code>V2ProfileCreate</code> from a plain JavaScript object, optionally creating a new instance.
62
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
63
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
64
+ * @param {module:model/V2ProfileCreate} obj Optional instance to populate.
65
+ * @return {module:model/V2ProfileCreate} The populated <code>V2ProfileCreate</code> instance.
66
+ */
67
+ }, {
68
+ key: "constructFromObject",
69
+ value: function constructFromObject(data, obj) {
70
+ if (data) {
71
+ obj = obj || new V2ProfileCreate();
72
+ if (data.hasOwnProperty('name')) {
73
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
74
+ }
75
+ if (data.hasOwnProperty('description')) {
76
+ obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
77
+ }
78
+ if (data.hasOwnProperty('checks')) {
79
+ obj['checks'] = _ApiClient["default"].convertToType(data['checks'], [_V2ProfileCheck["default"]]);
80
+ }
81
+ }
82
+ return obj;
83
+ }
84
+
85
+ /**
86
+ * Validates the JSON data with respect to <code>V2ProfileCreate</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>V2ProfileCreate</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(V2ProfileCreate.RequiredProperties),
95
+ _step;
96
+ try {
97
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
98
+ var property = _step.value;
99
+ if (!data.hasOwnProperty(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['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
110
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
111
+ }
112
+ // ensure the json data is a string
113
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
114
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
115
+ }
116
+ if (data['checks']) {
117
+ // data not null
118
+ // ensure the json data is an array
119
+ if (!Array.isArray(data['checks'])) {
120
+ throw new Error("Expected the field `checks` to be an array in the JSON data but got " + data['checks']);
121
+ }
122
+ // validate the optional field `checks` (array)
123
+ var _iterator2 = _createForOfIteratorHelper(data['checks']),
124
+ _step2;
125
+ try {
126
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
127
+ var item = _step2.value;
128
+ _V2ProfileCheck["default"].validateJSON(item);
129
+ }
130
+ } catch (err) {
131
+ _iterator2.e(err);
132
+ } finally {
133
+ _iterator2.f();
134
+ }
135
+ ;
136
+ }
137
+ return true;
138
+ }
139
+ }]);
140
+ }();
141
+ V2ProfileCreate.RequiredProperties = ["name", "checks"];
142
+
143
+ /**
144
+ * @member {String} name
145
+ */
146
+ V2ProfileCreate.prototype['name'] = undefined;
147
+
148
+ /**
149
+ * @member {String} description
150
+ * @default ''
151
+ */
152
+ V2ProfileCreate.prototype['description'] = '';
153
+
154
+ /**
155
+ * @member {Array.<module:model/V2ProfileCheck>} checks
156
+ */
157
+ V2ProfileCreate.prototype['checks'] = undefined;
158
+ var _default = exports["default"] = V2ProfileCreate;
@@ -0,0 +1,258 @@
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 _V2Money = _interopRequireDefault(require("./V2Money"));
9
+ var _V2ProfileCheckEntry = _interopRequireDefault(require("./V2ProfileCheckEntry"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _createForOfIteratorHelper(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; } } }; }
13
+ 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; } }
14
+ 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; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ 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); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
20
+ * Pescheck API
21
+ * 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.
22
+ *
23
+ * The version of the OpenAPI document: 2.0.0
24
+ *
25
+ *
26
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
27
+ * https://openapi-generator.tech
28
+ * Do not edit the class manually.
29
+ *
30
+ */
31
+ /**
32
+ * The V2ProfileDetail model module.
33
+ * @module model/V2ProfileDetail
34
+ * @version 0.0.5
35
+ */
36
+ var V2ProfileDetail = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>V2ProfileDetail</code>.
39
+ * @alias module:model/V2ProfileDetail
40
+ * @param id {String}
41
+ * @param name {String}
42
+ * @param description {String}
43
+ * @param checks {Array.<module:model/V2ProfileCheckEntry>}
44
+ * @param totalPrice {module:model/V2Money}
45
+ * @param supportedCountriesOfWork {Array.<String>}
46
+ * @param supportedCountriesOfResidence {Array.<String>}
47
+ * @param candidateFields {Array.<Object>}
48
+ * @param createdAt {Date}
49
+ * @param updatedAt {Date}
50
+ */
51
+ function V2ProfileDetail(id, name, description, checks, totalPrice, supportedCountriesOfWork, supportedCountriesOfResidence, candidateFields, createdAt, updatedAt) {
52
+ _classCallCheck(this, V2ProfileDetail);
53
+ V2ProfileDetail.initialize(this, id, name, description, checks, totalPrice, supportedCountriesOfWork, supportedCountriesOfResidence, candidateFields, createdAt, updatedAt);
54
+ }
55
+
56
+ /**
57
+ * Initializes the fields of this object.
58
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
59
+ * Only for internal use.
60
+ */
61
+ return _createClass(V2ProfileDetail, null, [{
62
+ key: "initialize",
63
+ value: function initialize(obj, id, name, description, checks, totalPrice, supportedCountriesOfWork, supportedCountriesOfResidence, candidateFields, createdAt, updatedAt) {
64
+ obj['id'] = id;
65
+ obj['name'] = name;
66
+ obj['description'] = description;
67
+ obj['checks'] = checks;
68
+ obj['total_price'] = totalPrice;
69
+ obj['supported_countries_of_work'] = supportedCountriesOfWork;
70
+ obj['supported_countries_of_residence'] = supportedCountriesOfResidence;
71
+ obj['candidate_fields'] = candidateFields;
72
+ obj['created_at'] = createdAt;
73
+ obj['updated_at'] = updatedAt;
74
+ }
75
+
76
+ /**
77
+ * Constructs a <code>V2ProfileDetail</code> from a plain JavaScript object, optionally creating a new instance.
78
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
79
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
80
+ * @param {module:model/V2ProfileDetail} obj Optional instance to populate.
81
+ * @return {module:model/V2ProfileDetail} The populated <code>V2ProfileDetail</code> instance.
82
+ */
83
+ }, {
84
+ key: "constructFromObject",
85
+ value: function constructFromObject(data, obj) {
86
+ if (data) {
87
+ obj = obj || new V2ProfileDetail();
88
+ if (data.hasOwnProperty('id')) {
89
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('name')) {
92
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
93
+ }
94
+ if (data.hasOwnProperty('description')) {
95
+ obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
96
+ }
97
+ if (data.hasOwnProperty('is_custom')) {
98
+ obj['is_custom'] = _ApiClient["default"].convertToType(data['is_custom'], 'Boolean');
99
+ }
100
+ if (data.hasOwnProperty('checks')) {
101
+ obj['checks'] = _ApiClient["default"].convertToType(data['checks'], [_V2ProfileCheckEntry["default"]]);
102
+ }
103
+ if (data.hasOwnProperty('total_price')) {
104
+ obj['total_price'] = _ApiClient["default"].convertToType(data['total_price'], _V2Money["default"]);
105
+ }
106
+ if (data.hasOwnProperty('supported_countries_of_work')) {
107
+ obj['supported_countries_of_work'] = _ApiClient["default"].convertToType(data['supported_countries_of_work'], ['String']);
108
+ }
109
+ if (data.hasOwnProperty('supported_countries_of_residence')) {
110
+ obj['supported_countries_of_residence'] = _ApiClient["default"].convertToType(data['supported_countries_of_residence'], ['String']);
111
+ }
112
+ if (data.hasOwnProperty('candidate_fields')) {
113
+ obj['candidate_fields'] = _ApiClient["default"].convertToType(data['candidate_fields'], [Object]);
114
+ }
115
+ if (data.hasOwnProperty('created_at')) {
116
+ obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Date');
117
+ }
118
+ if (data.hasOwnProperty('updated_at')) {
119
+ obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'Date');
120
+ }
121
+ }
122
+ return obj;
123
+ }
124
+
125
+ /**
126
+ * Validates the JSON data with respect to <code>V2ProfileDetail</code>.
127
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
128
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>V2ProfileDetail</code>.
129
+ */
130
+ }, {
131
+ key: "validateJSON",
132
+ value: function validateJSON(data) {
133
+ // check to make sure all required properties are present in the JSON string
134
+ var _iterator = _createForOfIteratorHelper(V2ProfileDetail.RequiredProperties),
135
+ _step;
136
+ try {
137
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
138
+ var property = _step.value;
139
+ if (!data.hasOwnProperty(property)) {
140
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
141
+ }
142
+ }
143
+ // ensure the json data is a string
144
+ } catch (err) {
145
+ _iterator.e(err);
146
+ } finally {
147
+ _iterator.f();
148
+ }
149
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
150
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
151
+ }
152
+ // ensure the json data is a string
153
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
154
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
155
+ }
156
+ // ensure the json data is a string
157
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
158
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
159
+ }
160
+ if (data['checks']) {
161
+ // data not null
162
+ // ensure the json data is an array
163
+ if (!Array.isArray(data['checks'])) {
164
+ throw new Error("Expected the field `checks` to be an array in the JSON data but got " + data['checks']);
165
+ }
166
+ // validate the optional field `checks` (array)
167
+ var _iterator2 = _createForOfIteratorHelper(data['checks']),
168
+ _step2;
169
+ try {
170
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
171
+ var item = _step2.value;
172
+ _V2ProfileCheckEntry["default"].validateJSON(item);
173
+ }
174
+ } catch (err) {
175
+ _iterator2.e(err);
176
+ } finally {
177
+ _iterator2.f();
178
+ }
179
+ ;
180
+ }
181
+ // validate the optional field `total_price`
182
+ if (data['total_price']) {
183
+ // data not null
184
+ _V2Money["default"].validateJSON(data['total_price']);
185
+ }
186
+ // ensure the json data is an array
187
+ if (!Array.isArray(data['supported_countries_of_work'])) {
188
+ throw new Error("Expected the field `supported_countries_of_work` to be an array in the JSON data but got " + data['supported_countries_of_work']);
189
+ }
190
+ // ensure the json data is an array
191
+ if (!Array.isArray(data['supported_countries_of_residence'])) {
192
+ throw new Error("Expected the field `supported_countries_of_residence` to be an array in the JSON data but got " + data['supported_countries_of_residence']);
193
+ }
194
+ // ensure the json data is an array
195
+ if (!Array.isArray(data['candidate_fields'])) {
196
+ throw new Error("Expected the field `candidate_fields` to be an array in the JSON data but got " + data['candidate_fields']);
197
+ }
198
+ return true;
199
+ }
200
+ }]);
201
+ }();
202
+ V2ProfileDetail.RequiredProperties = ["id", "name", "description", "checks", "total_price", "supported_countries_of_work", "supported_countries_of_residence", "candidate_fields", "created_at", "updated_at"];
203
+
204
+ /**
205
+ * @member {String} id
206
+ */
207
+ V2ProfileDetail.prototype['id'] = undefined;
208
+
209
+ /**
210
+ * @member {String} name
211
+ */
212
+ V2ProfileDetail.prototype['name'] = undefined;
213
+
214
+ /**
215
+ * @member {String} description
216
+ */
217
+ V2ProfileDetail.prototype['description'] = undefined;
218
+
219
+ /**
220
+ * @member {Boolean} is_custom
221
+ */
222
+ V2ProfileDetail.prototype['is_custom'] = undefined;
223
+
224
+ /**
225
+ * @member {Array.<module:model/V2ProfileCheckEntry>} checks
226
+ */
227
+ V2ProfileDetail.prototype['checks'] = undefined;
228
+
229
+ /**
230
+ * @member {module:model/V2Money} total_price
231
+ */
232
+ V2ProfileDetail.prototype['total_price'] = undefined;
233
+
234
+ /**
235
+ * @member {Array.<String>} supported_countries_of_work
236
+ */
237
+ V2ProfileDetail.prototype['supported_countries_of_work'] = undefined;
238
+
239
+ /**
240
+ * @member {Array.<String>} supported_countries_of_residence
241
+ */
242
+ V2ProfileDetail.prototype['supported_countries_of_residence'] = undefined;
243
+
244
+ /**
245
+ * @member {Array.<Object>} candidate_fields
246
+ */
247
+ V2ProfileDetail.prototype['candidate_fields'] = undefined;
248
+
249
+ /**
250
+ * @member {Date} created_at
251
+ */
252
+ V2ProfileDetail.prototype['created_at'] = undefined;
253
+
254
+ /**
255
+ * @member {Date} updated_at
256
+ */
257
+ V2ProfileDetail.prototype['updated_at'] = undefined;
258
+ var _default = exports["default"] = V2ProfileDetail;
@@ -0,0 +1,182 @@
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 V2ProfileListItem model module.
31
+ * @module model/V2ProfileListItem
32
+ * @version 0.0.5
33
+ */
34
+ var V2ProfileListItem = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>V2ProfileListItem</code>.
37
+ * @alias module:model/V2ProfileListItem
38
+ * @param id {String}
39
+ * @param name {String}
40
+ * @param description {String}
41
+ * @param checkTypes {Array.<String>}
42
+ * @param createdAt {Date}
43
+ * @param updatedAt {Date}
44
+ */
45
+ function V2ProfileListItem(id, name, description, checkTypes, createdAt, updatedAt) {
46
+ _classCallCheck(this, V2ProfileListItem);
47
+ V2ProfileListItem.initialize(this, id, name, description, checkTypes, createdAt, updatedAt);
48
+ }
49
+
50
+ /**
51
+ * Initializes the fields of this object.
52
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
53
+ * Only for internal use.
54
+ */
55
+ return _createClass(V2ProfileListItem, null, [{
56
+ key: "initialize",
57
+ value: function initialize(obj, id, name, description, checkTypes, createdAt, updatedAt) {
58
+ obj['id'] = id;
59
+ obj['name'] = name;
60
+ obj['description'] = description;
61
+ obj['check_types'] = checkTypes;
62
+ obj['created_at'] = createdAt;
63
+ obj['updated_at'] = updatedAt;
64
+ }
65
+
66
+ /**
67
+ * Constructs a <code>V2ProfileListItem</code> from a plain JavaScript object, optionally creating a new instance.
68
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
69
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
70
+ * @param {module:model/V2ProfileListItem} obj Optional instance to populate.
71
+ * @return {module:model/V2ProfileListItem} The populated <code>V2ProfileListItem</code> instance.
72
+ */
73
+ }, {
74
+ key: "constructFromObject",
75
+ value: function constructFromObject(data, obj) {
76
+ if (data) {
77
+ obj = obj || new V2ProfileListItem();
78
+ if (data.hasOwnProperty('id')) {
79
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('name')) {
82
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('description')) {
85
+ obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('is_custom')) {
88
+ obj['is_custom'] = _ApiClient["default"].convertToType(data['is_custom'], 'Boolean');
89
+ }
90
+ if (data.hasOwnProperty('check_types')) {
91
+ obj['check_types'] = _ApiClient["default"].convertToType(data['check_types'], ['String']);
92
+ }
93
+ if (data.hasOwnProperty('created_at')) {
94
+ obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Date');
95
+ }
96
+ if (data.hasOwnProperty('updated_at')) {
97
+ obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'Date');
98
+ }
99
+ }
100
+ return obj;
101
+ }
102
+
103
+ /**
104
+ * Validates the JSON data with respect to <code>V2ProfileListItem</code>.
105
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
106
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>V2ProfileListItem</code>.
107
+ */
108
+ }, {
109
+ key: "validateJSON",
110
+ value: function validateJSON(data) {
111
+ // check to make sure all required properties are present in the JSON string
112
+ var _iterator = _createForOfIteratorHelper(V2ProfileListItem.RequiredProperties),
113
+ _step;
114
+ try {
115
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
116
+ var property = _step.value;
117
+ if (!data.hasOwnProperty(property)) {
118
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
119
+ }
120
+ }
121
+ // ensure the json data is a string
122
+ } catch (err) {
123
+ _iterator.e(err);
124
+ } finally {
125
+ _iterator.f();
126
+ }
127
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
128
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
129
+ }
130
+ // ensure the json data is a string
131
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
132
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
133
+ }
134
+ // ensure the json data is a string
135
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
136
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
137
+ }
138
+ // ensure the json data is an array
139
+ if (!Array.isArray(data['check_types'])) {
140
+ throw new Error("Expected the field `check_types` to be an array in the JSON data but got " + data['check_types']);
141
+ }
142
+ return true;
143
+ }
144
+ }]);
145
+ }();
146
+ V2ProfileListItem.RequiredProperties = ["id", "name", "description", "check_types", "created_at", "updated_at"];
147
+
148
+ /**
149
+ * @member {String} id
150
+ */
151
+ V2ProfileListItem.prototype['id'] = undefined;
152
+
153
+ /**
154
+ * @member {String} name
155
+ */
156
+ V2ProfileListItem.prototype['name'] = undefined;
157
+
158
+ /**
159
+ * @member {String} description
160
+ */
161
+ V2ProfileListItem.prototype['description'] = undefined;
162
+
163
+ /**
164
+ * @member {Boolean} is_custom
165
+ */
166
+ V2ProfileListItem.prototype['is_custom'] = undefined;
167
+
168
+ /**
169
+ * @member {Array.<String>} check_types
170
+ */
171
+ V2ProfileListItem.prototype['check_types'] = undefined;
172
+
173
+ /**
174
+ * @member {Date} created_at
175
+ */
176
+ V2ProfileListItem.prototype['created_at'] = undefined;
177
+
178
+ /**
179
+ * @member {Date} updated_at
180
+ */
181
+ V2ProfileListItem.prototype['updated_at'] = undefined;
182
+ var _default = exports["default"] = V2ProfileListItem;