Class: Io::Flow::V0::Models::AvalaraTaxSetting

Inherits:
TaxSetting
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from TaxSetting

#discriminator

Instance Method Summary collapse

Methods inherited from TaxSetting

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ AvalaraTaxSetting

Returns a new instance of AvalaraTaxSetting.



23692
23693
23694
23695
23696
23697
23698
23699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23692

def initialize(incoming={})
  super(:discriminator => TaxSetting::Types::AVALARA_TAX_SETTING)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:company_code, :base_currency], 'AvalaraTaxSetting')
  @company_code = HttpClient::Preconditions.assert_class('company_code', opts.delete(:company_code), String)
  @base_currency = HttpClient::Preconditions.assert_class('base_currency', opts.delete(:base_currency), String)
  @api_key = (x = opts.delete(:api_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('api_key', x, String))
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



23690
23691
23692
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23690

def api_key
  @api_key
end

#base_currencyObject (readonly)

Returns the value of attribute base_currency.



23690
23691
23692
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23690

def base_currency
  @base_currency
end

#company_codeObject (readonly)

Returns the value of attribute company_code.



23690
23691
23692
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23690

def company_code
  @company_code
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



23705
23706
23707
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23705

def copy(incoming={})
  AvalaraTaxSetting.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



23709
23710
23711
23712
23713
23714
23715
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23709

def subtype_to_hash
  {
    :company_code => company_code,
    :base_currency => base_currency,
    :api_key => api_key
  }
end

#to_jsonObject



23701
23702
23703
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23701

def to_json
  JSON.dump(to_hash)
end