Class: NewStoreApi::StoreConfigUpdatePlV1Dto

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/store_config_update_pl_v1_dto.rb

Overview

StoreConfigUpdatePlV1Dto Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(auto_report_types = SKIP, footer_image_url = SKIP, report_types = SKIP, timezone = SKIP) ⇒ StoreConfigUpdatePlV1Dto

Returns a new instance of StoreConfigUpdatePlV1Dto.



59
60
61
62
63
64
65
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 59

def initialize(auto_report_types = SKIP, footer_image_url = SKIP,
               report_types = SKIP, timezone = SKIP)
  @auto_report_types = auto_report_types unless auto_report_types == SKIP
  @footer_image_url = footer_image_url unless footer_image_url == SKIP
  @report_types = report_types unless report_types == SKIP
  @timezone = timezone unless timezone == SKIP
end

Instance Attribute Details

#auto_report_typesArray[PeriodTypeEnum]

List of periodic report types that should be closed automatically before the first transaction in the next period.

Returns:



15
16
17
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 15

def auto_report_types
  @auto_report_types
end

The footer image URL to be configured on the fiscal printers.

  • Footer image must be a monochrome bitmap with top-down DIB, and without compression.
  • Footer image will be configured on the fiscal printers during the fiscal activation of a fiscal printer.
  • Fiscal printer will print the footer image on all supported documents.

Returns:

  • (String)


24
25
26
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 24

def footer_image_url
  @footer_image_url
end

#report_typesArray[PeriodTypeEnum]

List of supported periodic report types.

Returns:



28
29
30
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 28

def report_types
  @report_types
end

#timezoneTimezoneEnum

List of supported periodic report types.

Returns:



32
33
34
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 32

def timezone
  @timezone
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 68

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  auto_report_types =
    hash.key?('auto_report_types') ? hash['auto_report_types'] : SKIP
  footer_image_url =
    hash.key?('footer_image_url') ? hash['footer_image_url'] : SKIP
  report_types = hash.key?('report_types') ? hash['report_types'] : SKIP
  timezone = hash.key?('timezone') ? hash['timezone'] : SKIP

  # Create object from extracted values.
  StoreConfigUpdatePlV1Dto.new(auto_report_types,
                               footer_image_url,
                               report_types,
                               timezone)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
42
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['auto_report_types'] = 'auto_report_types'
  @_hash['footer_image_url'] = 'footer_image_url'
  @_hash['report_types'] = 'report_types'
  @_hash['timezone'] = 'timezone'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
52
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 45

def self.optionals
  %w[
    auto_report_types
    footer_image_url
    report_types
    timezone
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



88
89
90
91
92
93
94
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 88

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



104
105
106
107
108
109
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 104

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} auto_report_types: #{@auto_report_types.inspect}, footer_image_url:"\
  " #{@footer_image_url.inspect}, report_types: #{@report_types.inspect}, timezone:"\
  " #{@timezone.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



97
98
99
100
101
# File 'lib/new_store_api/models/store_config_update_pl_v1_dto.rb', line 97

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} auto_report_types: #{@auto_report_types}, footer_image_url:"\
  " #{@footer_image_url}, report_types: #{@report_types}, timezone: #{@timezone}>"
end