trevol 0.2.0 → 0.3.1

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/GENERADO.md +1 -1
  4. data/README.md +29 -4
  5. data/lib/trevol/client.rb +71 -9
  6. data/lib/trevol/llave.rb +30 -7
  7. data/lib/trevol/transporte.rb +44 -4
  8. data/lib/trevol_generado/api/account_api.rb +752 -0
  9. data/lib/trevol_generado/api/balance_api.rb +4 -4
  10. data/lib/trevol_generado/api/dian_syncs_api.rb +2 -2
  11. data/lib/trevol_generado/api/general_api.rb +2 -2
  12. data/lib/trevol_generado/api/requests_api.rb +2 -2
  13. data/lib/trevol_generado/models/account_api_key.rb +312 -0
  14. data/lib/trevol_generado/models/account_api_key_input.rb +254 -0
  15. data/lib/trevol_generado/models/account_api_key_list.rb +191 -0
  16. data/lib/trevol_generado/models/account_api_key_revocation.rb +181 -0
  17. data/lib/trevol_generado/models/account_company.rb +285 -0
  18. data/lib/trevol_generado/models/account_company_api_key_counts.rb +170 -0
  19. data/lib/trevol_generado/models/account_company_input.rb +209 -0
  20. data/lib/trevol_generado/models/account_company_list.rb +191 -0
  21. data/lib/trevol_generado/models/account_company_onboarding.rb +173 -0
  22. data/lib/trevol_generado/models/account_company_reference.rb +183 -0
  23. data/lib/trevol_generado/models/account_dian_counterpart.rb +193 -0
  24. data/lib/trevol_generado/models/account_dian_document.rb +348 -0
  25. data/lib/trevol_generado/models/account_dian_document_list.rb +191 -0
  26. data/lib/trevol_generado/models/account_key.rb +234 -0
  27. data/lib/trevol_generado/models/account_key_info.rb +181 -0
  28. data/lib/trevol_generado/models/account_key_info_account.rb +161 -0
  29. data/lib/trevol_generado/models/account_key_scope.rb +174 -0
  30. data/lib/trevol_generado/models/account_radian_event.rb +369 -0
  31. data/lib/trevol_generado/models/account_radian_event_list.rb +191 -0
  32. data/lib/trevol_generado/models/account_request_log.rb +262 -0
  33. data/lib/trevol_generado/models/account_request_log_list.rb +191 -0
  34. data/lib/trevol_generado/models/balance.rb +2 -2
  35. data/lib/trevol_generado/models/balance_operation_prices.rb +1 -1
  36. data/lib/trevol_generado/models/event.rb +1 -1
  37. data/lib/trevol_generado/models/problem.rb +35 -5
  38. data/lib/trevol_generado/models/radian_summary.rb +183 -0
  39. data/lib/trevol_generado/models/radian_summary_event.rb +201 -0
  40. data/lib/trevol_generado/models/webhook_endpoint.rb +1 -1
  41. data/lib/trevol_generado/models/webhook_endpoint_input.rb +1 -1
  42. data/lib/trevol_generado/models/webhook_endpoint_update.rb +1 -1
  43. data/lib/trevol_generado/tablas.rb +166 -151
  44. data/lib/trevol_generado/version.rb +1 -1
  45. data/lib/trevol_generado.rb +24 -0
  46. metadata +25 -1
@@ -0,0 +1,254 @@
1
+ =begin
2
+ #API de Trevol
3
+
4
+ #Trevol API. Documentación: https://platform.trevol.si/docs
5
+
6
+ The version of the OpenAPI document: 2026-11-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrevolGenerado
17
+ # La llave `tvl_` que se crea, en el ambiente de la llave de administración.
18
+ class AccountApiKeyInput < ApiModelBase
19
+ # Para reconocerla (el software o el equipo que la usa).
20
+ attr_accessor :name
21
+
22
+ # `read`: solo lee; `write`: emite y lee.
23
+ attr_accessor :permissions
24
+
25
+ # Hasta 10 direcciones IP o redes CIDR desde donde sirve (opcional).
26
+ attr_accessor :allowed_ips
27
+
28
+ # Con el permiso `customers:read` (los datos personales de los clientes). Solo si tu llave de administración lo tiene.
29
+ attr_accessor :customers_read
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'name' => :'name',
57
+ :'permissions' => :'permissions',
58
+ :'allowed_ips' => :'allowed_ips',
59
+ :'customers_read' => :'customers_read'
60
+ }
61
+ end
62
+
63
+ # Returns attribute mapping this model knows about
64
+ def self.acceptable_attribute_map
65
+ attribute_map
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ acceptable_attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'name' => :'String',
77
+ :'permissions' => :'String',
78
+ :'allowed_ips' => :'Array<String>',
79
+ :'customers_read' => :'Boolean'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ ])
87
+ end
88
+
89
+ # Returns attribute type mapping
90
+ def self.acceptable_openapi_types
91
+ openapi_types
92
+ end
93
+
94
+ # Returns the nullable attributes
95
+ def self.acceptable_openapi_nullable
96
+ openapi_nullable
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountApiKeyInput` initialize method"
104
+ end
105
+
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ acceptable_attribute_map = self.class.acceptable_attribute_map
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!acceptable_attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountApiKeyInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'name')
116
+ self.name = attributes[:'name']
117
+ else
118
+ self.name = nil
119
+ end
120
+
121
+ if attributes.key?(:'permissions')
122
+ self.permissions = attributes[:'permissions']
123
+ else
124
+ self.permissions = nil
125
+ end
126
+
127
+ if attributes.key?(:'allowed_ips')
128
+ if (value = attributes[:'allowed_ips']).is_a?(Array)
129
+ self.allowed_ips = value
130
+ end
131
+ end
132
+
133
+ if attributes.key?(:'customers_read')
134
+ self.customers_read = attributes[:'customers_read']
135
+ else
136
+ self.customers_read = false
137
+ end
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
144
+ invalid_properties = Array.new
145
+ if @name.nil?
146
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
147
+ end
148
+
149
+ if @permissions.nil?
150
+ invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
151
+ end
152
+
153
+ invalid_properties
154
+ end
155
+
156
+ # Check to see if the all the properties in the model are valid
157
+ # @return true if the model is valid
158
+ def valid?
159
+ warn '[DEPRECATED] the `valid?` method is obsolete'
160
+ return false if @name.nil?
161
+ return false if @permissions.nil?
162
+ permissions_validator = EnumAttributeValidator.new('String', ["read", "write", "unknown_default_open_api"])
163
+ return false unless permissions_validator.valid?(@permissions)
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] name Value to be assigned
169
+ def name=(name)
170
+ if name.nil?
171
+ fail ArgumentError, 'name cannot be nil'
172
+ end
173
+
174
+ @name = name
175
+ end
176
+
177
+ # Custom attribute writer method checking allowed values (enum).
178
+ # @param [Object] permissions Object to be assigned
179
+ def permissions=(permissions)
180
+ validator = EnumAttributeValidator.new('String', ["read", "write", "unknown_default_open_api"])
181
+ unless validator.valid?(permissions)
182
+ fail ArgumentError, "invalid value for \"permissions\", must be one of #{validator.allowable_values}."
183
+ end
184
+ @permissions = permissions
185
+ end
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] Object to be compared
189
+ def ==(o)
190
+ return true if self.equal?(o)
191
+ self.class == o.class &&
192
+ name == o.name &&
193
+ permissions == o.permissions &&
194
+ allowed_ips == o.allowed_ips &&
195
+ customers_read == o.customers_read
196
+ end
197
+
198
+ # @see the `==` method
199
+ # @param [Object] Object to be compared
200
+ def eql?(o)
201
+ self == o
202
+ end
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Integer] Hash code
206
+ def hash
207
+ [name, permissions, allowed_ips, customers_read].hash
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def self.build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ # include attributes inherited from allOf parents (the nearest declaration wins)
217
+ map = acceptable_attribute_map
218
+ transformed_hash = {}
219
+ acceptable_openapi_types.each_pair do |key, type|
220
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
221
+ transformed_hash["#{key}"] = nil
222
+ elsif type =~ /\AArray<(.*)>/i
223
+ # check to ensure the input is an array given that the attribute
224
+ # is documented as an array but the input is not
225
+ if attributes[map[key]].is_a?(Array)
226
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
227
+ end
228
+ elsif !attributes[map[key]].nil?
229
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
230
+ end
231
+ end
232
+ new(transformed_hash)
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ # include attributes inherited from allOf parents (the nearest declaration wins)
240
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ end
253
+
254
+ end
@@ -0,0 +1,191 @@
1
+ =begin
2
+ #API de Trevol
3
+
4
+ #Trevol API. Documentación: https://platform.trevol.si/docs
5
+
6
+ The version of the OpenAPI document: 2026-11-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrevolGenerado
17
+ class AccountApiKeyList < ApiModelBase
18
+ # Valores conocidos: `list`.
19
+ attr_accessor :object
20
+
21
+ attr_accessor :data
22
+
23
+ attr_accessor :has_more
24
+
25
+ attr_accessor :next_cursor
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'object' => :'object',
31
+ :'data' => :'data',
32
+ :'has_more' => :'has_more',
33
+ :'next_cursor' => :'next_cursor'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'object' => :'String',
51
+ :'data' => :'Array<AccountApiKey>',
52
+ :'has_more' => :'Boolean',
53
+ :'next_cursor' => :'String'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ :'next_cursor'
61
+ ])
62
+ end
63
+
64
+ # Returns attribute type mapping
65
+ def self.acceptable_openapi_types
66
+ openapi_types
67
+ end
68
+
69
+ # Returns the nullable attributes
70
+ def self.acceptable_openapi_nullable
71
+ openapi_nullable
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountApiKeyList` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ acceptable_attribute_map = self.class.acceptable_attribute_map
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!acceptable_attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountApiKeyList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'object')
91
+ self.object = attributes[:'object']
92
+ end
93
+
94
+ if attributes.key?(:'data')
95
+ if (value = attributes[:'data']).is_a?(Array)
96
+ self.data = value
97
+ end
98
+ end
99
+
100
+ if attributes.key?(:'has_more')
101
+ self.has_more = attributes[:'has_more']
102
+ end
103
+
104
+ if attributes.key?(:'next_cursor')
105
+ self.next_cursor = attributes[:'next_cursor']
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
113
+ invalid_properties = Array.new
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ warn '[DEPRECATED] the `valid?` method is obsolete'
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ object == o.object &&
130
+ data == o.data &&
131
+ has_more == o.has_more &&
132
+ next_cursor == o.next_cursor
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Integer] Hash code
143
+ def hash
144
+ [object, data, has_more, next_cursor].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def self.build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
152
+ attributes = attributes.transform_keys(&:to_sym)
153
+ # include attributes inherited from allOf parents (the nearest declaration wins)
154
+ map = acceptable_attribute_map
155
+ transformed_hash = {}
156
+ acceptable_openapi_types.each_pair do |key, type|
157
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ # include attributes inherited from allOf parents (the nearest declaration wins)
177
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ end
190
+
191
+ end
@@ -0,0 +1,181 @@
1
+ =begin
2
+ #API de Trevol
3
+
4
+ #Trevol API. Documentación: https://platform.trevol.si/docs
5
+
6
+ The version of the OpenAPI document: 2026-11-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrevolGenerado
17
+ # La llave revocada (deja de servir de inmediato).
18
+ class AccountApiKeyRevocation < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ # Valores conocidos: `api_key`.
22
+ attr_accessor :object
23
+
24
+ # Valores conocidos: `revoked`.
25
+ attr_accessor :status
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'id' => :'id',
31
+ :'object' => :'object',
32
+ :'status' => :'status'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'id' => :'String',
50
+ :'object' => :'String',
51
+ :'status' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Returns attribute type mapping
62
+ def self.acceptable_openapi_types
63
+ openapi_types
64
+ end
65
+
66
+ # Returns the nullable attributes
67
+ def self.acceptable_openapi_nullable
68
+ openapi_nullable
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountApiKeyRevocation` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountApiKeyRevocation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'id')
88
+ self.id = attributes[:'id']
89
+ end
90
+
91
+ if attributes.key?(:'object')
92
+ self.object = attributes[:'object']
93
+ end
94
+
95
+ if attributes.key?(:'status')
96
+ self.status = attributes[:'status']
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
+ invalid_properties = Array.new
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ warn '[DEPRECATED] the `valid?` method is obsolete'
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ id == o.id &&
121
+ object == o.object &&
122
+ status == o.status
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
+ [id, object, status].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
+ # include attributes inherited from allOf parents (the nearest declaration wins)
144
+ map = acceptable_attribute_map
145
+ transformed_hash = {}
146
+ acceptable_openapi_types.each_pair do |key, type|
147
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
148
+ transformed_hash["#{key}"] = nil
149
+ elsif type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[map[key]].is_a?(Array)
153
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
154
+ end
155
+ elsif !attributes[map[key]].nil?
156
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
157
+ end
158
+ end
159
+ new(transformed_hash)
160
+ end
161
+
162
+ # Returns the object in the form of hash
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_hash
165
+ hash = {}
166
+ # include attributes inherited from allOf parents (the nearest declaration wins)
167
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ if value.nil?
170
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
171
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
172
+ end
173
+
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ end
180
+
181
+ end