Class: NewStoreApi::AvalaraConfigUpdateDto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::AvalaraConfigUpdateDto
- Defined in:
- lib/new_store_api/models/avalara_config_update_dto.rb
Overview
AvalaraConfigUpdateDto Model.
Instance Attribute Summary collapse
-
#account_number ⇒ String
AvaTax account number or account ID.
-
#company_code ⇒ String
Company code that identifies the company in the AvaTax account.
-
#default_customer_code ⇒ String
Default customer code.
-
#environment ⇒ AvalaraEnvEnum
Default customer code.
-
#exemption_classes ⇒ Array[AvalaraExemptionClassItemUpdateDto]
A list of mappings between
ExemptionClassenum and Avalara custom entity use codes. -
#license_key ⇒ String
AvaTax license key.
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(account_number = SKIP, company_code = SKIP, default_customer_code = SKIP, environment = SKIP, exemption_classes = SKIP, license_key = SKIP) ⇒ AvalaraConfigUpdateDto
constructor
A new instance of AvalaraConfigUpdateDto.
-
#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(account_number = SKIP, company_code = SKIP, default_customer_code = SKIP, environment = SKIP, exemption_classes = SKIP, license_key = SKIP) ⇒ AvalaraConfigUpdateDto
Returns a new instance of AvalaraConfigUpdateDto.
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 70 def initialize(account_number = SKIP, company_code = SKIP, default_customer_code = SKIP, environment = SKIP, exemption_classes = SKIP, license_key = SKIP) @account_number = account_number unless account_number == SKIP @company_code = company_code unless company_code == SKIP @default_customer_code = default_customer_code unless default_customer_code == SKIP @environment = environment unless environment == SKIP @exemption_classes = exemption_classes unless exemption_classes == SKIP @license_key = license_key unless license_key == SKIP end |
Instance Attribute Details
#account_number ⇒ String
AvaTax account number or account ID.
14 15 16 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 14 def account_number @account_number end |
#company_code ⇒ String
Company code that identifies the company in the AvaTax account.
- Value is case-sensitive.
- Declared during the company setup in the AvaTax Admin Console.
20 21 22 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 20 def company_code @company_code end |
#default_customer_code ⇒ String
Default customer code. Will be used in case when no ConsumerUUID is provided.
25 26 27 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 25 def default_customer_code @default_customer_code end |
#environment ⇒ AvalaraEnvEnum
Default customer code. Will be used in case when no ConsumerUUID is provided.
30 31 32 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 30 def environment @environment end |
#exemption_classes ⇒ Array[AvalaraExemptionClassItemUpdateDto]
A list of mappings between ExemptionClass enum and Avalara custom entity
use codes.
35 36 37 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 35 def exemption_classes @exemption_classes end |
#license_key ⇒ String
AvaTax license key.
39 40 41 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 39 def license_key @license_key end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_number = hash.key?('account_number') ? hash['account_number'] : SKIP company_code = hash.key?('company_code') ? hash['company_code'] : SKIP default_customer_code = hash.key?('default_customer_code') ? hash['default_customer_code'] : SKIP environment = hash.key?('environment') ? hash['environment'] : 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 << (AvalaraExemptionClassItemUpdateDto.from_hash(structure) if structure) end end exemption_classes = SKIP unless hash.key?('exemption_classes') license_key = hash.key?('license_key') ? hash['license_key'] : SKIP # Create object from extracted values. AvalaraConfigUpdateDto.new(account_number, company_code, default_customer_code, environment, exemption_classes, license_key) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['account_number'] = 'account_number' @_hash['company_code'] = 'company_code' @_hash['default_customer_code'] = 'default_customer_code' @_hash['environment'] = 'environment' @_hash['exemption_classes'] = 'exemption_classes' @_hash['license_key'] = 'license_key' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 66 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 54 def self.optionals %w[ account_number company_code default_customer_code environment exemption_classes license_key ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 128 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number.inspect}, company_code:"\ " #{@company_code.inspect}, default_customer_code: #{@default_customer_code.inspect},"\ " environment: #{@environment.inspect}, exemption_classes: #{@exemption_classes.inspect},"\ " license_key: #{@license_key.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 119 |
# File 'lib/new_store_api/models/avalara_config_update_dto.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number}, company_code: #{@company_code},"\ " default_customer_code: #{@default_customer_code}, environment: #{@environment},"\ " exemption_classes: #{@exemption_classes}, license_key: #{@license_key}>" end |