Class: NewStoreApi::StoreConfigUpdateItV1Dto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::StoreConfigUpdateItV1Dto
- Defined in:
- lib/new_store_api/models/store_config_update_it_v1_dto.rb
Overview
StoreConfigUpdateItV1Dto Model.
Instance Attribute Summary collapse
-
#auto_report_types ⇒ Array[PeriodTypeEnum]
List of periodic report types that should be closed automatically before the first transaction in the next period.
-
#exemption_classes ⇒ Array[ExemptionClassMappingItV1Dto]
List of tax exemption classes and corresponding tax exemption codes.
-
#report_types ⇒ Array[PeriodTypeEnum]
List of supported periodic report types.
-
#timezone ⇒ TimezoneEnum
List of supported periodic report types.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(auto_report_types = SKIP, exemption_classes = SKIP, report_types = SKIP, timezone = SKIP) ⇒ StoreConfigUpdateItV1Dto
constructor
A new instance of StoreConfigUpdateItV1Dto.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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, exemption_classes = SKIP, report_types = SKIP, timezone = SKIP) ⇒ StoreConfigUpdateItV1Dto
Returns a new instance of StoreConfigUpdateItV1Dto.
58 59 60 61 62 63 64 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 58 def initialize(auto_report_types = SKIP, exemption_classes = SKIP, report_types = SKIP, timezone = SKIP) @auto_report_types = auto_report_types unless auto_report_types == SKIP @exemption_classes = exemption_classes unless exemption_classes == SKIP @report_types = report_types unless report_types == SKIP @timezone = timezone unless timezone == SKIP end |
Instance Attribute Details
#auto_report_types ⇒ Array[PeriodTypeEnum]
List of periodic report types that should be closed automatically before the first transaction in the next period.
15 16 17 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 15 def auto_report_types @auto_report_types end |
#exemption_classes ⇒ Array[ExemptionClassMappingItV1Dto]
List of tax exemption classes and corresponding tax exemption codes.
- For the configured tax exemption classes, the corresponding tax exemption code will be used while fiscalizing the transaction.
- For tax exemption classes that are not configured, the default tax
exemption code of
N3will be used while fiscalizing the transaction.
23 24 25 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 23 def exemption_classes @exemption_classes end |
#report_types ⇒ Array[PeriodTypeEnum]
List of supported periodic report types.
27 28 29 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 27 def report_types @report_types end |
#timezone ⇒ TimezoneEnum
List of supported periodic report types.
31 32 33 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 31 def timezone @timezone end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 67 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 # Parameter is an array, so we need to iterate through it exemption_classes = nil unless hash['exemption_classes'].nil? exemption_classes = [] hash['exemption_classes'].each do |structure| exemption_classes << (ExemptionClassMappingItV1Dto.from_hash(structure) if structure) end end exemption_classes = SKIP unless hash.key?('exemption_classes') report_types = hash.key?('report_types') ? hash['report_types'] : SKIP timezone = hash.key?('timezone') ? hash['timezone'] : SKIP # Create object from extracted values. StoreConfigUpdateItV1Dto.new(auto_report_types, exemption_classes, report_types, timezone) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['auto_report_types'] = 'auto_report_types' @_hash['exemption_classes'] = 'exemption_classes' @_hash['report_types'] = 'report_types' @_hash['timezone'] = 'timezone' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 44 def self.optionals %w[ auto_report_types exemption_classes report_types timezone ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
95 96 97 98 99 100 101 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 95 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
111 112 113 114 115 116 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 111 def inspect class_name = self.class.name.split('::').last "<#{class_name} auto_report_types: #{@auto_report_types.inspect}, exemption_classes:"\ " #{@exemption_classes.inspect}, report_types: #{@report_types.inspect}, timezone:"\ " #{@timezone.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
104 105 106 107 108 |
# File 'lib/new_store_api/models/store_config_update_it_v1_dto.rb', line 104 def to_s class_name = self.class.name.split('::').last "<#{class_name} auto_report_types: #{@auto_report_types}, exemption_classes:"\ " #{@exemption_classes}, report_types: #{@report_types}, timezone: #{@timezone}>" end |