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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/GENERADO.md +1 -1
- data/README.md +29 -4
- data/lib/trevol/client.rb +71 -9
- data/lib/trevol/llave.rb +30 -7
- data/lib/trevol/transporte.rb +44 -4
- data/lib/trevol_generado/api/account_api.rb +752 -0
- data/lib/trevol_generado/api/balance_api.rb +2 -2
- data/lib/trevol_generado/api/general_api.rb +2 -2
- data/lib/trevol_generado/api/requests_api.rb +2 -2
- data/lib/trevol_generado/models/account_api_key.rb +312 -0
- data/lib/trevol_generado/models/account_api_key_input.rb +254 -0
- data/lib/trevol_generado/models/account_api_key_list.rb +191 -0
- data/lib/trevol_generado/models/account_api_key_revocation.rb +181 -0
- data/lib/trevol_generado/models/account_company.rb +285 -0
- data/lib/trevol_generado/models/account_company_api_key_counts.rb +170 -0
- data/lib/trevol_generado/models/account_company_input.rb +209 -0
- data/lib/trevol_generado/models/account_company_list.rb +191 -0
- data/lib/trevol_generado/models/account_company_onboarding.rb +173 -0
- data/lib/trevol_generado/models/account_company_reference.rb +183 -0
- data/lib/trevol_generado/models/account_dian_counterpart.rb +193 -0
- data/lib/trevol_generado/models/account_dian_document.rb +348 -0
- data/lib/trevol_generado/models/account_dian_document_list.rb +191 -0
- data/lib/trevol_generado/models/account_key.rb +234 -0
- data/lib/trevol_generado/models/account_key_info.rb +181 -0
- data/lib/trevol_generado/models/account_key_info_account.rb +161 -0
- data/lib/trevol_generado/models/account_key_scope.rb +174 -0
- data/lib/trevol_generado/models/account_radian_event.rb +369 -0
- data/lib/trevol_generado/models/account_radian_event_list.rb +191 -0
- data/lib/trevol_generado/models/account_request_log.rb +262 -0
- data/lib/trevol_generado/models/account_request_log_list.rb +191 -0
- data/lib/trevol_generado/models/problem.rb +35 -5
- data/lib/trevol_generado/models/radian_summary.rb +183 -0
- data/lib/trevol_generado/models/radian_summary_event.rb +201 -0
- data/lib/trevol_generado/tablas.rb +166 -151
- data/lib/trevol_generado/version.rb +1 -1
- data/lib/trevol_generado.rb +24 -0
- metadata +25 -1
|
@@ -21,7 +21,7 @@ module TrevolGenerado
|
|
|
21
21
|
|
|
22
22
|
attr_accessor :status
|
|
23
23
|
|
|
24
|
-
# Valores conocidos: `authentication_required`, `automatic_mode_unavailable`, `certificate_problem`, `company_busy`, `company_not_enabled`, `confirmation_required`, `dian_rejected`, `dian_unavailable`, `duplicate_customer`, `duplicate_document`, `duplicate_product`, `external_id_in_use`, `file_unavailable`, `idempotency_key_required`, `idempotency_key_reused`, `insufficient_balance`, `internal_error`, `invalid_api_key`, `invalid_json`, `invalid_request`, `invalid_state`, `method_not_allowed`, `not_found`, `numbering_request_in_progress`, `numbering_unavailable`, `paper_numbering_limit_reached`, `permission_denied`, `portal_read_required`, `previous_event_pending`, `range_protected`, `rate_limited`, `report_too_large`, `request_in_progress`, `tacit_acceptance_not_due`, `top_up_above_maximum`, `top_up_below_minimum`, `top_ups_unavailable`, `unsupported_version`, `validation_error`, `webhook_limit_reached`.
|
|
24
|
+
# Valores conocidos: `authentication_required`, `automatic_mode_unavailable`, `certificate_problem`, `company_busy`, `company_exists`, `company_limit_reached`, `company_not_enabled`, `confirmation_required`, `dian_rejected`, `dian_unavailable`, `duplicate_customer`, `duplicate_document`, `duplicate_product`, `external_id_in_use`, `file_unavailable`, `idempotency_key_required`, `idempotency_key_reused`, `insufficient_balance`, `internal_error`, `invalid_api_key`, `invalid_json`, `invalid_request`, `invalid_state`, `key_limit_reached`, `method_not_allowed`, `not_found`, `numbering_request_in_progress`, `numbering_unavailable`, `paper_numbering_limit_reached`, `permission_denied`, `portal_read_required`, `previous_event_pending`, `range_protected`, `rate_limited`, `report_too_large`, `request_in_progress`, `tacit_acceptance_not_due`, `top_up_above_maximum`, `top_up_below_minimum`, `top_ups_unavailable`, `unsupported_version`, `validation_error`, `webhook_limit_reached`.
|
|
25
25
|
attr_accessor :code
|
|
26
26
|
|
|
27
27
|
attr_accessor :detail
|
|
@@ -39,7 +39,7 @@ module TrevolGenerado
|
|
|
39
39
|
# En `external_id_in_use` y `duplicate_document`: el id (con el prefijo de su clase) del recurso que ya existe. En `numbering_request_in_progress`: la solicitud en curso (`nreq_…`). En `duplicate_customer` y `duplicate_product`: el `cus_…` o `prod_…` que ya existe. No viene en un `duplicate_customer` por `document_number` pedido con una llave sin `customers:read` (diría de quién es ese documento).
|
|
40
40
|
attr_accessor :existing_id
|
|
41
41
|
|
|
42
|
-
# En `company_not_enabled` (`missing_legal_representative`, `missing_pin`, `missing_software`, `payroll_not_enabled`) y en `numbering_unavailable` (`missing_technical_key`, `no_contingency_numbering`, `no_resolution`, `prefix_in_use`, `resolution_exhausted`, `resolution_expired`, `resolution_not_yet_valid`): por qué. En `automatic_mode_unavailable` (`credentials_missing`, `mandate_required`: falta el mandato para integraciones que se acepta en la app, `disabled`) y en `permission_denied` de una ruta que solo existe en producción (`live_mode_required`). Valores conocidos: `credentials_missing`, `disabled`, `live_mode_required`, `mandate_required`, `missing_legal_representative`, `missing_pin`, `missing_software`, `missing_technical_key`, `no_contingency_numbering`, `no_resolution`, `payroll_not_enabled`, `prefix_in_use`, `resolution_exhausted`, `resolution_expired`, `resolution_not_yet_valid`.
|
|
42
|
+
# En `company_not_enabled` (`missing_legal_representative`, `missing_pin`, `missing_software`, `payroll_not_enabled`) y en `numbering_unavailable` (`missing_technical_key`, `no_contingency_numbering`, `no_resolution`, `prefix_in_use`, `resolution_exhausted`, `resolution_expired`, `resolution_not_yet_valid`): por qué. En `automatic_mode_unavailable` (`credentials_missing`, `mandate_required`: falta el mandato para integraciones que se acepta en la app, `disabled`) y en `permission_denied` de una ruta que solo existe en producción (`live_mode_required`). En `permission_denied` de una llave de administración: `environment_mismatch` (`Trevol-Environment` no es el ambiente de la llave), `live_mode_required` (el alta de empresas pide una llave de producción) y `scope_list` (una llave con alcance de lista no da de alta empresas; como esa llave no puede tener `companies:write`, lo que llega en la práctica es el 403 con `required_permission: companies:write`). Valores conocidos: `credentials_missing`, `disabled`, `environment_mismatch`, `live_mode_required`, `mandate_required`, `missing_legal_representative`, `missing_pin`, `missing_software`, `missing_technical_key`, `no_contingency_numbering`, `no_resolution`, `payroll_not_enabled`, `prefix_in_use`, `resolution_exhausted`, `resolution_expired`, `resolution_not_yet_valid`, `scope_list`.
|
|
43
43
|
attr_accessor :reason
|
|
44
44
|
|
|
45
45
|
# En `previous_event_pending`: el evento que la DIAN todavía no muestra.
|
|
@@ -51,7 +51,13 @@ module TrevolGenerado
|
|
|
51
51
|
# En `top_up_above_maximum`: la recarga máxima, en pesos.
|
|
52
52
|
attr_accessor :maximum_cop
|
|
53
53
|
|
|
54
|
-
# En `
|
|
54
|
+
# En `insufficient_balance` de una operación cobrada: el saldo disponible de la cuenta, en pesos.
|
|
55
|
+
attr_accessor :balance_cop
|
|
56
|
+
|
|
57
|
+
# En `insufficient_balance` de una operación cobrada: lo que cuesta la operación, en pesos.
|
|
58
|
+
attr_accessor :price_cop
|
|
59
|
+
|
|
60
|
+
# En `rate_limited`: qué límite se pasó. Con una llave de administración: `lecturas` (600 peticiones por minuto de la llave en `/v1/account`), `account_key` (el mismo contador, visto desde una ruta de empresa), `api_keys` (60 llaves de empresa creadas o revocadas por hora) y `account_queries` (60 consultas de documentos o eventos por minuto, sumando las llaves de la cuenta). En `company_limit_reached`: `hour` (20 altas por hora) o `day` (100 por día).
|
|
55
61
|
attr_accessor :limit
|
|
56
62
|
|
|
57
63
|
# En `tacit_acceptance_not_due`: desde cuándo procede la aceptación tácita. `null` si la DIAN todavía no muestra el recibo del bien (032) de la compradora: consulta de nuevo en unos minutos con `GET /v1/invoices/{id}/tacit_acceptance`.
|
|
@@ -66,9 +72,12 @@ module TrevolGenerado
|
|
|
66
72
|
# En `duplicate_customer` y `duplicate_product`: si el que ya existe está activo (si no, reactívalo con PATCH). No viene en un `duplicate_customer` por `document_number` pedido con una llave sin `customers:read` (diría de quién es ese documento).
|
|
67
73
|
attr_accessor :existing_active
|
|
68
74
|
|
|
69
|
-
# En `permission_denied`: el permiso de la llave que hace falta (buscar clientes por su documento necesita `customers:read`). Valores conocidos: `customers:read`.
|
|
75
|
+
# En `permission_denied`: el permiso de la llave que hace falta (buscar clientes por su documento necesita `customers:read`). Con una llave de administración, el permiso que le falta a esa llave (`companies:read`, `companies:write`, `keys:write`, `documents:read`, `documents:write`, `customers:read`). Valores conocidos: `companies:read`, `companies:write`, `keys:write`, `documents:read`, `documents:write`, `customers:read`.
|
|
70
76
|
attr_accessor :required_permission
|
|
71
77
|
|
|
78
|
+
# En `company_exists`: la empresa que ya está en la cuenta con ese NIT.
|
|
79
|
+
attr_accessor :company
|
|
80
|
+
|
|
72
81
|
# En `report_too_large`: cuántos documentos tiene lo pedido.
|
|
73
82
|
attr_accessor :rows
|
|
74
83
|
|
|
@@ -93,12 +102,15 @@ module TrevolGenerado
|
|
|
93
102
|
:'previous' => :'previous',
|
|
94
103
|
:'minimum_cop' => :'minimum_cop',
|
|
95
104
|
:'maximum_cop' => :'maximum_cop',
|
|
105
|
+
:'balance_cop' => :'balance_cop',
|
|
106
|
+
:'price_cop' => :'price_cop',
|
|
96
107
|
:'limit' => :'limit',
|
|
97
108
|
:'available_from' => :'available_from',
|
|
98
109
|
:'rules' => :'rules',
|
|
99
110
|
:'current_software' => :'current_software',
|
|
100
111
|
:'existing_active' => :'existing_active',
|
|
101
112
|
:'required_permission' => :'required_permission',
|
|
113
|
+
:'company' => :'company',
|
|
102
114
|
:'rows' => :'rows',
|
|
103
115
|
:'max_rows' => :'max_rows'
|
|
104
116
|
}
|
|
@@ -132,12 +144,15 @@ module TrevolGenerado
|
|
|
132
144
|
:'previous' => :'String',
|
|
133
145
|
:'minimum_cop' => :'Integer',
|
|
134
146
|
:'maximum_cop' => :'Integer',
|
|
147
|
+
:'balance_cop' => :'Integer',
|
|
148
|
+
:'price_cop' => :'Integer',
|
|
135
149
|
:'limit' => :'String',
|
|
136
150
|
:'available_from' => :'Date',
|
|
137
151
|
:'rules' => :'Array<Object>',
|
|
138
152
|
:'current_software' => :'ProblemCurrentSoftware',
|
|
139
153
|
:'existing_active' => :'Boolean',
|
|
140
154
|
:'required_permission' => :'String',
|
|
155
|
+
:'company' => :'AccountCompany',
|
|
141
156
|
:'rows' => :'Integer',
|
|
142
157
|
:'max_rows' => :'Integer'
|
|
143
158
|
}
|
|
@@ -240,6 +255,14 @@ module TrevolGenerado
|
|
|
240
255
|
self.maximum_cop = attributes[:'maximum_cop']
|
|
241
256
|
end
|
|
242
257
|
|
|
258
|
+
if attributes.key?(:'balance_cop')
|
|
259
|
+
self.balance_cop = attributes[:'balance_cop']
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if attributes.key?(:'price_cop')
|
|
263
|
+
self.price_cop = attributes[:'price_cop']
|
|
264
|
+
end
|
|
265
|
+
|
|
243
266
|
if attributes.key?(:'limit')
|
|
244
267
|
self.limit = attributes[:'limit']
|
|
245
268
|
end
|
|
@@ -266,6 +289,10 @@ module TrevolGenerado
|
|
|
266
289
|
self.required_permission = attributes[:'required_permission']
|
|
267
290
|
end
|
|
268
291
|
|
|
292
|
+
if attributes.key?(:'company')
|
|
293
|
+
self.company = attributes[:'company']
|
|
294
|
+
end
|
|
295
|
+
|
|
269
296
|
if attributes.key?(:'rows')
|
|
270
297
|
self.rows = attributes[:'rows']
|
|
271
298
|
end
|
|
@@ -310,12 +337,15 @@ module TrevolGenerado
|
|
|
310
337
|
previous == o.previous &&
|
|
311
338
|
minimum_cop == o.minimum_cop &&
|
|
312
339
|
maximum_cop == o.maximum_cop &&
|
|
340
|
+
balance_cop == o.balance_cop &&
|
|
341
|
+
price_cop == o.price_cop &&
|
|
313
342
|
limit == o.limit &&
|
|
314
343
|
available_from == o.available_from &&
|
|
315
344
|
rules == o.rules &&
|
|
316
345
|
current_software == o.current_software &&
|
|
317
346
|
existing_active == o.existing_active &&
|
|
318
347
|
required_permission == o.required_permission &&
|
|
348
|
+
company == o.company &&
|
|
319
349
|
rows == o.rows &&
|
|
320
350
|
max_rows == o.max_rows
|
|
321
351
|
end
|
|
@@ -329,7 +359,7 @@ module TrevolGenerado
|
|
|
329
359
|
# Calculates hash code according to all attributes.
|
|
330
360
|
# @return [Integer] Hash code
|
|
331
361
|
def hash
|
|
332
|
-
[type, title, status, code, detail, retryable, retry_after, request_id, errors, document, existing_id, reason, previous, minimum_cop, maximum_cop, limit, available_from, rules, current_software, existing_active, required_permission, rows, max_rows].hash
|
|
362
|
+
[type, title, status, code, detail, retryable, retry_after, request_id, errors, document, existing_id, reason, previous, minimum_cop, maximum_cop, balance_cop, price_cop, limit, available_from, rules, current_software, existing_active, required_permission, company, rows, max_rows].hash
|
|
333
363
|
end
|
|
334
364
|
|
|
335
365
|
# Builds the object from hash
|
|
@@ -0,0 +1,183 @@
|
|
|
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 eventos RADIAN de una factura que Trevol registró: los que llegaron al buzón y los que la empresa envió con Trevol. NO es el estado oficial en la DIAN (no se le consulta) y puede estar incompleto: un evento hecho en otro software que no llegó al buzón no aparece.
|
|
18
|
+
class RadianSummary < ApiModelBase
|
|
19
|
+
# Sale solo de los eventos verificados, con esta precedencia: `claimed` (031) > `accepted` (033) o `tacitly_accepted` (034) > `goods_received` (032) > `acknowledged` (030) > `none`. Valores conocidos: `claimed`, `accepted`, `tacitly_accepted`, `goods_received`, `acknowledged`, `none`.
|
|
20
|
+
attr_accessor :status
|
|
21
|
+
|
|
22
|
+
attr_accessor :events
|
|
23
|
+
|
|
24
|
+
# Cuándo se armó el resumen.
|
|
25
|
+
attr_accessor :as_of
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'status' => :'status',
|
|
31
|
+
:'events' => :'events',
|
|
32
|
+
:'as_of' => :'as_of'
|
|
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
|
+
:'status' => :'String',
|
|
50
|
+
:'events' => :'Array<RadianSummaryEvent>',
|
|
51
|
+
:'as_of' => :'Time'
|
|
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::RadianSummary` 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::RadianSummary`. 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?(:'status')
|
|
88
|
+
self.status = attributes[:'status']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'events')
|
|
92
|
+
if (value = attributes[:'events']).is_a?(Array)
|
|
93
|
+
self.events = value
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'as_of')
|
|
98
|
+
self.as_of = attributes[:'as_of']
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
103
|
+
# @return Array for valid properties with the reasons
|
|
104
|
+
def list_invalid_properties
|
|
105
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
106
|
+
invalid_properties = Array.new
|
|
107
|
+
invalid_properties
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Check to see if the all the properties in the model are valid
|
|
111
|
+
# @return true if the model is valid
|
|
112
|
+
def valid?
|
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
|
+
true
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Checks equality by comparing each attribute.
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def ==(o)
|
|
120
|
+
return true if self.equal?(o)
|
|
121
|
+
self.class == o.class &&
|
|
122
|
+
status == o.status &&
|
|
123
|
+
events == o.events &&
|
|
124
|
+
as_of == o.as_of
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# @see the `==` method
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def eql?(o)
|
|
130
|
+
self == o
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Calculates hash code according to all attributes.
|
|
134
|
+
# @return [Integer] Hash code
|
|
135
|
+
def hash
|
|
136
|
+
[status, events, as_of].hash
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Builds the object from hash
|
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
141
|
+
# @return [Object] Returns the model itself
|
|
142
|
+
def self.build_from_hash(attributes)
|
|
143
|
+
return nil unless attributes.is_a?(Hash)
|
|
144
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
145
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
146
|
+
map = acceptable_attribute_map
|
|
147
|
+
transformed_hash = {}
|
|
148
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
149
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
150
|
+
transformed_hash["#{key}"] = nil
|
|
151
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
152
|
+
# check to ensure the input is an array given that the attribute
|
|
153
|
+
# is documented as an array but the input is not
|
|
154
|
+
if attributes[map[key]].is_a?(Array)
|
|
155
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
156
|
+
end
|
|
157
|
+
elsif !attributes[map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
new(transformed_hash)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Returns the object in the form of hash
|
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
|
166
|
+
def to_hash
|
|
167
|
+
hash = {}
|
|
168
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
169
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
170
|
+
value = self.send(attr)
|
|
171
|
+
if value.nil?
|
|
172
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
173
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
hash[param] = _to_hash(value)
|
|
177
|
+
end
|
|
178
|
+
hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
end
|
|
@@ -0,0 +1,201 @@
|
|
|
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 RadianSummaryEvent < ApiModelBase
|
|
18
|
+
# Valores conocidos: `030`, `031`, `032`, `033`, `034`.
|
|
19
|
+
attr_accessor :code
|
|
20
|
+
|
|
21
|
+
# `company`: lo envió la empresa; `counterparty`: la otra parte. Valores conocidos: `company`, `counterparty`.
|
|
22
|
+
attr_accessor :by
|
|
23
|
+
|
|
24
|
+
# El número del evento, si se conoce.
|
|
25
|
+
attr_accessor :number
|
|
26
|
+
|
|
27
|
+
attr_accessor :date
|
|
28
|
+
|
|
29
|
+
# Si la DIAN lo confirmó. Uno sin verificar no cambia `status`.
|
|
30
|
+
attr_accessor :verified
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'code' => :'code',
|
|
36
|
+
:'by' => :'by',
|
|
37
|
+
:'number' => :'number',
|
|
38
|
+
:'date' => :'date',
|
|
39
|
+
:'verified' => :'verified'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Returns attribute mapping this model knows about
|
|
44
|
+
def self.acceptable_attribute_map
|
|
45
|
+
attribute_map
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
acceptable_attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'code' => :'String',
|
|
57
|
+
:'by' => :'String',
|
|
58
|
+
:'number' => :'String',
|
|
59
|
+
:'date' => :'Date',
|
|
60
|
+
:'verified' => :'Boolean'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# List of attributes with nullable: true
|
|
65
|
+
def self.openapi_nullable
|
|
66
|
+
Set.new([
|
|
67
|
+
:'date',
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns attribute type mapping
|
|
72
|
+
def self.acceptable_openapi_types
|
|
73
|
+
openapi_types
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Returns the nullable attributes
|
|
77
|
+
def self.acceptable_openapi_nullable
|
|
78
|
+
openapi_nullable
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Initializes the object
|
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
83
|
+
def initialize(attributes = {})
|
|
84
|
+
if (!attributes.is_a?(Hash))
|
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::RadianSummaryEvent` initialize method"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::RadianSummaryEvent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
93
|
+
end
|
|
94
|
+
h[k.to_sym] = v
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'code')
|
|
98
|
+
self.code = attributes[:'code']
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'by')
|
|
102
|
+
self.by = attributes[:'by']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'number')
|
|
106
|
+
self.number = attributes[:'number']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'date')
|
|
110
|
+
self.date = attributes[:'date']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'verified')
|
|
114
|
+
self.verified = attributes[:'verified']
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
119
|
+
# @return Array for valid properties with the reasons
|
|
120
|
+
def list_invalid_properties
|
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
122
|
+
invalid_properties = Array.new
|
|
123
|
+
invalid_properties
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Check to see if the all the properties in the model are valid
|
|
127
|
+
# @return true if the model is valid
|
|
128
|
+
def valid?
|
|
129
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
130
|
+
true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Checks equality by comparing each attribute.
|
|
134
|
+
# @param [Object] Object to be compared
|
|
135
|
+
def ==(o)
|
|
136
|
+
return true if self.equal?(o)
|
|
137
|
+
self.class == o.class &&
|
|
138
|
+
code == o.code &&
|
|
139
|
+
by == o.by &&
|
|
140
|
+
number == o.number &&
|
|
141
|
+
date == o.date &&
|
|
142
|
+
verified == o.verified
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# @see the `==` method
|
|
146
|
+
# @param [Object] Object to be compared
|
|
147
|
+
def eql?(o)
|
|
148
|
+
self == o
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Calculates hash code according to all attributes.
|
|
152
|
+
# @return [Integer] Hash code
|
|
153
|
+
def hash
|
|
154
|
+
[code, by, number, date, verified].hash
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Builds the object from hash
|
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
159
|
+
# @return [Object] Returns the model itself
|
|
160
|
+
def self.build_from_hash(attributes)
|
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
|
162
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
163
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
164
|
+
map = acceptable_attribute_map
|
|
165
|
+
transformed_hash = {}
|
|
166
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
167
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
168
|
+
transformed_hash["#{key}"] = nil
|
|
169
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
170
|
+
# check to ensure the input is an array given that the attribute
|
|
171
|
+
# is documented as an array but the input is not
|
|
172
|
+
if attributes[map[key]].is_a?(Array)
|
|
173
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
174
|
+
end
|
|
175
|
+
elsif !attributes[map[key]].nil?
|
|
176
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
new(transformed_hash)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Returns the object in the form of hash
|
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
|
184
|
+
def to_hash
|
|
185
|
+
hash = {}
|
|
186
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
187
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
188
|
+
value = self.send(attr)
|
|
189
|
+
if value.nil?
|
|
190
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
hash[param] = _to_hash(value)
|
|
195
|
+
end
|
|
196
|
+
hash
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
end
|