Class: Io::Flow::V0::Models::AvalaraTaxCsvSetting

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 = {}) ⇒ AvalaraTaxCsvSetting

Returns a new instance of AvalaraTaxCsvSetting.



22996
22997
22998
22999
23000
23001
23002
23003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22996

def initialize(incoming={})
  super(:discriminator => TaxSetting::Types::AVALARA_TAX_CSV_SETTING)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:schedule, :timezone], 'AvalaraTaxCsvSetting')
  @schedule = (x = opts.delete(:schedule); x.is_a?(::Io::Flow::V0::Models::RepeatSchedule) ? x : ::Io::Flow::V0::Models::RepeatSchedule.from_json(x))
  @timezone = HttpClient::Preconditions.assert_class('timezone', opts.delete(:timezone), String)
  @email_recipients = (x = opts.delete(:email_recipients); x.nil? ? nil : HttpClient::Preconditions.assert_class('email_recipients', x, Array).map { |v| HttpClient::Preconditions.assert_class('email_recipients', v, String) })
end

Instance Attribute Details

#email_recipientsObject (readonly)

Returns the value of attribute email_recipients.



22994
22995
22996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22994

def email_recipients
  @email_recipients
end

#scheduleObject (readonly)

Returns the value of attribute schedule.



22994
22995
22996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22994

def schedule
  @schedule
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



22994
22995
22996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22994

def timezone
  @timezone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



23009
23010
23011
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23009

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

#subtype_to_hashObject



23013
23014
23015
23016
23017
23018
23019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23013

def subtype_to_hash
  {
    :schedule => schedule.to_hash,
    :timezone => timezone,
    :email_recipients => email_recipients.nil? ? nil : email_recipients
  }
end

#to_jsonObject



23005
23006
23007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23005

def to_json
  JSON.dump(to_hash)
end