Class: NewStoreApi::CustomV0AvalaraConfigCreateDto

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

Overview

CustomV0AvalaraConfigCreateDto 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(account_number = nil, company_code = nil, license_key = nil, url = nil) ⇒ CustomV0AvalaraConfigCreateDto

Returns a new instance of CustomV0AvalaraConfigCreateDto.



51
52
53
54
55
56
57
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 51

def initialize( = nil, company_code = nil, license_key = nil,
               url = nil)
  @account_number = 
  @company_code = company_code
  @license_key = license_key
  @url = url
end

Instance Attribute Details

#account_numberString

AvaTax account number or account ID.

Returns:

  • (String)


14
15
16
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 14

def 
  @account_number
end

#company_codeString

Company code that identifies the company in the AvaTax account.

  • Value is case-sensitive.
  • Declared during the company setup in the AvaTax Admin Console.

Returns:

  • (String)


20
21
22
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 20

def company_code
  @company_code
end

#license_keyString

AvaTax license key.

Returns:

  • (String)


24
25
26
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 24

def license_key
  @license_key
end

#urlString

Custom provider RESTful API URL that uses AvaTax v1 schema. Will be used for tax calculations.

Returns:

  • (String)


29
30
31
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 29

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 60

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   =
    hash.key?('account_number') ? hash['account_number'] : nil
  company_code = hash.key?('company_code') ? hash['company_code'] : nil
  license_key = hash.key?('license_key') ? hash['license_key'] : nil
  url = hash.key?('url') ? hash['url'] : nil

  # Create object from extracted values.
  CustomV0AvalaraConfigCreateDto.new(,
                                     company_code,
                                     license_key,
                                     url)
end

.namesObject

A mapping from model property names to API property names.



32
33
34
35
36
37
38
39
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 32

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_number'] = 'account_number'
  @_hash['company_code'] = 'company_code'
  @_hash['license_key'] = 'license_key'
  @_hash['url'] = 'url'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



42
43
44
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 42

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



85
86
87
88
89
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 85

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_number: #{@account_number.inspect}, company_code:"\
  " #{@company_code.inspect}, license_key: #{@license_key.inspect}, url: #{@url.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



78
79
80
81
82
# File 'lib/new_store_api/models/custom_v0_avalara_config_create_dto.rb', line 78

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_number: #{@account_number}, company_code: #{@company_code},"\
  " license_key: #{@license_key}, url: #{@url}>"
end