trevol 0.3.0 → 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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -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/account_api.rb +2 -2
  8. data/lib/trevol_generado/api/balance_api.rb +2 -2
  9. data/lib/trevol_generado/api/catalogs_api.rb +164 -0
  10. data/lib/trevol_generado/api/company_settings_api.rb +384 -0
  11. data/lib/trevol_generado/api/credit_notes_api.rb +79 -0
  12. data/lib/trevol_generado/api/debit_notes_api.rb +79 -0
  13. data/lib/trevol_generado/api/dian_documents_api.rb +8 -2
  14. data/lib/trevol_generado/api/dian_syncs_api.rb +2 -2
  15. data/lib/trevol_generado/api/equivalent_document_adjustments_api.rb +79 -0
  16. data/lib/trevol_generado/api/equivalent_documents_api.rb +79 -0
  17. data/lib/trevol_generado/api/invoices_api.rb +79 -0
  18. data/lib/trevol_generado/api/payroll_adjustments_api.rb +6 -0
  19. data/lib/trevol_generado/api/payrolls_api.rb +6 -0
  20. data/lib/trevol_generado/api/pdf_designs_api.rb +357 -0
  21. data/lib/trevol_generado/api/pdf_templates_api.rb +79 -0
  22. data/lib/trevol_generado/api/radian_events_api.rb +6 -0
  23. data/lib/trevol_generado/api/support_document_adjustments_api.rb +6 -0
  24. data/lib/trevol_generado/api/support_documents_api.rb +6 -0
  25. data/lib/trevol_generado/models/account_api_key_input.rb +1 -1
  26. data/lib/trevol_generado/models/account_company.rb +11 -1
  27. data/lib/trevol_generado/models/account_company_onboarding.rb +1 -1
  28. data/lib/trevol_generado/models/balance.rb +2 -2
  29. data/lib/trevol_generado/models/balance_operation_prices.rb +1 -1
  30. data/lib/trevol_generado/models/code_list.rb +245 -0
  31. data/lib/trevol_generado/models/code_list_entry.rb +353 -0
  32. data/lib/trevol_generado/models/code_list_entry_list.rb +191 -0
  33. data/lib/trevol_generado/models/code_list_list.rb +191 -0
  34. data/lib/trevol_generado/models/code_list_rates.rb +174 -0
  35. data/lib/trevol_generado/models/company.rb +11 -1
  36. data/lib/trevol_generado/models/company_logo.rb +217 -0
  37. data/lib/trevol_generado/models/company_logo_deleted.rb +170 -0
  38. data/lib/trevol_generado/models/company_logo_input.rb +178 -0
  39. data/lib/trevol_generado/models/delivery.rb +16 -5
  40. data/lib/trevol_generado/models/delivery_email_resends.rb +171 -0
  41. data/lib/trevol_generado/models/document.rb +37 -5
  42. data/lib/trevol_generado/models/document_totals_item.rb +1 -0
  43. data/lib/trevol_generado/models/email_resend.rb +256 -0
  44. data/lib/trevol_generado/models/email_resend_delivery.rb +183 -0
  45. data/lib/trevol_generado/models/email_resend_request.rb +163 -0
  46. data/lib/trevol_generado/models/email_resend_summary.rb +256 -0
  47. data/lib/trevol_generado/models/equivalent_document.rb +27 -5
  48. data/lib/trevol_generado/models/equivalent_document_adjustment.rb +26 -4
  49. data/lib/trevol_generado/models/equivalent_document_adjustment_input.rb +15 -4
  50. data/lib/trevol_generado/models/equivalent_document_input.rb +15 -4
  51. data/lib/trevol_generado/models/event.rb +12 -2
  52. data/lib/trevol_generado/models/invoice_batch.rb +11 -1
  53. data/lib/trevol_generado/models/invoice_batch_invoice_input.rb +24 -5
  54. data/lib/trevol_generado/models/invoice_input.rb +24 -4
  55. data/lib/trevol_generado/models/note_input.rb +15 -4
  56. data/lib/trevol_generado/models/numbering.rb +1 -1
  57. data/lib/trevol_generado/models/pdf_design.rb +297 -0
  58. data/lib/trevol_generado/models/pdf_design_applied.rb +193 -0
  59. data/lib/trevol_generado/models/pdf_design_input.rb +277 -0
  60. data/lib/trevol_generado/models/pdf_design_list.rb +191 -0
  61. data/lib/trevol_generado/models/pdf_design_update.rb +246 -0
  62. data/lib/trevol_generado/models/pdf_settings.rb +202 -0
  63. data/lib/trevol_generado/models/pdf_settings_update.rb +170 -0
  64. data/lib/trevol_generado/models/pdf_template.rb +210 -0
  65. data/lib/trevol_generado/models/pdf_template_list.rb +191 -0
  66. data/lib/trevol_generado/models/preview.rb +11 -1
  67. data/lib/trevol_generado/models/preview_numbering.rb +161 -0
  68. data/lib/trevol_generado/models/problem.rb +26 -4
  69. data/lib/trevol_generado/models/problem_finding.rb +172 -0
  70. data/lib/trevol_generado/models/support_document.rb +11 -1
  71. data/lib/trevol_generado/models/support_document_adjustment.rb +11 -1
  72. data/lib/trevol_generado/models/webhook_endpoint.rb +13 -3
  73. data/lib/trevol_generado/models/webhook_endpoint_input.rb +15 -5
  74. data/lib/trevol_generado/models/webhook_endpoint_update.rb +12 -2
  75. data/lib/trevol_generado/tablas.rb +30 -1
  76. data/lib/trevol_generado/version.rb +1 -1
  77. data/lib/trevol_generado.rb +28 -0
  78. metadata +29 -1
@@ -0,0 +1,277 @@
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 PdfDesignInput < ApiModelBase
18
+ attr_accessor :template
19
+
20
+ # Único entre los diseños activos. Por omisión, el de la plantilla.
21
+ attr_accessor :name
22
+
23
+ # El color de acento, #rrggbb, con contraste de 4,5:1 como mínimo sobre blanco.
24
+ attr_accessor :accent_color
25
+
26
+ attr_accessor :font
27
+
28
+ # `company`: el logo de la empresa (PUT /v1/company/logo). `null`: sin logo (van las iniciales de la empresa). Por omisión `company` si la empresa tiene logo y la plantilla lo lleva.
29
+ attr_accessor :logo
30
+
31
+ # Volverlo el predeterminado de su formato (el anterior deja de serlo).
32
+ attr_accessor :set_as_default
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'template' => :'template',
60
+ :'name' => :'name',
61
+ :'accent_color' => :'accent_color',
62
+ :'font' => :'font',
63
+ :'logo' => :'logo',
64
+ :'set_as_default' => :'set_as_default'
65
+ }
66
+ end
67
+
68
+ # Returns attribute mapping this model knows about
69
+ def self.acceptable_attribute_map
70
+ attribute_map
71
+ end
72
+
73
+ # Returns all the JSON keys this model knows about
74
+ def self.acceptable_attributes
75
+ acceptable_attribute_map.values
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.openapi_types
80
+ {
81
+ :'template' => :'String',
82
+ :'name' => :'String',
83
+ :'accent_color' => :'String',
84
+ :'font' => :'String',
85
+ :'logo' => :'String',
86
+ :'set_as_default' => :'Boolean'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ :'logo',
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::PdfDesignInput` 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::PdfDesignInput`. 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?(:'template')
124
+ self.template = attributes[:'template']
125
+ else
126
+ self.template = nil
127
+ end
128
+
129
+ if attributes.key?(:'name')
130
+ self.name = attributes[:'name']
131
+ end
132
+
133
+ if attributes.key?(:'accent_color')
134
+ self.accent_color = attributes[:'accent_color']
135
+ end
136
+
137
+ if attributes.key?(:'font')
138
+ self.font = attributes[:'font']
139
+ end
140
+
141
+ if attributes.key?(:'logo')
142
+ self.logo = attributes[:'logo']
143
+ end
144
+
145
+ if attributes.key?(:'set_as_default')
146
+ self.set_as_default = attributes[:'set_as_default']
147
+ else
148
+ self.set_as_default = false
149
+ end
150
+ end
151
+
152
+ # Show invalid properties with the reasons. Usually used together with valid?
153
+ # @return Array for valid properties with the reasons
154
+ def list_invalid_properties
155
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
156
+ invalid_properties = Array.new
157
+ if @template.nil?
158
+ invalid_properties.push('invalid value for "template", template cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ warn '[DEPRECATED] the `valid?` method is obsolete'
168
+ return false if @template.nil?
169
+ template_validator = EnumAttributeValidator.new('String', ["modern", "color_band", "compact", "pos_80mm", "pos_57mm", "unknown_default_open_api"])
170
+ return false unless template_validator.valid?(@template)
171
+ font_validator = EnumAttributeValidator.new('String', ["helvetica", "inter", "unknown_default_open_api"])
172
+ return false unless font_validator.valid?(@font)
173
+ logo_validator = EnumAttributeValidator.new('String', ["company", "unknown_default_open_api"])
174
+ return false unless logo_validator.valid?(@logo)
175
+ true
176
+ end
177
+
178
+ # Custom attribute writer method checking allowed values (enum).
179
+ # @param [Object] template Object to be assigned
180
+ def template=(template)
181
+ validator = EnumAttributeValidator.new('String', ["modern", "color_band", "compact", "pos_80mm", "pos_57mm", "unknown_default_open_api"])
182
+ unless validator.valid?(template)
183
+ fail ArgumentError, "invalid value for \"template\", must be one of #{validator.allowable_values}."
184
+ end
185
+ @template = template
186
+ end
187
+
188
+ # Custom attribute writer method checking allowed values (enum).
189
+ # @param [Object] font Object to be assigned
190
+ def font=(font)
191
+ validator = EnumAttributeValidator.new('String', ["helvetica", "inter", "unknown_default_open_api"])
192
+ unless validator.valid?(font)
193
+ fail ArgumentError, "invalid value for \"font\", must be one of #{validator.allowable_values}."
194
+ end
195
+ @font = font
196
+ end
197
+
198
+ # Custom attribute writer method checking allowed values (enum).
199
+ # @param [Object] logo Object to be assigned
200
+ def logo=(logo)
201
+ validator = EnumAttributeValidator.new('String', ["company", "unknown_default_open_api"])
202
+ unless validator.valid?(logo)
203
+ fail ArgumentError, "invalid value for \"logo\", must be one of #{validator.allowable_values}."
204
+ end
205
+ @logo = logo
206
+ end
207
+
208
+ # Checks equality by comparing each attribute.
209
+ # @param [Object] Object to be compared
210
+ def ==(o)
211
+ return true if self.equal?(o)
212
+ self.class == o.class &&
213
+ template == o.template &&
214
+ name == o.name &&
215
+ accent_color == o.accent_color &&
216
+ font == o.font &&
217
+ logo == o.logo &&
218
+ set_as_default == o.set_as_default
219
+ end
220
+
221
+ # @see the `==` method
222
+ # @param [Object] Object to be compared
223
+ def eql?(o)
224
+ self == o
225
+ end
226
+
227
+ # Calculates hash code according to all attributes.
228
+ # @return [Integer] Hash code
229
+ def hash
230
+ [template, name, accent_color, font, logo, set_as_default].hash
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def self.build_from_hash(attributes)
237
+ return nil unless attributes.is_a?(Hash)
238
+ attributes = attributes.transform_keys(&:to_sym)
239
+ # include attributes inherited from allOf parents (the nearest declaration wins)
240
+ map = acceptable_attribute_map
241
+ transformed_hash = {}
242
+ acceptable_openapi_types.each_pair do |key, type|
243
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
244
+ transformed_hash["#{key}"] = nil
245
+ elsif type =~ /\AArray<(.*)>/i
246
+ # check to ensure the input is an array given that the attribute
247
+ # is documented as an array but the input is not
248
+ if attributes[map[key]].is_a?(Array)
249
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
250
+ end
251
+ elsif !attributes[map[key]].nil?
252
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
253
+ end
254
+ end
255
+ new(transformed_hash)
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ # include attributes inherited from allOf parents (the nearest declaration wins)
263
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
264
+ value = self.send(attr)
265
+ if value.nil?
266
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
267
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
+ end
269
+
270
+ hash[param] = _to_hash(value)
271
+ end
272
+ hash
273
+ end
274
+
275
+ end
276
+
277
+ 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-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 PdfDesignList < 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<PdfDesign>',
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::PdfDesignList` 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::PdfDesignList`. 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
@@ -0,0 +1,246 @@
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 PdfDesignUpdate < ApiModelBase
18
+ attr_accessor :name
19
+
20
+ # El color de acento, #rrggbb, con contraste de 4,5:1 como mínimo sobre blanco.
21
+ attr_accessor :accent_color
22
+
23
+ attr_accessor :font
24
+
25
+ # `company`: el logo de la empresa (PUT /v1/company/logo). `null`: sin logo (van las iniciales de la empresa).
26
+ attr_accessor :logo
27
+
28
+ # La versión que tienes: si cambió, 409 `pdf_design_outdated`.
29
+ attr_accessor :expected_version
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'name' => :'name',
57
+ :'accent_color' => :'accent_color',
58
+ :'font' => :'font',
59
+ :'logo' => :'logo',
60
+ :'expected_version' => :'expected_version'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'name' => :'String',
78
+ :'accent_color' => :'String',
79
+ :'font' => :'String',
80
+ :'logo' => :'String',
81
+ :'expected_version' => :'Integer'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ :'logo',
89
+ ])
90
+ end
91
+
92
+ # Returns attribute type mapping
93
+ def self.acceptable_openapi_types
94
+ openapi_types
95
+ end
96
+
97
+ # Returns the nullable attributes
98
+ def self.acceptable_openapi_nullable
99
+ openapi_nullable
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrevolGenerado::PdfDesignUpdate` initialize method"
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ acceptable_attribute_map = self.class.acceptable_attribute_map
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!acceptable_attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrevolGenerado::PdfDesignUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'name')
119
+ self.name = attributes[:'name']
120
+ end
121
+
122
+ if attributes.key?(:'accent_color')
123
+ self.accent_color = attributes[:'accent_color']
124
+ end
125
+
126
+ if attributes.key?(:'font')
127
+ self.font = attributes[:'font']
128
+ end
129
+
130
+ if attributes.key?(:'logo')
131
+ self.logo = attributes[:'logo']
132
+ end
133
+
134
+ if attributes.key?(:'expected_version')
135
+ self.expected_version = attributes[:'expected_version']
136
+ end
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properties with the reasons
141
+ def list_invalid_properties
142
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
143
+ invalid_properties = Array.new
144
+ invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ warn '[DEPRECATED] the `valid?` method is obsolete'
151
+ font_validator = EnumAttributeValidator.new('String', ["helvetica", "inter", "unknown_default_open_api"])
152
+ return false unless font_validator.valid?(@font)
153
+ logo_validator = EnumAttributeValidator.new('String', ["company", "unknown_default_open_api"])
154
+ return false unless logo_validator.valid?(@logo)
155
+ true
156
+ end
157
+
158
+ # Custom attribute writer method checking allowed values (enum).
159
+ # @param [Object] font Object to be assigned
160
+ def font=(font)
161
+ validator = EnumAttributeValidator.new('String', ["helvetica", "inter", "unknown_default_open_api"])
162
+ unless validator.valid?(font)
163
+ fail ArgumentError, "invalid value for \"font\", must be one of #{validator.allowable_values}."
164
+ end
165
+ @font = font
166
+ end
167
+
168
+ # Custom attribute writer method checking allowed values (enum).
169
+ # @param [Object] logo Object to be assigned
170
+ def logo=(logo)
171
+ validator = EnumAttributeValidator.new('String', ["company", "unknown_default_open_api"])
172
+ unless validator.valid?(logo)
173
+ fail ArgumentError, "invalid value for \"logo\", must be one of #{validator.allowable_values}."
174
+ end
175
+ @logo = logo
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ name == o.name &&
184
+ accent_color == o.accent_color &&
185
+ font == o.font &&
186
+ logo == o.logo &&
187
+ expected_version == o.expected_version
188
+ end
189
+
190
+ # @see the `==` method
191
+ # @param [Object] Object to be compared
192
+ def eql?(o)
193
+ self == o
194
+ end
195
+
196
+ # Calculates hash code according to all attributes.
197
+ # @return [Integer] Hash code
198
+ def hash
199
+ [name, accent_color, font, logo, expected_version].hash
200
+ end
201
+
202
+ # Builds the object from hash
203
+ # @param [Hash] attributes Model attributes in the form of hash
204
+ # @return [Object] Returns the model itself
205
+ def self.build_from_hash(attributes)
206
+ return nil unless attributes.is_a?(Hash)
207
+ attributes = attributes.transform_keys(&:to_sym)
208
+ # include attributes inherited from allOf parents (the nearest declaration wins)
209
+ map = acceptable_attribute_map
210
+ transformed_hash = {}
211
+ acceptable_openapi_types.each_pair do |key, type|
212
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
213
+ transformed_hash["#{key}"] = nil
214
+ elsif type =~ /\AArray<(.*)>/i
215
+ # check to ensure the input is an array given that the attribute
216
+ # is documented as an array but the input is not
217
+ if attributes[map[key]].is_a?(Array)
218
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
219
+ end
220
+ elsif !attributes[map[key]].nil?
221
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
222
+ end
223
+ end
224
+ new(transformed_hash)
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ # include attributes inherited from allOf parents (the nearest declaration wins)
232
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
233
+ value = self.send(attr)
234
+ if value.nil?
235
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
236
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
237
+ end
238
+
239
+ hash[param] = _to_hash(value)
240
+ end
241
+ hash
242
+ end
243
+
244
+ end
245
+
246
+ end