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,432 @@
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 PaymentOptionModelResponse
18
+ attr_accessor :nav
19
+
20
+ attr_accessor :iuv
21
+
22
+ attr_accessor :organization_fiscal_code
23
+
24
+ attr_accessor :amount
25
+
26
+ attr_accessor :description
27
+
28
+ attr_accessor :is_partial_payment
29
+
30
+ attr_accessor :due_date
31
+
32
+ attr_accessor :retention_date
33
+
34
+ attr_accessor :payment_date
35
+
36
+ attr_accessor :reporting_date
37
+
38
+ attr_accessor :inserted_date
39
+
40
+ attr_accessor :payment_method
41
+
42
+ attr_accessor :fee
43
+
44
+ attr_accessor :notification_fee
45
+
46
+ attr_accessor :psp_company
47
+
48
+ attr_accessor :id_receipt
49
+
50
+ attr_accessor :id_flow_reporting
51
+
52
+ attr_accessor :status
53
+
54
+ attr_accessor :last_updated_date
55
+
56
+ attr_accessor :payment_option_metadata
57
+
58
+ attr_accessor :transfer
59
+
60
+ class EnumAttributeValidator
61
+ attr_reader :datatype
62
+ attr_reader :allowable_values
63
+
64
+ def initialize(datatype, allowable_values)
65
+ @allowable_values = allowable_values.map do |value|
66
+ case datatype.to_s
67
+ when /Integer/i
68
+ value.to_i
69
+ when /Float/i
70
+ value.to_f
71
+ else
72
+ value
73
+ end
74
+ end
75
+ end
76
+
77
+ def valid?(value)
78
+ !value || allowable_values.include?(value)
79
+ end
80
+ end
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'nav' => :'nav',
86
+ :'iuv' => :'iuv',
87
+ :'organization_fiscal_code' => :'organizationFiscalCode',
88
+ :'amount' => :'amount',
89
+ :'description' => :'description',
90
+ :'is_partial_payment' => :'isPartialPayment',
91
+ :'due_date' => :'dueDate',
92
+ :'retention_date' => :'retentionDate',
93
+ :'payment_date' => :'paymentDate',
94
+ :'reporting_date' => :'reportingDate',
95
+ :'inserted_date' => :'insertedDate',
96
+ :'payment_method' => :'paymentMethod',
97
+ :'fee' => :'fee',
98
+ :'notification_fee' => :'notificationFee',
99
+ :'psp_company' => :'pspCompany',
100
+ :'id_receipt' => :'idReceipt',
101
+ :'id_flow_reporting' => :'idFlowReporting',
102
+ :'status' => :'status',
103
+ :'last_updated_date' => :'lastUpdatedDate',
104
+ :'payment_option_metadata' => :'paymentOptionMetadata',
105
+ :'transfer' => :'transfer'
106
+ }
107
+ end
108
+
109
+ # Returns all the JSON keys this model knows about
110
+ def self.acceptable_attributes
111
+ attribute_map.values
112
+ end
113
+
114
+ # Attribute type mapping.
115
+ def self.openapi_types
116
+ {
117
+ :'nav' => :'String',
118
+ :'iuv' => :'String',
119
+ :'organization_fiscal_code' => :'String',
120
+ :'amount' => :'Integer',
121
+ :'description' => :'String',
122
+ :'is_partial_payment' => :'Boolean',
123
+ :'due_date' => :'Time',
124
+ :'retention_date' => :'Time',
125
+ :'payment_date' => :'Time',
126
+ :'reporting_date' => :'Time',
127
+ :'inserted_date' => :'Time',
128
+ :'payment_method' => :'String',
129
+ :'fee' => :'Integer',
130
+ :'notification_fee' => :'Integer',
131
+ :'psp_company' => :'String',
132
+ :'id_receipt' => :'String',
133
+ :'id_flow_reporting' => :'String',
134
+ :'status' => :'String',
135
+ :'last_updated_date' => :'Time',
136
+ :'payment_option_metadata' => :'Array<PaymentOptionMetadataModelResponse>',
137
+ :'transfer' => :'Array<TransferModelResponse>'
138
+ }
139
+ end
140
+
141
+ # List of attributes with nullable: true
142
+ def self.openapi_nullable
143
+ Set.new([
144
+ ])
145
+ end
146
+
147
+ # Initializes the object
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ def initialize(attributes = {})
150
+ if (!attributes.is_a?(Hash))
151
+ fail ArgumentError, "The input argument (attributes) must be a hash in `GPDDebtPositions::PaymentOptionModelResponse` initialize method"
152
+ end
153
+
154
+ # check to see if the attribute exists and convert string to symbol for hash key
155
+ attributes = attributes.each_with_object({}) { |(k, v), h|
156
+ if (!self.class.attribute_map.key?(k.to_sym))
157
+ fail ArgumentError, "`#{k}` is not a valid attribute in `GPDDebtPositions::PaymentOptionModelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
158
+ end
159
+ h[k.to_sym] = v
160
+ }
161
+
162
+ if attributes.key?(:'nav')
163
+ self.nav = attributes[:'nav']
164
+ end
165
+
166
+ if attributes.key?(:'iuv')
167
+ self.iuv = attributes[:'iuv']
168
+ end
169
+
170
+ if attributes.key?(:'organization_fiscal_code')
171
+ self.organization_fiscal_code = attributes[:'organization_fiscal_code']
172
+ end
173
+
174
+ if attributes.key?(:'amount')
175
+ self.amount = attributes[:'amount']
176
+ end
177
+
178
+ if attributes.key?(:'description')
179
+ self.description = attributes[:'description']
180
+ end
181
+
182
+ if attributes.key?(:'is_partial_payment')
183
+ self.is_partial_payment = attributes[:'is_partial_payment']
184
+ end
185
+
186
+ if attributes.key?(:'due_date')
187
+ self.due_date = attributes[:'due_date']
188
+ end
189
+
190
+ if attributes.key?(:'retention_date')
191
+ self.retention_date = attributes[:'retention_date']
192
+ end
193
+
194
+ if attributes.key?(:'payment_date')
195
+ self.payment_date = attributes[:'payment_date']
196
+ end
197
+
198
+ if attributes.key?(:'reporting_date')
199
+ self.reporting_date = attributes[:'reporting_date']
200
+ end
201
+
202
+ if attributes.key?(:'inserted_date')
203
+ self.inserted_date = attributes[:'inserted_date']
204
+ end
205
+
206
+ if attributes.key?(:'payment_method')
207
+ self.payment_method = attributes[:'payment_method']
208
+ end
209
+
210
+ if attributes.key?(:'fee')
211
+ self.fee = attributes[:'fee']
212
+ end
213
+
214
+ if attributes.key?(:'notification_fee')
215
+ self.notification_fee = attributes[:'notification_fee']
216
+ end
217
+
218
+ if attributes.key?(:'psp_company')
219
+ self.psp_company = attributes[:'psp_company']
220
+ end
221
+
222
+ if attributes.key?(:'id_receipt')
223
+ self.id_receipt = attributes[:'id_receipt']
224
+ end
225
+
226
+ if attributes.key?(:'id_flow_reporting')
227
+ self.id_flow_reporting = attributes[:'id_flow_reporting']
228
+ end
229
+
230
+ if attributes.key?(:'status')
231
+ self.status = attributes[:'status']
232
+ end
233
+
234
+ if attributes.key?(:'last_updated_date')
235
+ self.last_updated_date = attributes[:'last_updated_date']
236
+ end
237
+
238
+ if attributes.key?(:'payment_option_metadata')
239
+ if (value = attributes[:'payment_option_metadata']).is_a?(Array)
240
+ self.payment_option_metadata = value
241
+ end
242
+ end
243
+
244
+ if attributes.key?(:'transfer')
245
+ if (value = attributes[:'transfer']).is_a?(Array)
246
+ self.transfer = value
247
+ end
248
+ end
249
+ end
250
+
251
+ # Show invalid properties with the reasons. Usually used together with valid?
252
+ # @return Array for valid properties with the reasons
253
+ def list_invalid_properties
254
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
255
+ invalid_properties = Array.new
256
+ invalid_properties
257
+ end
258
+
259
+ # Check to see if the all the properties in the model are valid
260
+ # @return true if the model is valid
261
+ def valid?
262
+ warn '[DEPRECATED] the `valid?` method is obsolete'
263
+ status_validator = EnumAttributeValidator.new('String', ["PO_UNPAID", "PO_PAID", "PO_PARTIALLY_REPORTED", "PO_REPORTED"])
264
+ return false unless status_validator.valid?(@status)
265
+ true
266
+ end
267
+
268
+ # Custom attribute writer method checking allowed values (enum).
269
+ # @param [Object] status Object to be assigned
270
+ def status=(status)
271
+ validator = EnumAttributeValidator.new('String', ["PO_UNPAID", "PO_PAID", "PO_PARTIALLY_REPORTED", "PO_REPORTED"])
272
+ unless validator.valid?(status)
273
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
274
+ end
275
+ @status = status
276
+ end
277
+
278
+ # Checks equality by comparing each attribute.
279
+ # @param [Object] Object to be compared
280
+ def ==(o)
281
+ return true if self.equal?(o)
282
+ self.class == o.class &&
283
+ nav == o.nav &&
284
+ iuv == o.iuv &&
285
+ organization_fiscal_code == o.organization_fiscal_code &&
286
+ amount == o.amount &&
287
+ description == o.description &&
288
+ is_partial_payment == o.is_partial_payment &&
289
+ due_date == o.due_date &&
290
+ retention_date == o.retention_date &&
291
+ payment_date == o.payment_date &&
292
+ reporting_date == o.reporting_date &&
293
+ inserted_date == o.inserted_date &&
294
+ payment_method == o.payment_method &&
295
+ fee == o.fee &&
296
+ notification_fee == o.notification_fee &&
297
+ psp_company == o.psp_company &&
298
+ id_receipt == o.id_receipt &&
299
+ id_flow_reporting == o.id_flow_reporting &&
300
+ status == o.status &&
301
+ last_updated_date == o.last_updated_date &&
302
+ payment_option_metadata == o.payment_option_metadata &&
303
+ transfer == o.transfer
304
+ end
305
+
306
+ # @see the `==` method
307
+ # @param [Object] Object to be compared
308
+ def eql?(o)
309
+ self == o
310
+ end
311
+
312
+ # Calculates hash code according to all attributes.
313
+ # @return [Integer] Hash code
314
+ def hash
315
+ [nav, iuv, organization_fiscal_code, amount, description, is_partial_payment, due_date, retention_date, payment_date, reporting_date, inserted_date, payment_method, fee, notification_fee, psp_company, id_receipt, id_flow_reporting, status, last_updated_date, payment_option_metadata, transfer].hash
316
+ end
317
+
318
+ # Builds the object from hash
319
+ # @param [Hash] attributes Model attributes in the form of hash
320
+ # @return [Object] Returns the model itself
321
+ def self.build_from_hash(attributes)
322
+ return nil unless attributes.is_a?(Hash)
323
+ attributes = attributes.transform_keys(&:to_sym)
324
+ transformed_hash = {}
325
+ openapi_types.each_pair do |key, type|
326
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
327
+ transformed_hash["#{key}"] = nil
328
+ elsif type =~ /\AArray<(.*)>/i
329
+ # check to ensure the input is an array given that the attribute
330
+ # is documented as an array but the input is not
331
+ if attributes[attribute_map[key]].is_a?(Array)
332
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
333
+ end
334
+ elsif !attributes[attribute_map[key]].nil?
335
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
336
+ end
337
+ end
338
+ new(transformed_hash)
339
+ end
340
+
341
+ # Deserializes the data based on type
342
+ # @param string type Data type
343
+ # @param string value Value to be deserialized
344
+ # @return [Object] Deserialized data
345
+ def self._deserialize(type, value)
346
+ case type.to_sym
347
+ when :Time
348
+ Time.parse(value)
349
+ when :Date
350
+ Date.parse(value)
351
+ when :String
352
+ value.to_s
353
+ when :Integer
354
+ value.to_i
355
+ when :Float
356
+ value.to_f
357
+ when :Boolean
358
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
359
+ true
360
+ else
361
+ false
362
+ end
363
+ when :Object
364
+ # generic object (usually a Hash), return directly
365
+ value
366
+ when /\AArray<(?<inner_type>.+)>\z/
367
+ inner_type = Regexp.last_match[:inner_type]
368
+ value.map { |v| _deserialize(inner_type, v) }
369
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
370
+ k_type = Regexp.last_match[:k_type]
371
+ v_type = Regexp.last_match[:v_type]
372
+ {}.tap do |hash|
373
+ value.each do |k, v|
374
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
375
+ end
376
+ end
377
+ else # model
378
+ # models (e.g. Pet) or oneOf
379
+ klass = GPDDebtPositions.const_get(type)
380
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
381
+ end
382
+ end
383
+
384
+ # Returns the string representation of the object
385
+ # @return [String] String presentation of the object
386
+ def to_s
387
+ to_hash.to_s
388
+ end
389
+
390
+ # to_body is an alias to to_hash (backward compatibility)
391
+ # @return [Hash] Returns the object in the form of hash
392
+ def to_body
393
+ to_hash
394
+ end
395
+
396
+ # Returns the object in the form of hash
397
+ # @return [Hash] Returns the object in the form of hash
398
+ def to_hash
399
+ hash = {}
400
+ self.class.attribute_map.each_pair do |attr, param|
401
+ value = self.send(attr)
402
+ if value.nil?
403
+ is_nullable = self.class.openapi_nullable.include?(attr)
404
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
405
+ end
406
+
407
+ hash[param] = _to_hash(value)
408
+ end
409
+ hash
410
+ end
411
+
412
+ # Outputs non-array value in the form of hash
413
+ # For object, use to_hash. Otherwise, just return the value
414
+ # @param [Object] value Any valid value
415
+ # @return [Hash] Returns the value in the form of hash
416
+ def _to_hash(value)
417
+ if value.is_a?(Array)
418
+ value.compact.map { |v| _to_hash(v) }
419
+ elsif value.is_a?(Hash)
420
+ {}.tap do |hash|
421
+ value.each { |k, v| hash[k] = _to_hash(v) }
422
+ end
423
+ elsif value.respond_to? :to_hash
424
+ value.to_hash
425
+ else
426
+ value
427
+ end
428
+ end
429
+
430
+ end
431
+
432
+ end