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