trevol 0.1.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 +7 -0
- data/CHANGELOG.md +15 -0
- data/GENERADO.md +14 -0
- data/LICENSE +21 -0
- data/README.md +173 -0
- data/lib/trevol/client.rb +94 -0
- data/lib/trevol/errors.rb +152 -0
- data/lib/trevol/llave.rb +21 -0
- data/lib/trevol/paginacion.rb +41 -0
- data/lib/trevol/transporte.rb +173 -0
- data/lib/trevol/webhook.rb +100 -0
- data/lib/trevol.rb +18 -0
- data/lib/trevol_generado/api/balance_api.rb +220 -0
- data/lib/trevol_generado/api/credit_notes_api.rb +671 -0
- data/lib/trevol_generado/api/debit_notes_api.rb +671 -0
- data/lib/trevol_generado/api/equivalent_document_adjustments_api.rb +691 -0
- data/lib/trevol_generado/api/equivalent_documents_api.rb +698 -0
- data/lib/trevol_generado/api/events_api.rb +231 -0
- data/lib/trevol_generado/api/general_api.rb +201 -0
- data/lib/trevol_generado/api/invoices_api.rb +736 -0
- data/lib/trevol_generado/api/payroll_adjustments_api.rb +637 -0
- data/lib/trevol_generado/api/payrolls_api.rb +637 -0
- data/lib/trevol_generado/api/radian_events_api.rb +431 -0
- data/lib/trevol_generado/api/requests_api.rb +97 -0
- data/lib/trevol_generado/api/support_document_adjustments_api.rb +565 -0
- data/lib/trevol_generado/api/support_documents_api.rb +565 -0
- data/lib/trevol_generado/api/webhook_endpoints_api.rb +556 -0
- data/lib/trevol_generado/api_client.rb +441 -0
- data/lib/trevol_generado/api_error.rb +58 -0
- data/lib/trevol_generado/api_model_base.rb +88 -0
- data/lib/trevol_generado/configuration.rb +392 -0
- data/lib/trevol_generado/models/acquirer.rb +209 -0
- data/lib/trevol_generado/models/air_collection.rb +205 -0
- data/lib/trevol_generado/models/air_extension.rb +216 -0
- data/lib/trevol_generado/models/allowance_charge.rb +250 -0
- data/lib/trevol_generado/models/alternative_currency.rb +180 -0
- data/lib/trevol_generado/models/balance.rb +244 -0
- data/lib/trevol_generado/models/balance_event_data.rb +172 -0
- data/lib/trevol_generado/models/balance_transaction.rb +265 -0
- data/lib/trevol_generado/models/balance_transaction_company.rb +172 -0
- data/lib/trevol_generado/models/balance_transaction_document.rb +173 -0
- data/lib/trevol_generado/models/balance_transaction_list.rb +191 -0
- data/lib/trevol_generado/models/carrier.rb +219 -0
- data/lib/trevol_generado/models/certificate_event_data.rb +180 -0
- data/lib/trevol_generado/models/cinema_extension.rb +214 -0
- data/lib/trevol_generado/models/cinema_screening.rb +256 -0
- data/lib/trevol_generado/models/company.rb +267 -0
- data/lib/trevol_generado/models/company_key.rb +182 -0
- data/lib/trevol_generado/models/company_numbering.rb +201 -0
- data/lib/trevol_generado/models/consumption.rb +246 -0
- data/lib/trevol_generado/models/consumption_adjustment.rb +204 -0
- data/lib/trevol_generado/models/contingency.rb +160 -0
- data/lib/trevol_generado/models/credit_note_list.rb +191 -0
- data/lib/trevol_generado/models/currency.rb +241 -0
- data/lib/trevol_generado/models/customer.rb +360 -0
- data/lib/trevol_generado/models/debit_note_list.rb +191 -0
- data/lib/trevol_generado/models/deleted_object.rb +178 -0
- data/lib/trevol_generado/models/delivery.rb +200 -0
- data/lib/trevol_generado/models/delivery_email.rb +181 -0
- data/lib/trevol_generado/models/delivery_terms.rb +169 -0
- data/lib/trevol_generado/models/dian_result.rb +182 -0
- data/lib/trevol_generado/models/dian_rule.rb +216 -0
- data/lib/trevol_generado/models/document.rb +432 -0
- data/lib/trevol_generado/models/document_event_data.rb +315 -0
- data/lib/trevol_generado/models/document_reference.rb +169 -0
- data/lib/trevol_generado/models/document_totals.rb +299 -0
- data/lib/trevol_generado/models/document_totals_currency.rb +197 -0
- data/lib/trevol_generado/models/document_totals_item.rb +196 -0
- data/lib/trevol_generado/models/document_totals_tax.rb +197 -0
- data/lib/trevol_generado/models/document_totals_withholding.rb +206 -0
- data/lib/trevol_generado/models/equivalent_adjustment_item.rb +374 -0
- data/lib/trevol_generado/models/equivalent_document.rb +470 -0
- data/lib/trevol_generado/models/equivalent_document_adjustment.rb +440 -0
- data/lib/trevol_generado/models/equivalent_document_adjustment_input.rb +388 -0
- data/lib/trevol_generado/models/equivalent_document_adjustment_list.rb +191 -0
- data/lib/trevol_generado/models/equivalent_document_contingency.rb +181 -0
- data/lib/trevol_generado/models/equivalent_document_contingency_backup.rb +171 -0
- data/lib/trevol_generado/models/equivalent_document_event_data.rb +313 -0
- data/lib/trevol_generado/models/equivalent_document_input.rb +365 -0
- data/lib/trevol_generado/models/equivalent_document_list.rb +191 -0
- data/lib/trevol_generado/models/equivalent_document_reference.rb +241 -0
- data/lib/trevol_generado/models/equivalent_item.rb +387 -0
- data/lib/trevol_generado/models/event.rb +223 -0
- data/lib/trevol_generado/models/event_claim.rb +170 -0
- data/lib/trevol_generado/models/event_delivery.rb +178 -0
- data/lib/trevol_generado/models/event_delivery_email.rb +161 -0
- data/lib/trevol_generado/models/event_dian_result.rb +173 -0
- data/lib/trevol_generado/models/event_dian_rule.rb +170 -0
- data/lib/trevol_generado/models/event_document_error.rb +170 -0
- data/lib/trevol_generado/models/event_equivalent_document_ref.rb +161 -0
- data/lib/trevol_generado/models/event_error.rb +170 -0
- data/lib/trevol_generado/models/event_invoice_ref.rb +161 -0
- data/lib/trevol_generado/models/event_list.rb +191 -0
- data/lib/trevol_generado/models/event_payroll_ref.rb +160 -0
- data/lib/trevol_generado/models/event_radian_invoice_ref.rb +181 -0
- data/lib/trevol_generado/models/event_resend_input.rb +177 -0
- data/lib/trevol_generado/models/event_support_document_ref.rb +161 -0
- data/lib/trevol_generado/models/extension.rb +215 -0
- data/lib/trevol_generado/models/foreign_address.rb +218 -0
- data/lib/trevol_generado/models/free_of_charge.rb +170 -0
- data/lib/trevol_generado/models/game.rb +203 -0
- data/lib/trevol_generado/models/game_credit.rb +204 -0
- data/lib/trevol_generado/models/games_extension.rb +216 -0
- data/lib/trevol_generado/models/games_venue.rb +204 -0
- data/lib/trevol_generado/models/interoperability.rb +205 -0
- data/lib/trevol_generado/models/interoperability_collection.rb +171 -0
- data/lib/trevol_generado/models/interoperability_data.rb +186 -0
- data/lib/trevol_generado/models/invoice_input.rb +364 -0
- data/lib/trevol_generado/models/invoice_list.rb +191 -0
- data/lib/trevol_generado/models/invoice_reference.rb +198 -0
- data/lib/trevol_generado/models/item.rb +439 -0
- data/lib/trevol_generado/models/item_allowance.rb +190 -0
- data/lib/trevol_generado/models/item_consignment.rb +286 -0
- data/lib/trevol_generado/models/item_mandator.rb +231 -0
- data/lib/trevol_generado/models/item_notary.rb +204 -0
- data/lib/trevol_generado/models/item_property.rb +223 -0
- data/lib/trevol_generado/models/item_tax.rb +246 -0
- data/lib/trevol_generado/models/item_withholding.rb +214 -0
- data/lib/trevol_generado/models/meter.rb +233 -0
- data/lib/trevol_generado/models/note_input.rb +329 -0
- data/lib/trevol_generado/models/numbering.rb +178 -0
- data/lib/trevol_generado/models/numbering_expiring_event_data.rb +209 -0
- data/lib/trevol_generado/models/numbering_low_event_data.rb +209 -0
- data/lib/trevol_generado/models/origin_note.rb +230 -0
- data/lib/trevol_generado/models/payment.rb +232 -0
- data/lib/trevol_generado/models/payment_method.rb +187 -0
- data/lib/trevol_generado/models/payroll.rb +455 -0
- data/lib/trevol_generado/models/payroll_adjustment.rb +467 -0
- data/lib/trevol_generado/models/payroll_adjustment_input.rb +362 -0
- data/lib/trevol_generado/models/payroll_adjustment_list.rb +191 -0
- data/lib/trevol_generado/models/payroll_basic.rb +204 -0
- data/lib/trevol_generado/models/payroll_compensated_vacation.rb +204 -0
- data/lib/trevol_generado/models/payroll_compensation.rb +205 -0
- data/lib/trevol_generado/models/payroll_deductions.rb +370 -0
- data/lib/trevol_generado/models/payroll_disability.rb +249 -0
- data/lib/trevol_generado/models/payroll_earnings.rb +406 -0
- data/lib/trevol_generado/models/payroll_employee.rb +437 -0
- data/lib/trevol_generado/models/payroll_employer.rb +238 -0
- data/lib/trevol_generado/models/payroll_epctv_bonus.rb +191 -0
- data/lib/trevol_generado/models/payroll_event_data.rb +303 -0
- data/lib/trevol_generado/models/payroll_files.rb +179 -0
- data/lib/trevol_generado/models/payroll_input.rb +420 -0
- data/lib/trevol_generado/models/payroll_leaves.rb +184 -0
- data/lib/trevol_generado/models/payroll_list.rb +191 -0
- data/lib/trevol_generado/models/payroll_loan.rb +204 -0
- data/lib/trevol_generado/models/payroll_novelty.rb +177 -0
- data/lib/trevol_generado/models/payroll_other_concept.rb +197 -0
- data/lib/trevol_generado/models/payroll_overtime.rb +262 -0
- data/lib/trevol_generado/models/payroll_paid_period.rb +222 -0
- data/lib/trevol_generado/models/payroll_payment.rb +215 -0
- data/lib/trevol_generado/models/payroll_percent_amount.rb +205 -0
- data/lib/trevol_generado/models/payroll_period.rb +247 -0
- data/lib/trevol_generado/models/payroll_place.rb +179 -0
- data/lib/trevol_generado/models/payroll_reference.rb +188 -0
- data/lib/trevol_generado/models/payroll_salary_amounts.rb +171 -0
- data/lib/trevol_generado/models/payroll_sanction.rb +205 -0
- data/lib/trevol_generado/models/payroll_service_bonus.rb +214 -0
- data/lib/trevol_generado/models/payroll_severance.rb +232 -0
- data/lib/trevol_generado/models/payroll_solidarity_fund.rb +191 -0
- data/lib/trevol_generado/models/payroll_totals.rb +188 -0
- data/lib/trevol_generado/models/payroll_transport.rb +181 -0
- data/lib/trevol_generado/models/payroll_unpaid_period.rb +195 -0
- data/lib/trevol_generado/models/payroll_vacation.rb +173 -0
- data/lib/trevol_generado/models/payroll_workplace.rb +188 -0
- data/lib/trevol_generado/models/period.rb +169 -0
- data/lib/trevol_generado/models/physical_document.rb +179 -0
- data/lib/trevol_generado/models/pos.rb +186 -0
- data/lib/trevol_generado/models/pos_buyer.rb +181 -0
- data/lib/trevol_generado/models/pos_register.rb +269 -0
- data/lib/trevol_generado/models/prepayment.rb +248 -0
- data/lib/trevol_generado/models/preview.rb +195 -0
- data/lib/trevol_generado/models/problem.rb +329 -0
- data/lib/trevol_generado/models/problem_error.rb +178 -0
- data/lib/trevol_generado/models/public_services_extension.rb +385 -0
- data/lib/trevol_generado/models/radian_event.rb +359 -0
- data/lib/trevol_generado/models/radian_event_data.rb +289 -0
- data/lib/trevol_generado/models/radian_event_input.rb +284 -0
- data/lib/trevol_generado/models/radian_event_invoice.rb +208 -0
- data/lib/trevol_generado/models/radian_event_list.rb +191 -0
- data/lib/trevol_generado/models/received_invoice.rb +200 -0
- data/lib/trevol_generado/models/received_invoice_issuer.rb +190 -0
- data/lib/trevol_generado/models/references.rb +182 -0
- data/lib/trevol_generado/models/request_list.rb +191 -0
- data/lib/trevol_generado/models/request_log.rb +275 -0
- data/lib/trevol_generado/models/seller.rb +385 -0
- data/lib/trevol_generado/models/shipment.rb +178 -0
- data/lib/trevol_generado/models/show_event.rb +276 -0
- data/lib/trevol_generado/models/show_extension.rb +203 -0
- data/lib/trevol_generado/models/show_producer.rb +212 -0
- data/lib/trevol_generado/models/standard_code.rb +169 -0
- data/lib/trevol_generado/models/stock_exchange_extension.rb +320 -0
- data/lib/trevol_generado/models/stock_exchange_prices.rb +169 -0
- data/lib/trevol_generado/models/support_adjustment_item.rb +295 -0
- data/lib/trevol_generado/models/support_adjustment_reference.rb +188 -0
- data/lib/trevol_generado/models/support_currency.rb +231 -0
- data/lib/trevol_generado/models/support_document.rb +401 -0
- data/lib/trevol_generado/models/support_document_adjustment.rb +409 -0
- data/lib/trevol_generado/models/support_document_adjustment_input.rb +331 -0
- data/lib/trevol_generado/models/support_document_adjustment_list.rb +191 -0
- data/lib/trevol_generado/models/support_document_delivery.rb +199 -0
- data/lib/trevol_generado/models/support_document_event_data.rb +305 -0
- data/lib/trevol_generado/models/support_document_input.rb +331 -0
- data/lib/trevol_generado/models/support_document_list.rb +191 -0
- data/lib/trevol_generado/models/support_document_reference.rb +198 -0
- data/lib/trevol_generado/models/support_item.rb +317 -0
- data/lib/trevol_generado/models/support_item_charge.rb +180 -0
- data/lib/trevol_generado/models/support_item_tax.rb +197 -0
- data/lib/trevol_generado/models/support_item_withholding.rb +205 -0
- data/lib/trevol_generado/models/tacit_acceptance.rb +224 -0
- data/lib/trevol_generado/models/tacit_acceptance_rule.rb +226 -0
- data/lib/trevol_generado/models/test_event_data.rb +171 -0
- data/lib/trevol_generado/models/third_party_charge.rb +277 -0
- data/lib/trevol_generado/models/third_party_company.rb +203 -0
- data/lib/trevol_generado/models/top_up.rb +199 -0
- data/lib/trevol_generado/models/top_up_buyer.rb +352 -0
- data/lib/trevol_generado/models/top_up_input.rb +187 -0
- data/lib/trevol_generado/models/top_up_wompi.rb +209 -0
- data/lib/trevol_generado/models/transport_extension.rb +281 -0
- data/lib/trevol_generado/models/webhook_delivery.rb +267 -0
- data/lib/trevol_generado/models/webhook_delivery_attempt.rb +192 -0
- data/lib/trevol_generado/models/webhook_delivery_list.rb +191 -0
- data/lib/trevol_generado/models/webhook_endpoint.rb +317 -0
- data/lib/trevol_generado/models/webhook_endpoint_input.rb +229 -0
- data/lib/trevol_generado/models/webhook_endpoint_list.rb +191 -0
- data/lib/trevol_generado/models/webhook_endpoint_rotate_input.rb +160 -0
- data/lib/trevol_generado/models/webhook_endpoint_update.rb +227 -0
- data/lib/trevol_generado/models/withholding.rb +224 -0
- data/lib/trevol_generado/tablas.rb +243 -0
- data/lib/trevol_generado/version.rb +15 -0
- data/lib/trevol_generado.rb +251 -0
- metadata +386 -0
|
@@ -0,0 +1,241 @@
|
|
|
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-10-22
|
|
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
|
+
# Usa `id`, o `number` + `cude` + `issue_date` + `document_type`.
|
|
18
|
+
class EquivalentDocumentReference < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
attr_accessor :number
|
|
22
|
+
|
|
23
|
+
attr_accessor :cude
|
|
24
|
+
|
|
25
|
+
attr_accessor :issue_date
|
|
26
|
+
|
|
27
|
+
attr_accessor :document_type
|
|
28
|
+
|
|
29
|
+
# Número o texto decimal con punto («150000.50»).
|
|
30
|
+
attr_accessor :total
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'id' => :'id',
|
|
58
|
+
:'number' => :'number',
|
|
59
|
+
:'cude' => :'cude',
|
|
60
|
+
:'issue_date' => :'issue_date',
|
|
61
|
+
:'document_type' => :'document_type',
|
|
62
|
+
:'total' => :'total'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns all the JSON keys this model knows about
|
|
72
|
+
def self.acceptable_attributes
|
|
73
|
+
acceptable_attribute_map.values
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute type mapping.
|
|
77
|
+
def self.openapi_types
|
|
78
|
+
{
|
|
79
|
+
:'id' => :'String',
|
|
80
|
+
:'number' => :'String',
|
|
81
|
+
:'cude' => :'String',
|
|
82
|
+
:'issue_date' => :'Date',
|
|
83
|
+
:'document_type' => :'String',
|
|
84
|
+
:'total' => :'String'
|
|
85
|
+
}
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# List of attributes with nullable: true
|
|
89
|
+
def self.openapi_nullable
|
|
90
|
+
Set.new([
|
|
91
|
+
])
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Returns attribute type mapping
|
|
95
|
+
def self.acceptable_openapi_types
|
|
96
|
+
openapi_types
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Returns the nullable attributes
|
|
100
|
+
def self.acceptable_openapi_nullable
|
|
101
|
+
openapi_nullable
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Initializes the object
|
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
106
|
+
def initialize(attributes = {})
|
|
107
|
+
if (!attributes.is_a?(Hash))
|
|
108
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::EquivalentDocumentReference` initialize method"
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
112
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
113
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
114
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
115
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::EquivalentDocumentReference`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
116
|
+
end
|
|
117
|
+
h[k.to_sym] = v
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'id')
|
|
121
|
+
self.id = attributes[:'id']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'number')
|
|
125
|
+
self.number = attributes[:'number']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'cude')
|
|
129
|
+
self.cude = attributes[:'cude']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'issue_date')
|
|
133
|
+
self.issue_date = attributes[:'issue_date']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'document_type')
|
|
137
|
+
self.document_type = attributes[:'document_type']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'total')
|
|
141
|
+
self.total = attributes[:'total']
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
146
|
+
# @return Array for valid properties with the reasons
|
|
147
|
+
def list_invalid_properties
|
|
148
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
149
|
+
invalid_properties = Array.new
|
|
150
|
+
invalid_properties
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Check to see if the all the properties in the model are valid
|
|
154
|
+
# @return true if the model is valid
|
|
155
|
+
def valid?
|
|
156
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
157
|
+
document_type_validator = EnumAttributeValidator.new('String', ["20", "25", "27", "30", "35", "40", "45", "50", "55", "60", "unknown_default_open_api"])
|
|
158
|
+
return false unless document_type_validator.valid?(@document_type)
|
|
159
|
+
true
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
163
|
+
# @param [Object] document_type Object to be assigned
|
|
164
|
+
def document_type=(document_type)
|
|
165
|
+
validator = EnumAttributeValidator.new('String', ["20", "25", "27", "30", "35", "40", "45", "50", "55", "60", "unknown_default_open_api"])
|
|
166
|
+
unless validator.valid?(document_type)
|
|
167
|
+
fail ArgumentError, "invalid value for \"document_type\", must be one of #{validator.allowable_values}."
|
|
168
|
+
end
|
|
169
|
+
@document_type = document_type
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Checks equality by comparing each attribute.
|
|
173
|
+
# @param [Object] Object to be compared
|
|
174
|
+
def ==(o)
|
|
175
|
+
return true if self.equal?(o)
|
|
176
|
+
self.class == o.class &&
|
|
177
|
+
id == o.id &&
|
|
178
|
+
number == o.number &&
|
|
179
|
+
cude == o.cude &&
|
|
180
|
+
issue_date == o.issue_date &&
|
|
181
|
+
document_type == o.document_type &&
|
|
182
|
+
total == o.total
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# @see the `==` method
|
|
186
|
+
# @param [Object] Object to be compared
|
|
187
|
+
def eql?(o)
|
|
188
|
+
self == o
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Calculates hash code according to all attributes.
|
|
192
|
+
# @return [Integer] Hash code
|
|
193
|
+
def hash
|
|
194
|
+
[id, number, cude, issue_date, document_type, total].hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Builds the object from hash
|
|
198
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
199
|
+
# @return [Object] Returns the model itself
|
|
200
|
+
def self.build_from_hash(attributes)
|
|
201
|
+
return nil unless attributes.is_a?(Hash)
|
|
202
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
203
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
204
|
+
map = acceptable_attribute_map
|
|
205
|
+
transformed_hash = {}
|
|
206
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
207
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
208
|
+
transformed_hash["#{key}"] = nil
|
|
209
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
210
|
+
# check to ensure the input is an array given that the attribute
|
|
211
|
+
# is documented as an array but the input is not
|
|
212
|
+
if attributes[map[key]].is_a?(Array)
|
|
213
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
214
|
+
end
|
|
215
|
+
elsif !attributes[map[key]].nil?
|
|
216
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
new(transformed_hash)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Returns the object in the form of hash
|
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
|
224
|
+
def to_hash
|
|
225
|
+
hash = {}
|
|
226
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
227
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
228
|
+
value = self.send(attr)
|
|
229
|
+
if value.nil?
|
|
230
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
231
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
hash[param] = _to_hash(value)
|
|
235
|
+
end
|
|
236
|
+
hash
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
end
|
|
@@ -0,0 +1,387 @@
|
|
|
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-10-22
|
|
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 EquivalentItem < ApiModelBase
|
|
18
|
+
# Código (texto).
|
|
19
|
+
attr_accessor :code
|
|
20
|
+
|
|
21
|
+
attr_accessor :description
|
|
22
|
+
|
|
23
|
+
# Unidad de medida (tabla 13.3.6). Por defecto 94 (unidad).
|
|
24
|
+
attr_accessor :unit
|
|
25
|
+
|
|
26
|
+
# Número o texto decimal con punto («150000.50»).
|
|
27
|
+
attr_accessor :quantity
|
|
28
|
+
|
|
29
|
+
# Precio unitario SIN impuestos.
|
|
30
|
+
attr_accessor :unit_price
|
|
31
|
+
|
|
32
|
+
# Impuestos de la línea: {code, rate} porcentual, {code: \"01\", excluded: true} o nominal {code, unit_amount, unit?, quantity?}.
|
|
33
|
+
attr_accessor :taxes
|
|
34
|
+
|
|
35
|
+
attr_accessor :discounts
|
|
36
|
+
|
|
37
|
+
attr_accessor :charges
|
|
38
|
+
|
|
39
|
+
# Retenciones (informativas): 05 ReteIVA, 06 ReteRenta, 07 ReteICA.
|
|
40
|
+
attr_accessor :withholdings
|
|
41
|
+
|
|
42
|
+
attr_accessor :free_of_charge
|
|
43
|
+
|
|
44
|
+
attr_accessor :standard_code
|
|
45
|
+
|
|
46
|
+
attr_accessor :brand
|
|
47
|
+
|
|
48
|
+
attr_accessor :model
|
|
49
|
+
|
|
50
|
+
# Mandatos (tabla 16.16): \"own\" (por defecto), \"collected\" (ingreso recaudado para terceros) o \"third_party\" (facturado para terceros); los dos últimos con `mandator`. En 272 y 274 la línea del mandante va con \"collected\".
|
|
51
|
+
attr_accessor :income
|
|
52
|
+
|
|
53
|
+
# El mandante de un ingreso para terceros (con NIT en 272 y 274).
|
|
54
|
+
attr_accessor :mandator
|
|
55
|
+
|
|
56
|
+
class EnumAttributeValidator
|
|
57
|
+
attr_reader :datatype
|
|
58
|
+
attr_reader :allowable_values
|
|
59
|
+
|
|
60
|
+
def initialize(datatype, allowable_values)
|
|
61
|
+
@allowable_values = allowable_values.map do |value|
|
|
62
|
+
case datatype.to_s
|
|
63
|
+
when /Integer/i
|
|
64
|
+
value.to_i
|
|
65
|
+
when /Float/i
|
|
66
|
+
value.to_f
|
|
67
|
+
else
|
|
68
|
+
value
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def valid?(value)
|
|
74
|
+
!value || allowable_values.include?(value)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
79
|
+
def self.attribute_map
|
|
80
|
+
{
|
|
81
|
+
:'code' => :'code',
|
|
82
|
+
:'description' => :'description',
|
|
83
|
+
:'unit' => :'unit',
|
|
84
|
+
:'quantity' => :'quantity',
|
|
85
|
+
:'unit_price' => :'unit_price',
|
|
86
|
+
:'taxes' => :'taxes',
|
|
87
|
+
:'discounts' => :'discounts',
|
|
88
|
+
:'charges' => :'charges',
|
|
89
|
+
:'withholdings' => :'withholdings',
|
|
90
|
+
:'free_of_charge' => :'free_of_charge',
|
|
91
|
+
:'standard_code' => :'standard_code',
|
|
92
|
+
:'brand' => :'brand',
|
|
93
|
+
:'model' => :'model',
|
|
94
|
+
:'income' => :'income',
|
|
95
|
+
:'mandator' => :'mandator'
|
|
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
|
+
:'code' => :'String',
|
|
113
|
+
:'description' => :'String',
|
|
114
|
+
:'unit' => :'String',
|
|
115
|
+
:'quantity' => :'String',
|
|
116
|
+
:'unit_price' => :'String',
|
|
117
|
+
:'taxes' => :'Array<ItemTax>',
|
|
118
|
+
:'discounts' => :'Array<ItemAllowance>',
|
|
119
|
+
:'charges' => :'Array<ItemAllowance>',
|
|
120
|
+
:'withholdings' => :'Array<ItemWithholding>',
|
|
121
|
+
:'free_of_charge' => :'FreeOfCharge',
|
|
122
|
+
:'standard_code' => :'StandardCode',
|
|
123
|
+
:'brand' => :'String',
|
|
124
|
+
:'model' => :'String',
|
|
125
|
+
:'income' => :'String',
|
|
126
|
+
:'mandator' => :'ItemMandator'
|
|
127
|
+
}
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# List of attributes with nullable: true
|
|
131
|
+
def self.openapi_nullable
|
|
132
|
+
Set.new([
|
|
133
|
+
])
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Returns attribute type mapping
|
|
137
|
+
def self.acceptable_openapi_types
|
|
138
|
+
openapi_types
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Returns the nullable attributes
|
|
142
|
+
def self.acceptable_openapi_nullable
|
|
143
|
+
openapi_nullable
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Initializes the object
|
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
148
|
+
def initialize(attributes = {})
|
|
149
|
+
if (!attributes.is_a?(Hash))
|
|
150
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::EquivalentItem` initialize method"
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
154
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
155
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
156
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
157
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::EquivalentItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
158
|
+
end
|
|
159
|
+
h[k.to_sym] = v
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'code')
|
|
163
|
+
self.code = attributes[:'code']
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'description')
|
|
167
|
+
self.description = attributes[:'description']
|
|
168
|
+
else
|
|
169
|
+
self.description = nil
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'unit')
|
|
173
|
+
self.unit = attributes[:'unit']
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.key?(:'quantity')
|
|
177
|
+
self.quantity = attributes[:'quantity']
|
|
178
|
+
else
|
|
179
|
+
self.quantity = nil
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.key?(:'unit_price')
|
|
183
|
+
self.unit_price = attributes[:'unit_price']
|
|
184
|
+
else
|
|
185
|
+
self.unit_price = nil
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if attributes.key?(:'taxes')
|
|
189
|
+
if (value = attributes[:'taxes']).is_a?(Array)
|
|
190
|
+
self.taxes = value
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if attributes.key?(:'discounts')
|
|
195
|
+
if (value = attributes[:'discounts']).is_a?(Array)
|
|
196
|
+
self.discounts = value
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if attributes.key?(:'charges')
|
|
201
|
+
if (value = attributes[:'charges']).is_a?(Array)
|
|
202
|
+
self.charges = value
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if attributes.key?(:'withholdings')
|
|
207
|
+
if (value = attributes[:'withholdings']).is_a?(Array)
|
|
208
|
+
self.withholdings = value
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if attributes.key?(:'free_of_charge')
|
|
213
|
+
self.free_of_charge = attributes[:'free_of_charge']
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if attributes.key?(:'standard_code')
|
|
217
|
+
self.standard_code = attributes[:'standard_code']
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
if attributes.key?(:'brand')
|
|
221
|
+
self.brand = attributes[:'brand']
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
if attributes.key?(:'model')
|
|
225
|
+
self.model = attributes[:'model']
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if attributes.key?(:'income')
|
|
229
|
+
self.income = attributes[:'income']
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
if attributes.key?(:'mandator')
|
|
233
|
+
self.mandator = attributes[:'mandator']
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
238
|
+
# @return Array for valid properties with the reasons
|
|
239
|
+
def list_invalid_properties
|
|
240
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
241
|
+
invalid_properties = Array.new
|
|
242
|
+
if @description.nil?
|
|
243
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
if @quantity.nil?
|
|
247
|
+
invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
if @unit_price.nil?
|
|
251
|
+
invalid_properties.push('invalid value for "unit_price", unit_price cannot be nil.')
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
invalid_properties
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Check to see if the all the properties in the model are valid
|
|
258
|
+
# @return true if the model is valid
|
|
259
|
+
def valid?
|
|
260
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
261
|
+
return false if @description.nil?
|
|
262
|
+
return false if @quantity.nil?
|
|
263
|
+
return false if @unit_price.nil?
|
|
264
|
+
income_validator = EnumAttributeValidator.new('String', ["own", "collected", "third_party", "unknown_default_open_api"])
|
|
265
|
+
return false unless income_validator.valid?(@income)
|
|
266
|
+
true
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Custom attribute writer method with validation
|
|
270
|
+
# @param [Object] description Value to be assigned
|
|
271
|
+
def description=(description)
|
|
272
|
+
if description.nil?
|
|
273
|
+
fail ArgumentError, 'description cannot be nil'
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
@description = description
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Custom attribute writer method with validation
|
|
280
|
+
# @param [Object] quantity Value to be assigned
|
|
281
|
+
def quantity=(quantity)
|
|
282
|
+
if quantity.nil?
|
|
283
|
+
fail ArgumentError, 'quantity cannot be nil'
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
@quantity = quantity
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Custom attribute writer method with validation
|
|
290
|
+
# @param [Object] unit_price Value to be assigned
|
|
291
|
+
def unit_price=(unit_price)
|
|
292
|
+
if unit_price.nil?
|
|
293
|
+
fail ArgumentError, 'unit_price cannot be nil'
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
@unit_price = unit_price
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
300
|
+
# @param [Object] income Object to be assigned
|
|
301
|
+
def income=(income)
|
|
302
|
+
validator = EnumAttributeValidator.new('String', ["own", "collected", "third_party", "unknown_default_open_api"])
|
|
303
|
+
unless validator.valid?(income)
|
|
304
|
+
fail ArgumentError, "invalid value for \"income\", must be one of #{validator.allowable_values}."
|
|
305
|
+
end
|
|
306
|
+
@income = income
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Checks equality by comparing each attribute.
|
|
310
|
+
# @param [Object] Object to be compared
|
|
311
|
+
def ==(o)
|
|
312
|
+
return true if self.equal?(o)
|
|
313
|
+
self.class == o.class &&
|
|
314
|
+
code == o.code &&
|
|
315
|
+
description == o.description &&
|
|
316
|
+
unit == o.unit &&
|
|
317
|
+
quantity == o.quantity &&
|
|
318
|
+
unit_price == o.unit_price &&
|
|
319
|
+
taxes == o.taxes &&
|
|
320
|
+
discounts == o.discounts &&
|
|
321
|
+
charges == o.charges &&
|
|
322
|
+
withholdings == o.withholdings &&
|
|
323
|
+
free_of_charge == o.free_of_charge &&
|
|
324
|
+
standard_code == o.standard_code &&
|
|
325
|
+
brand == o.brand &&
|
|
326
|
+
model == o.model &&
|
|
327
|
+
income == o.income &&
|
|
328
|
+
mandator == o.mandator
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# @see the `==` method
|
|
332
|
+
# @param [Object] Object to be compared
|
|
333
|
+
def eql?(o)
|
|
334
|
+
self == o
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Calculates hash code according to all attributes.
|
|
338
|
+
# @return [Integer] Hash code
|
|
339
|
+
def hash
|
|
340
|
+
[code, description, unit, quantity, unit_price, taxes, discounts, charges, withholdings, free_of_charge, standard_code, brand, model, income, mandator].hash
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Builds the object from hash
|
|
344
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
345
|
+
# @return [Object] Returns the model itself
|
|
346
|
+
def self.build_from_hash(attributes)
|
|
347
|
+
return nil unless attributes.is_a?(Hash)
|
|
348
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
349
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
350
|
+
map = acceptable_attribute_map
|
|
351
|
+
transformed_hash = {}
|
|
352
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
353
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
354
|
+
transformed_hash["#{key}"] = nil
|
|
355
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
356
|
+
# check to ensure the input is an array given that the attribute
|
|
357
|
+
# is documented as an array but the input is not
|
|
358
|
+
if attributes[map[key]].is_a?(Array)
|
|
359
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
360
|
+
end
|
|
361
|
+
elsif !attributes[map[key]].nil?
|
|
362
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
new(transformed_hash)
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Returns the object in the form of hash
|
|
369
|
+
# @return [Hash] Returns the object in the form of hash
|
|
370
|
+
def to_hash
|
|
371
|
+
hash = {}
|
|
372
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
373
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
374
|
+
value = self.send(attr)
|
|
375
|
+
if value.nil?
|
|
376
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
377
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
hash[param] = _to_hash(value)
|
|
381
|
+
end
|
|
382
|
+
hash
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
end
|