Class: NewStoreApi::StoreConfigUpdateV1Dto

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

Overview

StoreConfigUpdateV1Dto 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, report_types = SKIP, timezone = SKIP) ⇒ StoreConfigUpdateV1Dto

Returns a new instance of StoreConfigUpdateV1Dto.



48
49
50
51
52
53
# File 'lib/new_store_api/models/store_config_update_v1_dto.rb', line 48

def initialize(auto_report_types = SKIP, report_types = SKIP,
               timezone = SKIP)
  @auto_report_types = auto_report_types unless auto_report_types == 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_v1_dto.rb', line 15

def auto_report_types
  @auto_report_types
end

#report_typesArray[PeriodTypeEnum]

List of supported periodic report types.

Returns:



19
20
21
# File 'lib/new_store_api/models/store_config_update_v1_dto.rb', line 19

def report_types
  @report_types
end

#timezoneTimezoneEnum

List of supported periodic report types.

Returns:



23
24
25
# File 'lib/new_store_api/models/store_config_update_v1_dto.rb', line 23

def timezone
  @timezone
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/new_store_api/models/store_config_update_v1_dto.rb', line 56

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
  report_types = hash.key?('report_types') ? hash['report_types'] : SKIP
  timezone = hash.key?('timezone') ? hash['timezone'] : SKIP

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

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/new_store_api/models/store_config_update_v1_dto.rb', line 26

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

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/new_store_api/models/store_config_update_v1_dto.rb', line 44

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



73
74
75
76
77
78
79
# File 'lib/new_store_api/models/store_config_update_v1_dto.rb', line 73

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.



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

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

#to_sObject

Provides a human-readable string representation of the object.



82
83
84
85
86
# File 'lib/new_store_api/models/store_config_update_v1_dto.rb', line 82

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