gpd_debtposition_api 3.8.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 (73) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +141 -0
  4. data/Rakefile +10 -0
  5. data/docs/AppInfo.md +22 -0
  6. data/docs/DebtPositionActionsAPIApi.md +165 -0
  7. data/docs/DebtPositionsAPIApi.md +424 -0
  8. data/docs/HomeApi.md +82 -0
  9. data/docs/MultipleIUPDModel.md +18 -0
  10. data/docs/MultiplePaymentPositionModel.md +18 -0
  11. data/docs/PageInfo.md +24 -0
  12. data/docs/PaymentOptionMetadataModel.md +20 -0
  13. data/docs/PaymentOptionMetadataModelResponse.md +20 -0
  14. data/docs/PaymentOptionModel.md +38 -0
  15. data/docs/PaymentOptionModelResponse.md +58 -0
  16. data/docs/PaymentPositionModel.md +60 -0
  17. data/docs/PaymentPositionModelBaseResponse.md +44 -0
  18. data/docs/PaymentPositionsInfo.md +20 -0
  19. data/docs/ProblemJson.md +22 -0
  20. data/docs/Stamp.md +22 -0
  21. data/docs/TransferMetadataModel.md +20 -0
  22. data/docs/TransferMetadataModelResponse.md +20 -0
  23. data/docs/TransferModel.md +34 -0
  24. data/docs/TransferModelResponse.md +40 -0
  25. data/git_push.sh +57 -0
  26. data/gpd_debtposition_api.gemspec +39 -0
  27. data/lib/gpd_debtposition_api/api/debt_position_actions_api_api.rb +162 -0
  28. data/lib/gpd_debtposition_api/api/debt_positions_api_api.rb +439 -0
  29. data/lib/gpd_debtposition_api/api/home_api.rb +80 -0
  30. data/lib/gpd_debtposition_api/api_client.rb +394 -0
  31. data/lib/gpd_debtposition_api/api_error.rb +58 -0
  32. data/lib/gpd_debtposition_api/configuration.rb +320 -0
  33. data/lib/gpd_debtposition_api/models/app_info.rb +232 -0
  34. data/lib/gpd_debtposition_api/models/multiple_iupd_model.rb +251 -0
  35. data/lib/gpd_debtposition_api/models/multiple_payment_position_model.rb +223 -0
  36. data/lib/gpd_debtposition_api/models/page_info.rb +273 -0
  37. data/lib/gpd_debtposition_api/models/payment_option_metadata_model.rb +231 -0
  38. data/lib/gpd_debtposition_api/models/payment_option_metadata_model_response.rb +223 -0
  39. data/lib/gpd_debtposition_api/models/payment_option_model.rb +396 -0
  40. data/lib/gpd_debtposition_api/models/payment_option_model_response.rb +432 -0
  41. data/lib/gpd_debtposition_api/models/payment_position_model.rb +568 -0
  42. data/lib/gpd_debtposition_api/models/payment_position_model_base_response.rb +383 -0
  43. data/lib/gpd_debtposition_api/models/payment_positions_info.rb +239 -0
  44. data/lib/gpd_debtposition_api/models/problem_json.rb +259 -0
  45. data/lib/gpd_debtposition_api/models/stamp.rb +305 -0
  46. data/lib/gpd_debtposition_api/models/transfer_metadata_model.rb +231 -0
  47. data/lib/gpd_debtposition_api/models/transfer_metadata_model_response.rb +223 -0
  48. data/lib/gpd_debtposition_api/models/transfer_model.rb +378 -0
  49. data/lib/gpd_debtposition_api/models/transfer_model_response.rb +349 -0
  50. data/lib/gpd_debtposition_api/version.rb +15 -0
  51. data/lib/gpd_debtposition_api.rb +59 -0
  52. data/spec/api/debt_position_actions_api_api_spec.rb +61 -0
  53. data/spec/api/debt_positions_api_api_spec.rb +111 -0
  54. data/spec/api/home_api_spec.rb +46 -0
  55. data/spec/models/app_info_spec.rb +48 -0
  56. data/spec/models/multiple_iupd_model_spec.rb +36 -0
  57. data/spec/models/multiple_payment_position_model_spec.rb +36 -0
  58. data/spec/models/page_info_spec.rb +54 -0
  59. data/spec/models/payment_option_metadata_model_response_spec.rb +42 -0
  60. data/spec/models/payment_option_metadata_model_spec.rb +42 -0
  61. data/spec/models/payment_option_model_response_spec.rb +160 -0
  62. data/spec/models/payment_option_model_spec.rb +96 -0
  63. data/spec/models/payment_position_model_base_response_spec.rb +122 -0
  64. data/spec/models/payment_position_model_spec.rb +170 -0
  65. data/spec/models/payment_positions_info_spec.rb +42 -0
  66. data/spec/models/problem_json_spec.rb +48 -0
  67. data/spec/models/stamp_spec.rb +48 -0
  68. data/spec/models/transfer_metadata_model_response_spec.rb +42 -0
  69. data/spec/models/transfer_metadata_model_spec.rb +42 -0
  70. data/spec/models/transfer_model_response_spec.rb +106 -0
  71. data/spec/models/transfer_model_spec.rb +88 -0
  72. data/spec/spec_helper.rb +111 -0
  73. metadata +175 -0
@@ -0,0 +1,568 @@
1
+ =begin
2
+ #PagoPA API Debt Position
3
+
4
+ #Progetto Gestione Posizioni Debitorie
5
+
6
+ The version of the OpenAPI document: 0.11.18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module GPDDebtPositions
17
+ class PaymentPositionModel
18
+ attr_accessor :iupd
19
+
20
+ attr_accessor :aca
21
+
22
+ attr_accessor :type
23
+
24
+ # feature flag to enable a debt position in stand-in mode
25
+ attr_accessor :pay_stand_in
26
+
27
+ attr_accessor :fiscal_code
28
+
29
+ attr_accessor :full_name
30
+
31
+ attr_accessor :street_name
32
+
33
+ attr_accessor :civic_number
34
+
35
+ attr_accessor :postal_code
36
+
37
+ attr_accessor :city
38
+
39
+ attr_accessor :province
40
+
41
+ attr_accessor :region
42
+
43
+ attr_accessor :country
44
+
45
+ attr_accessor :email
46
+
47
+ attr_accessor :phone
48
+
49
+ # feature flag to enable the debt position to expire after the due date
50
+ attr_accessor :switch_to_expired
51
+
52
+ attr_accessor :company_name
53
+
54
+ attr_accessor :office_name
55
+
56
+ attr_accessor :validity_date
57
+
58
+ attr_accessor :payment_date
59
+
60
+ attr_accessor :status
61
+
62
+ attr_accessor :payment_option
63
+
64
+ class EnumAttributeValidator
65
+ attr_reader :datatype
66
+ attr_reader :allowable_values
67
+
68
+ def initialize(datatype, allowable_values)
69
+ @allowable_values = allowable_values.map do |value|
70
+ case datatype.to_s
71
+ when /Integer/i
72
+ value.to_i
73
+ when /Float/i
74
+ value.to_f
75
+ else
76
+ value
77
+ end
78
+ end
79
+ end
80
+
81
+ def valid?(value)
82
+ !value || allowable_values.include?(value)
83
+ end
84
+ end
85
+
86
+ # Attribute mapping from ruby-style variable name to JSON key.
87
+ def self.attribute_map
88
+ {
89
+ :'iupd' => :'iupd',
90
+ :'aca' => :'aca',
91
+ :'type' => :'type',
92
+ :'pay_stand_in' => :'payStandIn',
93
+ :'fiscal_code' => :'fiscalCode',
94
+ :'full_name' => :'fullName',
95
+ :'street_name' => :'streetName',
96
+ :'civic_number' => :'civicNumber',
97
+ :'postal_code' => :'postalCode',
98
+ :'city' => :'city',
99
+ :'province' => :'province',
100
+ :'region' => :'region',
101
+ :'country' => :'country',
102
+ :'email' => :'email',
103
+ :'phone' => :'phone',
104
+ :'switch_to_expired' => :'switchToExpired',
105
+ :'company_name' => :'companyName',
106
+ :'office_name' => :'officeName',
107
+ :'validity_date' => :'validityDate',
108
+ :'payment_date' => :'paymentDate',
109
+ :'status' => :'status',
110
+ :'payment_option' => :'paymentOption'
111
+ }
112
+ end
113
+
114
+ # Returns all the JSON keys this model knows about
115
+ def self.acceptable_attributes
116
+ attribute_map.values
117
+ end
118
+
119
+ # Attribute type mapping.
120
+ def self.openapi_types
121
+ {
122
+ :'iupd' => :'String',
123
+ :'aca' => :'Boolean',
124
+ :'type' => :'String',
125
+ :'pay_stand_in' => :'Boolean',
126
+ :'fiscal_code' => :'String',
127
+ :'full_name' => :'String',
128
+ :'street_name' => :'String',
129
+ :'civic_number' => :'String',
130
+ :'postal_code' => :'String',
131
+ :'city' => :'String',
132
+ :'province' => :'String',
133
+ :'region' => :'String',
134
+ :'country' => :'String',
135
+ :'email' => :'String',
136
+ :'phone' => :'String',
137
+ :'switch_to_expired' => :'Boolean',
138
+ :'company_name' => :'String',
139
+ :'office_name' => :'String',
140
+ :'validity_date' => :'Time',
141
+ :'payment_date' => :'Time',
142
+ :'status' => :'String',
143
+ :'payment_option' => :'Array<PaymentOptionModel>'
144
+ }
145
+ end
146
+
147
+ # List of attributes with nullable: true
148
+ def self.openapi_nullable
149
+ Set.new([
150
+ ])
151
+ end
152
+
153
+ # Initializes the object
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ def initialize(attributes = {})
156
+ if (!attributes.is_a?(Hash))
157
+ fail ArgumentError, "The input argument (attributes) must be a hash in `GPDDebtPositions::PaymentPositionModel` initialize method"
158
+ end
159
+
160
+ # check to see if the attribute exists and convert string to symbol for hash key
161
+ attributes = attributes.each_with_object({}) { |(k, v), h|
162
+ if (!self.class.attribute_map.key?(k.to_sym))
163
+ fail ArgumentError, "`#{k}` is not a valid attribute in `GPDDebtPositions::PaymentPositionModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
164
+ end
165
+ h[k.to_sym] = v
166
+ }
167
+
168
+ if attributes.key?(:'iupd')
169
+ self.iupd = attributes[:'iupd']
170
+ else
171
+ self.iupd = nil
172
+ end
173
+
174
+ if attributes.key?(:'aca')
175
+ self.aca = attributes[:'aca']
176
+ else
177
+ self.aca = false
178
+ end
179
+
180
+ if attributes.key?(:'type')
181
+ self.type = attributes[:'type']
182
+ else
183
+ self.type = nil
184
+ end
185
+
186
+ if attributes.key?(:'pay_stand_in')
187
+ self.pay_stand_in = attributes[:'pay_stand_in']
188
+ else
189
+ self.pay_stand_in = true
190
+ end
191
+
192
+ if attributes.key?(:'fiscal_code')
193
+ self.fiscal_code = attributes[:'fiscal_code']
194
+ else
195
+ self.fiscal_code = nil
196
+ end
197
+
198
+ if attributes.key?(:'full_name')
199
+ self.full_name = attributes[:'full_name']
200
+ else
201
+ self.full_name = nil
202
+ end
203
+
204
+ if attributes.key?(:'street_name')
205
+ self.street_name = attributes[:'street_name']
206
+ end
207
+
208
+ if attributes.key?(:'civic_number')
209
+ self.civic_number = attributes[:'civic_number']
210
+ end
211
+
212
+ if attributes.key?(:'postal_code')
213
+ self.postal_code = attributes[:'postal_code']
214
+ end
215
+
216
+ if attributes.key?(:'city')
217
+ self.city = attributes[:'city']
218
+ end
219
+
220
+ if attributes.key?(:'province')
221
+ self.province = attributes[:'province']
222
+ end
223
+
224
+ if attributes.key?(:'region')
225
+ self.region = attributes[:'region']
226
+ end
227
+
228
+ if attributes.key?(:'country')
229
+ self.country = attributes[:'country']
230
+ end
231
+
232
+ if attributes.key?(:'email')
233
+ self.email = attributes[:'email']
234
+ end
235
+
236
+ if attributes.key?(:'phone')
237
+ self.phone = attributes[:'phone']
238
+ end
239
+
240
+ if attributes.key?(:'switch_to_expired')
241
+ self.switch_to_expired = attributes[:'switch_to_expired']
242
+ else
243
+ self.switch_to_expired = false
244
+ end
245
+
246
+ if attributes.key?(:'company_name')
247
+ self.company_name = attributes[:'company_name']
248
+ else
249
+ self.company_name = nil
250
+ end
251
+
252
+ if attributes.key?(:'office_name')
253
+ self.office_name = attributes[:'office_name']
254
+ end
255
+
256
+ if attributes.key?(:'validity_date')
257
+ self.validity_date = attributes[:'validity_date']
258
+ end
259
+
260
+ if attributes.key?(:'payment_date')
261
+ self.payment_date = attributes[:'payment_date']
262
+ end
263
+
264
+ if attributes.key?(:'status')
265
+ self.status = attributes[:'status']
266
+ end
267
+
268
+ if attributes.key?(:'payment_option')
269
+ if (value = attributes[:'payment_option']).is_a?(Array)
270
+ self.payment_option = value
271
+ end
272
+ end
273
+ end
274
+
275
+ # Show invalid properties with the reasons. Usually used together with valid?
276
+ # @return Array for valid properties with the reasons
277
+ def list_invalid_properties
278
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
279
+ invalid_properties = Array.new
280
+ if @iupd.nil?
281
+ invalid_properties.push('invalid value for "iupd", iupd cannot be nil.')
282
+ end
283
+
284
+ if @type.nil?
285
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
286
+ end
287
+
288
+ if @fiscal_code.nil?
289
+ invalid_properties.push('invalid value for "fiscal_code", fiscal_code cannot be nil.')
290
+ end
291
+
292
+ if @full_name.nil?
293
+ invalid_properties.push('invalid value for "full_name", full_name cannot be nil.')
294
+ end
295
+
296
+ pattern = Regexp.new(/[A-Z]{2}/)
297
+ if !@country.nil? && @country !~ pattern
298
+ invalid_properties.push("invalid value for \"country\", must conform to the pattern #{pattern}.")
299
+ end
300
+
301
+ if @switch_to_expired.nil?
302
+ invalid_properties.push('invalid value for "switch_to_expired", switch_to_expired cannot be nil.')
303
+ end
304
+
305
+ if @company_name.nil?
306
+ invalid_properties.push('invalid value for "company_name", company_name cannot be nil.')
307
+ end
308
+
309
+ if @company_name.to_s.length > 140
310
+ invalid_properties.push('invalid value for "company_name", the character length must be smaller than or equal to 140.')
311
+ end
312
+
313
+ if @company_name.to_s.length < 0
314
+ invalid_properties.push('invalid value for "company_name", the character length must be great than or equal to 0.')
315
+ end
316
+
317
+ if !@office_name.nil? && @office_name.to_s.length > 140
318
+ invalid_properties.push('invalid value for "office_name", the character length must be smaller than or equal to 140.')
319
+ end
320
+
321
+ if !@office_name.nil? && @office_name.to_s.length < 0
322
+ invalid_properties.push('invalid value for "office_name", the character length must be great than or equal to 0.')
323
+ end
324
+
325
+ invalid_properties
326
+ end
327
+
328
+ # Check to see if the all the properties in the model are valid
329
+ # @return true if the model is valid
330
+ def valid?
331
+ warn '[DEPRECATED] the `valid?` method is obsolete'
332
+ return false if @iupd.nil?
333
+ return false if @type.nil?
334
+ type_validator = EnumAttributeValidator.new('String', ["F", "G"])
335
+ return false unless type_validator.valid?(@type)
336
+ return false if @fiscal_code.nil?
337
+ return false if @full_name.nil?
338
+ return false if !@country.nil? && @country !~ Regexp.new(/[A-Z]{2}/)
339
+ return false if @switch_to_expired.nil?
340
+ return false if @company_name.nil?
341
+ return false if @company_name.to_s.length > 140
342
+ return false if @company_name.to_s.length < 0
343
+ return false if !@office_name.nil? && @office_name.to_s.length > 140
344
+ return false if !@office_name.nil? && @office_name.to_s.length < 0
345
+ status_validator = EnumAttributeValidator.new('String', ["DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED"])
346
+ return false unless status_validator.valid?(@status)
347
+ true
348
+ end
349
+
350
+ # Custom attribute writer method checking allowed values (enum).
351
+ # @param [Object] type Object to be assigned
352
+ def type=(type)
353
+ validator = EnumAttributeValidator.new('String', ["F", "G"])
354
+ unless validator.valid?(type)
355
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
356
+ end
357
+ @type = type
358
+ end
359
+
360
+ # Custom attribute writer method with validation
361
+ # @param [Object] country Value to be assigned
362
+ def country=(country)
363
+ pattern = Regexp.new(/[A-Z]{2}/)
364
+ if country !~ pattern
365
+ fail ArgumentError, "invalid value for \"country\", must conform to the pattern #{pattern}."
366
+ end
367
+
368
+ @country = country
369
+ end
370
+
371
+ # Custom attribute writer method with validation
372
+ # @param [Object] company_name Value to be assigned
373
+ def company_name=(company_name)
374
+ if company_name.nil?
375
+ fail ArgumentError, 'company_name cannot be nil'
376
+ end
377
+
378
+ if company_name.to_s.length > 140
379
+ fail ArgumentError, 'invalid value for "company_name", the character length must be smaller than or equal to 140.'
380
+ end
381
+
382
+ if company_name.to_s.length < 0
383
+ fail ArgumentError, 'invalid value for "company_name", the character length must be great than or equal to 0.'
384
+ end
385
+
386
+ @company_name = company_name
387
+ end
388
+
389
+ # Custom attribute writer method with validation
390
+ # @param [Object] office_name Value to be assigned
391
+ def office_name=(office_name)
392
+ if office_name.to_s.length > 140
393
+ fail ArgumentError, 'invalid value for "office_name", the character length must be smaller than or equal to 140.'
394
+ end
395
+
396
+ if office_name.to_s.length < 0
397
+ fail ArgumentError, 'invalid value for "office_name", the character length must be great than or equal to 0.'
398
+ end
399
+
400
+ @office_name = office_name
401
+ end
402
+
403
+ # Custom attribute writer method checking allowed values (enum).
404
+ # @param [Object] status Object to be assigned
405
+ def status=(status)
406
+ validator = EnumAttributeValidator.new('String', ["DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED"])
407
+ unless validator.valid?(status)
408
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
409
+ end
410
+ @status = status
411
+ end
412
+
413
+ # Checks equality by comparing each attribute.
414
+ # @param [Object] Object to be compared
415
+ def ==(o)
416
+ return true if self.equal?(o)
417
+ self.class == o.class &&
418
+ iupd == o.iupd &&
419
+ aca == o.aca &&
420
+ type == o.type &&
421
+ pay_stand_in == o.pay_stand_in &&
422
+ fiscal_code == o.fiscal_code &&
423
+ full_name == o.full_name &&
424
+ street_name == o.street_name &&
425
+ civic_number == o.civic_number &&
426
+ postal_code == o.postal_code &&
427
+ city == o.city &&
428
+ province == o.province &&
429
+ region == o.region &&
430
+ country == o.country &&
431
+ email == o.email &&
432
+ phone == o.phone &&
433
+ switch_to_expired == o.switch_to_expired &&
434
+ company_name == o.company_name &&
435
+ office_name == o.office_name &&
436
+ validity_date == o.validity_date &&
437
+ payment_date == o.payment_date &&
438
+ status == o.status &&
439
+ payment_option == o.payment_option
440
+ end
441
+
442
+ # @see the `==` method
443
+ # @param [Object] Object to be compared
444
+ def eql?(o)
445
+ self == o
446
+ end
447
+
448
+ # Calculates hash code according to all attributes.
449
+ # @return [Integer] Hash code
450
+ def hash
451
+ [iupd, aca, type, pay_stand_in, fiscal_code, full_name, street_name, civic_number, postal_code, city, province, region, country, email, phone, switch_to_expired, company_name, office_name, validity_date, payment_date, status, payment_option].hash
452
+ end
453
+
454
+ # Builds the object from hash
455
+ # @param [Hash] attributes Model attributes in the form of hash
456
+ # @return [Object] Returns the model itself
457
+ def self.build_from_hash(attributes)
458
+ return nil unless attributes.is_a?(Hash)
459
+ attributes = attributes.transform_keys(&:to_sym)
460
+ transformed_hash = {}
461
+ openapi_types.each_pair do |key, type|
462
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
463
+ transformed_hash["#{key}"] = nil
464
+ elsif type =~ /\AArray<(.*)>/i
465
+ # check to ensure the input is an array given that the attribute
466
+ # is documented as an array but the input is not
467
+ if attributes[attribute_map[key]].is_a?(Array)
468
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
469
+ end
470
+ elsif !attributes[attribute_map[key]].nil?
471
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
472
+ end
473
+ end
474
+ new(transformed_hash)
475
+ end
476
+
477
+ # Deserializes the data based on type
478
+ # @param string type Data type
479
+ # @param string value Value to be deserialized
480
+ # @return [Object] Deserialized data
481
+ def self._deserialize(type, value)
482
+ case type.to_sym
483
+ when :Time
484
+ Time.parse(value)
485
+ when :Date
486
+ Date.parse(value)
487
+ when :String
488
+ value.to_s
489
+ when :Integer
490
+ value.to_i
491
+ when :Float
492
+ value.to_f
493
+ when :Boolean
494
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
495
+ true
496
+ else
497
+ false
498
+ end
499
+ when :Object
500
+ # generic object (usually a Hash), return directly
501
+ value
502
+ when /\AArray<(?<inner_type>.+)>\z/
503
+ inner_type = Regexp.last_match[:inner_type]
504
+ value.map { |v| _deserialize(inner_type, v) }
505
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
506
+ k_type = Regexp.last_match[:k_type]
507
+ v_type = Regexp.last_match[:v_type]
508
+ {}.tap do |hash|
509
+ value.each do |k, v|
510
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
511
+ end
512
+ end
513
+ else # model
514
+ # models (e.g. Pet) or oneOf
515
+ klass = GPDDebtPositions.const_get(type)
516
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
517
+ end
518
+ end
519
+
520
+ # Returns the string representation of the object
521
+ # @return [String] String presentation of the object
522
+ def to_s
523
+ to_hash.to_s
524
+ end
525
+
526
+ # to_body is an alias to to_hash (backward compatibility)
527
+ # @return [Hash] Returns the object in the form of hash
528
+ def to_body
529
+ to_hash
530
+ end
531
+
532
+ # Returns the object in the form of hash
533
+ # @return [Hash] Returns the object in the form of hash
534
+ def to_hash
535
+ hash = {}
536
+ self.class.attribute_map.each_pair do |attr, param|
537
+ value = self.send(attr)
538
+ if value.nil?
539
+ is_nullable = self.class.openapi_nullable.include?(attr)
540
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
541
+ end
542
+
543
+ hash[param] = _to_hash(value)
544
+ end
545
+ hash
546
+ end
547
+
548
+ # Outputs non-array value in the form of hash
549
+ # For object, use to_hash. Otherwise, just return the value
550
+ # @param [Object] value Any valid value
551
+ # @return [Hash] Returns the value in the form of hash
552
+ def _to_hash(value)
553
+ if value.is_a?(Array)
554
+ value.compact.map { |v| _to_hash(v) }
555
+ elsif value.is_a?(Hash)
556
+ {}.tap do |hash|
557
+ value.each { |k, v| hash[k] = _to_hash(v) }
558
+ end
559
+ elsif value.respond_to? :to_hash
560
+ value.to_hash
561
+ else
562
+ value
563
+ end
564
+ end
565
+
566
+ end
567
+
568
+ end