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
@@ -0,0 +1,170 @@
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 CompanyLogoDeleted < ApiModelBase
18
+ # Valores conocidos: `company_logo`.
19
+ attr_accessor :object
20
+
21
+ attr_accessor :deleted
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'object' => :'object',
27
+ :'deleted' => :'deleted'
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
+ :'object' => :'String',
45
+ :'deleted' => :'Boolean'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Returns attribute type mapping
56
+ def self.acceptable_openapi_types
57
+ openapi_types
58
+ end
59
+
60
+ # Returns the nullable attributes
61
+ def self.acceptable_openapi_nullable
62
+ openapi_nullable
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::CompanyLogoDeleted` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::CompanyLogoDeleted`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'object')
82
+ self.object = attributes[:'object']
83
+ end
84
+
85
+ if attributes.key?(:'deleted')
86
+ self.deleted = attributes[:'deleted']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ object == o.object &&
111
+ deleted == o.deleted
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [object, deleted].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ # include attributes inherited from allOf parents (the nearest declaration wins)
133
+ map = acceptable_attribute_map
134
+ transformed_hash = {}
135
+ acceptable_openapi_types.each_pair do |key, type|
136
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Returns the object in the form of hash
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_hash
154
+ hash = {}
155
+ # include attributes inherited from allOf parents (the nearest declaration wins)
156
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ if value.nil?
159
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
160
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
161
+ end
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ end
169
+
170
+ end
@@ -0,0 +1,178 @@
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 CompanyLogoInput < ApiModelBase
18
+ # PNG, JPEG o WebP en base64 estándar (con relleno, sin prefijo data:).
19
+ attr_accessor :image_base64
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'image_base64' => :'image_base64'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'image_base64' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Returns attribute type mapping
52
+ def self.acceptable_openapi_types
53
+ openapi_types
54
+ end
55
+
56
+ # Returns the nullable attributes
57
+ def self.acceptable_openapi_nullable
58
+ openapi_nullable
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::CompanyLogoInput` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::CompanyLogoInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'image_base64')
78
+ self.image_base64 = attributes[:'image_base64']
79
+ else
80
+ self.image_base64 = nil
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ if @image_base64.nil?
90
+ invalid_properties.push('invalid value for "image_base64", image_base64 cannot be nil.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ return false if @image_base64.nil?
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param [Object] image_base64 Value to be assigned
106
+ def image_base64=(image_base64)
107
+ if image_base64.nil?
108
+ fail ArgumentError, 'image_base64 cannot be nil'
109
+ end
110
+
111
+ @image_base64 = image_base64
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ image_base64 == o.image_base64
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [image_base64].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ # include attributes inherited from allOf parents (the nearest declaration wins)
141
+ map = acceptable_attribute_map
142
+ transformed_hash = {}
143
+ acceptable_openapi_types.each_pair do |key, type|
144
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ # include attributes inherited from allOf parents (the nearest declaration wins)
164
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
165
+ value = self.send(attr)
166
+ if value.nil?
167
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
168
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
169
+ end
170
+
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ end
177
+
178
+ end
@@ -27,6 +27,9 @@ module TrevolGenerado
27
27
 
28
28
  attr_accessor :email
29
29
 
30
+ # 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.
31
+ attr_accessor :email_resends
32
+
30
33
  # Attribute mapping from ruby-style variable name to JSON key.
31
34
  def self.attribute_map
32
35
  {
@@ -34,7 +37,8 @@ module TrevolGenerado
34
37
  :'pdf' => :'pdf',
35
38
  :'zip' => :'zip',
36
39
  :'xml' => :'xml',
37
- :'email' => :'email'
40
+ :'email' => :'email',
41
+ :'email_resends' => :'email_resends'
38
42
  }
39
43
  end
40
44
 
@@ -55,7 +59,8 @@ module TrevolGenerado
55
59
  :'pdf' => :'Boolean',
56
60
  :'zip' => :'Boolean',
57
61
  :'xml' => :'Boolean',
58
- :'email' => :'DeliveryEmail'
62
+ :'email' => :'DeliveryEmail',
63
+ :'email_resends' => :'DeliveryEmailResends'
59
64
  }
60
65
  end
61
66
 
@@ -63,7 +68,8 @@ module TrevolGenerado
63
68
  def self.openapi_nullable
64
69
  Set.new([
65
70
  :'status',
66
- :'email'
71
+ :'email',
72
+ :'email_resends'
67
73
  ])
68
74
  end
69
75
 
@@ -112,6 +118,10 @@ module TrevolGenerado
112
118
  if attributes.key?(:'email')
113
119
  self.email = attributes[:'email']
114
120
  end
121
+
122
+ if attributes.key?(:'email_resends')
123
+ self.email_resends = attributes[:'email_resends']
124
+ end
115
125
  end
116
126
 
117
127
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -138,7 +148,8 @@ module TrevolGenerado
138
148
  pdf == o.pdf &&
139
149
  zip == o.zip &&
140
150
  xml == o.xml &&
141
- email == o.email
151
+ email == o.email &&
152
+ email_resends == o.email_resends
142
153
  end
143
154
 
144
155
  # @see the `==` method
@@ -150,7 +161,7 @@ module TrevolGenerado
150
161
  # Calculates hash code according to all attributes.
151
162
  # @return [Integer] Hash code
152
163
  def hash
153
- [status, pdf, zip, xml, email].hash
164
+ [status, pdf, zip, xml, email, email_resends].hash
154
165
  end
155
166
 
156
167
  # Builds the object from hash
@@ -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