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,378 @@
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 TransferModel
18
+ attr_accessor :id_transfer
19
+
20
+ attr_accessor :amount
21
+
22
+ # Fiscal code related to the organization targeted by this transfer.
23
+ attr_accessor :organization_fiscal_code
24
+
25
+ attr_accessor :remittance_information
26
+
27
+ attr_accessor :category
28
+
29
+ # mutual exclusive with stamp
30
+ attr_accessor :iban
31
+
32
+ # optional - can be combined with iban but not with stamp
33
+ attr_accessor :postal_iban
34
+
35
+ attr_accessor :stamp
36
+
37
+ # it can added a maximum of 10 key-value pairs for metadata
38
+ attr_accessor :transfer_metadata
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
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'id_transfer' => :'idTransfer',
66
+ :'amount' => :'amount',
67
+ :'organization_fiscal_code' => :'organizationFiscalCode',
68
+ :'remittance_information' => :'remittanceInformation',
69
+ :'category' => :'category',
70
+ :'iban' => :'iban',
71
+ :'postal_iban' => :'postalIban',
72
+ :'stamp' => :'stamp',
73
+ :'transfer_metadata' => :'transferMetadata'
74
+ }
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'id_transfer' => :'String',
86
+ :'amount' => :'Integer',
87
+ :'organization_fiscal_code' => :'String',
88
+ :'remittance_information' => :'String',
89
+ :'category' => :'String',
90
+ :'iban' => :'String',
91
+ :'postal_iban' => :'String',
92
+ :'stamp' => :'Stamp',
93
+ :'transfer_metadata' => :'Array<TransferMetadataModel>'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `GPDDebtPositions::TransferModel` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `GPDDebtPositions::TransferModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'id_transfer')
119
+ self.id_transfer = attributes[:'id_transfer']
120
+ else
121
+ self.id_transfer = nil
122
+ end
123
+
124
+ if attributes.key?(:'amount')
125
+ self.amount = attributes[:'amount']
126
+ else
127
+ self.amount = nil
128
+ end
129
+
130
+ if attributes.key?(:'organization_fiscal_code')
131
+ self.organization_fiscal_code = attributes[:'organization_fiscal_code']
132
+ end
133
+
134
+ if attributes.key?(:'remittance_information')
135
+ self.remittance_information = attributes[:'remittance_information']
136
+ else
137
+ self.remittance_information = nil
138
+ end
139
+
140
+ if attributes.key?(:'category')
141
+ self.category = attributes[:'category']
142
+ else
143
+ self.category = nil
144
+ end
145
+
146
+ if attributes.key?(:'iban')
147
+ self.iban = attributes[:'iban']
148
+ end
149
+
150
+ if attributes.key?(:'postal_iban')
151
+ self.postal_iban = attributes[:'postal_iban']
152
+ end
153
+
154
+ if attributes.key?(:'stamp')
155
+ self.stamp = attributes[:'stamp']
156
+ end
157
+
158
+ if attributes.key?(:'transfer_metadata')
159
+ if (value = attributes[:'transfer_metadata']).is_a?(Array)
160
+ self.transfer_metadata = value
161
+ end
162
+ end
163
+ end
164
+
165
+ # Show invalid properties with the reasons. Usually used together with valid?
166
+ # @return Array for valid properties with the reasons
167
+ def list_invalid_properties
168
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
169
+ invalid_properties = Array.new
170
+ if @id_transfer.nil?
171
+ invalid_properties.push('invalid value for "id_transfer", id_transfer cannot be nil.')
172
+ end
173
+
174
+ if @amount.nil?
175
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
176
+ end
177
+
178
+ if @remittance_information.nil?
179
+ invalid_properties.push('invalid value for "remittance_information", remittance_information cannot be nil.')
180
+ end
181
+
182
+ if @category.nil?
183
+ invalid_properties.push('invalid value for "category", category cannot be nil.')
184
+ end
185
+
186
+ if !@transfer_metadata.nil? && @transfer_metadata.length > 10
187
+ invalid_properties.push('invalid value for "transfer_metadata", number of items must be less than or equal to 10.')
188
+ end
189
+
190
+ if !@transfer_metadata.nil? && @transfer_metadata.length < 0
191
+ invalid_properties.push('invalid value for "transfer_metadata", number of items must be greater than or equal to 0.')
192
+ end
193
+
194
+ invalid_properties
195
+ end
196
+
197
+ # Check to see if the all the properties in the model are valid
198
+ # @return true if the model is valid
199
+ def valid?
200
+ warn '[DEPRECATED] the `valid?` method is obsolete'
201
+ return false if @id_transfer.nil?
202
+ id_transfer_validator = EnumAttributeValidator.new('String', ["1", "2", "3", "4", "5"])
203
+ return false unless id_transfer_validator.valid?(@id_transfer)
204
+ return false if @amount.nil?
205
+ return false if @remittance_information.nil?
206
+ return false if @category.nil?
207
+ return false if !@transfer_metadata.nil? && @transfer_metadata.length > 10
208
+ return false if !@transfer_metadata.nil? && @transfer_metadata.length < 0
209
+ true
210
+ end
211
+
212
+ # Custom attribute writer method checking allowed values (enum).
213
+ # @param [Object] id_transfer Object to be assigned
214
+ def id_transfer=(id_transfer)
215
+ validator = EnumAttributeValidator.new('String', ["1", "2", "3", "4", "5"])
216
+ unless validator.valid?(id_transfer)
217
+ fail ArgumentError, "invalid value for \"id_transfer\", must be one of #{validator.allowable_values}."
218
+ end
219
+ @id_transfer = id_transfer
220
+ end
221
+
222
+ # Custom attribute writer method with validation
223
+ # @param [Object] transfer_metadata Value to be assigned
224
+ def transfer_metadata=(transfer_metadata)
225
+ if transfer_metadata.length > 10
226
+ fail ArgumentError, 'invalid value for "transfer_metadata", number of items must be less than or equal to 10.'
227
+ end
228
+
229
+ if transfer_metadata.length < 0
230
+ fail ArgumentError, 'invalid value for "transfer_metadata", number of items must be greater than or equal to 0.'
231
+ end
232
+
233
+ @transfer_metadata = transfer_metadata
234
+ end
235
+
236
+ # Checks equality by comparing each attribute.
237
+ # @param [Object] Object to be compared
238
+ def ==(o)
239
+ return true if self.equal?(o)
240
+ self.class == o.class &&
241
+ id_transfer == o.id_transfer &&
242
+ amount == o.amount &&
243
+ organization_fiscal_code == o.organization_fiscal_code &&
244
+ remittance_information == o.remittance_information &&
245
+ category == o.category &&
246
+ iban == o.iban &&
247
+ postal_iban == o.postal_iban &&
248
+ stamp == o.stamp &&
249
+ transfer_metadata == o.transfer_metadata
250
+ end
251
+
252
+ # @see the `==` method
253
+ # @param [Object] Object to be compared
254
+ def eql?(o)
255
+ self == o
256
+ end
257
+
258
+ # Calculates hash code according to all attributes.
259
+ # @return [Integer] Hash code
260
+ def hash
261
+ [id_transfer, amount, organization_fiscal_code, remittance_information, category, iban, postal_iban, stamp, transfer_metadata].hash
262
+ end
263
+
264
+ # Builds the object from hash
265
+ # @param [Hash] attributes Model attributes in the form of hash
266
+ # @return [Object] Returns the model itself
267
+ def self.build_from_hash(attributes)
268
+ return nil unless attributes.is_a?(Hash)
269
+ attributes = attributes.transform_keys(&:to_sym)
270
+ transformed_hash = {}
271
+ openapi_types.each_pair do |key, type|
272
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
273
+ transformed_hash["#{key}"] = nil
274
+ elsif type =~ /\AArray<(.*)>/i
275
+ # check to ensure the input is an array given that the attribute
276
+ # is documented as an array but the input is not
277
+ if attributes[attribute_map[key]].is_a?(Array)
278
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
279
+ end
280
+ elsif !attributes[attribute_map[key]].nil?
281
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
282
+ end
283
+ end
284
+ new(transformed_hash)
285
+ end
286
+
287
+ # Deserializes the data based on type
288
+ # @param string type Data type
289
+ # @param string value Value to be deserialized
290
+ # @return [Object] Deserialized data
291
+ def self._deserialize(type, value)
292
+ case type.to_sym
293
+ when :Time
294
+ Time.parse(value)
295
+ when :Date
296
+ Date.parse(value)
297
+ when :String
298
+ value.to_s
299
+ when :Integer
300
+ value.to_i
301
+ when :Float
302
+ value.to_f
303
+ when :Boolean
304
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
305
+ true
306
+ else
307
+ false
308
+ end
309
+ when :Object
310
+ # generic object (usually a Hash), return directly
311
+ value
312
+ when /\AArray<(?<inner_type>.+)>\z/
313
+ inner_type = Regexp.last_match[:inner_type]
314
+ value.map { |v| _deserialize(inner_type, v) }
315
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
316
+ k_type = Regexp.last_match[:k_type]
317
+ v_type = Regexp.last_match[:v_type]
318
+ {}.tap do |hash|
319
+ value.each do |k, v|
320
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
321
+ end
322
+ end
323
+ else # model
324
+ # models (e.g. Pet) or oneOf
325
+ klass = GPDDebtPositions.const_get(type)
326
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
327
+ end
328
+ end
329
+
330
+ # Returns the string representation of the object
331
+ # @return [String] String presentation of the object
332
+ def to_s
333
+ to_hash.to_s
334
+ end
335
+
336
+ # to_body is an alias to to_hash (backward compatibility)
337
+ # @return [Hash] Returns the object in the form of hash
338
+ def to_body
339
+ to_hash
340
+ end
341
+
342
+ # Returns the object in the form of hash
343
+ # @return [Hash] Returns the object in the form of hash
344
+ def to_hash
345
+ hash = {}
346
+ self.class.attribute_map.each_pair do |attr, param|
347
+ value = self.send(attr)
348
+ if value.nil?
349
+ is_nullable = self.class.openapi_nullable.include?(attr)
350
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
351
+ end
352
+
353
+ hash[param] = _to_hash(value)
354
+ end
355
+ hash
356
+ end
357
+
358
+ # Outputs non-array value in the form of hash
359
+ # For object, use to_hash. Otherwise, just return the value
360
+ # @param [Object] value Any valid value
361
+ # @return [Hash] Returns the value in the form of hash
362
+ def _to_hash(value)
363
+ if value.is_a?(Array)
364
+ value.compact.map { |v| _to_hash(v) }
365
+ elsif value.is_a?(Hash)
366
+ {}.tap do |hash|
367
+ value.each { |k, v| hash[k] = _to_hash(v) }
368
+ end
369
+ elsif value.respond_to? :to_hash
370
+ value.to_hash
371
+ else
372
+ value
373
+ end
374
+ end
375
+
376
+ end
377
+
378
+ end