trevol 0.2.0 → 0.3.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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -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 +2 -2
  10. data/lib/trevol_generado/api/general_api.rb +2 -2
  11. data/lib/trevol_generado/api/requests_api.rb +2 -2
  12. data/lib/trevol_generado/models/account_api_key.rb +312 -0
  13. data/lib/trevol_generado/models/account_api_key_input.rb +254 -0
  14. data/lib/trevol_generado/models/account_api_key_list.rb +191 -0
  15. data/lib/trevol_generado/models/account_api_key_revocation.rb +181 -0
  16. data/lib/trevol_generado/models/account_company.rb +285 -0
  17. data/lib/trevol_generado/models/account_company_api_key_counts.rb +170 -0
  18. data/lib/trevol_generado/models/account_company_input.rb +209 -0
  19. data/lib/trevol_generado/models/account_company_list.rb +191 -0
  20. data/lib/trevol_generado/models/account_company_onboarding.rb +173 -0
  21. data/lib/trevol_generado/models/account_company_reference.rb +183 -0
  22. data/lib/trevol_generado/models/account_dian_counterpart.rb +193 -0
  23. data/lib/trevol_generado/models/account_dian_document.rb +348 -0
  24. data/lib/trevol_generado/models/account_dian_document_list.rb +191 -0
  25. data/lib/trevol_generado/models/account_key.rb +234 -0
  26. data/lib/trevol_generado/models/account_key_info.rb +181 -0
  27. data/lib/trevol_generado/models/account_key_info_account.rb +161 -0
  28. data/lib/trevol_generado/models/account_key_scope.rb +174 -0
  29. data/lib/trevol_generado/models/account_radian_event.rb +369 -0
  30. data/lib/trevol_generado/models/account_radian_event_list.rb +191 -0
  31. data/lib/trevol_generado/models/account_request_log.rb +262 -0
  32. data/lib/trevol_generado/models/account_request_log_list.rb +191 -0
  33. data/lib/trevol_generado/models/problem.rb +35 -5
  34. data/lib/trevol_generado/models/radian_summary.rb +183 -0
  35. data/lib/trevol_generado/models/radian_summary_event.rb +201 -0
  36. data/lib/trevol_generado/tablas.rb +166 -151
  37. data/lib/trevol_generado/version.rb +1 -1
  38. data/lib/trevol_generado.rb +24 -0
  39. metadata +25 -1
@@ -0,0 +1,234 @@
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 llave de administración (solo metadatos: el token se muestra una sola vez, en la consola, al crearla).
18
+ class AccountKey < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ # Valores conocidos: `account_key`.
22
+ attr_accessor :object
23
+
24
+ # Los primeros 14 caracteres del token (`tva_live_ab12c`), para reconocerla.
25
+ attr_accessor :prefix
26
+
27
+ # `test` (habilitación) con una `tva_test_…`; `live` (producción) con una `tva_live_…`. No cambia. Valores conocidos: `test`, `live`.
28
+ attr_accessor :environment
29
+
30
+ # `companies:read` (ver las empresas y sus llaves), `companies:write` (reservar empresas), `keys:write` (crear y revocar llaves de empresa), `documents:read` (leer documentos y eventos), `documents:write` (emitir; incluye `documents:read`) y `customers:read` (los datos personales de los clientes).
31
+ attr_accessor :permissions
32
+
33
+ # Las direcciones IP o redes CIDR desde donde sirve; vacía, desde cualquiera.
34
+ attr_accessor :allowed_ips
35
+
36
+ # La versión de la API de la llave (el encabezado `Trevol-Version` manda). Valores conocidos: `2026-10-21`, `2026-10-22`, `2026-11-18`.
37
+ attr_accessor :api_version
38
+
39
+ attr_accessor :scope
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'id' => :'id',
45
+ :'object' => :'object',
46
+ :'prefix' => :'prefix',
47
+ :'environment' => :'environment',
48
+ :'permissions' => :'permissions',
49
+ :'allowed_ips' => :'allowed_ips',
50
+ :'api_version' => :'api_version',
51
+ :'scope' => :'scope'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'id' => :'String',
69
+ :'object' => :'String',
70
+ :'prefix' => :'String',
71
+ :'environment' => :'String',
72
+ :'permissions' => :'Array<String>',
73
+ :'allowed_ips' => :'Array<String>',
74
+ :'api_version' => :'String',
75
+ :'scope' => :'AccountKeyScope'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Returns attribute type mapping
86
+ def self.acceptable_openapi_types
87
+ openapi_types
88
+ end
89
+
90
+ # Returns the nullable attributes
91
+ def self.acceptable_openapi_nullable
92
+ openapi_nullable
93
+ end
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ def initialize(attributes = {})
98
+ if (!attributes.is_a?(Hash))
99
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::AccountKey` initialize method"
100
+ end
101
+
102
+ # check to see if the attribute exists and convert string to symbol for hash key
103
+ acceptable_attribute_map = self.class.acceptable_attribute_map
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!acceptable_attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'id')
112
+ self.id = attributes[:'id']
113
+ end
114
+
115
+ if attributes.key?(:'object')
116
+ self.object = attributes[:'object']
117
+ end
118
+
119
+ if attributes.key?(:'prefix')
120
+ self.prefix = attributes[:'prefix']
121
+ end
122
+
123
+ if attributes.key?(:'environment')
124
+ self.environment = attributes[:'environment']
125
+ end
126
+
127
+ if attributes.key?(:'permissions')
128
+ if (value = attributes[:'permissions']).is_a?(Array)
129
+ self.permissions = value
130
+ end
131
+ end
132
+
133
+ if attributes.key?(:'allowed_ips')
134
+ if (value = attributes[:'allowed_ips']).is_a?(Array)
135
+ self.allowed_ips = value
136
+ end
137
+ end
138
+
139
+ if attributes.key?(:'api_version')
140
+ self.api_version = attributes[:'api_version']
141
+ end
142
+
143
+ if attributes.key?(:'scope')
144
+ self.scope = attributes[:'scope']
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
152
+ invalid_properties = Array.new
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
+ true
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ id == o.id &&
169
+ object == o.object &&
170
+ prefix == o.prefix &&
171
+ environment == o.environment &&
172
+ permissions == o.permissions &&
173
+ allowed_ips == o.allowed_ips &&
174
+ api_version == o.api_version &&
175
+ scope == o.scope
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [id, object, prefix, environment, permissions, allowed_ips, api_version, scope].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ # include attributes inherited from allOf parents (the nearest declaration wins)
197
+ map = acceptable_attribute_map
198
+ transformed_hash = {}
199
+ acceptable_openapi_types.each_pair do |key, type|
200
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
201
+ transformed_hash["#{key}"] = nil
202
+ elsif type =~ /\AArray<(.*)>/i
203
+ # check to ensure the input is an array given that the attribute
204
+ # is documented as an array but the input is not
205
+ if attributes[map[key]].is_a?(Array)
206
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
207
+ end
208
+ elsif !attributes[map[key]].nil?
209
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
210
+ end
211
+ end
212
+ new(transformed_hash)
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ # include attributes inherited from allOf parents (the nearest declaration wins)
220
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ end
233
+
234
+ 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 cuenta y la llave de administración con que llamas.
18
+ class AccountKeyInfo < ApiModelBase
19
+ # Valores conocidos: `account_key_info`.
20
+ attr_accessor :object
21
+
22
+ # Tu cuenta de Trevol.
23
+ attr_accessor :account
24
+
25
+ attr_accessor :key
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'object' => :'object',
31
+ :'account' => :'account',
32
+ :'key' => :'key'
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
+ :'object' => :'String',
50
+ :'account' => :'AccountKeyInfoAccount',
51
+ :'key' => :'AccountKey'
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::AccountKeyInfo` 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::AccountKeyInfo`. 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?(:'object')
88
+ self.object = attributes[:'object']
89
+ end
90
+
91
+ if attributes.key?(:'account')
92
+ self.account = attributes[:'account']
93
+ end
94
+
95
+ if attributes.key?(:'key')
96
+ self.key = attributes[:'key']
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
+ object == o.object &&
121
+ account == o.account &&
122
+ key == o.key
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
+ [object, account, key].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
@@ -0,0 +1,161 @@
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
+ # Tu cuenta de Trevol.
18
+ class AccountKeyInfoAccount < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'id' => :'id'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Returns attribute type mapping
52
+ def self.acceptable_openapi_types
53
+ openapi_types
54
+ end
55
+
56
+ # Returns the nullable attributes
57
+ def self.acceptable_openapi_nullable
58
+ openapi_nullable
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 `TrevolGenerado::AccountKeyInfoAccount` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::AccountKeyInfoAccount`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'id')
78
+ self.id = attributes[:'id']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ id == o.id
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
+ [id].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
+ # include attributes inherited from allOf parents (the nearest declaration wins)
124
+ map = acceptable_attribute_map
125
+ transformed_hash = {}
126
+ acceptable_openapi_types.each_pair do |key, type|
127
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
134
+ end
135
+ elsif !attributes[map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
137
+ end
138
+ end
139
+ new(transformed_hash)
140
+ end
141
+
142
+ # Returns the object in the form of hash
143
+ # @return [Hash] Returns the object in the form of hash
144
+ def to_hash
145
+ hash = {}
146
+ # include attributes inherited from allOf parents (the nearest declaration wins)
147
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
148
+ value = self.send(attr)
149
+ if value.nil?
150
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
151
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
152
+ end
153
+
154
+ hash[param] = _to_hash(value)
155
+ end
156
+ hash
157
+ end
158
+
159
+ end
160
+
161
+ end