pescheck 0.0.1

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 (143) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +193 -0
  4. data/Rakefile +10 -0
  5. data/docs/AuthenticationApi.md +217 -0
  6. data/docs/ChecksApi.md +147 -0
  7. data/docs/CustomTokenObtainPair.md +20 -0
  8. data/docs/DivisionReadOnly.md +46 -0
  9. data/docs/DivisionWrite.md +40 -0
  10. data/docs/DivisionsApi.md +369 -0
  11. data/docs/JWTGeneration.md +24 -0
  12. data/docs/JWTResponse.md +28 -0
  13. data/docs/OAuthApi.md +213 -0
  14. data/docs/OAuthApplication.md +26 -0
  15. data/docs/OAuthApplicationResponse.md +32 -0
  16. data/docs/PaginatedDivisionReadOnlyList.md +24 -0
  17. data/docs/PaginatedV2ProfileListItemList.md +24 -0
  18. data/docs/PaginatedV2ScreeningListItemList.md +24 -0
  19. data/docs/PatchedDivisionWrite.md +40 -0
  20. data/docs/PatchedV2ProfilePartialUpdate.md +20 -0
  21. data/docs/ProfilesApi.md +438 -0
  22. data/docs/ScreeningsApi.md +293 -0
  23. data/docs/TokenRefresh.md +20 -0
  24. data/docs/V2Candidate.md +36 -0
  25. data/docs/V2CheckField.md +26 -0
  26. data/docs/V2CheckInfo.md +40 -0
  27. data/docs/V2Document.md +28 -0
  28. data/docs/V2DocumentContent.md +20 -0
  29. data/docs/V2Money.md +20 -0
  30. data/docs/V2ProfileCheck.md +20 -0
  31. data/docs/V2ProfileCheckEntry.md +30 -0
  32. data/docs/V2ProfileCreate.md +22 -0
  33. data/docs/V2ProfileDetail.md +38 -0
  34. data/docs/V2ProfileListItem.md +30 -0
  35. data/docs/V2ProfileUpdate.md +22 -0
  36. data/docs/V2ProfileUpdateCheck.md +22 -0
  37. data/docs/V2ScreeningCheck.md +24 -0
  38. data/docs/V2ScreeningCheckEntry.md +34 -0
  39. data/docs/V2ScreeningCheckListItem.md +22 -0
  40. data/docs/V2ScreeningCreate.md +22 -0
  41. data/docs/V2ScreeningDetail.md +34 -0
  42. data/docs/V2ScreeningDetailProfile.md +20 -0
  43. data/docs/V2ScreeningListItem.md +34 -0
  44. data/docs/VerifyWebhook.md +18 -0
  45. data/docs/Webhook.md +26 -0
  46. data/docs/WebhookResponse.md +36 -0
  47. data/docs/WebhooksApi.md +290 -0
  48. data/git_push.sh +57 -0
  49. data/lib/pescheck/api/authentication_api.rb +220 -0
  50. data/lib/pescheck/api/checks_api.rb +144 -0
  51. data/lib/pescheck/api/divisions_api.rb +365 -0
  52. data/lib/pescheck/api/o_auth_api.rb +202 -0
  53. data/lib/pescheck/api/profiles_api.rb +432 -0
  54. data/lib/pescheck/api/screenings_api.rb +288 -0
  55. data/lib/pescheck/api/webhooks_api.rb +278 -0
  56. data/lib/pescheck/api_client.rb +441 -0
  57. data/lib/pescheck/api_error.rb +58 -0
  58. data/lib/pescheck/api_model_base.rb +88 -0
  59. data/lib/pescheck/configuration.rb +429 -0
  60. data/lib/pescheck/models/custom_token_obtain_pair.rb +191 -0
  61. data/lib/pescheck/models/division_read_only.rb +469 -0
  62. data/lib/pescheck/models/division_write.rb +436 -0
  63. data/lib/pescheck/models/jwt_generation.rb +213 -0
  64. data/lib/pescheck/models/jwt_response.rb +285 -0
  65. data/lib/pescheck/models/o_auth_application.rb +265 -0
  66. data/lib/pescheck/models/o_auth_application_response.rb +379 -0
  67. data/lib/pescheck/models/paginated_division_read_only_list.rb +216 -0
  68. data/lib/pescheck/models/paginated_v2_profile_list_item_list.rb +216 -0
  69. data/lib/pescheck/models/paginated_v2_screening_list_item_list.rb +216 -0
  70. data/lib/pescheck/models/patched_division_write.rb +360 -0
  71. data/lib/pescheck/models/patched_v2_profile_partial_update.rb +176 -0
  72. data/lib/pescheck/models/token_refresh.rb +173 -0
  73. data/lib/pescheck/models/v2_candidate.rb +390 -0
  74. data/lib/pescheck/models/v2_check_field.rb +246 -0
  75. data/lib/pescheck/models/v2_check_info.rb +438 -0
  76. data/lib/pescheck/models/v2_document.rb +308 -0
  77. data/lib/pescheck/models/v2_document_content.rb +175 -0
  78. data/lib/pescheck/models/v2_money.rb +210 -0
  79. data/lib/pescheck/models/v2_profile_check.rb +201 -0
  80. data/lib/pescheck/models/v2_profile_check_entry.rb +349 -0
  81. data/lib/pescheck/models/v2_profile_create.rb +212 -0
  82. data/lib/pescheck/models/v2_profile_detail.rb +401 -0
  83. data/lib/pescheck/models/v2_profile_list_item.rb +291 -0
  84. data/lib/pescheck/models/v2_profile_update.rb +213 -0
  85. data/lib/pescheck/models/v2_profile_update_check.rb +210 -0
  86. data/lib/pescheck/models/v2_screening_check.rb +221 -0
  87. data/lib/pescheck/models/v2_screening_check_entry.rb +376 -0
  88. data/lib/pescheck/models/v2_screening_check_list_item.rb +242 -0
  89. data/lib/pescheck/models/v2_screening_create.rb +201 -0
  90. data/lib/pescheck/models/v2_screening_detail.rb +348 -0
  91. data/lib/pescheck/models/v2_screening_detail_profile.rb +156 -0
  92. data/lib/pescheck/models/v2_screening_list_item.rb +330 -0
  93. data/lib/pescheck/models/verify_webhook.rb +166 -0
  94. data/lib/pescheck/models/webhook.rb +265 -0
  95. data/lib/pescheck/models/webhook_response.rb +353 -0
  96. data/lib/pescheck/version.rb +15 -0
  97. data/lib/pescheck.rb +83 -0
  98. data/pescheck.gemspec +41 -0
  99. data/spec/api/authentication_api_spec.rb +68 -0
  100. data/spec/api/checks_api_spec.rb +56 -0
  101. data/spec/api/divisions_api_spec.rb +94 -0
  102. data/spec/api/o_auth_api_spec.rb +67 -0
  103. data/spec/api/profiles_api_spec.rb +105 -0
  104. data/spec/api/screenings_api_spec.rb +81 -0
  105. data/spec/api/webhooks_api_spec.rb +81 -0
  106. data/spec/models/custom_token_obtain_pair_spec.rb +42 -0
  107. data/spec/models/division_read_only_spec.rb +120 -0
  108. data/spec/models/division_write_spec.rb +102 -0
  109. data/spec/models/jwt_generation_spec.rb +54 -0
  110. data/spec/models/jwt_response_spec.rb +66 -0
  111. data/spec/models/o_auth_application_response_spec.rb +86 -0
  112. data/spec/models/o_auth_application_spec.rb +68 -0
  113. data/spec/models/paginated_division_read_only_list_spec.rb +54 -0
  114. data/spec/models/paginated_v2_profile_list_item_list_spec.rb +54 -0
  115. data/spec/models/paginated_v2_screening_list_item_list_spec.rb +54 -0
  116. data/spec/models/patched_division_write_spec.rb +102 -0
  117. data/spec/models/patched_v2_profile_partial_update_spec.rb +42 -0
  118. data/spec/models/token_refresh_spec.rb +42 -0
  119. data/spec/models/v2_candidate_spec.rb +94 -0
  120. data/spec/models/v2_check_field_spec.rb +60 -0
  121. data/spec/models/v2_check_info_spec.rb +102 -0
  122. data/spec/models/v2_document_content_spec.rb +42 -0
  123. data/spec/models/v2_document_spec.rb +70 -0
  124. data/spec/models/v2_money_spec.rb +42 -0
  125. data/spec/models/v2_profile_check_entry_spec.rb +76 -0
  126. data/spec/models/v2_profile_check_spec.rb +46 -0
  127. data/spec/models/v2_profile_create_spec.rb +48 -0
  128. data/spec/models/v2_profile_detail_spec.rb +96 -0
  129. data/spec/models/v2_profile_list_item_spec.rb +72 -0
  130. data/spec/models/v2_profile_update_check_spec.rb +52 -0
  131. data/spec/models/v2_profile_update_spec.rb +48 -0
  132. data/spec/models/v2_screening_check_entry_spec.rb +88 -0
  133. data/spec/models/v2_screening_check_list_item_spec.rb +52 -0
  134. data/spec/models/v2_screening_check_spec.rb +58 -0
  135. data/spec/models/v2_screening_create_spec.rb +48 -0
  136. data/spec/models/v2_screening_detail_profile_spec.rb +42 -0
  137. data/spec/models/v2_screening_detail_spec.rb +84 -0
  138. data/spec/models/v2_screening_list_item_spec.rb +84 -0
  139. data/spec/models/verify_webhook_spec.rb +36 -0
  140. data/spec/models/webhook_response_spec.rb +90 -0
  141. data/spec/models/webhook_spec.rb +64 -0
  142. data/spec/spec_helper.rb +111 -0
  143. metadata +302 -0
@@ -0,0 +1,438 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #API for Pescheck ## Authentication This API supports three authentication methods: 1. **OAuth2** (recommended for API clients) - Use client credentials flow 2. **JWT Bearer** (for user-based access) - Obtain tokens via /api/jwt/ endpoint 3. **Cookie** (for browser-based access) - Session authentication via web login ## Quick Start for API Clients 1. Select your environment from the servers dropdown 2. Use OAuth2 with client credentials flow 3. Scopes are automatically included: read:api, create:api, update:api
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
+ # Everything a client needs to know to use a check type via the API.
18
+ class V2CheckInfo < ApiModelBase
19
+ attr_accessor :check_type
20
+
21
+ attr_accessor :display_name
22
+
23
+ attr_accessor :description
24
+
25
+ attr_accessor :has_config
26
+
27
+ # True for checks added automatically (e.g. as a dependency) - clients neither add nor configure these.
28
+ attr_accessor :is_system_managed
29
+
30
+ # Other check types this check pulls in automatically when added.
31
+ attr_accessor :requires_checks
32
+
33
+ attr_accessor :supported_countries_of_work
34
+
35
+ attr_accessor :supported_countries_of_residence
36
+
37
+ attr_accessor :default_price
38
+
39
+ attr_accessor :config_fields
40
+
41
+ attr_accessor :input_fields
42
+
43
+ # Screening-level candidate facts this check needs (name, email, sometimes date of birth, etc.).
44
+ attr_accessor :candidate_fields
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'check_type' => :'check_type',
50
+ :'display_name' => :'display_name',
51
+ :'description' => :'description',
52
+ :'has_config' => :'has_config',
53
+ :'is_system_managed' => :'is_system_managed',
54
+ :'requires_checks' => :'requires_checks',
55
+ :'supported_countries_of_work' => :'supported_countries_of_work',
56
+ :'supported_countries_of_residence' => :'supported_countries_of_residence',
57
+ :'default_price' => :'default_price',
58
+ :'config_fields' => :'config_fields',
59
+ :'input_fields' => :'input_fields',
60
+ :'candidate_fields' => :'candidate_fields'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'check_type' => :'String',
78
+ :'display_name' => :'String',
79
+ :'description' => :'String',
80
+ :'has_config' => :'Boolean',
81
+ :'is_system_managed' => :'Boolean',
82
+ :'requires_checks' => :'Array<String>',
83
+ :'supported_countries_of_work' => :'Array<String>',
84
+ :'supported_countries_of_residence' => :'Array<String>',
85
+ :'default_price' => :'V2Money',
86
+ :'config_fields' => :'Array<V2CheckField>',
87
+ :'input_fields' => :'Array<V2CheckField>',
88
+ :'candidate_fields' => :'Array<V2CheckField>'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ :'description',
96
+ :'default_price',
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2CheckInfo` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ acceptable_attribute_map = self.class.acceptable_attribute_map
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!acceptable_attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2CheckInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'check_type')
117
+ self.check_type = attributes[:'check_type']
118
+ else
119
+ self.check_type = nil
120
+ end
121
+
122
+ if attributes.key?(:'display_name')
123
+ self.display_name = attributes[:'display_name']
124
+ else
125
+ self.display_name = nil
126
+ end
127
+
128
+ if attributes.key?(:'description')
129
+ self.description = attributes[:'description']
130
+ else
131
+ self.description = nil
132
+ end
133
+
134
+ if attributes.key?(:'has_config')
135
+ self.has_config = attributes[:'has_config']
136
+ else
137
+ self.has_config = nil
138
+ end
139
+
140
+ if attributes.key?(:'is_system_managed')
141
+ self.is_system_managed = attributes[:'is_system_managed']
142
+ else
143
+ self.is_system_managed = nil
144
+ end
145
+
146
+ if attributes.key?(:'requires_checks')
147
+ if (value = attributes[:'requires_checks']).is_a?(Array)
148
+ self.requires_checks = value
149
+ end
150
+ else
151
+ self.requires_checks = nil
152
+ end
153
+
154
+ if attributes.key?(:'supported_countries_of_work')
155
+ if (value = attributes[:'supported_countries_of_work']).is_a?(Array)
156
+ self.supported_countries_of_work = value
157
+ end
158
+ else
159
+ self.supported_countries_of_work = nil
160
+ end
161
+
162
+ if attributes.key?(:'supported_countries_of_residence')
163
+ if (value = attributes[:'supported_countries_of_residence']).is_a?(Array)
164
+ self.supported_countries_of_residence = value
165
+ end
166
+ else
167
+ self.supported_countries_of_residence = nil
168
+ end
169
+
170
+ if attributes.key?(:'default_price')
171
+ self.default_price = attributes[:'default_price']
172
+ else
173
+ self.default_price = nil
174
+ end
175
+
176
+ if attributes.key?(:'config_fields')
177
+ if (value = attributes[:'config_fields']).is_a?(Array)
178
+ self.config_fields = value
179
+ end
180
+ else
181
+ self.config_fields = nil
182
+ end
183
+
184
+ if attributes.key?(:'input_fields')
185
+ if (value = attributes[:'input_fields']).is_a?(Array)
186
+ self.input_fields = value
187
+ end
188
+ else
189
+ self.input_fields = nil
190
+ end
191
+
192
+ if attributes.key?(:'candidate_fields')
193
+ if (value = attributes[:'candidate_fields']).is_a?(Array)
194
+ self.candidate_fields = value
195
+ end
196
+ else
197
+ self.candidate_fields = nil
198
+ end
199
+ end
200
+
201
+ # Show invalid properties with the reasons. Usually used together with valid?
202
+ # @return Array for valid properties with the reasons
203
+ def list_invalid_properties
204
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
205
+ invalid_properties = Array.new
206
+ if @check_type.nil?
207
+ invalid_properties.push('invalid value for "check_type", check_type cannot be nil.')
208
+ end
209
+
210
+ if @display_name.nil?
211
+ invalid_properties.push('invalid value for "display_name", display_name cannot be nil.')
212
+ end
213
+
214
+ if @has_config.nil?
215
+ invalid_properties.push('invalid value for "has_config", has_config cannot be nil.')
216
+ end
217
+
218
+ if @is_system_managed.nil?
219
+ invalid_properties.push('invalid value for "is_system_managed", is_system_managed cannot be nil.')
220
+ end
221
+
222
+ if @requires_checks.nil?
223
+ invalid_properties.push('invalid value for "requires_checks", requires_checks cannot be nil.')
224
+ end
225
+
226
+ if @supported_countries_of_work.nil?
227
+ invalid_properties.push('invalid value for "supported_countries_of_work", supported_countries_of_work cannot be nil.')
228
+ end
229
+
230
+ if @supported_countries_of_residence.nil?
231
+ invalid_properties.push('invalid value for "supported_countries_of_residence", supported_countries_of_residence cannot be nil.')
232
+ end
233
+
234
+ if @config_fields.nil?
235
+ invalid_properties.push('invalid value for "config_fields", config_fields cannot be nil.')
236
+ end
237
+
238
+ if @input_fields.nil?
239
+ invalid_properties.push('invalid value for "input_fields", input_fields cannot be nil.')
240
+ end
241
+
242
+ if @candidate_fields.nil?
243
+ invalid_properties.push('invalid value for "candidate_fields", candidate_fields cannot be nil.')
244
+ end
245
+
246
+ invalid_properties
247
+ end
248
+
249
+ # Check to see if the all the properties in the model are valid
250
+ # @return true if the model is valid
251
+ def valid?
252
+ warn '[DEPRECATED] the `valid?` method is obsolete'
253
+ return false if @check_type.nil?
254
+ return false if @display_name.nil?
255
+ return false if @has_config.nil?
256
+ return false if @is_system_managed.nil?
257
+ return false if @requires_checks.nil?
258
+ return false if @supported_countries_of_work.nil?
259
+ return false if @supported_countries_of_residence.nil?
260
+ return false if @config_fields.nil?
261
+ return false if @input_fields.nil?
262
+ return false if @candidate_fields.nil?
263
+ true
264
+ end
265
+
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] check_type Value to be assigned
268
+ def check_type=(check_type)
269
+ if check_type.nil?
270
+ fail ArgumentError, 'check_type cannot be nil'
271
+ end
272
+
273
+ @check_type = check_type
274
+ end
275
+
276
+ # Custom attribute writer method with validation
277
+ # @param [Object] display_name Value to be assigned
278
+ def display_name=(display_name)
279
+ if display_name.nil?
280
+ fail ArgumentError, 'display_name cannot be nil'
281
+ end
282
+
283
+ @display_name = display_name
284
+ end
285
+
286
+ # Custom attribute writer method with validation
287
+ # @param [Object] has_config Value to be assigned
288
+ def has_config=(has_config)
289
+ if has_config.nil?
290
+ fail ArgumentError, 'has_config cannot be nil'
291
+ end
292
+
293
+ @has_config = has_config
294
+ end
295
+
296
+ # Custom attribute writer method with validation
297
+ # @param [Object] is_system_managed Value to be assigned
298
+ def is_system_managed=(is_system_managed)
299
+ if is_system_managed.nil?
300
+ fail ArgumentError, 'is_system_managed cannot be nil'
301
+ end
302
+
303
+ @is_system_managed = is_system_managed
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] requires_checks Value to be assigned
308
+ def requires_checks=(requires_checks)
309
+ if requires_checks.nil?
310
+ fail ArgumentError, 'requires_checks cannot be nil'
311
+ end
312
+
313
+ @requires_checks = requires_checks
314
+ end
315
+
316
+ # Custom attribute writer method with validation
317
+ # @param [Object] supported_countries_of_work Value to be assigned
318
+ def supported_countries_of_work=(supported_countries_of_work)
319
+ if supported_countries_of_work.nil?
320
+ fail ArgumentError, 'supported_countries_of_work cannot be nil'
321
+ end
322
+
323
+ @supported_countries_of_work = supported_countries_of_work
324
+ end
325
+
326
+ # Custom attribute writer method with validation
327
+ # @param [Object] supported_countries_of_residence Value to be assigned
328
+ def supported_countries_of_residence=(supported_countries_of_residence)
329
+ if supported_countries_of_residence.nil?
330
+ fail ArgumentError, 'supported_countries_of_residence cannot be nil'
331
+ end
332
+
333
+ @supported_countries_of_residence = supported_countries_of_residence
334
+ end
335
+
336
+ # Custom attribute writer method with validation
337
+ # @param [Object] config_fields Value to be assigned
338
+ def config_fields=(config_fields)
339
+ if config_fields.nil?
340
+ fail ArgumentError, 'config_fields cannot be nil'
341
+ end
342
+
343
+ @config_fields = config_fields
344
+ end
345
+
346
+ # Custom attribute writer method with validation
347
+ # @param [Object] input_fields Value to be assigned
348
+ def input_fields=(input_fields)
349
+ if input_fields.nil?
350
+ fail ArgumentError, 'input_fields cannot be nil'
351
+ end
352
+
353
+ @input_fields = input_fields
354
+ end
355
+
356
+ # Custom attribute writer method with validation
357
+ # @param [Object] candidate_fields Value to be assigned
358
+ def candidate_fields=(candidate_fields)
359
+ if candidate_fields.nil?
360
+ fail ArgumentError, 'candidate_fields cannot be nil'
361
+ end
362
+
363
+ @candidate_fields = candidate_fields
364
+ end
365
+
366
+ # Checks equality by comparing each attribute.
367
+ # @param [Object] Object to be compared
368
+ def ==(o)
369
+ return true if self.equal?(o)
370
+ self.class == o.class &&
371
+ check_type == o.check_type &&
372
+ display_name == o.display_name &&
373
+ description == o.description &&
374
+ has_config == o.has_config &&
375
+ is_system_managed == o.is_system_managed &&
376
+ requires_checks == o.requires_checks &&
377
+ supported_countries_of_work == o.supported_countries_of_work &&
378
+ supported_countries_of_residence == o.supported_countries_of_residence &&
379
+ default_price == o.default_price &&
380
+ config_fields == o.config_fields &&
381
+ input_fields == o.input_fields &&
382
+ candidate_fields == o.candidate_fields
383
+ end
384
+
385
+ # @see the `==` method
386
+ # @param [Object] Object to be compared
387
+ def eql?(o)
388
+ self == o
389
+ end
390
+
391
+ # Calculates hash code according to all attributes.
392
+ # @return [Integer] Hash code
393
+ def hash
394
+ [check_type, display_name, description, has_config, is_system_managed, requires_checks, supported_countries_of_work, supported_countries_of_residence, default_price, config_fields, input_fields, candidate_fields].hash
395
+ end
396
+
397
+ # Builds the object from hash
398
+ # @param [Hash] attributes Model attributes in the form of hash
399
+ # @return [Object] Returns the model itself
400
+ def self.build_from_hash(attributes)
401
+ return nil unless attributes.is_a?(Hash)
402
+ attributes = attributes.transform_keys(&:to_sym)
403
+ transformed_hash = {}
404
+ openapi_types.each_pair do |key, type|
405
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
406
+ transformed_hash["#{key}"] = nil
407
+ elsif type =~ /\AArray<(.*)>/i
408
+ # check to ensure the input is an array given that the attribute
409
+ # is documented as an array but the input is not
410
+ if attributes[attribute_map[key]].is_a?(Array)
411
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
412
+ end
413
+ elsif !attributes[attribute_map[key]].nil?
414
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
415
+ end
416
+ end
417
+ new(transformed_hash)
418
+ end
419
+
420
+ # Returns the object in the form of hash
421
+ # @return [Hash] Returns the object in the form of hash
422
+ def to_hash
423
+ hash = {}
424
+ self.class.attribute_map.each_pair do |attr, param|
425
+ value = self.send(attr)
426
+ if value.nil?
427
+ is_nullable = self.class.openapi_nullable.include?(attr)
428
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
429
+ end
430
+
431
+ hash[param] = _to_hash(value)
432
+ end
433
+ hash
434
+ end
435
+
436
+ end
437
+
438
+ end