trevol 0.3.0 → 0.4.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 +34 -0
- data/GENERADO.md +1 -1
- data/README.md +1 -1
- data/lib/trevol/client.rb +6 -1
- data/lib/trevol/transporte.rb +1 -0
- data/lib/trevol_generado/api/account_api.rb +2 -2
- data/lib/trevol_generado/api/balance_api.rb +2 -2
- data/lib/trevol_generado/api/catalogs_api.rb +164 -0
- data/lib/trevol_generado/api/company_settings_api.rb +384 -0
- data/lib/trevol_generado/api/credit_notes_api.rb +79 -0
- data/lib/trevol_generado/api/debit_notes_api.rb +79 -0
- data/lib/trevol_generado/api/dian_documents_api.rb +8 -2
- data/lib/trevol_generado/api/dian_syncs_api.rb +2 -2
- data/lib/trevol_generado/api/equivalent_document_adjustments_api.rb +79 -0
- data/lib/trevol_generado/api/equivalent_documents_api.rb +79 -0
- data/lib/trevol_generado/api/invoices_api.rb +79 -0
- data/lib/trevol_generado/api/payroll_adjustments_api.rb +6 -0
- data/lib/trevol_generado/api/payrolls_api.rb +6 -0
- data/lib/trevol_generado/api/pdf_designs_api.rb +357 -0
- data/lib/trevol_generado/api/pdf_templates_api.rb +79 -0
- data/lib/trevol_generado/api/radian_events_api.rb +6 -0
- data/lib/trevol_generado/api/support_document_adjustments_api.rb +6 -0
- data/lib/trevol_generado/api/support_documents_api.rb +6 -0
- data/lib/trevol_generado/models/account_api_key_input.rb +1 -1
- data/lib/trevol_generado/models/account_company.rb +11 -1
- data/lib/trevol_generado/models/account_company_onboarding.rb +1 -1
- data/lib/trevol_generado/models/balance.rb +2 -2
- data/lib/trevol_generado/models/balance_operation_prices.rb +1 -1
- data/lib/trevol_generado/models/code_list.rb +245 -0
- data/lib/trevol_generado/models/code_list_entry.rb +353 -0
- data/lib/trevol_generado/models/code_list_entry_list.rb +191 -0
- data/lib/trevol_generado/models/code_list_list.rb +191 -0
- data/lib/trevol_generado/models/code_list_rates.rb +174 -0
- data/lib/trevol_generado/models/company.rb +11 -1
- data/lib/trevol_generado/models/company_logo.rb +217 -0
- data/lib/trevol_generado/models/company_logo_deleted.rb +170 -0
- data/lib/trevol_generado/models/company_logo_input.rb +178 -0
- data/lib/trevol_generado/models/delivery.rb +16 -5
- data/lib/trevol_generado/models/delivery_email_resends.rb +171 -0
- data/lib/trevol_generado/models/document.rb +37 -5
- data/lib/trevol_generado/models/document_totals_item.rb +1 -0
- data/lib/trevol_generado/models/email_resend.rb +256 -0
- data/lib/trevol_generado/models/email_resend_delivery.rb +183 -0
- data/lib/trevol_generado/models/email_resend_request.rb +163 -0
- data/lib/trevol_generado/models/email_resend_summary.rb +256 -0
- data/lib/trevol_generado/models/equivalent_document.rb +27 -5
- data/lib/trevol_generado/models/equivalent_document_adjustment.rb +26 -4
- data/lib/trevol_generado/models/equivalent_document_adjustment_input.rb +15 -4
- data/lib/trevol_generado/models/equivalent_document_input.rb +15 -4
- data/lib/trevol_generado/models/event.rb +12 -2
- data/lib/trevol_generado/models/invoice_batch.rb +11 -1
- data/lib/trevol_generado/models/invoice_batch_invoice_input.rb +24 -5
- data/lib/trevol_generado/models/invoice_input.rb +24 -4
- data/lib/trevol_generado/models/note_input.rb +15 -4
- data/lib/trevol_generado/models/numbering.rb +1 -1
- data/lib/trevol_generado/models/pdf_design.rb +297 -0
- data/lib/trevol_generado/models/pdf_design_applied.rb +193 -0
- data/lib/trevol_generado/models/pdf_design_input.rb +277 -0
- data/lib/trevol_generado/models/pdf_design_list.rb +191 -0
- data/lib/trevol_generado/models/pdf_design_update.rb +246 -0
- data/lib/trevol_generado/models/pdf_settings.rb +202 -0
- data/lib/trevol_generado/models/pdf_settings_update.rb +170 -0
- data/lib/trevol_generado/models/pdf_template.rb +210 -0
- data/lib/trevol_generado/models/pdf_template_list.rb +191 -0
- data/lib/trevol_generado/models/preview.rb +11 -1
- data/lib/trevol_generado/models/preview_numbering.rb +161 -0
- data/lib/trevol_generado/models/problem.rb +26 -4
- data/lib/trevol_generado/models/problem_finding.rb +172 -0
- data/lib/trevol_generado/models/support_document.rb +11 -1
- data/lib/trevol_generado/models/support_document_adjustment.rb +11 -1
- data/lib/trevol_generado/models/webhook_endpoint.rb +13 -3
- data/lib/trevol_generado/models/webhook_endpoint_input.rb +15 -5
- data/lib/trevol_generado/models/webhook_endpoint_update.rb +12 -2
- data/lib/trevol_generado/tablas.rb +30 -1
- data/lib/trevol_generado/version.rb +1 -1
- data/lib/trevol_generado.rb +28 -0
- metadata +29 -1
|
@@ -0,0 +1,245 @@
|
|
|
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 lista de valores (sin sus entradas: están en `GET /v1/catalogs/{name}`).
|
|
18
|
+
class CodeList < ApiModelBase
|
|
19
|
+
# Valores conocidos: `catalog`.
|
|
20
|
+
attr_accessor :object
|
|
21
|
+
|
|
22
|
+
# El nombre de la lista: va en la ruta.
|
|
23
|
+
attr_accessor :id
|
|
24
|
+
|
|
25
|
+
# El nombre en español.
|
|
26
|
+
attr_accessor :name
|
|
27
|
+
|
|
28
|
+
attr_accessor :description
|
|
29
|
+
|
|
30
|
+
# La tabla de la DIAN de donde sale.
|
|
31
|
+
attr_accessor :source
|
|
32
|
+
|
|
33
|
+
# Los campos de los pedidos que la usan.
|
|
34
|
+
attr_accessor :used_in
|
|
35
|
+
|
|
36
|
+
# Los filtros que admite `GET /v1/catalogs/{name}` en esta lista.
|
|
37
|
+
attr_accessor :filters
|
|
38
|
+
|
|
39
|
+
# Cuántas entradas tiene.
|
|
40
|
+
attr_accessor :count
|
|
41
|
+
|
|
42
|
+
# Cambia si cambia el contenido de la lista: guárdalo para saber cuándo volver a bajarla.
|
|
43
|
+
attr_accessor :content_hash
|
|
44
|
+
|
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
46
|
+
def self.attribute_map
|
|
47
|
+
{
|
|
48
|
+
:'object' => :'object',
|
|
49
|
+
:'id' => :'id',
|
|
50
|
+
:'name' => :'name',
|
|
51
|
+
:'description' => :'description',
|
|
52
|
+
:'source' => :'source',
|
|
53
|
+
:'used_in' => :'used_in',
|
|
54
|
+
:'filters' => :'filters',
|
|
55
|
+
:'count' => :'count',
|
|
56
|
+
:'content_hash' => :'content_hash'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns attribute mapping this model knows about
|
|
61
|
+
def self.acceptable_attribute_map
|
|
62
|
+
attribute_map
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns all the JSON keys this model knows about
|
|
66
|
+
def self.acceptable_attributes
|
|
67
|
+
acceptable_attribute_map.values
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Attribute type mapping.
|
|
71
|
+
def self.openapi_types
|
|
72
|
+
{
|
|
73
|
+
:'object' => :'String',
|
|
74
|
+
:'id' => :'String',
|
|
75
|
+
:'name' => :'String',
|
|
76
|
+
:'description' => :'String',
|
|
77
|
+
:'source' => :'String',
|
|
78
|
+
:'used_in' => :'Array<String>',
|
|
79
|
+
:'filters' => :'Array<String>',
|
|
80
|
+
:'count' => :'Integer',
|
|
81
|
+
:'content_hash' => :'String'
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List of attributes with nullable: true
|
|
86
|
+
def self.openapi_nullable
|
|
87
|
+
Set.new([
|
|
88
|
+
])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Returns attribute type mapping
|
|
92
|
+
def self.acceptable_openapi_types
|
|
93
|
+
openapi_types
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Returns the nullable attributes
|
|
97
|
+
def self.acceptable_openapi_nullable
|
|
98
|
+
openapi_nullable
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Initializes the object
|
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
103
|
+
def initialize(attributes = {})
|
|
104
|
+
if (!attributes.is_a?(Hash))
|
|
105
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::CodeList` initialize method"
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
109
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
110
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
111
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
112
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::CodeList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
113
|
+
end
|
|
114
|
+
h[k.to_sym] = v
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'object')
|
|
118
|
+
self.object = attributes[:'object']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'id')
|
|
122
|
+
self.id = attributes[:'id']
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'name')
|
|
126
|
+
self.name = attributes[:'name']
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'description')
|
|
130
|
+
self.description = attributes[:'description']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'source')
|
|
134
|
+
self.source = attributes[:'source']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'used_in')
|
|
138
|
+
if (value = attributes[:'used_in']).is_a?(Array)
|
|
139
|
+
self.used_in = value
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'filters')
|
|
144
|
+
if (value = attributes[:'filters']).is_a?(Array)
|
|
145
|
+
self.filters = value
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'count')
|
|
150
|
+
self.count = attributes[:'count']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'content_hash')
|
|
154
|
+
self.content_hash = attributes[:'content_hash']
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
159
|
+
# @return Array for valid properties with the reasons
|
|
160
|
+
def list_invalid_properties
|
|
161
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
162
|
+
invalid_properties = Array.new
|
|
163
|
+
invalid_properties
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Check to see if the all the properties in the model are valid
|
|
167
|
+
# @return true if the model is valid
|
|
168
|
+
def valid?
|
|
169
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
170
|
+
true
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Checks equality by comparing each attribute.
|
|
174
|
+
# @param [Object] Object to be compared
|
|
175
|
+
def ==(o)
|
|
176
|
+
return true if self.equal?(o)
|
|
177
|
+
self.class == o.class &&
|
|
178
|
+
object == o.object &&
|
|
179
|
+
id == o.id &&
|
|
180
|
+
name == o.name &&
|
|
181
|
+
description == o.description &&
|
|
182
|
+
source == o.source &&
|
|
183
|
+
used_in == o.used_in &&
|
|
184
|
+
filters == o.filters &&
|
|
185
|
+
count == o.count &&
|
|
186
|
+
content_hash == o.content_hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @see the `==` method
|
|
190
|
+
# @param [Object] Object to be compared
|
|
191
|
+
def eql?(o)
|
|
192
|
+
self == o
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Calculates hash code according to all attributes.
|
|
196
|
+
# @return [Integer] Hash code
|
|
197
|
+
def hash
|
|
198
|
+
[object, id, name, description, source, used_in, filters, count, content_hash].hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Builds the object from hash
|
|
202
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
203
|
+
# @return [Object] Returns the model itself
|
|
204
|
+
def self.build_from_hash(attributes)
|
|
205
|
+
return nil unless attributes.is_a?(Hash)
|
|
206
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
207
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
208
|
+
map = acceptable_attribute_map
|
|
209
|
+
transformed_hash = {}
|
|
210
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
211
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
212
|
+
transformed_hash["#{key}"] = nil
|
|
213
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
214
|
+
# check to ensure the input is an array given that the attribute
|
|
215
|
+
# is documented as an array but the input is not
|
|
216
|
+
if attributes[map[key]].is_a?(Array)
|
|
217
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
218
|
+
end
|
|
219
|
+
elsif !attributes[map[key]].nil?
|
|
220
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
new(transformed_hash)
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Returns the object in the form of hash
|
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
|
228
|
+
def to_hash
|
|
229
|
+
hash = {}
|
|
230
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
231
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
232
|
+
value = self.send(attr)
|
|
233
|
+
if value.nil?
|
|
234
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
235
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
hash[param] = _to_hash(value)
|
|
239
|
+
end
|
|
240
|
+
hash
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
end
|
|
@@ -0,0 +1,353 @@
|
|
|
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 entrada de una lista de valores: siempre `code` y `name`; los demás campos, según la lista.
|
|
18
|
+
class CodeListEntry < ApiModelBase
|
|
19
|
+
# Valores conocidos: `catalog_entry`.
|
|
20
|
+
attr_accessor :object
|
|
21
|
+
|
|
22
|
+
# El valor que va en el pedido.
|
|
23
|
+
attr_accessor :code
|
|
24
|
+
|
|
25
|
+
# El nombre de la tabla de la DIAN.
|
|
26
|
+
attr_accessor :name
|
|
27
|
+
|
|
28
|
+
attr_accessor :description
|
|
29
|
+
|
|
30
|
+
# `municipalities` y `postal_codes`: el departamento.
|
|
31
|
+
attr_accessor :department_code
|
|
32
|
+
|
|
33
|
+
attr_accessor :department_name
|
|
34
|
+
|
|
35
|
+
# Los recursos donde vale este código (las listas que cambian según el documento).
|
|
36
|
+
attr_accessor :resources
|
|
37
|
+
|
|
38
|
+
# `taxes`: impuesto o retención; `discount_charge_codes`: descuento o recargo. Valores conocidos: `tax`, `withholding`, `discount`, `charge`.
|
|
39
|
+
attr_accessor :kind
|
|
40
|
+
|
|
41
|
+
# `taxes`: porcentual (`rate`), por unidad (`unit_amount`) o los dos. Valores conocidos: `percentage`, `per_unit`, `both`.
|
|
42
|
+
attr_accessor :calculation
|
|
43
|
+
|
|
44
|
+
# `taxes`: la tarifa va por mil (ICA y ReteICA).
|
|
45
|
+
attr_accessor :per_thousand
|
|
46
|
+
|
|
47
|
+
# `taxes`: la unidad por defecto de un tributo por unidad.
|
|
48
|
+
attr_accessor :default_unit
|
|
49
|
+
|
|
50
|
+
# Las tarifas de la tabla de la DIAN, como texto decimal; null si la tabla no las fija.
|
|
51
|
+
attr_accessor :rates
|
|
52
|
+
|
|
53
|
+
# `taxes`: true si solo se aceptan las tarifas de `rates`.
|
|
54
|
+
attr_accessor :strict_rates
|
|
55
|
+
|
|
56
|
+
# `taxes`: las tarifas que fija la ley para cada año (IBUA e ICUI). Informativo: Trevol acepta cualquiera de `rates` sin mirar la fecha del documento.
|
|
57
|
+
attr_accessor :rates_by_year
|
|
58
|
+
|
|
59
|
+
# `taxes`: las tarifas de un recurso cuando no son las de `rates`.
|
|
60
|
+
attr_accessor :rates_by_resource
|
|
61
|
+
|
|
62
|
+
# `payment_forms`: el código de la DIAN de la forma de pago.
|
|
63
|
+
attr_accessor :dian_code
|
|
64
|
+
|
|
65
|
+
# `document_types` del documento equivalente: las operaciones que admite (`operation_type`); la primera es la de por defecto.
|
|
66
|
+
attr_accessor :operation_types
|
|
67
|
+
|
|
68
|
+
# `identity_document_types`: en el documento soporte, para qué vendedor vale.
|
|
69
|
+
attr_accessor :seller_residency
|
|
70
|
+
|
|
71
|
+
# `payroll_overtime_types`: el porcentaje fijo de la hora.
|
|
72
|
+
attr_accessor :percent
|
|
73
|
+
|
|
74
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
75
|
+
def self.attribute_map
|
|
76
|
+
{
|
|
77
|
+
:'object' => :'object',
|
|
78
|
+
:'code' => :'code',
|
|
79
|
+
:'name' => :'name',
|
|
80
|
+
:'description' => :'description',
|
|
81
|
+
:'department_code' => :'department_code',
|
|
82
|
+
:'department_name' => :'department_name',
|
|
83
|
+
:'resources' => :'resources',
|
|
84
|
+
:'kind' => :'kind',
|
|
85
|
+
:'calculation' => :'calculation',
|
|
86
|
+
:'per_thousand' => :'per_thousand',
|
|
87
|
+
:'default_unit' => :'default_unit',
|
|
88
|
+
:'rates' => :'rates',
|
|
89
|
+
:'strict_rates' => :'strict_rates',
|
|
90
|
+
:'rates_by_year' => :'rates_by_year',
|
|
91
|
+
:'rates_by_resource' => :'rates_by_resource',
|
|
92
|
+
:'dian_code' => :'dian_code',
|
|
93
|
+
:'operation_types' => :'operation_types',
|
|
94
|
+
:'seller_residency' => :'seller_residency',
|
|
95
|
+
:'percent' => :'percent'
|
|
96
|
+
}
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Returns attribute mapping this model knows about
|
|
100
|
+
def self.acceptable_attribute_map
|
|
101
|
+
attribute_map
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Returns all the JSON keys this model knows about
|
|
105
|
+
def self.acceptable_attributes
|
|
106
|
+
acceptable_attribute_map.values
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Attribute type mapping.
|
|
110
|
+
def self.openapi_types
|
|
111
|
+
{
|
|
112
|
+
:'object' => :'String',
|
|
113
|
+
:'code' => :'String',
|
|
114
|
+
:'name' => :'String',
|
|
115
|
+
:'description' => :'String',
|
|
116
|
+
:'department_code' => :'String',
|
|
117
|
+
:'department_name' => :'String',
|
|
118
|
+
:'resources' => :'Array<String>',
|
|
119
|
+
:'kind' => :'String',
|
|
120
|
+
:'calculation' => :'String',
|
|
121
|
+
:'per_thousand' => :'Boolean',
|
|
122
|
+
:'default_unit' => :'String',
|
|
123
|
+
:'rates' => :'Array<String>',
|
|
124
|
+
:'strict_rates' => :'Boolean',
|
|
125
|
+
:'rates_by_year' => :'Hash<String, Array<String>>',
|
|
126
|
+
:'rates_by_resource' => :'Hash<String, CodeListRates>',
|
|
127
|
+
:'dian_code' => :'String',
|
|
128
|
+
:'operation_types' => :'Array<String>',
|
|
129
|
+
:'seller_residency' => :'Array<String>',
|
|
130
|
+
:'percent' => :'String'
|
|
131
|
+
}
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# List of attributes with nullable: true
|
|
135
|
+
def self.openapi_nullable
|
|
136
|
+
Set.new([
|
|
137
|
+
:'rates',
|
|
138
|
+
])
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Returns attribute type mapping
|
|
142
|
+
def self.acceptable_openapi_types
|
|
143
|
+
openapi_types
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Returns the nullable attributes
|
|
147
|
+
def self.acceptable_openapi_nullable
|
|
148
|
+
openapi_nullable
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Initializes the object
|
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
153
|
+
def initialize(attributes = {})
|
|
154
|
+
if (!attributes.is_a?(Hash))
|
|
155
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::CodeListEntry` initialize method"
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
159
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
160
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
161
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
162
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::CodeListEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
163
|
+
end
|
|
164
|
+
h[k.to_sym] = v
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'object')
|
|
168
|
+
self.object = attributes[:'object']
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'code')
|
|
172
|
+
self.code = attributes[:'code']
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'name')
|
|
176
|
+
self.name = attributes[:'name']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'description')
|
|
180
|
+
self.description = attributes[:'description']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'department_code')
|
|
184
|
+
self.department_code = attributes[:'department_code']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'department_name')
|
|
188
|
+
self.department_name = attributes[:'department_name']
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'resources')
|
|
192
|
+
if (value = attributes[:'resources']).is_a?(Array)
|
|
193
|
+
self.resources = value
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'kind')
|
|
198
|
+
self.kind = attributes[:'kind']
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
if attributes.key?(:'calculation')
|
|
202
|
+
self.calculation = attributes[:'calculation']
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'per_thousand')
|
|
206
|
+
self.per_thousand = attributes[:'per_thousand']
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'default_unit')
|
|
210
|
+
self.default_unit = attributes[:'default_unit']
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if attributes.key?(:'rates')
|
|
214
|
+
if (value = attributes[:'rates']).is_a?(Array)
|
|
215
|
+
self.rates = value
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if attributes.key?(:'strict_rates')
|
|
220
|
+
self.strict_rates = attributes[:'strict_rates']
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
if attributes.key?(:'rates_by_year')
|
|
224
|
+
if (value = attributes[:'rates_by_year']).is_a?(Hash)
|
|
225
|
+
self.rates_by_year = value
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'rates_by_resource')
|
|
230
|
+
if (value = attributes[:'rates_by_resource']).is_a?(Hash)
|
|
231
|
+
self.rates_by_resource = value
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if attributes.key?(:'dian_code')
|
|
236
|
+
self.dian_code = attributes[:'dian_code']
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if attributes.key?(:'operation_types')
|
|
240
|
+
if (value = attributes[:'operation_types']).is_a?(Array)
|
|
241
|
+
self.operation_types = value
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if attributes.key?(:'seller_residency')
|
|
246
|
+
if (value = attributes[:'seller_residency']).is_a?(Array)
|
|
247
|
+
self.seller_residency = value
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
if attributes.key?(:'percent')
|
|
252
|
+
self.percent = attributes[:'percent']
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
257
|
+
# @return Array for valid properties with the reasons
|
|
258
|
+
def list_invalid_properties
|
|
259
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
260
|
+
invalid_properties = Array.new
|
|
261
|
+
invalid_properties
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Check to see if the all the properties in the model are valid
|
|
265
|
+
# @return true if the model is valid
|
|
266
|
+
def valid?
|
|
267
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
268
|
+
true
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Checks equality by comparing each attribute.
|
|
272
|
+
# @param [Object] Object to be compared
|
|
273
|
+
def ==(o)
|
|
274
|
+
return true if self.equal?(o)
|
|
275
|
+
self.class == o.class &&
|
|
276
|
+
object == o.object &&
|
|
277
|
+
code == o.code &&
|
|
278
|
+
name == o.name &&
|
|
279
|
+
description == o.description &&
|
|
280
|
+
department_code == o.department_code &&
|
|
281
|
+
department_name == o.department_name &&
|
|
282
|
+
resources == o.resources &&
|
|
283
|
+
kind == o.kind &&
|
|
284
|
+
calculation == o.calculation &&
|
|
285
|
+
per_thousand == o.per_thousand &&
|
|
286
|
+
default_unit == o.default_unit &&
|
|
287
|
+
rates == o.rates &&
|
|
288
|
+
strict_rates == o.strict_rates &&
|
|
289
|
+
rates_by_year == o.rates_by_year &&
|
|
290
|
+
rates_by_resource == o.rates_by_resource &&
|
|
291
|
+
dian_code == o.dian_code &&
|
|
292
|
+
operation_types == o.operation_types &&
|
|
293
|
+
seller_residency == o.seller_residency &&
|
|
294
|
+
percent == o.percent
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# @see the `==` method
|
|
298
|
+
# @param [Object] Object to be compared
|
|
299
|
+
def eql?(o)
|
|
300
|
+
self == o
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Calculates hash code according to all attributes.
|
|
304
|
+
# @return [Integer] Hash code
|
|
305
|
+
def hash
|
|
306
|
+
[object, code, name, description, department_code, department_name, resources, kind, calculation, per_thousand, default_unit, rates, strict_rates, rates_by_year, rates_by_resource, dian_code, operation_types, seller_residency, percent].hash
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Builds the object from hash
|
|
310
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
311
|
+
# @return [Object] Returns the model itself
|
|
312
|
+
def self.build_from_hash(attributes)
|
|
313
|
+
return nil unless attributes.is_a?(Hash)
|
|
314
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
315
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
316
|
+
map = acceptable_attribute_map
|
|
317
|
+
transformed_hash = {}
|
|
318
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
319
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
320
|
+
transformed_hash["#{key}"] = nil
|
|
321
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
322
|
+
# check to ensure the input is an array given that the attribute
|
|
323
|
+
# is documented as an array but the input is not
|
|
324
|
+
if attributes[map[key]].is_a?(Array)
|
|
325
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
326
|
+
end
|
|
327
|
+
elsif !attributes[map[key]].nil?
|
|
328
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
new(transformed_hash)
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Returns the object in the form of hash
|
|
335
|
+
# @return [Hash] Returns the object in the form of hash
|
|
336
|
+
def to_hash
|
|
337
|
+
hash = {}
|
|
338
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
339
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
340
|
+
value = self.send(attr)
|
|
341
|
+
if value.nil?
|
|
342
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
343
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
hash[param] = _to_hash(value)
|
|
347
|
+
end
|
|
348
|
+
hash
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
end
|