Class: NewStoreApi::CustomV0AvalaraConfigUpdateDto

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

Overview

CustomV0AvalaraConfigUpdateDto 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 = SKIP, company_code = SKIP, license_key = SKIP, url = SKIP) ⇒ CustomV0AvalaraConfigUpdateDto

Returns a new instance of CustomV0AvalaraConfigUpdateDto.



56
57
58
59
60
61
62
# File 'lib/new_store_api/models/custom_v0_avalara_config_update_dto.rb', line 56

def initialize( = SKIP, company_code = SKIP,
               license_key = SKIP, url = SKIP)
  @account_number =  unless  == SKIP
  @company_code = company_code unless company_code == SKIP
  @license_key = license_key unless license_key == SKIP
  @url = url unless url == SKIP
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_update_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_update_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_update_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_update_dto.rb', line 29

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/new_store_api/models/custom_v0_avalara_config_update_dto.rb', line 65

def self.from_hash(hash)
  return nil unless hash

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

  # Create object from extracted values.
  CustomV0AvalaraConfigUpdateDto.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_update_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



52
53
54
# File 'lib/new_store_api/models/custom_v0_avalara_config_update_dto.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



42
43
44
45
46
47
48
49
# File 'lib/new_store_api/models/custom_v0_avalara_config_update_dto.rb', line 42

def self.optionals
  %w[
    account_number
    company_code
    license_key
    url
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



90
91
92
93
94
# File 'lib/new_store_api/models/custom_v0_avalara_config_update_dto.rb', line 90

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.



83
84
85
86
87
# File 'lib/new_store_api/models/custom_v0_avalara_config_update_dto.rb', line 83

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