pescheck-client 0.4.2 → 0.5.0

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +54 -45
  3. data/docs/AddOnsApi.md +305 -0
  4. data/docs/AddonPrice.md +20 -0
  5. data/docs/AuthenticationApi.md +1 -71
  6. data/docs/DisabledDivision.md +20 -0
  7. data/docs/OAuthApplication.md +1 -1
  8. data/docs/OAuthApplicationResponse.md +6 -2
  9. data/docs/OrganisationAddon.md +32 -0
  10. data/docs/OrganisationAddonUpdate.md +18 -0
  11. data/docs/OrganisationAddonUpdateResult.md +34 -0
  12. data/docs/PatchedOrganisationAddonUpdate.md +18 -0
  13. data/docs/ScreeningsApi.md +72 -0
  14. data/docs/V2Candidate.md +1 -1
  15. data/docs/V2CheckField.md +1 -1
  16. data/docs/V2Document.md +1 -1
  17. data/docs/V2ProfileCheck.md +1 -1
  18. data/docs/V2ProfileCheckEntry.md +1 -1
  19. data/docs/V2ProfileDetail.md +4 -0
  20. data/docs/V2ProfileUpdateCheck.md +1 -1
  21. data/docs/V2ScreeningCheck.md +1 -1
  22. data/docs/V2ScreeningCheckEntry.md +1 -1
  23. data/docs/V2ScreeningCheckListItem.md +1 -1
  24. data/docs/V2ScreeningCreate.md +5 -1
  25. data/docs/V2ScreeningDetail.md +5 -1
  26. data/docs/{V2ScreeningDetailProfile.md → V2ScreeningDetailOrganisation.md} +2 -2
  27. data/docs/V2ScreeningListItem.md +3 -1
  28. data/docs/V2ScreeningNote.md +24 -0
  29. data/docs/V2ScreeningNoteInput.md +22 -0
  30. data/docs/WebhooksApi.md +1 -1
  31. data/lib/pescheck-client/api/add_ons_api.rb +305 -0
  32. data/lib/pescheck-client/api/authentication_api.rb +2 -68
  33. data/lib/pescheck-client/api/profiles_api.rb +1 -1
  34. data/lib/pescheck-client/api/screenings_api.rb +66 -0
  35. data/lib/pescheck-client/api/webhooks_api.rb +2 -2
  36. data/lib/pescheck-client/configuration.rb +8 -0
  37. data/lib/pescheck-client/models/addon_price.rb +202 -0
  38. data/lib/pescheck-client/models/{custom_token_obtain_pair.rb → disabled_division.rb} +34 -35
  39. data/lib/pescheck-client/models/o_auth_application.rb +3 -3
  40. data/lib/pescheck-client/models/o_auth_application_response.rb +70 -44
  41. data/lib/pescheck-client/models/organisation_addon.rb +339 -0
  42. data/lib/pescheck-client/models/organisation_addon_update.rb +165 -0
  43. data/lib/pescheck-client/models/organisation_addon_update_result.rb +368 -0
  44. data/lib/pescheck-client/models/patched_organisation_addon_update.rb +148 -0
  45. data/lib/pescheck-client/models/v2_candidate.rb +1 -35
  46. data/lib/pescheck-client/models/v2_check_field.rb +2 -2
  47. data/lib/pescheck-client/models/v2_document.rb +6 -30
  48. data/lib/pescheck-client/models/v2_profile_check.rb +3 -3
  49. data/lib/pescheck-client/models/v2_profile_check_entry.rb +6 -30
  50. data/lib/pescheck-client/models/v2_profile_detail.rb +55 -1
  51. data/lib/pescheck-client/models/v2_profile_update_check.rb +3 -3
  52. data/lib/pescheck-client/models/v2_screening_check.rb +3 -3
  53. data/lib/pescheck-client/models/v2_screening_check_entry.rb +6 -30
  54. data/lib/pescheck-client/models/v2_screening_check_list_item.rb +6 -30
  55. data/lib/pescheck-client/models/v2_screening_create.rb +25 -4
  56. data/lib/pescheck-client/models/v2_screening_detail.rb +42 -2
  57. data/lib/pescheck-client/models/{v2_screening_detail_profile.rb → v2_screening_detail_organisation.rb} +4 -3
  58. data/lib/pescheck-client/models/v2_screening_list_item.rb +14 -2
  59. data/lib/pescheck-client/models/v2_screening_note.rb +229 -0
  60. data/lib/pescheck-client/models/v2_screening_note_input.rb +220 -0
  61. data/lib/pescheck-client/models/webhook_response.rb +5 -5
  62. data/lib/pescheck-client/version.rb +1 -1
  63. data/lib/pescheck-client.rb +10 -2
  64. data/spec/api/add_ons_api_spec.rb +84 -0
  65. data/spec/api/authentication_api_spec.rb +1 -12
  66. data/spec/api/screenings_api_spec.rb +13 -0
  67. data/spec/api/webhooks_api_spec.rb +1 -1
  68. data/spec/models/{custom_token_obtain_pair_spec.rb → addon_price_spec.rb} +8 -8
  69. data/spec/models/disabled_division_spec.rb +42 -0
  70. data/spec/models/o_auth_application_response_spec.rb +12 -8
  71. data/spec/models/o_auth_application_spec.rb +1 -1
  72. data/spec/models/organisation_addon_spec.rb +78 -0
  73. data/spec/models/organisation_addon_update_result_spec.rb +84 -0
  74. data/spec/models/organisation_addon_update_spec.rb +36 -0
  75. data/spec/models/patched_organisation_addon_update_spec.rb +36 -0
  76. data/spec/models/v2_candidate_spec.rb +0 -4
  77. data/spec/models/v2_document_spec.rb +0 -4
  78. data/spec/models/v2_profile_check_entry_spec.rb +0 -4
  79. data/spec/models/v2_profile_check_spec.rb +1 -1
  80. data/spec/models/v2_profile_detail_spec.rb +12 -0
  81. data/spec/models/v2_profile_update_check_spec.rb +1 -1
  82. data/spec/models/v2_screening_check_entry_spec.rb +0 -4
  83. data/spec/models/v2_screening_check_list_item_spec.rb +0 -4
  84. data/spec/models/v2_screening_check_spec.rb +1 -1
  85. data/spec/models/v2_screening_create_spec.rb +12 -0
  86. data/spec/models/{v2_screening_detail_profile_spec.rb → v2_screening_detail_organisation_spec.rb} +6 -6
  87. data/spec/models/v2_screening_detail_spec.rb +12 -0
  88. data/spec/models/v2_screening_list_item_spec.rb +6 -0
  89. data/spec/models/v2_screening_note_input_spec.rb +52 -0
  90. data/spec/models/v2_screening_note_spec.rb +54 -0
  91. metadata +71 -39
  92. data/docs/CustomTokenObtainPair.md +0 -20
@@ -0,0 +1,368 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #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.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pescheck
17
+ # One add-on for one organisation, built from ``addon_service.addon_cards``.
18
+ class OrganisationAddonUpdateResult < ApiModelBase
19
+ # Add-on identifier, used in the URL. * `branded_journey` - Branded Journey * `sso` - Single Sign-On (SSO) * `api_access` - API & MCP Access * `connected_ats` - Connected ATS - Click & Go Known values: branded_journey, sso, api_access, connected_ats. New values may be added; handle unknown values.
20
+ attr_accessor :addon
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :description
25
+
26
+ # Switched on (and billed) for this organisation.
27
+ attr_accessor :enabled
28
+
29
+ # Usable right now. A division also needs the add-on on its parent organisation.
30
+ attr_accessor :active
31
+
32
+ # Only the missing add-on on the parent organisation stands in the way.
33
+ attr_accessor :blocked_by_parent
34
+
35
+ # What this organisation pays per month; the division price for a division. Null when unpriced.
36
+ attr_accessor :monthly_price
37
+
38
+ # The price is a starting price (\"from\").
39
+ attr_accessor :price_is_indicative
40
+
41
+ # Divisions that were switched off too, because the add-on was switched off on their parent.
42
+ attr_accessor :disabled_divisions
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'addon' => :'addon',
48
+ :'name' => :'name',
49
+ :'description' => :'description',
50
+ :'enabled' => :'enabled',
51
+ :'active' => :'active',
52
+ :'blocked_by_parent' => :'blocked_by_parent',
53
+ :'monthly_price' => :'monthly_price',
54
+ :'price_is_indicative' => :'price_is_indicative',
55
+ :'disabled_divisions' => :'disabled_divisions'
56
+ }
57
+ end
58
+
59
+ # Returns attribute mapping this model knows about
60
+ def self.acceptable_attribute_map
61
+ attribute_map
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ acceptable_attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'addon' => :'String',
73
+ :'name' => :'String',
74
+ :'description' => :'String',
75
+ :'enabled' => :'Boolean',
76
+ :'active' => :'Boolean',
77
+ :'blocked_by_parent' => :'Boolean',
78
+ :'monthly_price' => :'AddonPrice',
79
+ :'price_is_indicative' => :'Boolean',
80
+ :'disabled_divisions' => :'Array<DisabledDivision>'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ :'monthly_price',
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::OrganisationAddonUpdateResult` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ acceptable_attribute_map = self.class.acceptable_attribute_map
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!acceptable_attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::OrganisationAddonUpdateResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'addon')
108
+ self.addon = attributes[:'addon']
109
+ else
110
+ self.addon = nil
111
+ end
112
+
113
+ if attributes.key?(:'name')
114
+ self.name = attributes[:'name']
115
+ else
116
+ self.name = nil
117
+ end
118
+
119
+ if attributes.key?(:'description')
120
+ self.description = attributes[:'description']
121
+ else
122
+ self.description = nil
123
+ end
124
+
125
+ if attributes.key?(:'enabled')
126
+ self.enabled = attributes[:'enabled']
127
+ else
128
+ self.enabled = nil
129
+ end
130
+
131
+ if attributes.key?(:'active')
132
+ self.active = attributes[:'active']
133
+ else
134
+ self.active = nil
135
+ end
136
+
137
+ if attributes.key?(:'blocked_by_parent')
138
+ self.blocked_by_parent = attributes[:'blocked_by_parent']
139
+ else
140
+ self.blocked_by_parent = nil
141
+ end
142
+
143
+ if attributes.key?(:'monthly_price')
144
+ self.monthly_price = attributes[:'monthly_price']
145
+ else
146
+ self.monthly_price = nil
147
+ end
148
+
149
+ if attributes.key?(:'price_is_indicative')
150
+ self.price_is_indicative = attributes[:'price_is_indicative']
151
+ else
152
+ self.price_is_indicative = nil
153
+ end
154
+
155
+ if attributes.key?(:'disabled_divisions')
156
+ if (value = attributes[:'disabled_divisions']).is_a?(Array)
157
+ self.disabled_divisions = value
158
+ end
159
+ else
160
+ self.disabled_divisions = nil
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
168
+ invalid_properties = Array.new
169
+ if @addon.nil?
170
+ invalid_properties.push('invalid value for "addon", addon cannot be nil.')
171
+ end
172
+
173
+ if @name.nil?
174
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
175
+ end
176
+
177
+ if @description.nil?
178
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
179
+ end
180
+
181
+ if @enabled.nil?
182
+ invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
183
+ end
184
+
185
+ if @active.nil?
186
+ invalid_properties.push('invalid value for "active", active cannot be nil.')
187
+ end
188
+
189
+ if @blocked_by_parent.nil?
190
+ invalid_properties.push('invalid value for "blocked_by_parent", blocked_by_parent cannot be nil.')
191
+ end
192
+
193
+ if @price_is_indicative.nil?
194
+ invalid_properties.push('invalid value for "price_is_indicative", price_is_indicative cannot be nil.')
195
+ end
196
+
197
+ if @disabled_divisions.nil?
198
+ invalid_properties.push('invalid value for "disabled_divisions", disabled_divisions cannot be nil.')
199
+ end
200
+
201
+ invalid_properties
202
+ end
203
+
204
+ # Check to see if the all the properties in the model are valid
205
+ # @return true if the model is valid
206
+ def valid?
207
+ warn '[DEPRECATED] the `valid?` method is obsolete'
208
+ return false if @addon.nil?
209
+ return false if @name.nil?
210
+ return false if @description.nil?
211
+ return false if @enabled.nil?
212
+ return false if @active.nil?
213
+ return false if @blocked_by_parent.nil?
214
+ return false if @price_is_indicative.nil?
215
+ return false if @disabled_divisions.nil?
216
+ true
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] addon Value to be assigned
221
+ def addon=(addon)
222
+ if addon.nil?
223
+ fail ArgumentError, 'addon cannot be nil'
224
+ end
225
+
226
+ @addon = addon
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] name Value to be assigned
231
+ def name=(name)
232
+ if name.nil?
233
+ fail ArgumentError, 'name cannot be nil'
234
+ end
235
+
236
+ @name = name
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] description Value to be assigned
241
+ def description=(description)
242
+ if description.nil?
243
+ fail ArgumentError, 'description cannot be nil'
244
+ end
245
+
246
+ @description = description
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] enabled Value to be assigned
251
+ def enabled=(enabled)
252
+ if enabled.nil?
253
+ fail ArgumentError, 'enabled cannot be nil'
254
+ end
255
+
256
+ @enabled = enabled
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] active Value to be assigned
261
+ def active=(active)
262
+ if active.nil?
263
+ fail ArgumentError, 'active cannot be nil'
264
+ end
265
+
266
+ @active = active
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] blocked_by_parent Value to be assigned
271
+ def blocked_by_parent=(blocked_by_parent)
272
+ if blocked_by_parent.nil?
273
+ fail ArgumentError, 'blocked_by_parent cannot be nil'
274
+ end
275
+
276
+ @blocked_by_parent = blocked_by_parent
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] price_is_indicative Value to be assigned
281
+ def price_is_indicative=(price_is_indicative)
282
+ if price_is_indicative.nil?
283
+ fail ArgumentError, 'price_is_indicative cannot be nil'
284
+ end
285
+
286
+ @price_is_indicative = price_is_indicative
287
+ end
288
+
289
+ # Custom attribute writer method with validation
290
+ # @param [Object] disabled_divisions Value to be assigned
291
+ def disabled_divisions=(disabled_divisions)
292
+ if disabled_divisions.nil?
293
+ fail ArgumentError, 'disabled_divisions cannot be nil'
294
+ end
295
+
296
+ @disabled_divisions = disabled_divisions
297
+ end
298
+
299
+ # Checks equality by comparing each attribute.
300
+ # @param [Object] Object to be compared
301
+ def ==(o)
302
+ return true if self.equal?(o)
303
+ self.class == o.class &&
304
+ addon == o.addon &&
305
+ name == o.name &&
306
+ description == o.description &&
307
+ enabled == o.enabled &&
308
+ active == o.active &&
309
+ blocked_by_parent == o.blocked_by_parent &&
310
+ monthly_price == o.monthly_price &&
311
+ price_is_indicative == o.price_is_indicative &&
312
+ disabled_divisions == o.disabled_divisions
313
+ end
314
+
315
+ # @see the `==` method
316
+ # @param [Object] Object to be compared
317
+ def eql?(o)
318
+ self == o
319
+ end
320
+
321
+ # Calculates hash code according to all attributes.
322
+ # @return [Integer] Hash code
323
+ def hash
324
+ [addon, name, description, enabled, active, blocked_by_parent, monthly_price, price_is_indicative, disabled_divisions].hash
325
+ end
326
+
327
+ # Builds the object from hash
328
+ # @param [Hash] attributes Model attributes in the form of hash
329
+ # @return [Object] Returns the model itself
330
+ def self.build_from_hash(attributes)
331
+ return nil unless attributes.is_a?(Hash)
332
+ attributes = attributes.transform_keys(&:to_sym)
333
+ transformed_hash = {}
334
+ openapi_types.each_pair do |key, type|
335
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
336
+ transformed_hash["#{key}"] = nil
337
+ elsif type =~ /\AArray<(.*)>/i
338
+ # check to ensure the input is an array given that the attribute
339
+ # is documented as an array but the input is not
340
+ if attributes[attribute_map[key]].is_a?(Array)
341
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
342
+ end
343
+ elsif !attributes[attribute_map[key]].nil?
344
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
345
+ end
346
+ end
347
+ new(transformed_hash)
348
+ end
349
+
350
+ # Returns the object in the form of hash
351
+ # @return [Hash] Returns the object in the form of hash
352
+ def to_hash
353
+ hash = {}
354
+ self.class.attribute_map.each_pair do |attr, param|
355
+ value = self.send(attr)
356
+ if value.nil?
357
+ is_nullable = self.class.openapi_nullable.include?(attr)
358
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
359
+ end
360
+
361
+ hash[param] = _to_hash(value)
362
+ end
363
+ hash
364
+ end
365
+
366
+ end
367
+
368
+ end
@@ -0,0 +1,148 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #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.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pescheck
17
+ class PatchedOrganisationAddonUpdate < ApiModelBase
18
+ # Switch the add-on on (billed monthly from today) or off (billing stops at the end of the month).
19
+ attr_accessor :enabled
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'enabled' => :'enabled'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'enabled' => :'Boolean'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::PatchedOrganisationAddonUpdate` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::PatchedOrganisationAddonUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'enabled')
68
+ self.enabled = attributes[:'enabled']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ enabled == o.enabled
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [enabled].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Returns the object in the form of hash
131
+ # @return [Hash] Returns the object in the form of hash
132
+ def to_hash
133
+ hash = {}
134
+ self.class.attribute_map.each_pair do |attr, param|
135
+ value = self.send(attr)
136
+ if value.nil?
137
+ is_nullable = self.class.openapi_nullable.include?(attr)
138
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
139
+ end
140
+
141
+ hash[param] = _to_hash(value)
142
+ end
143
+ hash
144
+ end
145
+
146
+ end
147
+
148
+ end
@@ -28,7 +28,7 @@ module Pescheck
28
28
 
29
29
  attr_accessor :gender
30
30
 
31
- # ISO 3166-1 alpha-2 country code (e.g. \"NL\", \"DE\", \"US\"). * `AD` - AD * `AE` - AE * `AF` - AF * `AG` - AG * `AI` - AI * `AL` - AL * `AM` - AM * `AN` - AN * `AO` - AO * `AQ` - AQ * `AR` - AR * `AS` - AS * `AT` - AT * `AU` - AU * `AW` - AW * `AX` - AX * `AZ` - AZ * `BA` - BA * `BB` - BB * `BD` - BD * `BE` - BE * `BF` - BF * `BG` - BG * `BH` - BH * `BI` - BI * `BJ` - BJ * `BL` - BL * `BM` - BM * `BN` - BN * `BO` - BO * `BR` - BR * `BS` - BS * `BT` - BT * `BV` - BV * `BW` - BW * `BY` - BY * `BZ` - BZ * `CA` - CA * `CC` - CC * `CD` - CD * `CF` - CF * `CG` - CG * `CH` - CH * `CI` - CI * `CK` - CK * `CL` - CL * `CM` - CM * `CN` - CN * `CO` - CO * `CR` - CR * `CU` - CU * `CV` - CV * `CW` - CW * `CX` - CX * `CY` - CY * `CZ` - CZ * `DE` - DE * `DJ` - DJ * `DK` - DK * `DM` - DM * `DO` - DO * `DZ` - DZ * `EC` - EC * `EE` - EE * `EG` - EG * `EH` - EH * `ER` - ER * `ES` - ES * `ET` - ET * `FI` - FI * `FJ` - FJ * `FK` - FK * `FM` - FM * `FO` - FO * `FR` - FR * `GA` - GA * `GB` - GB * `GD` - GD * `GE` - GE * `GF` - GF * `GG` - GG * `GH` - GH * `GI` - GI * `GL` - GL * `GM` - GM * `GN` - GN * `GP` - GP * `GQ` - GQ * `GR` - GR * `GS` - GS * `GT` - GT * `GU` - GU * `GW` - GW * `GY` - GY * `HK` - HK * `HM` - HM * `HN` - HN * `HR` - HR * `HT` - HT * `HU` - HU * `ID` - ID * `IE` - IE * `IL` - IL * `IM` - IM * `IN` - IN * `IO` - IO * `IQ` - IQ * `IR` - IR * `IS` - IS * `IT` - IT * `JE` - JE * `JM` - JM * `JO` - JO * `JP` - JP * `KE` - KE * `KG` - KG * `KH` - KH * `KI` - KI * `KM` - KM * `KN` - KN * `KP` - KP * `KR` - KR * `KW` - KW * `KY` - KY * `KZ` - KZ * `LA` - LA * `LB` - LB * `LC` - LC * `LI` - LI * `LK` - LK * `LR` - LR * `LS` - LS * `LT` - LT * `LU` - LU * `LV` - LV * `LY` - LY * `MA` - MA * `MC` - MC * `MD` - MD * `ME` - ME * `MG` - MG * `MH` - MH * `MK` - MK * `ML` - ML * `MM` - MM * `MN` - MN * `MO` - MO * `MP` - MP * `MQ` - MQ * `MR` - MR * `MS` - MS * `MT` - MT * `MU` - MU * `MV` - MV * `MW` - MW * `MX` - MX * `MY` - MY * `MZ` - MZ * `NA` - NA * `NC` - NC * `NE` - NE * `NF` - NF * `NG` - NG * `NI` - NI * `NL` - NL * `NO` - NO * `NP` - NP * `NR` - NR * `NU` - NU * `NZ` - NZ * `OM` - OM * `PA` - PA * `PE` - PE * `PF` - PF * `PG` - PG * `PH` - PH * `PK` - PK * `PL` - PL * `PM` - PM * `PN` - PN * `PR` - PR * `PS` - PS * `PT` - PT * `PW` - PW * `PY` - PY * `QA` - QA * `RE` - RE * `RO` - RO * `RS` - RS * `RU` - RU * `RW` - RW * `SA` - SA * `SB` - SB * `SC` - SC * `SD` - SD * `SE` - SE * `SG` - SG * `SH` - SH * `SI` - SI * `SJ` - SJ * `SK` - SK * `SL` - SL * `SM` - SM * `SN` - SN * `SO` - SO * `SR` - SR * `ST` - ST * `SV` - SV * `SY` - SY * `SZ` - SZ * `TC` - TC * `TD` - TD * `TF` - TF * `TG` - TG * `TH` - TH * `TJ` - TJ * `TK` - TK * `TL` - TL * `TM` - TM * `TN` - TN * `TO` - TO * `TR` - TR * `TT` - TT * `TV` - TV * `TW` - TW * `TZ` - TZ * `UA` - UA * `UG` - UG * `UM` - UM * `US` - US * `UY` - UY * `UZ` - UZ * `VA` - VA * `VC` - VC * `VE` - VE * `VG` - VG * `VI` - VI * `VN` - VN * `VU` - VU * `WF` - WF * `WS` - WS * `XK` - XK * `YE` - YE * `YT` - YT * `ZA` - ZA * `ZM` - ZM * `ZW` - ZW
31
+ # ISO 3166-1 alpha-2 country code (e.g. \"NL\", \"DE\", \"US\"). * `AD` - AD * `AE` - AE * `AF` - AF * `AG` - AG * `AI` - AI * `AL` - AL * `AM` - AM * `AO` - AO * `AQ` - AQ * `AR` - AR * `AS` - AS * `AT` - AT * `AU` - AU * `AW` - AW * `AX` - AX * `AZ` - AZ * `BA` - BA * `BB` - BB * `BD` - BD * `BE` - BE * `BF` - BF * `BG` - BG * `BH` - BH * `BI` - BI * `BJ` - BJ * `BL` - BL * `BM` - BM * `BN` - BN * `BO` - BO * `BQ` - BQ * `BR` - BR * `BS` - BS * `BT` - BT * `BV` - BV * `BW` - BW * `BY` - BY * `BZ` - BZ * `CA` - CA * `CC` - CC * `CD` - CD * `CF` - CF * `CG` - CG * `CH` - CH * `CI` - CI * `CK` - CK * `CL` - CL * `CM` - CM * `CN` - CN * `CO` - CO * `CR` - CR * `CU` - CU * `CV` - CV * `CW` - CW * `CX` - CX * `CY` - CY * `CZ` - CZ * `DE` - DE * `DJ` - DJ * `DK` - DK * `DM` - DM * `DO` - DO * `DZ` - DZ * `EC` - EC * `EE` - EE * `EG` - EG * `EH` - EH * `ER` - ER * `ES` - ES * `ET` - ET * `FI` - FI * `FJ` - FJ * `FK` - FK * `FM` - FM * `FO` - FO * `FR` - FR * `GA` - GA * `GB` - GB * `GD` - GD * `GE` - GE * `GF` - GF * `GG` - GG * `GH` - GH * `GI` - GI * `GL` - GL * `GM` - GM * `GN` - GN * `GP` - GP * `GQ` - GQ * `GR` - GR * `GS` - GS * `GT` - GT * `GU` - GU * `GW` - GW * `GY` - GY * `HK` - HK * `HM` - HM * `HN` - HN * `HR` - HR * `HT` - HT * `HU` - HU * `ID` - ID * `IE` - IE * `IL` - IL * `IM` - IM * `IN` - IN * `IO` - IO * `IQ` - IQ * `IR` - IR * `IS` - IS * `IT` - IT * `JE` - JE * `JM` - JM * `JO` - JO * `JP` - JP * `KE` - KE * `KG` - KG * `KH` - KH * `KI` - KI * `KM` - KM * `KN` - KN * `KP` - KP * `KR` - KR * `KW` - KW * `KY` - KY * `KZ` - KZ * `LA` - LA * `LB` - LB * `LC` - LC * `LI` - LI * `LK` - LK * `LR` - LR * `LS` - LS * `LT` - LT * `LU` - LU * `LV` - LV * `LY` - LY * `MA` - MA * `MC` - MC * `MD` - MD * `ME` - ME * `MF` - MF * `MG` - MG * `MH` - MH * `MK` - MK * `ML` - ML * `MM` - MM * `MN` - MN * `MO` - MO * `MP` - MP * `MQ` - MQ * `MR` - MR * `MS` - MS * `MT` - MT * `MU` - MU * `MV` - MV * `MW` - MW * `MX` - MX * `MY` - MY * `MZ` - MZ * `NA` - NA * `NC` - NC * `NE` - NE * `NF` - NF * `NG` - NG * `NI` - NI * `NL` - NL * `NO` - NO * `NP` - NP * `NR` - NR * `NU` - NU * `NZ` - NZ * `OM` - OM * `PA` - PA * `PE` - PE * `PF` - PF * `PG` - PG * `PH` - PH * `PK` - PK * `PL` - PL * `PM` - PM * `PN` - PN * `PR` - PR * `PS` - PS * `PT` - PT * `PW` - PW * `PY` - PY * `QA` - QA * `RE` - RE * `RO` - RO * `RS` - RS * `RU` - RU * `RW` - RW * `SA` - SA * `SB` - SB * `SC` - SC * `SD` - SD * `SE` - SE * `SG` - SG * `SH` - SH * `SI` - SI * `SJ` - SJ * `SK` - SK * `SL` - SL * `SM` - SM * `SN` - SN * `SO` - SO * `SR` - SR * `SS` - SS * `ST` - ST * `SV` - SV * `SX` - SX * `SY` - SY * `SZ` - SZ * `TC` - TC * `TD` - TD * `TF` - TF * `TG` - TG * `TH` - TH * `TJ` - TJ * `TK` - TK * `TL` - TL * `TM` - TM * `TN` - TN * `TO` - TO * `TR` - TR * `TT` - TT * `TV` - TV * `TW` - TW * `TZ` - TZ * `UA` - UA * `UG` - UG * `UM` - UM * `US` - US * `UY` - UY * `UZ` - UZ * `VA` - VA * `VC` - VC * `VE` - VE * `VG` - VG * `VI` - VI * `VN` - VN * `VU` - VU * `WF` - WF * `WS` - WS * `XK` - XK * `YE` - YE * `YT` - YT * `ZA` - ZA * `ZM` - ZM * `ZW` - ZW Known values: AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW, . New values may be added; handle unknown values.
32
32
  attr_accessor :nationality
33
33
 
34
34
  attr_accessor :postal_code
@@ -37,28 +37,6 @@ module Pescheck
37
37
 
38
38
  attr_accessor :extension
39
39
 
40
- class EnumAttributeValidator
41
- attr_reader :datatype
42
- attr_reader :allowable_values
43
-
44
- def initialize(datatype, allowable_values)
45
- @allowable_values = allowable_values.map do |value|
46
- case datatype.to_s
47
- when /Integer/i
48
- value.to_i
49
- when /Float/i
50
- value.to_f
51
- else
52
- value
53
- end
54
- end
55
- end
56
-
57
- def valid?(value)
58
- !value || allowable_values.include?(value)
59
- end
60
- end
61
-
62
40
  # Attribute mapping from ruby-style variable name to JSON key.
63
41
  def self.attribute_map
64
42
  {
@@ -220,8 +198,6 @@ module Pescheck
220
198
  return false if @last_name.to_s.length > 255
221
199
  return false if @email.nil?
222
200
  return false if !@date_of_birth.nil? && @date_of_birth.to_s.length > 10
223
- nationality_validator = EnumAttributeValidator.new('String', ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", ""])
224
- return false unless nationality_validator.valid?(@nationality)
225
201
  return false if !@postal_code.nil? && @postal_code.to_s.length > 255
226
202
  return false if !@house_number.nil? && @house_number.to_s.length > 50
227
203
  true
@@ -279,16 +255,6 @@ module Pescheck
279
255
  @date_of_birth = date_of_birth
280
256
  end
281
257
 
282
- # Custom attribute writer method checking allowed values (enum).
283
- # @param [Object] nationality Object to be assigned
284
- def nationality=(nationality)
285
- validator = EnumAttributeValidator.new('String', ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", ""])
286
- unless validator.valid?(nationality)
287
- fail ArgumentError, "invalid value for \"nationality\", must be one of #{validator.allowable_values}."
288
- end
289
- @nationality = nationality
290
- end
291
-
292
258
  # Custom attribute writer method with validation
293
259
  # @param [Object] postal_code Value to be assigned
294
260
  def postal_code=(postal_code)
@@ -24,7 +24,7 @@ module Pescheck
24
24
  # Whether the request body must include this field.
25
25
  attr_accessor :required
26
26
 
27
- # Allowed values, or null if the field isn't constrained to a set.
27
+ # Allowed values, or null if the field isn't constrained to a set. Each choice has \"value\" (what to send), \"label\" (human-readable), and possibly check-specific extras such as \"description\".
28
28
  attr_accessor :choices
29
29
 
30
30
  attr_accessor :help_text
@@ -56,7 +56,7 @@ module Pescheck
56
56
  :'name' => :'String',
57
57
  :'type' => :'String',
58
58
  :'required' => :'Boolean',
59
- :'choices' => :'Array<String>',
59
+ :'choices' => :'Array<Hash<String, Object>>',
60
60
  :'help_text' => :'String'
61
61
  }
62
62
  end