Class: KoronaCloudClient::ReceiptLayoutConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/korona-cloud-client/models/receipt_layout_configuration.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ReceiptLayoutConfiguration

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 162

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `KoronaCloudClient::ReceiptLayoutConfiguration` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `KoronaCloudClient::ReceiptLayoutConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'active')
    self.active = attributes[:'active']
  end

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'revision')
    self.revision = attributes[:'revision']
  end

  if attributes.key?(:'number')
    self.number = attributes[:'number']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'show_product_numbers')
    self.show_product_numbers = attributes[:'show_product_numbers']
  end

  if attributes.key?(:'show_receipt_number_barcode')
    self.show_receipt_number_barcode = attributes[:'show_receipt_number_barcode']
  end

  if attributes.key?(:'footer_logo')
    self. = attributes[:'footer_logo']
  end

  if attributes.key?(:'footer_logo_number')
    self.footer_logo_number = attributes[:'footer_logo_number']
  end

  if attributes.key?(:'header_logo')
    self. = attributes[:'header_logo']
  end

  if attributes.key?(:'header_logo_number')
    self.header_logo_number = attributes[:'header_logo_number']
  end

  if attributes.key?(:'show_recommended_retail_price_threshold')
    self.show_recommended_retail_price_threshold = attributes[:'show_recommended_retail_price_threshold']
  end

  if attributes.key?(:'item_grouping')
    self.item_grouping = attributes[:'item_grouping']
  end

  if attributes.key?(:'show_reduced_receipt_information')
    self.show_reduced_receipt_information = attributes[:'show_reduced_receipt_information']
  end

  if attributes.key?(:'show_reduced_customer_information')
    self.show_reduced_customer_information = attributes[:'show_reduced_customer_information']
  end

  if attributes.key?(:'show_removed_items')
    self.show_removed_items = attributes[:'show_removed_items']
  end

  if attributes.key?(:'show_total_discount')
    self.show_total_discount = attributes[:'show_total_discount']
  end

  if attributes.key?(:'show_prices_on_delivery_notes')
    self.show_prices_on_delivery_notes = attributes[:'show_prices_on_delivery_notes']
  end

  if attributes.key?(:'show_tax_name')
    self.show_tax_name = attributes[:'show_tax_name']
  end

  if attributes.key?(:'deposit_summary')
    self.deposit_summary = attributes[:'deposit_summary']
  end

  if attributes.key?(:'show_article_count')
    self.show_article_count = attributes[:'show_article_count']
  end

  if attributes.key?(:'fiscal_data_format')
    self.fiscal_data_format = attributes[:'fiscal_data_format']
  end

  if attributes.key?(:'show_optional_fiscal_data')
    self.show_optional_fiscal_data = attributes[:'show_optional_fiscal_data']
  end
end

Instance Attribute Details

#activeObject

indicates whether the object is active for use or not



19
20
21
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 19

def active
  @active
end

#deposit_summaryObject

Returns the value of attribute deposit_summary.



60
61
62
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 60

def deposit_summary
  @deposit_summary
end

#fiscal_data_formatObject

Returns the value of attribute fiscal_data_format.



64
65
66
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 64

def fiscal_data_format
  @fiscal_data_format
end

Returns the value of attribute footer_logo.



36
37
38
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 36

def 
  @footer_logo
end

Returns the value of attribute footer_logo_number.



38
39
40
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 38

def footer_logo_number
  @footer_logo_number
end

#header_logoObject

Returns the value of attribute header_logo.



40
41
42
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 40

def 
  @header_logo
end

#header_logo_numberObject

Returns the value of attribute header_logo_number.



42
43
44
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 42

def header_logo_number
  @header_logo_number
end

#idObject

global object uuid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)



22
23
24
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 22

def id
  @id
end

#item_groupingObject

Returns the value of attribute item_grouping.



46
47
48
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 46

def item_grouping
  @item_grouping
end

#nameObject

Returns the value of attribute name.



30
31
32
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 30

def name
  @name
end

#numberObject

number of the object, like it is set in backoffice; will be removed when active=false



28
29
30
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 28

def number
  @number
end

#revisionObject

the revision number of the object. revision numbers are unique per object-type. there is is no object of the same type with identical revision numbers.



25
26
27
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 25

def revision
  @revision
end

#show_article_countObject

Returns the value of attribute show_article_count.



62
63
64
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 62

def show_article_count
  @show_article_count
end

#show_optional_fiscal_dataObject

use new property fiscalDataFormat, value corresponds to the following mapping false equals TEXT & true equals TEXT_AND_QR_CODE



67
68
69
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 67

def show_optional_fiscal_data
  @show_optional_fiscal_data
end

#show_prices_on_delivery_notesObject

Returns the value of attribute show_prices_on_delivery_notes.



56
57
58
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 56

def show_prices_on_delivery_notes
  @show_prices_on_delivery_notes
end

#show_product_numbersObject

Returns the value of attribute show_product_numbers.



32
33
34
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 32

def show_product_numbers
  @show_product_numbers
end

#show_receipt_number_barcodeObject

Returns the value of attribute show_receipt_number_barcode.



34
35
36
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 34

def show_receipt_number_barcode
  @show_receipt_number_barcode
end

Returns the value of attribute show_recommended_retail_price_threshold.



44
45
46
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 44

def show_recommended_retail_price_threshold
  @show_recommended_retail_price_threshold
end

#show_reduced_customer_informationObject

Returns the value of attribute show_reduced_customer_information.



50
51
52
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 50

def show_reduced_customer_information
  @show_reduced_customer_information
end

#show_reduced_receipt_informationObject

Returns the value of attribute show_reduced_receipt_information.



48
49
50
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 48

def show_reduced_receipt_information
  @show_reduced_receipt_information
end

#show_removed_itemsObject

Returns the value of attribute show_removed_items.



52
53
54
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 52

def show_removed_items
  @show_removed_items
end

#show_tax_nameObject

Returns the value of attribute show_tax_name.



58
59
60
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 58

def show_tax_name
  @show_tax_name
end

#show_total_discountObject

Returns the value of attribute show_total_discount.



54
55
56
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 54

def show_total_discount
  @show_total_discount
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 376

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = KoronaCloudClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



121
122
123
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 121

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 92

def self.attribute_map
  {
    :'active' => :'active',
    :'id' => :'id',
    :'revision' => :'revision',
    :'number' => :'number',
    :'name' => :'name',
    :'show_product_numbers' => :'showProductNumbers',
    :'show_receipt_number_barcode' => :'showReceiptNumberBarcode',
    :'footer_logo' => :'footerLogo',
    :'footer_logo_number' => :'footerLogoNumber',
    :'header_logo' => :'headerLogo',
    :'header_logo_number' => :'headerLogoNumber',
    :'show_recommended_retail_price_threshold' => :'showRecommendedRetailPriceThreshold',
    :'item_grouping' => :'itemGrouping',
    :'show_reduced_receipt_information' => :'showReducedReceiptInformation',
    :'show_reduced_customer_information' => :'showReducedCustomerInformation',
    :'show_removed_items' => :'showRemovedItems',
    :'show_total_discount' => :'showTotalDiscount',
    :'show_prices_on_delivery_notes' => :'showPricesOnDeliveryNotes',
    :'show_tax_name' => :'showTaxName',
    :'deposit_summary' => :'depositSummary',
    :'show_article_count' => :'showArticleCount',
    :'fiscal_data_format' => :'fiscalDataFormat',
    :'show_optional_fiscal_data' => :'showOptionalFiscalData'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 352

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



155
156
157
158
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 155

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 126

def self.openapi_types
  {
    :'active' => :'Boolean',
    :'id' => :'String',
    :'revision' => :'Integer',
    :'number' => :'String',
    :'name' => :'String',
    :'show_product_numbers' => :'Boolean',
    :'show_receipt_number_barcode' => :'Boolean',
    :'footer_logo' => :'ModelReference',
    :'footer_logo_number' => :'Integer',
    :'header_logo' => :'ModelReference',
    :'header_logo_number' => :'Integer',
    :'show_recommended_retail_price_threshold' => :'Integer',
    :'item_grouping' => :'String',
    :'show_reduced_receipt_information' => :'Boolean',
    :'show_reduced_customer_information' => :'Boolean',
    :'show_removed_items' => :'Boolean',
    :'show_total_discount' => :'Boolean',
    :'show_prices_on_delivery_notes' => :'Boolean',
    :'show_tax_name' => :'Boolean',
    :'deposit_summary' => :'Boolean',
    :'show_article_count' => :'Boolean',
    :'fiscal_data_format' => :'String',
    :'show_optional_fiscal_data' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 309

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      active == o.active &&
      id == o.id &&
      revision == o.revision &&
      number == o.number &&
      name == o.name &&
      show_product_numbers == o.show_product_numbers &&
      show_receipt_number_barcode == o.show_receipt_number_barcode &&
       == o. &&
      footer_logo_number == o.footer_logo_number &&
       == o. &&
      header_logo_number == o.header_logo_number &&
      show_recommended_retail_price_threshold == o.show_recommended_retail_price_threshold &&
      item_grouping == o.item_grouping &&
      show_reduced_receipt_information == o.show_reduced_receipt_information &&
      show_reduced_customer_information == o.show_reduced_customer_information &&
      show_removed_items == o.show_removed_items &&
      show_total_discount == o.show_total_discount &&
      show_prices_on_delivery_notes == o.show_prices_on_delivery_notes &&
      show_tax_name == o.show_tax_name &&
      deposit_summary == o.deposit_summary &&
      show_article_count == o.show_article_count &&
      fiscal_data_format == o.fiscal_data_format &&
      show_optional_fiscal_data == o.show_optional_fiscal_data
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 447

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


339
340
341
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 339

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



345
346
347
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 345

def hash
  [active, id, revision, number, name, show_product_numbers, show_receipt_number_barcode, , footer_logo_number, , header_logo_number, show_recommended_retail_price_threshold, item_grouping, show_reduced_receipt_information, show_reduced_customer_information, show_removed_items, show_total_discount, show_prices_on_delivery_notes, show_tax_name, deposit_summary, show_article_count, fiscal_data_format, show_optional_fiscal_data].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



270
271
272
273
274
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 270

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



423
424
425
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 423

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 429

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



417
418
419
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 417

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



278
279
280
281
282
283
284
285
# File 'lib/korona-cloud-client/models/receipt_layout_configuration.rb', line 278

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  item_grouping_validator = EnumAttributeValidator.new('String', ["ASSORTMENT", "COMMODITY_GROUP", "NONE"])
  return false unless item_grouping_validator.valid?(@item_grouping)
  fiscal_data_format_validator = EnumAttributeValidator.new('String', ["TEXT", "QR_CODE", "TEXT_AND_QR_CODE"])
  return false unless fiscal_data_format_validator.valid?(@fiscal_data_format)
  true
end