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