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,193 @@
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 otra parte: en lo emitido, el adquiriente (o, en un documento soporte, quien vende); en lo recibido, el emisor. En lo emitido, con una llave de administración sin el permiso `customers:read`, `document_number` (y `check_digit`) vienen en null.
18
+ class AccountDianCounterpart < ApiModelBase
19
+ attr_accessor :document_type
20
+
21
+ attr_accessor :document_number
22
+
23
+ # El dígito de verificación, si es un NIT (`document_type` 31); si no, null.
24
+ attr_accessor :check_digit
25
+
26
+ attr_accessor :name
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'document_type' => :'document_type',
32
+ :'document_number' => :'document_number',
33
+ :'check_digit' => :'check_digit',
34
+ :'name' => :'name'
35
+ }
36
+ end
37
+
38
+ # Returns attribute mapping this model knows about
39
+ def self.acceptable_attribute_map
40
+ attribute_map
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ acceptable_attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'document_type' => :'String',
52
+ :'document_number' => :'String',
53
+ :'check_digit' => :'String',
54
+ :'name' => :'String'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ :'document_type',
62
+ :'document_number',
63
+ :'check_digit',
64
+ :'name'
65
+ ])
66
+ end
67
+
68
+ # Returns attribute type mapping
69
+ def self.acceptable_openapi_types
70
+ openapi_types
71
+ end
72
+
73
+ # Returns the nullable attributes
74
+ def self.acceptable_openapi_nullable
75
+ openapi_nullable
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountDianCounterpart` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountDianCounterpart`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'document_type')
95
+ self.document_type = attributes[:'document_type']
96
+ end
97
+
98
+ if attributes.key?(:'document_number')
99
+ self.document_number = attributes[:'document_number']
100
+ end
101
+
102
+ if attributes.key?(:'check_digit')
103
+ self.check_digit = attributes[:'check_digit']
104
+ end
105
+
106
+ if attributes.key?(:'name')
107
+ self.name = attributes[:'name']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ document_type == o.document_type &&
132
+ document_number == o.document_number &&
133
+ check_digit == o.check_digit &&
134
+ name == o.name
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [document_type, document_number, check_digit, name].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ # include attributes inherited from allOf parents (the nearest declaration wins)
156
+ map = acceptable_attribute_map
157
+ transformed_hash = {}
158
+ acceptable_openapi_types.each_pair do |key, type|
159
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ # include attributes inherited from allOf parents (the nearest declaration wins)
179
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ end
192
+
193
+ end
@@ -0,0 +1,348 @@
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
+ # Un documento de una empresa de tu cuenta ante la DIAN, emitido o recibido, tal como lo trajo la sincronización (el mismo `dian_document` de `GET /v1/dian_documents`, sin `xml_available`), con la empresa y, en las facturas, el resumen RADIAN. Lo que llegó al buzón y la sincronización todavía no vio no aparece.
18
+ class AccountDianDocument < ApiModelBase
19
+ # Úsalo en `starting_after` para pedir la página siguiente.
20
+ attr_accessor :id
21
+
22
+ # Valores conocidos: `dian_document`.
23
+ attr_accessor :object
24
+
25
+ # Valores conocidos: `live`, `test`.
26
+ attr_accessor :environment
27
+
28
+ # Valores conocidos: `credit_note`, `debit_note`, `invoice`, `other`, `support_document`, `support_document_adjustment`.
29
+ attr_accessor :type
30
+
31
+ # El tipo como lo escribe la DIAN («Factura electrónica»…).
32
+ attr_accessor :dian_type
33
+
34
+ # Con su prefijo (FE7595).
35
+ attr_accessor :number
36
+
37
+ attr_accessor :prefix
38
+
39
+ # El CUFE, CUDE o CUDS: lo identifica ante la DIAN.
40
+ attr_accessor :cufe
41
+
42
+ # La fecha de expedición.
43
+ attr_accessor :issued_on
44
+
45
+ # La otra parte: en lo emitido, el adquiriente (o, en un documento soporte, quien vende); en lo recibido, el emisor. En lo emitido, con una llave de administración sin el permiso `customers:read`, `document_number` (y `check_digit`) vienen en null.
46
+ attr_accessor :counterpart
47
+
48
+ attr_accessor :currency
49
+
50
+ attr_accessor :total
51
+
52
+ attr_accessor :tax_total
53
+
54
+ # Como lo lista la DIAN («Aprobado», «Aprobado con notificación»…).
55
+ attr_accessor :dian_status
56
+
57
+ # Emitido por la empresa o recibido. Valores conocidos: `issued`, `received`.
58
+ attr_accessor :direction
59
+
60
+ # La fecha de recepción que lista la DIAN.
61
+ attr_accessor :received_on
62
+
63
+ # De dónde salió: la sincronización con la DIAN o el buzón de recepción (lo recibido). Lo del buzón aparece cuando la sincronización con la DIAN ya lo trajo. Valores conocidos: `sync`, `mailbox`.
64
+ attr_accessor :source
65
+
66
+ # La empresa de tu cuenta a la que pertenece.
67
+ attr_accessor :company
68
+
69
+ # Solo en facturas: el resumen de sus eventos RADIAN. `null` en lo demás.
70
+ attr_accessor :radian
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ :'id' => :'id',
76
+ :'object' => :'object',
77
+ :'environment' => :'environment',
78
+ :'type' => :'type',
79
+ :'dian_type' => :'dian_type',
80
+ :'number' => :'number',
81
+ :'prefix' => :'prefix',
82
+ :'cufe' => :'cufe',
83
+ :'issued_on' => :'issued_on',
84
+ :'counterpart' => :'counterpart',
85
+ :'currency' => :'currency',
86
+ :'total' => :'total',
87
+ :'tax_total' => :'tax_total',
88
+ :'dian_status' => :'dian_status',
89
+ :'direction' => :'direction',
90
+ :'received_on' => :'received_on',
91
+ :'source' => :'source',
92
+ :'company' => :'company',
93
+ :'radian' => :'radian'
94
+ }
95
+ end
96
+
97
+ # Returns attribute mapping this model knows about
98
+ def self.acceptable_attribute_map
99
+ attribute_map
100
+ end
101
+
102
+ # Returns all the JSON keys this model knows about
103
+ def self.acceptable_attributes
104
+ acceptable_attribute_map.values
105
+ end
106
+
107
+ # Attribute type mapping.
108
+ def self.openapi_types
109
+ {
110
+ :'id' => :'String',
111
+ :'object' => :'String',
112
+ :'environment' => :'String',
113
+ :'type' => :'String',
114
+ :'dian_type' => :'String',
115
+ :'number' => :'String',
116
+ :'prefix' => :'String',
117
+ :'cufe' => :'String',
118
+ :'issued_on' => :'Date',
119
+ :'counterpart' => :'AccountDianCounterpart',
120
+ :'currency' => :'String',
121
+ :'total' => :'Float',
122
+ :'tax_total' => :'Float',
123
+ :'dian_status' => :'String',
124
+ :'direction' => :'String',
125
+ :'received_on' => :'Date',
126
+ :'source' => :'String',
127
+ :'company' => :'AccountCompanyReference',
128
+ :'radian' => :'RadianSummary'
129
+ }
130
+ end
131
+
132
+ # List of attributes with nullable: true
133
+ def self.openapi_nullable
134
+ Set.new([
135
+ :'dian_type',
136
+ :'number',
137
+ :'prefix',
138
+ :'cufe',
139
+ :'issued_on',
140
+ :'total',
141
+ :'tax_total',
142
+ :'dian_status',
143
+ :'received_on',
144
+ :'radian'
145
+ ])
146
+ end
147
+
148
+ # Returns attribute type mapping
149
+ def self.acceptable_openapi_types
150
+ openapi_types
151
+ end
152
+
153
+ # Returns the nullable attributes
154
+ def self.acceptable_openapi_nullable
155
+ openapi_nullable
156
+ end
157
+
158
+ # Initializes the object
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ def initialize(attributes = {})
161
+ if (!attributes.is_a?(Hash))
162
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountDianDocument` initialize method"
163
+ end
164
+
165
+ # check to see if the attribute exists and convert string to symbol for hash key
166
+ acceptable_attribute_map = self.class.acceptable_attribute_map
167
+ attributes = attributes.each_with_object({}) { |(k, v), h|
168
+ if (!acceptable_attribute_map.key?(k.to_sym))
169
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountDianDocument`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
170
+ end
171
+ h[k.to_sym] = v
172
+ }
173
+
174
+ if attributes.key?(:'id')
175
+ self.id = attributes[:'id']
176
+ end
177
+
178
+ if attributes.key?(:'object')
179
+ self.object = attributes[:'object']
180
+ end
181
+
182
+ if attributes.key?(:'environment')
183
+ self.environment = attributes[:'environment']
184
+ end
185
+
186
+ if attributes.key?(:'type')
187
+ self.type = attributes[:'type']
188
+ end
189
+
190
+ if attributes.key?(:'dian_type')
191
+ self.dian_type = attributes[:'dian_type']
192
+ end
193
+
194
+ if attributes.key?(:'number')
195
+ self.number = attributes[:'number']
196
+ end
197
+
198
+ if attributes.key?(:'prefix')
199
+ self.prefix = attributes[:'prefix']
200
+ end
201
+
202
+ if attributes.key?(:'cufe')
203
+ self.cufe = attributes[:'cufe']
204
+ end
205
+
206
+ if attributes.key?(:'issued_on')
207
+ self.issued_on = attributes[:'issued_on']
208
+ end
209
+
210
+ if attributes.key?(:'counterpart')
211
+ self.counterpart = attributes[:'counterpart']
212
+ end
213
+
214
+ if attributes.key?(:'currency')
215
+ self.currency = attributes[:'currency']
216
+ end
217
+
218
+ if attributes.key?(:'total')
219
+ self.total = attributes[:'total']
220
+ end
221
+
222
+ if attributes.key?(:'tax_total')
223
+ self.tax_total = attributes[:'tax_total']
224
+ end
225
+
226
+ if attributes.key?(:'dian_status')
227
+ self.dian_status = attributes[:'dian_status']
228
+ end
229
+
230
+ if attributes.key?(:'direction')
231
+ self.direction = attributes[:'direction']
232
+ end
233
+
234
+ if attributes.key?(:'received_on')
235
+ self.received_on = attributes[:'received_on']
236
+ end
237
+
238
+ if attributes.key?(:'source')
239
+ self.source = attributes[:'source']
240
+ end
241
+
242
+ if attributes.key?(:'company')
243
+ self.company = attributes[:'company']
244
+ end
245
+
246
+ if attributes.key?(:'radian')
247
+ self.radian = attributes[:'radian']
248
+ end
249
+ end
250
+
251
+ # Show invalid properties with the reasons. Usually used together with valid?
252
+ # @return Array for valid properties with the reasons
253
+ def list_invalid_properties
254
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
255
+ invalid_properties = Array.new
256
+ invalid_properties
257
+ end
258
+
259
+ # Check to see if the all the properties in the model are valid
260
+ # @return true if the model is valid
261
+ def valid?
262
+ warn '[DEPRECATED] the `valid?` method is obsolete'
263
+ true
264
+ end
265
+
266
+ # Checks equality by comparing each attribute.
267
+ # @param [Object] Object to be compared
268
+ def ==(o)
269
+ return true if self.equal?(o)
270
+ self.class == o.class &&
271
+ id == o.id &&
272
+ object == o.object &&
273
+ environment == o.environment &&
274
+ type == o.type &&
275
+ dian_type == o.dian_type &&
276
+ number == o.number &&
277
+ prefix == o.prefix &&
278
+ cufe == o.cufe &&
279
+ issued_on == o.issued_on &&
280
+ counterpart == o.counterpart &&
281
+ currency == o.currency &&
282
+ total == o.total &&
283
+ tax_total == o.tax_total &&
284
+ dian_status == o.dian_status &&
285
+ direction == o.direction &&
286
+ received_on == o.received_on &&
287
+ source == o.source &&
288
+ company == o.company &&
289
+ radian == o.radian
290
+ end
291
+
292
+ # @see the `==` method
293
+ # @param [Object] Object to be compared
294
+ def eql?(o)
295
+ self == o
296
+ end
297
+
298
+ # Calculates hash code according to all attributes.
299
+ # @return [Integer] Hash code
300
+ def hash
301
+ [id, object, environment, type, dian_type, number, prefix, cufe, issued_on, counterpart, currency, total, tax_total, dian_status, direction, received_on, source, company, radian].hash
302
+ end
303
+
304
+ # Builds the object from hash
305
+ # @param [Hash] attributes Model attributes in the form of hash
306
+ # @return [Object] Returns the model itself
307
+ def self.build_from_hash(attributes)
308
+ return nil unless attributes.is_a?(Hash)
309
+ attributes = attributes.transform_keys(&:to_sym)
310
+ # include attributes inherited from allOf parents (the nearest declaration wins)
311
+ map = acceptable_attribute_map
312
+ transformed_hash = {}
313
+ acceptable_openapi_types.each_pair do |key, type|
314
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
315
+ transformed_hash["#{key}"] = nil
316
+ elsif type =~ /\AArray<(.*)>/i
317
+ # check to ensure the input is an array given that the attribute
318
+ # is documented as an array but the input is not
319
+ if attributes[map[key]].is_a?(Array)
320
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
321
+ end
322
+ elsif !attributes[map[key]].nil?
323
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
324
+ end
325
+ end
326
+ new(transformed_hash)
327
+ end
328
+
329
+ # Returns the object in the form of hash
330
+ # @return [Hash] Returns the object in the form of hash
331
+ def to_hash
332
+ hash = {}
333
+ # include attributes inherited from allOf parents (the nearest declaration wins)
334
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
335
+ value = self.send(attr)
336
+ if value.nil?
337
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
338
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
339
+ end
340
+
341
+ hash[param] = _to_hash(value)
342
+ end
343
+ hash
344
+ end
345
+
346
+ end
347
+
348
+ end