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.



31770
31771
31772
31773
31774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31770

def initialize(incoming={})
  super(:discriminator => TaxSetting::Types::AVALARA_TAX_CSV_SETTING)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @reports = (x = opts.delete(:reports); x.nil? ? nil : HttpClient::Preconditions.assert_class('reports', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::TaxReport) ? x : ::Io::Flow::V0::Models::TaxReport.new(x)) })
end

Instance Attribute Details

#reportsObject (readonly)

Returns the value of attribute reports.



31768
31769
31770
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31768

def reports
  @reports
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31780
31781
31782
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31780

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

#subtype_to_hashObject



31784
31785
31786
31787
31788
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31784

def subtype_to_hash
  {
    :reports => reports.nil? ? nil : reports.map { |o| o.to_hash }
  }
end

#to_jsonObject



31776
31777
31778
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31776

def to_json
  JSON.dump(to_hash)
end