Class: NewStoreApi::AvalaraConfigCreateDto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::AvalaraConfigCreateDto
- Defined in:
- lib/new_store_api/models/avalara_config_create_dto.rb
Overview
AvalaraConfigCreateDto 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[AvalaraExemptionClassItemCreateDto]
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 = nil, company_code = nil, environment = nil, license_key = nil, default_customer_code = SKIP, exemption_classes = SKIP) ⇒ AvalaraConfigCreateDto
constructor
A new instance of AvalaraConfigCreateDto.
-
#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 = nil, company_code = nil, environment = nil, license_key = nil, default_customer_code = SKIP, exemption_classes = SKIP) ⇒ AvalaraConfigCreateDto
Returns a new instance of AvalaraConfigCreateDto.
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/new_store_api/models/avalara_config_create_dto.rb', line 66 def initialize(account_number = nil, company_code = nil, environment = nil, license_key = nil, default_customer_code = SKIP, exemption_classes = SKIP) @account_number = account_number @company_code = company_code @default_customer_code = default_customer_code unless default_customer_code == SKIP @environment = environment @exemption_classes = exemption_classes unless exemption_classes == SKIP @license_key = license_key end |
Instance Attribute Details
#account_number ⇒ String
AvaTax account number or account ID.
14 15 16 |
# File 'lib/new_store_api/models/avalara_config_create_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_create_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_create_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_create_dto.rb', line 30 def environment @environment end |
#exemption_classes ⇒ Array[AvalaraExemptionClassItemCreateDto]
A list of mappings between ExemptionClass enum and Avalara custom entity
use codes.
35 36 37 |
# File 'lib/new_store_api/models/avalara_config_create_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_create_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.
78 79 80 81 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 |
# File 'lib/new_store_api/models/avalara_config_create_dto.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_number = hash.key?('account_number') ? hash['account_number'] : nil company_code = hash.key?('company_code') ? hash['company_code'] : nil environment = hash.key?('environment') ? hash['environment'] : nil license_key = hash.key?('license_key') ? hash['license_key'] : nil default_customer_code = hash.key?('default_customer_code') ? hash['default_customer_code'] : 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 << (AvalaraExemptionClassItemCreateDto.from_hash(structure) if structure) end end exemption_classes = SKIP unless hash.key?('exemption_classes') # Create object from extracted values. AvalaraConfigCreateDto.new(account_number, company_code, environment, license_key, default_customer_code, exemption_classes) 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_create_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
62 63 64 |
# File 'lib/new_store_api/models/avalara_config_create_dto.rb', line 62 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 |
# File 'lib/new_store_api/models/avalara_config_create_dto.rb', line 54 def self.optionals %w[ default_customer_code exemption_classes ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
118 119 120 121 122 123 124 |
# File 'lib/new_store_api/models/avalara_config_create_dto.rb', line 118 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.
110 111 112 113 114 115 |
# File 'lib/new_store_api/models/avalara_config_create_dto.rb', line 110 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 |