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,251 @@
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 MultipleIUPDModel
18
+ attr_accessor :payment_position_iupds
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'payment_position_iupds' => :'paymentPositionIUPDs'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'payment_position_iupds' => :'Array<String>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `GPDDebtPositions::MultipleIUPDModel` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `GPDDebtPositions::MultipleIUPDModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'payment_position_iupds')
61
+ if (value = attributes[:'payment_position_iupds']).is_a?(Array)
62
+ self.payment_position_iupds = value
63
+ end
64
+ else
65
+ self.payment_position_iupds = nil
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
+ invalid_properties = Array.new
74
+ if @payment_position_iupds.nil?
75
+ invalid_properties.push('invalid value for "payment_position_iupds", payment_position_iupds cannot be nil.')
76
+ end
77
+
78
+ if @payment_position_iupds.length > 100
79
+ invalid_properties.push('invalid value for "payment_position_iupds", number of items must be less than or equal to 100.')
80
+ end
81
+
82
+ if @payment_position_iupds.length < 0
83
+ invalid_properties.push('invalid value for "payment_position_iupds", number of items must be greater than or equal to 0.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if @payment_position_iupds.nil?
94
+ return false if @payment_position_iupds.length > 100
95
+ return false if @payment_position_iupds.length < 0
96
+ true
97
+ end
98
+
99
+ # Custom attribute writer method with validation
100
+ # @param [Object] payment_position_iupds Value to be assigned
101
+ def payment_position_iupds=(payment_position_iupds)
102
+ if payment_position_iupds.nil?
103
+ fail ArgumentError, 'payment_position_iupds cannot be nil'
104
+ end
105
+
106
+ if payment_position_iupds.length > 100
107
+ fail ArgumentError, 'invalid value for "payment_position_iupds", number of items must be less than or equal to 100.'
108
+ end
109
+
110
+ if payment_position_iupds.length < 0
111
+ fail ArgumentError, 'invalid value for "payment_position_iupds", number of items must be greater than or equal to 0.'
112
+ end
113
+
114
+ @payment_position_iupds = payment_position_iupds
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ payment_position_iupds == o.payment_position_iupds
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [payment_position_iupds].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ transformed_hash = {}
144
+ openapi_types.each_pair do |key, type|
145
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = nil
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[attribute_map[key]].is_a?(Array)
151
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
+ end
153
+ elsif !attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
+ end
156
+ end
157
+ new(transformed_hash)
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def self._deserialize(type, value)
165
+ case type.to_sym
166
+ when :Time
167
+ Time.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ # models (e.g. Pet) or oneOf
198
+ klass = GPDDebtPositions.const_get(type)
199
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+
249
+ end
250
+
251
+ end
@@ -0,0 +1,223 @@
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 MultiplePaymentPositionModel
18
+ attr_accessor :payment_positions
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'payment_positions' => :'paymentPositions'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'payment_positions' => :'Array<PaymentPositionModel>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `GPDDebtPositions::MultiplePaymentPositionModel` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `GPDDebtPositions::MultiplePaymentPositionModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'payment_positions')
61
+ if (value = attributes[:'payment_positions']).is_a?(Array)
62
+ self.payment_positions = value
63
+ end
64
+ else
65
+ self.payment_positions = nil
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
+ invalid_properties = Array.new
74
+ if @payment_positions.nil?
75
+ invalid_properties.push('invalid value for "payment_positions", payment_positions cannot be nil.')
76
+ end
77
+
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ return false if @payment_positions.nil?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ payment_positions == o.payment_positions
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [payment_positions].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
128
+ end
129
+ new(transformed_hash)
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def self._deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = GPDDebtPositions.const_get(type)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end