Class: NewStoreApi::TenantConfigUpdateDto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::TenantConfigUpdateDto
- Defined in:
- lib/new_store_api/models/tenant_config_update_dto.rb
Overview
TenantConfigUpdateDto Model.
Instance Attribute Summary collapse
-
#avalara ⇒ AvalaraConfigUpdateDto
Avalara configuration.
-
#custom ⇒ CustomConfigUpdateDto
Custom provider configuration.
-
#fixed_rate ⇒ FixedRateConfigUpdateDto
Fixed rate configuration.
-
#fixed_rate_per_country ⇒ Hash[String, FixedRateConfigCreateDto]
Fixed rate configuration per country.
-
#tax_calculation_strategy ⇒ TaxCalculationStrategyEnum
Fixed rate configuration per country.
-
#tax_committing_enabled ⇒ TrueClass | FalseClass
Enable tax committing to the selected tax calculation strategy.
-
#vertex ⇒ VertexConfigUpdateDto
Vertex configuration.
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.
Instance Method Summary collapse
-
#initialize(avalara = SKIP, custom = SKIP, fixed_rate = SKIP, fixed_rate_per_country = SKIP, tax_calculation_strategy = SKIP, tax_committing_enabled = SKIP, vertex = SKIP) ⇒ TenantConfigUpdateDto
constructor
A new instance of TenantConfigUpdateDto.
-
#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(avalara = SKIP, custom = SKIP, fixed_rate = SKIP, fixed_rate_per_country = SKIP, tax_calculation_strategy = SKIP, tax_committing_enabled = SKIP, vertex = SKIP) ⇒ TenantConfigUpdateDto
Returns a new instance of TenantConfigUpdateDto.
112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 112 def initialize(avalara = SKIP, custom = SKIP, fixed_rate = SKIP, fixed_rate_per_country = SKIP, tax_calculation_strategy = SKIP, tax_committing_enabled = SKIP, vertex = SKIP) @avalara = avalara unless avalara == SKIP @custom = custom unless custom == SKIP @fixed_rate = fixed_rate unless fixed_rate == SKIP @fixed_rate_per_country = fixed_rate_per_country unless fixed_rate_per_country == SKIP @tax_calculation_strategy = tax_calculation_strategy unless tax_calculation_strategy == SKIP @tax_committing_enabled = tax_committing_enabled unless tax_committing_enabled == SKIP @vertex = vertex unless vertex == SKIP end |
Instance Attribute Details
#avalara ⇒ AvalaraConfigUpdateDto
Avalara configuration.
- Required if the
tax_calculation_strategyis set toavalara. - If the tax calculation strategy is set to
avalara, the given configuration will be used. - If the Avalara configuration is defined, the configuration will be validated through a ping request to Avalara, which will validate the authenticity of Avalara credentials.
20 21 22 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 20 def avalara @avalara end |
#custom ⇒ CustomConfigUpdateDto
Custom provider configuration.
- Required if the
tax_calculation_strategyis set tocustom. - If the tax calculation strategy is set to
custom, the given configuration will be used.
27 28 29 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 27 def custom @custom end |
#fixed_rate ⇒ FixedRateConfigUpdateDto
Fixed rate configuration.
- If the tax calculation strategy is set to
fixedrate, the specified tax rate will be used. - For the other tax calculation strategies, the specified rate will be used as a fallback if the tax calculation fails (e.g. if the tax provider is not reachable).
- The specified rate will be used as a fallback by the Associate App in offline-mode.
38 39 40 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 38 def fixed_rate @fixed_rate end |
#fixed_rate_per_country ⇒ Hash[String, FixedRateConfigCreateDto]
Fixed rate configuration per country.
- Uses ISO 3166 Alpha-2 format as the key in upper-case.
- Fixed rate specification can be defined under each country key for the desired countries.
- If the tax calculation strategy is set to
fixed_rate_per_country:- Fixed rate configuration must be configured.
- The specified tax rate will be used if the country code of the store has a fixed rate configuration.
- The tax calculation will fail if the country code of the store does not have a fixed rate configuration.
51 52 53 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 51 def fixed_rate_per_country @fixed_rate_per_country end |
#tax_calculation_strategy ⇒ TaxCalculationStrategyEnum
Fixed rate configuration per country.
- Uses ISO 3166 Alpha-2 format as the key in upper-case.
- Fixed rate specification can be defined under each country key for the desired countries.
- If the tax calculation strategy is set to
fixed_rate_per_country:- Fixed rate configuration must be configured.
- The specified tax rate will be used if the country code of the store has a fixed rate configuration.
- The tax calculation will fail if the country code of the store does not have a fixed rate configuration.
64 65 66 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 64 def tax_calculation_strategy @tax_calculation_strategy end |
#tax_committing_enabled ⇒ TrueClass | FalseClass
Enable tax committing to the selected tax calculation strategy. The tax committing feature is only supported for in-store orders.
69 70 71 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 69 def tax_committing_enabled @tax_committing_enabled end |
#vertex ⇒ VertexConfigUpdateDto
Vertex configuration.
- Required if the
tax_calculation_strategyis set tovertex. - If the tax calculation strategy is set to
vertex, the given configuration will be used. - If the Vertex configuration is defined, the configuration will be validated through a ping request to Vertex, which will validate the authenticity of Vertex credentials.
79 80 81 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 79 def vertex @vertex end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 126 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. avalara = AvalaraConfigUpdateDto.from_hash(hash['avalara']) if hash['avalara'] custom = CustomConfigUpdateDto.from_hash(hash['custom']) if hash['custom'] fixed_rate = FixedRateConfigUpdateDto.from_hash(hash['fixed_rate']) if hash['fixed_rate'] fixed_rate_per_country = FixedRateConfigCreateDto.from_hash(hash['fixed_rate_per_country']) if hash['fixed_rate_per_country'] fixed_rate_per_country = SKIP unless hash.key?('fixed_rate_per_country') tax_calculation_strategy = hash.key?('tax_calculation_strategy') ? hash['tax_calculation_strategy'] : SKIP tax_committing_enabled = hash.key?('tax_committing_enabled') ? hash['tax_committing_enabled'] : SKIP vertex = VertexConfigUpdateDto.from_hash(hash['vertex']) if hash['vertex'] # Create object from extracted values. TenantConfigUpdateDto.new(avalara, custom, fixed_rate, fixed_rate_per_country, tax_calculation_strategy, tax_committing_enabled, vertex) end |
.names ⇒ Object
A mapping from model property names to API property names.
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 82 def self.names @_hash = {} if @_hash.nil? @_hash['avalara'] = 'avalara' @_hash['custom'] = 'custom' @_hash['fixed_rate'] = 'fixed_rate' @_hash['fixed_rate_per_country'] = 'fixed_rate_per_country' @_hash['tax_calculation_strategy'] = 'tax_calculation_strategy' @_hash['tax_committing_enabled'] = 'tax_committing_enabled' @_hash['vertex'] = 'vertex' @_hash end |
.nullables ⇒ Object
An array for nullable fields
108 109 110 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 108 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 95 def self.optionals %w[ avalara custom fixed_rate fixed_rate_per_country tax_calculation_strategy tax_committing_enabled vertex ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
163 164 165 166 167 168 169 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 163 def inspect class_name = self.class.name.split('::').last "<#{class_name} avalara: #{@avalara.inspect}, custom: #{@custom.inspect}, fixed_rate:"\ " #{@fixed_rate.inspect}, fixed_rate_per_country: #{@fixed_rate_per_country.inspect},"\ " tax_calculation_strategy: #{@tax_calculation_strategy.inspect}, tax_committing_enabled:"\ " #{@tax_committing_enabled.inspect}, vertex: #{@vertex.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
154 155 156 157 158 159 160 |
# File 'lib/new_store_api/models/tenant_config_update_dto.rb', line 154 def to_s class_name = self.class.name.split('::').last "<#{class_name} avalara: #{@avalara}, custom: #{@custom}, fixed_rate: #{@fixed_rate},"\ " fixed_rate_per_country: #{@fixed_rate_per_country}, tax_calculation_strategy:"\ " #{@tax_calculation_strategy}, tax_committing_enabled: #{@tax_committing_enabled}, vertex:"\ " #{@vertex}>" end |