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,285 @@
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
+ # Una empresa de tu cuenta. Sin correo, representante, certificado ni nada de la vinculación con la DIAN: eso se ve en la app (`onboarding_url`).
18
+ class AccountCompany < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ # Valores conocidos: `company`.
22
+ attr_accessor :object
23
+
24
+ # El NIT, sin DV.
25
+ attr_accessor :nit
26
+
27
+ # El dígito de verificación del NIT (como texto).
28
+ attr_accessor :check_digit
29
+
30
+ # La razón social.
31
+ attr_accessor :name
32
+
33
+ # El nombre comercial.
34
+ attr_accessor :trade_name
35
+
36
+ # `pending`: reservada, la vinculación con la DIAN no ha empezado; `enabling`: en la habilitación (ver `onboarding.step`); `enabled`: habilitada, ya emite; `stopped`: la habilitación se detuvo (ver `onboarding.stop_reason`). Valores conocidos: `pending`, `enabling`, `enabled`, `stopped`.
37
+ attr_accessor :status
38
+
39
+ # En qué va la habilitación.
40
+ attr_accessor :onboarding
41
+
42
+ # En qué ambiente emite hoy la empresa en la app. Valores conocidos: `test`, `live`.
43
+ attr_accessor :emission_environment
44
+
45
+ attr_accessor :created_at
46
+
47
+ # Cuándo quedó habilitada.
48
+ attr_accessor :enabled_at
49
+
50
+ # Donde la empresa termina la vinculación con la DIAN, en la app.
51
+ attr_accessor :onboarding_url
52
+
53
+ # Cuántas llaves `tvl_` activas tiene, por ambiente.
54
+ attr_accessor :api_keys
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'id' => :'id',
60
+ :'object' => :'object',
61
+ :'nit' => :'nit',
62
+ :'check_digit' => :'check_digit',
63
+ :'name' => :'name',
64
+ :'trade_name' => :'trade_name',
65
+ :'status' => :'status',
66
+ :'onboarding' => :'onboarding',
67
+ :'emission_environment' => :'emission_environment',
68
+ :'created_at' => :'created_at',
69
+ :'enabled_at' => :'enabled_at',
70
+ :'onboarding_url' => :'onboarding_url',
71
+ :'api_keys' => :'api_keys'
72
+ }
73
+ end
74
+
75
+ # Returns attribute mapping this model knows about
76
+ def self.acceptable_attribute_map
77
+ attribute_map
78
+ end
79
+
80
+ # Returns all the JSON keys this model knows about
81
+ def self.acceptable_attributes
82
+ acceptable_attribute_map.values
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.openapi_types
87
+ {
88
+ :'id' => :'String',
89
+ :'object' => :'String',
90
+ :'nit' => :'String',
91
+ :'check_digit' => :'String',
92
+ :'name' => :'String',
93
+ :'trade_name' => :'String',
94
+ :'status' => :'String',
95
+ :'onboarding' => :'AccountCompanyOnboarding',
96
+ :'emission_environment' => :'String',
97
+ :'created_at' => :'Time',
98
+ :'enabled_at' => :'Time',
99
+ :'onboarding_url' => :'String',
100
+ :'api_keys' => :'AccountCompanyApiKeyCounts'
101
+ }
102
+ end
103
+
104
+ # List of attributes with nullable: true
105
+ def self.openapi_nullable
106
+ Set.new([
107
+ :'check_digit',
108
+ :'name',
109
+ :'trade_name',
110
+ :'emission_environment',
111
+ :'enabled_at',
112
+ ])
113
+ end
114
+
115
+ # Returns attribute type mapping
116
+ def self.acceptable_openapi_types
117
+ openapi_types
118
+ end
119
+
120
+ # Returns the nullable attributes
121
+ def self.acceptable_openapi_nullable
122
+ openapi_nullable
123
+ end
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ def initialize(attributes = {})
128
+ if (!attributes.is_a?(Hash))
129
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountCompany` initialize method"
130
+ end
131
+
132
+ # check to see if the attribute exists and convert string to symbol for hash key
133
+ acceptable_attribute_map = self.class.acceptable_attribute_map
134
+ attributes = attributes.each_with_object({}) { |(k, v), h|
135
+ if (!acceptable_attribute_map.key?(k.to_sym))
136
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountCompany`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
137
+ end
138
+ h[k.to_sym] = v
139
+ }
140
+
141
+ if attributes.key?(:'id')
142
+ self.id = attributes[:'id']
143
+ end
144
+
145
+ if attributes.key?(:'object')
146
+ self.object = attributes[:'object']
147
+ end
148
+
149
+ if attributes.key?(:'nit')
150
+ self.nit = attributes[:'nit']
151
+ end
152
+
153
+ if attributes.key?(:'check_digit')
154
+ self.check_digit = attributes[:'check_digit']
155
+ end
156
+
157
+ if attributes.key?(:'name')
158
+ self.name = attributes[:'name']
159
+ end
160
+
161
+ if attributes.key?(:'trade_name')
162
+ self.trade_name = attributes[:'trade_name']
163
+ end
164
+
165
+ if attributes.key?(:'status')
166
+ self.status = attributes[:'status']
167
+ end
168
+
169
+ if attributes.key?(:'onboarding')
170
+ self.onboarding = attributes[:'onboarding']
171
+ end
172
+
173
+ if attributes.key?(:'emission_environment')
174
+ self.emission_environment = attributes[:'emission_environment']
175
+ end
176
+
177
+ if attributes.key?(:'created_at')
178
+ self.created_at = attributes[:'created_at']
179
+ end
180
+
181
+ if attributes.key?(:'enabled_at')
182
+ self.enabled_at = attributes[:'enabled_at']
183
+ end
184
+
185
+ if attributes.key?(:'onboarding_url')
186
+ self.onboarding_url = attributes[:'onboarding_url']
187
+ end
188
+
189
+ if attributes.key?(:'api_keys')
190
+ self.api_keys = attributes[:'api_keys']
191
+ end
192
+ end
193
+
194
+ # Show invalid properties with the reasons. Usually used together with valid?
195
+ # @return Array for valid properties with the reasons
196
+ def list_invalid_properties
197
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
198
+ invalid_properties = Array.new
199
+ invalid_properties
200
+ end
201
+
202
+ # Check to see if the all the properties in the model are valid
203
+ # @return true if the model is valid
204
+ def valid?
205
+ warn '[DEPRECATED] the `valid?` method is obsolete'
206
+ true
207
+ end
208
+
209
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(o)
212
+ return true if self.equal?(o)
213
+ self.class == o.class &&
214
+ id == o.id &&
215
+ object == o.object &&
216
+ nit == o.nit &&
217
+ check_digit == o.check_digit &&
218
+ name == o.name &&
219
+ trade_name == o.trade_name &&
220
+ status == o.status &&
221
+ onboarding == o.onboarding &&
222
+ emission_environment == o.emission_environment &&
223
+ created_at == o.created_at &&
224
+ enabled_at == o.enabled_at &&
225
+ onboarding_url == o.onboarding_url &&
226
+ api_keys == o.api_keys
227
+ end
228
+
229
+ # @see the `==` method
230
+ # @param [Object] Object to be compared
231
+ def eql?(o)
232
+ self == o
233
+ end
234
+
235
+ # Calculates hash code according to all attributes.
236
+ # @return [Integer] Hash code
237
+ def hash
238
+ [id, object, nit, check_digit, name, trade_name, status, onboarding, emission_environment, created_at, enabled_at, onboarding_url, api_keys].hash
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def self.build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ attributes = attributes.transform_keys(&:to_sym)
247
+ # include attributes inherited from allOf parents (the nearest declaration wins)
248
+ map = acceptable_attribute_map
249
+ transformed_hash = {}
250
+ acceptable_openapi_types.each_pair do |key, type|
251
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
252
+ transformed_hash["#{key}"] = nil
253
+ elsif type =~ /\AArray<(.*)>/i
254
+ # check to ensure the input is an array given that the attribute
255
+ # is documented as an array but the input is not
256
+ if attributes[map[key]].is_a?(Array)
257
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
258
+ end
259
+ elsif !attributes[map[key]].nil?
260
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
261
+ end
262
+ end
263
+ new(transformed_hash)
264
+ end
265
+
266
+ # Returns the object in the form of hash
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_hash
269
+ hash = {}
270
+ # include attributes inherited from allOf parents (the nearest declaration wins)
271
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
272
+ value = self.send(attr)
273
+ if value.nil?
274
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
275
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
276
+ end
277
+
278
+ hash[param] = _to_hash(value)
279
+ end
280
+ hash
281
+ end
282
+
283
+ end
284
+
285
+ end
@@ -0,0 +1,170 @@
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
+ # Cuántas llaves `tvl_` activas tiene, por ambiente.
18
+ class AccountCompanyApiKeyCounts < ApiModelBase
19
+ attr_accessor :active_test
20
+
21
+ attr_accessor :active_live
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'active_test' => :'active_test',
27
+ :'active_live' => :'active_live'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'active_test' => :'Integer',
45
+ :'active_live' => :'Integer'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Returns attribute type mapping
56
+ def self.acceptable_openapi_types
57
+ openapi_types
58
+ end
59
+
60
+ # Returns the nullable attributes
61
+ def self.acceptable_openapi_nullable
62
+ openapi_nullable
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountCompanyApiKeyCounts` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountCompanyApiKeyCounts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'active_test')
82
+ self.active_test = attributes[:'active_test']
83
+ end
84
+
85
+ if attributes.key?(:'active_live')
86
+ self.active_live = attributes[:'active_live']
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
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ active_test == o.active_test &&
111
+ active_live == o.active_live
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [active_test, active_live].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ # include attributes inherited from allOf parents (the nearest declaration wins)
133
+ map = acceptable_attribute_map
134
+ transformed_hash = {}
135
+ acceptable_openapi_types.each_pair do |key, type|
136
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Returns the object in the form of hash
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_hash
154
+ hash = {}
155
+ # include attributes inherited from allOf parents (the nearest declaration wins)
156
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ if value.nil?
159
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
160
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
161
+ end
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ end
169
+
170
+ end
@@ -0,0 +1,209 @@
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
+ # Los datos para reservar una empresa. Nunca certificados, contraseñas, PIN ni tokens: la vinculación con la DIAN se hace en la app (cualquier otro campo es 422).
18
+ class AccountCompanyInput < ApiModelBase
19
+ # El NIT, de 5 a 15 dígitos, sin DV ni puntos.
20
+ attr_accessor :nit
21
+
22
+ # La razón social.
23
+ attr_accessor :name
24
+
25
+ # El nombre comercial.
26
+ attr_accessor :trade_name
27
+
28
+ # El correo de la empresa, para la vinculación en la app (la API no lo devuelve).
29
+ attr_accessor :email
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'nit' => :'nit',
35
+ :'name' => :'name',
36
+ :'trade_name' => :'trade_name',
37
+ :'email' => :'email'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'nit' => :'String',
55
+ :'name' => :'String',
56
+ :'trade_name' => :'String',
57
+ :'email' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Returns attribute type mapping
68
+ def self.acceptable_openapi_types
69
+ openapi_types
70
+ end
71
+
72
+ # Returns the nullable attributes
73
+ def self.acceptable_openapi_nullable
74
+ openapi_nullable
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountCompanyInput` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountCompanyInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'nit')
94
+ self.nit = attributes[:'nit']
95
+ else
96
+ self.nit = nil
97
+ end
98
+
99
+ if attributes.key?(:'name')
100
+ self.name = attributes[:'name']
101
+ end
102
+
103
+ if attributes.key?(:'trade_name')
104
+ self.trade_name = attributes[:'trade_name']
105
+ end
106
+
107
+ if attributes.key?(:'email')
108
+ self.email = attributes[:'email']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @nit.nil?
118
+ invalid_properties.push('invalid value for "nit", nit cannot be nil.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ warn '[DEPRECATED] the `valid?` method is obsolete'
128
+ return false if @nit.nil?
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param [Object] nit Value to be assigned
134
+ def nit=(nit)
135
+ if nit.nil?
136
+ fail ArgumentError, 'nit cannot be nil'
137
+ end
138
+
139
+ @nit = nit
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ nit == o.nit &&
148
+ name == o.name &&
149
+ trade_name == o.trade_name &&
150
+ email == o.email
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [nit, name, trade_name, email].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ # include attributes inherited from allOf parents (the nearest declaration wins)
172
+ map = acceptable_attribute_map
173
+ transformed_hash = {}
174
+ acceptable_openapi_types.each_pair do |key, type|
175
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
176
+ transformed_hash["#{key}"] = nil
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[map[key]].is_a?(Array)
181
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
182
+ end
183
+ elsif !attributes[map[key]].nil?
184
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
185
+ end
186
+ end
187
+ new(transformed_hash)
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ # include attributes inherited from allOf parents (the nearest declaration wins)
195
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ end
208
+
209
+ end