trevol 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/GENERADO.md +1 -1
  4. data/README.md +1 -1
  5. data/lib/trevol/client.rb +6 -1
  6. data/lib/trevol/transporte.rb +1 -0
  7. data/lib/trevol_generado/api/balance_api.rb +6 -6
  8. data/lib/trevol_generado/api/catalogs_api.rb +164 -0
  9. data/lib/trevol_generado/api/company_settings_api.rb +384 -0
  10. data/lib/trevol_generado/api/credit_notes_api.rb +79 -0
  11. data/lib/trevol_generado/api/debit_notes_api.rb +79 -0
  12. data/lib/trevol_generado/api/dian_documents_api.rb +8 -2
  13. data/lib/trevol_generado/api/equivalent_document_adjustments_api.rb +79 -0
  14. data/lib/trevol_generado/api/equivalent_documents_api.rb +79 -0
  15. data/lib/trevol_generado/api/invoices_api.rb +79 -0
  16. data/lib/trevol_generado/api/payroll_adjustments_api.rb +6 -0
  17. data/lib/trevol_generado/api/payrolls_api.rb +6 -0
  18. data/lib/trevol_generado/api/pdf_designs_api.rb +357 -0
  19. data/lib/trevol_generado/api/pdf_templates_api.rb +79 -0
  20. data/lib/trevol_generado/api/radian_events_api.rb +6 -0
  21. data/lib/trevol_generado/api/support_document_adjustments_api.rb +6 -0
  22. data/lib/trevol_generado/api/support_documents_api.rb +6 -0
  23. data/lib/trevol_generado/models/account_company.rb +11 -1
  24. data/lib/trevol_generado/models/balance.rb +13 -2
  25. data/lib/trevol_generado/models/balance_key_owner.rb +162 -0
  26. data/lib/trevol_generado/models/code_list.rb +245 -0
  27. data/lib/trevol_generado/models/code_list_entry.rb +353 -0
  28. data/lib/trevol_generado/models/code_list_entry_list.rb +191 -0
  29. data/lib/trevol_generado/models/code_list_list.rb +191 -0
  30. data/lib/trevol_generado/models/code_list_rates.rb +174 -0
  31. data/lib/trevol_generado/models/company.rb +11 -1
  32. data/lib/trevol_generado/models/company_logo.rb +217 -0
  33. data/lib/trevol_generado/models/company_logo_deleted.rb +170 -0
  34. data/lib/trevol_generado/models/company_logo_input.rb +178 -0
  35. data/lib/trevol_generado/models/delivery.rb +16 -5
  36. data/lib/trevol_generado/models/delivery_email_resends.rb +171 -0
  37. data/lib/trevol_generado/models/document.rb +37 -5
  38. data/lib/trevol_generado/models/document_totals_item.rb +1 -0
  39. data/lib/trevol_generado/models/email_resend.rb +256 -0
  40. data/lib/trevol_generado/models/email_resend_delivery.rb +183 -0
  41. data/lib/trevol_generado/models/email_resend_request.rb +163 -0
  42. data/lib/trevol_generado/models/email_resend_summary.rb +256 -0
  43. data/lib/trevol_generado/models/equivalent_document.rb +27 -5
  44. data/lib/trevol_generado/models/equivalent_document_adjustment.rb +26 -4
  45. data/lib/trevol_generado/models/equivalent_document_adjustment_input.rb +15 -4
  46. data/lib/trevol_generado/models/equivalent_document_input.rb +15 -4
  47. data/lib/trevol_generado/models/event.rb +11 -1
  48. data/lib/trevol_generado/models/invoice_batch.rb +11 -1
  49. data/lib/trevol_generado/models/invoice_batch_invoice_input.rb +24 -5
  50. data/lib/trevol_generado/models/invoice_input.rb +24 -4
  51. data/lib/trevol_generado/models/note_input.rb +15 -4
  52. data/lib/trevol_generado/models/numbering.rb +1 -1
  53. data/lib/trevol_generado/models/pdf_design.rb +297 -0
  54. data/lib/trevol_generado/models/pdf_design_applied.rb +193 -0
  55. data/lib/trevol_generado/models/pdf_design_input.rb +277 -0
  56. data/lib/trevol_generado/models/pdf_design_list.rb +191 -0
  57. data/lib/trevol_generado/models/pdf_design_update.rb +246 -0
  58. data/lib/trevol_generado/models/pdf_settings.rb +202 -0
  59. data/lib/trevol_generado/models/pdf_settings_update.rb +170 -0
  60. data/lib/trevol_generado/models/pdf_template.rb +210 -0
  61. data/lib/trevol_generado/models/pdf_template_list.rb +191 -0
  62. data/lib/trevol_generado/models/preview.rb +11 -1
  63. data/lib/trevol_generado/models/preview_numbering.rb +161 -0
  64. data/lib/trevol_generado/models/problem.rb +27 -5
  65. data/lib/trevol_generado/models/problem_finding.rb +172 -0
  66. data/lib/trevol_generado/models/support_document.rb +11 -1
  67. data/lib/trevol_generado/models/support_document_adjustment.rb +11 -1
  68. data/lib/trevol_generado/models/webhook_endpoint.rb +12 -2
  69. data/lib/trevol_generado/models/webhook_endpoint_input.rb +14 -4
  70. data/lib/trevol_generado/models/webhook_endpoint_update.rb +11 -1
  71. data/lib/trevol_generado/tablas.rb +30 -1
  72. data/lib/trevol_generado/version.rb +1 -1
  73. data/lib/trevol_generado.rb +29 -0
  74. metadata +30 -1
@@ -24,6 +24,9 @@ module TrevolGenerado
24
24
  # Valores conocidos: `test`, `live`.
25
25
  attr_accessor :environment
26
26
 
27
+ # Solo en el entorno SIMULADO (la empresa simulada de la cuenta): el objeto se validó, se calculó y se firmó como siempre, pero nunca llegó a la DIAN ni tiene validez. Un objeto real no lleva esta propiedad.
28
+ attr_accessor :simulated
29
+
27
30
  # `processing` solo en la versión 2026-10-22: la DIAN no confirmó y Trevol sigue resolviendo el documento (el resultado llega por GET y por webhook; no crees otro documento para la misma venta). En 2026-10-21 ese documento se ve como `error`. Valores conocidos: `pending`, `sending`, `accepted`, `rejected`, `error`, `contingency`, `processing`.
28
31
  attr_accessor :status
29
32
 
@@ -85,12 +88,19 @@ module TrevolGenerado
85
88
 
86
89
  attr_accessor :updated_at
87
90
 
91
+ # El que pidió el documento, o null.
92
+ attr_accessor :pdf_design_id
93
+
94
+ # El diseño fijado al emitir; null mientras está pendiente.
95
+ attr_accessor :pdf_design
96
+
88
97
  # Attribute mapping from ruby-style variable name to JSON key.
89
98
  def self.attribute_map
90
99
  {
91
100
  :'id' => :'id',
92
101
  :'object' => :'object',
93
102
  :'environment' => :'environment',
103
+ :'simulated' => :'simulated',
94
104
  :'status' => :'status',
95
105
  :'number' => :'number',
96
106
  :'prefix' => :'prefix',
@@ -117,7 +127,9 @@ module TrevolGenerado
117
127
  :'dian' => :'dian',
118
128
  :'delivery' => :'delivery',
119
129
  :'created_at' => :'created_at',
120
- :'updated_at' => :'updated_at'
130
+ :'updated_at' => :'updated_at',
131
+ :'pdf_design_id' => :'pdf_design_id',
132
+ :'pdf_design' => :'pdf_design'
121
133
  }
122
134
  end
123
135
 
@@ -137,6 +149,7 @@ module TrevolGenerado
137
149
  :'id' => :'String',
138
150
  :'object' => :'String',
139
151
  :'environment' => :'String',
152
+ :'simulated' => :'Boolean',
140
153
  :'status' => :'String',
141
154
  :'number' => :'String',
142
155
  :'prefix' => :'String',
@@ -163,7 +176,9 @@ module TrevolGenerado
163
176
  :'dian' => :'DianResult',
164
177
  :'delivery' => :'Delivery',
165
178
  :'created_at' => :'Time',
166
- :'updated_at' => :'Time'
179
+ :'updated_at' => :'Time',
180
+ :'pdf_design_id' => :'String',
181
+ :'pdf_design' => :'PdfDesignApplied'
167
182
  }
168
183
  end
169
184
 
@@ -179,7 +194,9 @@ module TrevolGenerado
179
194
  :'issued_at',
180
195
  :'contingency',
181
196
  :'totals',
182
- :'updated_at'
197
+ :'updated_at',
198
+ :'pdf_design_id',
199
+ :'pdf_design'
183
200
  ])
184
201
  end
185
202
 
@@ -221,6 +238,10 @@ module TrevolGenerado
221
238
  self.environment = attributes[:'environment']
222
239
  end
223
240
 
241
+ if attributes.key?(:'simulated')
242
+ self.simulated = attributes[:'simulated']
243
+ end
244
+
224
245
  if attributes.key?(:'status')
225
246
  self.status = attributes[:'status']
226
247
  end
@@ -330,6 +351,14 @@ module TrevolGenerado
330
351
  if attributes.key?(:'updated_at')
331
352
  self.updated_at = attributes[:'updated_at']
332
353
  end
354
+
355
+ if attributes.key?(:'pdf_design_id')
356
+ self.pdf_design_id = attributes[:'pdf_design_id']
357
+ end
358
+
359
+ if attributes.key?(:'pdf_design')
360
+ self.pdf_design = attributes[:'pdf_design']
361
+ end
333
362
  end
334
363
 
335
364
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -355,6 +384,7 @@ module TrevolGenerado
355
384
  id == o.id &&
356
385
  object == o.object &&
357
386
  environment == o.environment &&
387
+ simulated == o.simulated &&
358
388
  status == o.status &&
359
389
  number == o.number &&
360
390
  prefix == o.prefix &&
@@ -381,7 +411,9 @@ module TrevolGenerado
381
411
  dian == o.dian &&
382
412
  delivery == o.delivery &&
383
413
  created_at == o.created_at &&
384
- updated_at == o.updated_at
414
+ updated_at == o.updated_at &&
415
+ pdf_design_id == o.pdf_design_id &&
416
+ pdf_design == o.pdf_design
385
417
  end
386
418
 
387
419
  # @see the `==` method
@@ -393,7 +425,7 @@ module TrevolGenerado
393
425
  # Calculates hash code according to all attributes.
394
426
  # @return [Integer] Hash code
395
427
  def hash
396
- [id, object, environment, status, number, prefix, external_id, origin, cufe, cude, qr, issued_at, customer, items, payment, invoice, document_type, operation_type, currency, cop_totals, delivery_terms, shipment, due_diligence, interoperability, contingency, totals, dian, delivery, created_at, updated_at].hash
428
+ [id, object, environment, simulated, status, number, prefix, external_id, origin, cufe, cude, qr, issued_at, customer, items, payment, invoice, document_type, operation_type, currency, cop_totals, delivery_terms, shipment, due_diligence, interoperability, contingency, totals, dian, delivery, created_at, updated_at, pdf_design_id, pdf_design].hash
397
429
  end
398
430
 
399
431
  # Builds the object from hash
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module TrevolGenerado
17
17
  class DocumentTotalsItem < ApiModelBase
18
+ # Cantidad × precio SIN impuestos.
18
19
  attr_accessor :gross
19
20
 
20
21
  attr_accessor :discount
@@ -0,0 +1,256 @@
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
+ # Un reenvío del correo de un documento validado.
18
+ class EmailResend < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ # Valores conocidos: `email_resend`.
22
+ attr_accessor :object
23
+
24
+ # El documento (inv_…, cn_…, dn_…, pos_…, posa_…).
25
+ attr_accessor :document_id
26
+
27
+ # Valores conocidos: `credit_note`, `debit_note`, `equivalent_document`, `equivalent_document_adjustment`, `invoice`.
28
+ attr_accessor :document_object
29
+
30
+ # `customer`: el correo del comprador; `custom`: las direcciones de `to`; `issuer`: quien emitió (habilitación). Valores conocidos: `custom`, `customer`, `issuer`.
31
+ attr_accessor :recipient
32
+
33
+ # Las direcciones, enmascaradas (`c***@dominio.co`). null sin el permiso `customers:read`.
34
+ attr_accessor :to
35
+
36
+ # `sent`: salió a todos; `partially_sent`: a algunos; `failed`: a ninguno; `unconfirmed`: el envío se interrumpió y no sabemos si salió (no se repite solo); `sending`: todavía se está enviando. Valores conocidos: `sending`, `sent`, `partially_sent`, `failed`, `unconfirmed`.
37
+ attr_accessor :status
38
+
39
+ attr_accessor :created_at
40
+
41
+ attr_accessor :completed_at
42
+
43
+ # Una por destinatario, en el orden de `to`.
44
+ attr_accessor :deliveries
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'id' => :'id',
50
+ :'object' => :'object',
51
+ :'document_id' => :'document_id',
52
+ :'document_object' => :'document_object',
53
+ :'recipient' => :'recipient',
54
+ :'to' => :'to',
55
+ :'status' => :'status',
56
+ :'created_at' => :'created_at',
57
+ :'completed_at' => :'completed_at',
58
+ :'deliveries' => :'deliveries'
59
+ }
60
+ end
61
+
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ acceptable_attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'id' => :'String',
76
+ :'object' => :'String',
77
+ :'document_id' => :'String',
78
+ :'document_object' => :'String',
79
+ :'recipient' => :'String',
80
+ :'to' => :'Array<String>',
81
+ :'status' => :'String',
82
+ :'created_at' => :'Time',
83
+ :'completed_at' => :'Time',
84
+ :'deliveries' => :'Array<EmailResendDelivery>'
85
+ }
86
+ end
87
+
88
+ # List of attributes with nullable: true
89
+ def self.openapi_nullable
90
+ Set.new([
91
+ :'to',
92
+ :'created_at',
93
+ :'completed_at',
94
+ ])
95
+ end
96
+
97
+ # Returns attribute type mapping
98
+ def self.acceptable_openapi_types
99
+ openapi_types
100
+ end
101
+
102
+ # Returns the nullable attributes
103
+ def self.acceptable_openapi_nullable
104
+ openapi_nullable
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::EmailResend` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ acceptable_attribute_map = self.class.acceptable_attribute_map
116
+ attributes = attributes.each_with_object({}) { |(k, v), h|
117
+ if (!acceptable_attribute_map.key?(k.to_sym))
118
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::EmailResend`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
119
+ end
120
+ h[k.to_sym] = v
121
+ }
122
+
123
+ if attributes.key?(:'id')
124
+ self.id = attributes[:'id']
125
+ end
126
+
127
+ if attributes.key?(:'object')
128
+ self.object = attributes[:'object']
129
+ end
130
+
131
+ if attributes.key?(:'document_id')
132
+ self.document_id = attributes[:'document_id']
133
+ end
134
+
135
+ if attributes.key?(:'document_object')
136
+ self.document_object = attributes[:'document_object']
137
+ end
138
+
139
+ if attributes.key?(:'recipient')
140
+ self.recipient = attributes[:'recipient']
141
+ end
142
+
143
+ if attributes.key?(:'to')
144
+ if (value = attributes[:'to']).is_a?(Array)
145
+ self.to = value
146
+ end
147
+ end
148
+
149
+ if attributes.key?(:'status')
150
+ self.status = attributes[:'status']
151
+ end
152
+
153
+ if attributes.key?(:'created_at')
154
+ self.created_at = attributes[:'created_at']
155
+ end
156
+
157
+ if attributes.key?(:'completed_at')
158
+ self.completed_at = attributes[:'completed_at']
159
+ end
160
+
161
+ if attributes.key?(:'deliveries')
162
+ if (value = attributes[:'deliveries']).is_a?(Array)
163
+ self.deliveries = value
164
+ end
165
+ end
166
+ end
167
+
168
+ # Show invalid properties with the reasons. Usually used together with valid?
169
+ # @return Array for valid properties with the reasons
170
+ def list_invalid_properties
171
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
172
+ invalid_properties = Array.new
173
+ invalid_properties
174
+ end
175
+
176
+ # Check to see if the all the properties in the model are valid
177
+ # @return true if the model is valid
178
+ def valid?
179
+ warn '[DEPRECATED] the `valid?` method is obsolete'
180
+ true
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param [Object] Object to be compared
185
+ def ==(o)
186
+ return true if self.equal?(o)
187
+ self.class == o.class &&
188
+ id == o.id &&
189
+ object == o.object &&
190
+ document_id == o.document_id &&
191
+ document_object == o.document_object &&
192
+ recipient == o.recipient &&
193
+ to == o.to &&
194
+ status == o.status &&
195
+ created_at == o.created_at &&
196
+ completed_at == o.completed_at &&
197
+ deliveries == o.deliveries
198
+ end
199
+
200
+ # @see the `==` method
201
+ # @param [Object] Object to be compared
202
+ def eql?(o)
203
+ self == o
204
+ end
205
+
206
+ # Calculates hash code according to all attributes.
207
+ # @return [Integer] Hash code
208
+ def hash
209
+ [id, object, document_id, document_object, recipient, to, status, created_at, completed_at, deliveries].hash
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def self.build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ attributes = attributes.transform_keys(&:to_sym)
218
+ # include attributes inherited from allOf parents (the nearest declaration wins)
219
+ map = acceptable_attribute_map
220
+ transformed_hash = {}
221
+ acceptable_openapi_types.each_pair do |key, type|
222
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
223
+ transformed_hash["#{key}"] = nil
224
+ elsif type =~ /\AArray<(.*)>/i
225
+ # check to ensure the input is an array given that the attribute
226
+ # is documented as an array but the input is not
227
+ if attributes[map[key]].is_a?(Array)
228
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
229
+ end
230
+ elsif !attributes[map[key]].nil?
231
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
232
+ end
233
+ end
234
+ new(transformed_hash)
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ # include attributes inherited from allOf parents (the nearest declaration wins)
242
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ end
255
+
256
+ end
@@ -0,0 +1,183 @@
1
+ =begin
2
+ #API de Trevol
3
+
4
+ #Trevol API. Documentación: https://platform.trevol.si/docs
5
+
6
+ The version of the OpenAPI document: 2026-11-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrevolGenerado
17
+ class EmailResendDelivery < ApiModelBase
18
+ # La dirección enmascarada; null sin `customers:read`.
19
+ attr_accessor :to
20
+
21
+ # `bounced` / `complained`: rebotó o se quejó después (a esa dirección no le volvemos a escribir). Valores conocidos: `sending`, `sent`, `failed`, `unconfirmed`, `bounced`, `complained`.
22
+ attr_accessor :status
23
+
24
+ # Un código si falló.
25
+ attr_accessor :detail
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'to' => :'to',
31
+ :'status' => :'status',
32
+ :'detail' => :'detail'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'to' => :'String',
50
+ :'status' => :'String',
51
+ :'detail' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'to',
59
+ :'detail'
60
+ ])
61
+ end
62
+
63
+ # Returns attribute type mapping
64
+ def self.acceptable_openapi_types
65
+ openapi_types
66
+ end
67
+
68
+ # Returns the nullable attributes
69
+ def self.acceptable_openapi_nullable
70
+ openapi_nullable
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::EmailResendDelivery` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!acceptable_attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::EmailResendDelivery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'to')
90
+ self.to = attributes[:'to']
91
+ end
92
+
93
+ if attributes.key?(:'status')
94
+ self.status = attributes[:'status']
95
+ end
96
+
97
+ if attributes.key?(:'detail')
98
+ self.detail = attributes[:'detail']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
+ invalid_properties = Array.new
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ to == o.to &&
123
+ status == o.status &&
124
+ detail == o.detail
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [to, status, detail].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ attributes = attributes.transform_keys(&:to_sym)
145
+ # include attributes inherited from allOf parents (the nearest declaration wins)
146
+ map = acceptable_attribute_map
147
+ transformed_hash = {}
148
+ acceptable_openapi_types.each_pair do |key, type|
149
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
156
+ end
157
+ elsif !attributes[map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ # include attributes inherited from allOf parents (the nearest declaration wins)
169
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ if value.nil?
172
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
173
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
174
+ end
175
+
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ end
182
+
183
+ end