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,284 @@
|
|
|
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 RadianEventInput < ApiModelBase
|
|
18
|
+
# Tu identificador del documento: único entre los documentos API de la empresa y el ambiente. En los eventos es único entre los eventos (aparte de las facturas y las nóminas).
|
|
19
|
+
attr_accessor :external_id
|
|
20
|
+
|
|
21
|
+
# \"030\" acuse de recibo, \"031\" reclamo, \"032\" recibo del bien o servicio, \"033\" aceptación expresa (las cuatro sobre una factura RECIBIDA) o \"034\" aceptación tácita (sobre una factura PROPIA a crédito). Los 035 a 051 necesitan un participante RADIAN y no están disponibles.
|
|
22
|
+
attr_accessor :event_code
|
|
23
|
+
|
|
24
|
+
# 030–033: la factura RECIBIDA sobre la que va el evento (CUFE, número y quién la emitió). 034: la factura PROPIA por su CUFE, `{cufe, number?}` (solo esos dos), en lugar de `invoice_id`: sirve también para las facturas que no se emitieron con Trevol (las trae la sincronización con la DIAN). Si el CUFE es de una factura de Trevol, es lo mismo que mandar su `invoice_id`.
|
|
25
|
+
attr_accessor :invoice
|
|
26
|
+
|
|
27
|
+
# 034: el id (`inv_…`) de una factura de Trevol: propia, validada, a crédito y que no sea de consumidor final. Va aparte de `invoice` para que cada esquema sea plano en los SDK. Para una factura que no se emitió con Trevol, usa `invoice: {cufe}` (exactamente uno de los dos).
|
|
28
|
+
attr_accessor :invoice_id
|
|
29
|
+
|
|
30
|
+
# Solo en el reclamo (031) y obligatorio en él: {code: \"01\" a \"04\", note?}.
|
|
31
|
+
attr_accessor :claim
|
|
32
|
+
|
|
33
|
+
# 030–033: `own` (el Software Propio de la empresa, por defecto) o `dian_free` (el software gratuito de la DIAN). El 034 se firma con el Software Propio.
|
|
34
|
+
attr_accessor :software
|
|
35
|
+
|
|
36
|
+
# 030–033: quién es el proveedor tecnológico: `dian` (por defecto con `dian_free`) o `company` (por defecto con `own`).
|
|
37
|
+
attr_accessor :provider
|
|
38
|
+
|
|
39
|
+
class EnumAttributeValidator
|
|
40
|
+
attr_reader :datatype
|
|
41
|
+
attr_reader :allowable_values
|
|
42
|
+
|
|
43
|
+
def initialize(datatype, allowable_values)
|
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
|
45
|
+
case datatype.to_s
|
|
46
|
+
when /Integer/i
|
|
47
|
+
value.to_i
|
|
48
|
+
when /Float/i
|
|
49
|
+
value.to_f
|
|
50
|
+
else
|
|
51
|
+
value
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def valid?(value)
|
|
57
|
+
!value || allowable_values.include?(value)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
|
+
def self.attribute_map
|
|
63
|
+
{
|
|
64
|
+
:'external_id' => :'external_id',
|
|
65
|
+
:'event_code' => :'event_code',
|
|
66
|
+
:'invoice' => :'invoice',
|
|
67
|
+
:'invoice_id' => :'invoice_id',
|
|
68
|
+
:'claim' => :'claim',
|
|
69
|
+
:'software' => :'software',
|
|
70
|
+
:'provider' => :'provider'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Returns attribute mapping this model knows about
|
|
75
|
+
def self.acceptable_attribute_map
|
|
76
|
+
attribute_map
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Returns all the JSON keys this model knows about
|
|
80
|
+
def self.acceptable_attributes
|
|
81
|
+
acceptable_attribute_map.values
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Attribute type mapping.
|
|
85
|
+
def self.openapi_types
|
|
86
|
+
{
|
|
87
|
+
:'external_id' => :'String',
|
|
88
|
+
:'event_code' => :'String',
|
|
89
|
+
:'invoice' => :'ReceivedInvoice',
|
|
90
|
+
:'invoice_id' => :'String',
|
|
91
|
+
:'claim' => :'EventClaim',
|
|
92
|
+
:'software' => :'String',
|
|
93
|
+
:'provider' => :'String'
|
|
94
|
+
}
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# List of attributes with nullable: true
|
|
98
|
+
def self.openapi_nullable
|
|
99
|
+
Set.new([
|
|
100
|
+
])
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Returns attribute type mapping
|
|
104
|
+
def self.acceptable_openapi_types
|
|
105
|
+
openapi_types
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Returns the nullable attributes
|
|
109
|
+
def self.acceptable_openapi_nullable
|
|
110
|
+
openapi_nullable
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Initializes the object
|
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
115
|
+
def initialize(attributes = {})
|
|
116
|
+
if (!attributes.is_a?(Hash))
|
|
117
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::RadianEventInput` initialize method"
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
121
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
122
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
123
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
124
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::RadianEventInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
125
|
+
end
|
|
126
|
+
h[k.to_sym] = v
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'external_id')
|
|
130
|
+
self.external_id = attributes[:'external_id']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'event_code')
|
|
134
|
+
self.event_code = attributes[:'event_code']
|
|
135
|
+
else
|
|
136
|
+
self.event_code = nil
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'invoice')
|
|
140
|
+
self.invoice = attributes[:'invoice']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'invoice_id')
|
|
144
|
+
self.invoice_id = attributes[:'invoice_id']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'claim')
|
|
148
|
+
self.claim = attributes[:'claim']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'software')
|
|
152
|
+
self.software = attributes[:'software']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'provider')
|
|
156
|
+
self.provider = attributes[:'provider']
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
161
|
+
# @return Array for valid properties with the reasons
|
|
162
|
+
def list_invalid_properties
|
|
163
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
164
|
+
invalid_properties = Array.new
|
|
165
|
+
if @event_code.nil?
|
|
166
|
+
invalid_properties.push('invalid value for "event_code", event_code cannot be nil.')
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
invalid_properties
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Check to see if the all the properties in the model are valid
|
|
173
|
+
# @return true if the model is valid
|
|
174
|
+
def valid?
|
|
175
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
176
|
+
return false if @event_code.nil?
|
|
177
|
+
software_validator = EnumAttributeValidator.new('String', ["own", "dian_free", "unknown_default_open_api"])
|
|
178
|
+
return false unless software_validator.valid?(@software)
|
|
179
|
+
provider_validator = EnumAttributeValidator.new('String', ["dian", "company", "unknown_default_open_api"])
|
|
180
|
+
return false unless provider_validator.valid?(@provider)
|
|
181
|
+
true
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Custom attribute writer method with validation
|
|
185
|
+
# @param [Object] event_code Value to be assigned
|
|
186
|
+
def event_code=(event_code)
|
|
187
|
+
if event_code.nil?
|
|
188
|
+
fail ArgumentError, 'event_code cannot be nil'
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
@event_code = event_code
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
195
|
+
# @param [Object] software Object to be assigned
|
|
196
|
+
def software=(software)
|
|
197
|
+
validator = EnumAttributeValidator.new('String', ["own", "dian_free", "unknown_default_open_api"])
|
|
198
|
+
unless validator.valid?(software)
|
|
199
|
+
fail ArgumentError, "invalid value for \"software\", must be one of #{validator.allowable_values}."
|
|
200
|
+
end
|
|
201
|
+
@software = software
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
205
|
+
# @param [Object] provider Object to be assigned
|
|
206
|
+
def provider=(provider)
|
|
207
|
+
validator = EnumAttributeValidator.new('String', ["dian", "company", "unknown_default_open_api"])
|
|
208
|
+
unless validator.valid?(provider)
|
|
209
|
+
fail ArgumentError, "invalid value for \"provider\", must be one of #{validator.allowable_values}."
|
|
210
|
+
end
|
|
211
|
+
@provider = provider
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Checks equality by comparing each attribute.
|
|
215
|
+
# @param [Object] Object to be compared
|
|
216
|
+
def ==(o)
|
|
217
|
+
return true if self.equal?(o)
|
|
218
|
+
self.class == o.class &&
|
|
219
|
+
external_id == o.external_id &&
|
|
220
|
+
event_code == o.event_code &&
|
|
221
|
+
invoice == o.invoice &&
|
|
222
|
+
invoice_id == o.invoice_id &&
|
|
223
|
+
claim == o.claim &&
|
|
224
|
+
software == o.software &&
|
|
225
|
+
provider == o.provider
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# @see the `==` method
|
|
229
|
+
# @param [Object] Object to be compared
|
|
230
|
+
def eql?(o)
|
|
231
|
+
self == o
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Calculates hash code according to all attributes.
|
|
235
|
+
# @return [Integer] Hash code
|
|
236
|
+
def hash
|
|
237
|
+
[external_id, event_code, invoice, invoice_id, claim, software, provider].hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Builds the object from hash
|
|
241
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
242
|
+
# @return [Object] Returns the model itself
|
|
243
|
+
def self.build_from_hash(attributes)
|
|
244
|
+
return nil unless attributes.is_a?(Hash)
|
|
245
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
246
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
247
|
+
map = acceptable_attribute_map
|
|
248
|
+
transformed_hash = {}
|
|
249
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
250
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
251
|
+
transformed_hash["#{key}"] = nil
|
|
252
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
253
|
+
# check to ensure the input is an array given that the attribute
|
|
254
|
+
# is documented as an array but the input is not
|
|
255
|
+
if attributes[map[key]].is_a?(Array)
|
|
256
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
257
|
+
end
|
|
258
|
+
elsif !attributes[map[key]].nil?
|
|
259
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
new(transformed_hash)
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Returns the object in the form of hash
|
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
|
267
|
+
def to_hash
|
|
268
|
+
hash = {}
|
|
269
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
270
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
271
|
+
value = self.send(attr)
|
|
272
|
+
if value.nil?
|
|
273
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
274
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
hash[param] = _to_hash(value)
|
|
278
|
+
end
|
|
279
|
+
hash
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
end
|
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
# 030–033: la factura recibida (con el emisor). 034: {id, cufe, number} de la factura propia; sin `id` si no se emitió con Trevol (la trajo la sincronización con la DIAN).
|
|
18
|
+
class RadianEventInvoice < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
attr_accessor :cufe
|
|
22
|
+
|
|
23
|
+
attr_accessor :number
|
|
24
|
+
|
|
25
|
+
attr_accessor :type
|
|
26
|
+
|
|
27
|
+
attr_accessor :issuer
|
|
28
|
+
|
|
29
|
+
attr_accessor :acquirer_document_type
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'id' => :'id',
|
|
35
|
+
:'cufe' => :'cufe',
|
|
36
|
+
:'number' => :'number',
|
|
37
|
+
:'type' => :'type',
|
|
38
|
+
:'issuer' => :'issuer',
|
|
39
|
+
:'acquirer_document_type' => :'acquirer_document_type'
|
|
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
|
+
:'id' => :'String',
|
|
57
|
+
:'cufe' => :'String',
|
|
58
|
+
:'number' => :'String',
|
|
59
|
+
:'type' => :'String',
|
|
60
|
+
:'issuer' => :'ReceivedInvoiceIssuer',
|
|
61
|
+
:'acquirer_document_type' => :'String'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
:'cufe',
|
|
69
|
+
:'number',
|
|
70
|
+
])
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Returns attribute type mapping
|
|
74
|
+
def self.acceptable_openapi_types
|
|
75
|
+
openapi_types
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns the nullable attributes
|
|
79
|
+
def self.acceptable_openapi_nullable
|
|
80
|
+
openapi_nullable
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Initializes the object
|
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
85
|
+
def initialize(attributes = {})
|
|
86
|
+
if (!attributes.is_a?(Hash))
|
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::RadianEventInvoice` initialize method"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
91
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
93
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::RadianEventInvoice`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
95
|
+
end
|
|
96
|
+
h[k.to_sym] = v
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'id')
|
|
100
|
+
self.id = attributes[:'id']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'cufe')
|
|
104
|
+
self.cufe = attributes[:'cufe']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'number')
|
|
108
|
+
self.number = attributes[:'number']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'type')
|
|
112
|
+
self.type = attributes[:'type']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'issuer')
|
|
116
|
+
self.issuer = attributes[:'issuer']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'acquirer_document_type')
|
|
120
|
+
self.acquirer_document_type = attributes[:'acquirer_document_type']
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
125
|
+
# @return Array for valid properties with the reasons
|
|
126
|
+
def list_invalid_properties
|
|
127
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
128
|
+
invalid_properties = Array.new
|
|
129
|
+
invalid_properties
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Check to see if the all the properties in the model are valid
|
|
133
|
+
# @return true if the model is valid
|
|
134
|
+
def valid?
|
|
135
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Checks equality by comparing each attribute.
|
|
140
|
+
# @param [Object] Object to be compared
|
|
141
|
+
def ==(o)
|
|
142
|
+
return true if self.equal?(o)
|
|
143
|
+
self.class == o.class &&
|
|
144
|
+
id == o.id &&
|
|
145
|
+
cufe == o.cufe &&
|
|
146
|
+
number == o.number &&
|
|
147
|
+
type == o.type &&
|
|
148
|
+
issuer == o.issuer &&
|
|
149
|
+
acquirer_document_type == o.acquirer_document_type
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# @see the `==` method
|
|
153
|
+
# @param [Object] Object to be compared
|
|
154
|
+
def eql?(o)
|
|
155
|
+
self == o
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Calculates hash code according to all attributes.
|
|
159
|
+
# @return [Integer] Hash code
|
|
160
|
+
def hash
|
|
161
|
+
[id, cufe, number, type, issuer, acquirer_document_type].hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Builds the object from hash
|
|
165
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
166
|
+
# @return [Object] Returns the model itself
|
|
167
|
+
def self.build_from_hash(attributes)
|
|
168
|
+
return nil unless attributes.is_a?(Hash)
|
|
169
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
170
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
171
|
+
map = acceptable_attribute_map
|
|
172
|
+
transformed_hash = {}
|
|
173
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
174
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = nil
|
|
176
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
177
|
+
# check to ensure the input is an array given that the attribute
|
|
178
|
+
# is documented as an array but the input is not
|
|
179
|
+
if attributes[map[key]].is_a?(Array)
|
|
180
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
181
|
+
end
|
|
182
|
+
elsif !attributes[map[key]].nil?
|
|
183
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
new(transformed_hash)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Returns the object in the form of hash
|
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
|
191
|
+
def to_hash
|
|
192
|
+
hash = {}
|
|
193
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
194
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
195
|
+
value = self.send(attr)
|
|
196
|
+
if value.nil?
|
|
197
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
hash[param] = _to_hash(value)
|
|
202
|
+
end
|
|
203
|
+
hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|
|
@@ -0,0 +1,191 @@
|
|
|
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 RadianEventList < ApiModelBase
|
|
18
|
+
# Valores conocidos: `list`.
|
|
19
|
+
attr_accessor :object
|
|
20
|
+
|
|
21
|
+
attr_accessor :data
|
|
22
|
+
|
|
23
|
+
attr_accessor :has_more
|
|
24
|
+
|
|
25
|
+
attr_accessor :next_cursor
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'object' => :'object',
|
|
31
|
+
:'data' => :'data',
|
|
32
|
+
:'has_more' => :'has_more',
|
|
33
|
+
:'next_cursor' => :'next_cursor'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'object' => :'String',
|
|
51
|
+
:'data' => :'Array<RadianEvent>',
|
|
52
|
+
:'has_more' => :'Boolean',
|
|
53
|
+
:'next_cursor' => :'String'
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# List of attributes with nullable: true
|
|
58
|
+
def self.openapi_nullable
|
|
59
|
+
Set.new([
|
|
60
|
+
:'next_cursor'
|
|
61
|
+
])
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns attribute type mapping
|
|
65
|
+
def self.acceptable_openapi_types
|
|
66
|
+
openapi_types
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns the nullable attributes
|
|
70
|
+
def self.acceptable_openapi_nullable
|
|
71
|
+
openapi_nullable
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Initializes the object
|
|
75
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
76
|
+
def initialize(attributes = {})
|
|
77
|
+
if (!attributes.is_a?(Hash))
|
|
78
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::RadianEventList` initialize method"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
82
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
83
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
84
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
85
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::RadianEventList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
86
|
+
end
|
|
87
|
+
h[k.to_sym] = v
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'object')
|
|
91
|
+
self.object = attributes[:'object']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'data')
|
|
95
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
96
|
+
self.data = value
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'has_more')
|
|
101
|
+
self.has_more = attributes[:'has_more']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'next_cursor')
|
|
105
|
+
self.next_cursor = attributes[:'next_cursor']
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properties with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
113
|
+
invalid_properties = Array.new
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
true
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Checks equality by comparing each attribute.
|
|
125
|
+
# @param [Object] Object to be compared
|
|
126
|
+
def ==(o)
|
|
127
|
+
return true if self.equal?(o)
|
|
128
|
+
self.class == o.class &&
|
|
129
|
+
object == o.object &&
|
|
130
|
+
data == o.data &&
|
|
131
|
+
has_more == o.has_more &&
|
|
132
|
+
next_cursor == o.next_cursor
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# @see the `==` method
|
|
136
|
+
# @param [Object] Object to be compared
|
|
137
|
+
def eql?(o)
|
|
138
|
+
self == o
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Calculates hash code according to all attributes.
|
|
142
|
+
# @return [Integer] Hash code
|
|
143
|
+
def hash
|
|
144
|
+
[object, data, has_more, next_cursor].hash
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Builds the object from hash
|
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
149
|
+
# @return [Object] Returns the model itself
|
|
150
|
+
def self.build_from_hash(attributes)
|
|
151
|
+
return nil unless attributes.is_a?(Hash)
|
|
152
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
153
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
154
|
+
map = acceptable_attribute_map
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
177
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
178
|
+
value = self.send(attr)
|
|
179
|
+
if value.nil?
|
|
180
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
hash[param] = _to_hash(value)
|
|
185
|
+
end
|
|
186
|
+
hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|