trevol 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -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/catalogs_api.rb +164 -0
  8. data/lib/trevol_generado/api/company_settings_api.rb +384 -0
  9. data/lib/trevol_generado/api/credit_notes_api.rb +79 -0
  10. data/lib/trevol_generado/api/debit_notes_api.rb +79 -0
  11. data/lib/trevol_generado/api/dian_documents_api.rb +8 -2
  12. data/lib/trevol_generado/api/equivalent_document_adjustments_api.rb +79 -0
  13. data/lib/trevol_generado/api/equivalent_documents_api.rb +79 -0
  14. data/lib/trevol_generado/api/invoices_api.rb +79 -0
  15. data/lib/trevol_generado/api/payroll_adjustments_api.rb +6 -0
  16. data/lib/trevol_generado/api/payrolls_api.rb +6 -0
  17. data/lib/trevol_generado/api/pdf_designs_api.rb +357 -0
  18. data/lib/trevol_generado/api/pdf_templates_api.rb +79 -0
  19. data/lib/trevol_generado/api/radian_events_api.rb +6 -0
  20. data/lib/trevol_generado/api/support_document_adjustments_api.rb +6 -0
  21. data/lib/trevol_generado/api/support_documents_api.rb +6 -0
  22. data/lib/trevol_generado/models/account_company.rb +11 -1
  23. data/lib/trevol_generado/models/code_list.rb +245 -0
  24. data/lib/trevol_generado/models/code_list_entry.rb +353 -0
  25. data/lib/trevol_generado/models/code_list_entry_list.rb +191 -0
  26. data/lib/trevol_generado/models/code_list_list.rb +191 -0
  27. data/lib/trevol_generado/models/code_list_rates.rb +174 -0
  28. data/lib/trevol_generado/models/company.rb +11 -1
  29. data/lib/trevol_generado/models/company_logo.rb +217 -0
  30. data/lib/trevol_generado/models/company_logo_deleted.rb +170 -0
  31. data/lib/trevol_generado/models/company_logo_input.rb +178 -0
  32. data/lib/trevol_generado/models/delivery.rb +16 -5
  33. data/lib/trevol_generado/models/delivery_email_resends.rb +171 -0
  34. data/lib/trevol_generado/models/document.rb +37 -5
  35. data/lib/trevol_generado/models/document_totals_item.rb +1 -0
  36. data/lib/trevol_generado/models/email_resend.rb +256 -0
  37. data/lib/trevol_generado/models/email_resend_delivery.rb +183 -0
  38. data/lib/trevol_generado/models/email_resend_request.rb +163 -0
  39. data/lib/trevol_generado/models/email_resend_summary.rb +256 -0
  40. data/lib/trevol_generado/models/equivalent_document.rb +27 -5
  41. data/lib/trevol_generado/models/equivalent_document_adjustment.rb +26 -4
  42. data/lib/trevol_generado/models/equivalent_document_adjustment_input.rb +15 -4
  43. data/lib/trevol_generado/models/equivalent_document_input.rb +15 -4
  44. data/lib/trevol_generado/models/event.rb +11 -1
  45. data/lib/trevol_generado/models/invoice_batch.rb +11 -1
  46. data/lib/trevol_generado/models/invoice_batch_invoice_input.rb +24 -5
  47. data/lib/trevol_generado/models/invoice_input.rb +24 -4
  48. data/lib/trevol_generado/models/note_input.rb +15 -4
  49. data/lib/trevol_generado/models/numbering.rb +1 -1
  50. data/lib/trevol_generado/models/pdf_design.rb +297 -0
  51. data/lib/trevol_generado/models/pdf_design_applied.rb +193 -0
  52. data/lib/trevol_generado/models/pdf_design_input.rb +277 -0
  53. data/lib/trevol_generado/models/pdf_design_list.rb +191 -0
  54. data/lib/trevol_generado/models/pdf_design_update.rb +246 -0
  55. data/lib/trevol_generado/models/pdf_settings.rb +202 -0
  56. data/lib/trevol_generado/models/pdf_settings_update.rb +170 -0
  57. data/lib/trevol_generado/models/pdf_template.rb +210 -0
  58. data/lib/trevol_generado/models/pdf_template_list.rb +191 -0
  59. data/lib/trevol_generado/models/preview.rb +11 -1
  60. data/lib/trevol_generado/models/preview_numbering.rb +161 -0
  61. data/lib/trevol_generado/models/problem.rb +26 -4
  62. data/lib/trevol_generado/models/problem_finding.rb +172 -0
  63. data/lib/trevol_generado/models/support_document.rb +11 -1
  64. data/lib/trevol_generado/models/support_document_adjustment.rb +11 -1
  65. data/lib/trevol_generado/models/webhook_endpoint.rb +12 -2
  66. data/lib/trevol_generado/models/webhook_endpoint_input.rb +14 -4
  67. data/lib/trevol_generado/models/webhook_endpoint_update.rb +11 -1
  68. data/lib/trevol_generado/tablas.rb +30 -1
  69. data/lib/trevol_generado/version.rb +1 -1
  70. data/lib/trevol_generado.rb +28 -0
  71. metadata +29 -1
@@ -0,0 +1,171 @@
1
+ =begin
2
+ #API de Trevol
3
+
4
+ #Trevol API. Documentación: https://platform.trevol.si/docs
5
+
6
+ The version of the OpenAPI document: 2026-11-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrevolGenerado
17
+ # Los reenvíos del correo con `POST …/{id}/email`; null si nunca se reenvió. `status` y `email` siguen hablando del correo original. `last.deliveries` dice cómo le fue a cada destinatario del último reenvío, también si rebotó o se quejó después. Sin `customers:read`, `last.to` y `last.deliveries[].to` salen en null.
18
+ class DeliveryEmailResends < ApiModelBase
19
+ attr_accessor :count
20
+
21
+ attr_accessor :last
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'count' => :'count',
27
+ :'last' => :'last'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'count' => :'Integer',
45
+ :'last' => :'EmailResendSummary'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'last'
53
+ ])
54
+ end
55
+
56
+ # Returns attribute type mapping
57
+ def self.acceptable_openapi_types
58
+ openapi_types
59
+ end
60
+
61
+ # Returns the nullable attributes
62
+ def self.acceptable_openapi_nullable
63
+ openapi_nullable
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::DeliveryEmailResends` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::DeliveryEmailResends`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'count')
83
+ self.count = attributes[:'count']
84
+ end
85
+
86
+ if attributes.key?(:'last')
87
+ self.last = attributes[:'last']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ count == o.count &&
112
+ last == o.last
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [count, last].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ # include attributes inherited from allOf parents (the nearest declaration wins)
134
+ map = acceptable_attribute_map
135
+ transformed_hash = {}
136
+ acceptable_openapi_types.each_pair do |key, type|
137
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
138
+ transformed_hash["#{key}"] = nil
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[map[key]].is_a?(Array)
143
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
144
+ end
145
+ elsif !attributes[map[key]].nil?
146
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
147
+ end
148
+ end
149
+ new(transformed_hash)
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ # include attributes inherited from allOf parents (the nearest declaration wins)
157
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
158
+ value = self.send(attr)
159
+ if value.nil?
160
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
161
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
162
+ end
163
+
164
+ hash[param] = _to_hash(value)
165
+ end
166
+ hash
167
+ end
168
+
169
+ end
170
+
171
+ end
@@ -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