class Taxamo::CalculateTaxLocationOut

Attributes

billing_country_code[RW]
buyer_credit_card_prefix[RW]
buyer_ip[RW]
countries[RW]
evidence[RW]
tax_country_code[RW]
tax_deducted[RW]
tax_supported[RW]

Public Class Methods

attribute_map() click to toggle source

:internal => :external

# File lib/taxamo/models/calculatetaxlocationout.rb, line 18
def self.attribute_map
  {
    :tax_country_code => :tax_country_code,
    :tax_deducted => :tax_deducted,
    :tax_supported => :tax_supported,
    :countries => :countries,
    :buyer_ip => :buyer_ip,
    :billing_country_code => :billing_country_code,
    :buyer_credit_card_prefix => :buyer_credit_card_prefix,
    :evidence => :evidence

  }
end
new(attributes = {}) click to toggle source
# File lib/taxamo/models/calculatetaxlocationout.rb, line 32
def initialize(attributes = {})
  return if attributes.nil? or attributes.empty?
  # Morph attribute keys into undescored rubyish style
  if attributes.key?("tax_country_code")
    @tax_country_code = attributes["tax_country_code"]
      
  end
  if attributes.key?("tax_deducted")
    @tax_deducted = attributes["tax_deducted"]
      
  end
  if attributes.key?("tax_supported")
    @tax_supported = attributes["tax_supported"]
      
  end
  if attributes.key?("countries")
    @countries = Countries.new(attributes["countries"])
      
  end
  if attributes.key?("buyer_ip")
    @buyer_ip = attributes["buyer_ip"]
      
  end
  if attributes.key?("billing_country_code")
    @billing_country_code = attributes["billing_country_code"]
      
  end
  if attributes.key?("buyer_credit_card_prefix")
    @buyer_credit_card_prefix = attributes["buyer_credit_card_prefix"]
      
  end
  if attributes.key?("evidence")
    @evidence = Evidence.new(attributes["evidence"])
      
  end
  

end

Public Instance Methods

to_body() click to toggle source
# File lib/taxamo/models/calculatetaxlocationout.rb, line 71
def to_body
  body = {}
  self.class.attribute_map.each_pair do |key, value|
    v = self.send(key)
    unless v.nil?
      if v.is_a?(Array)
        array = Array.new
        v.each do |item|
          if item.respond_to?("to_body".to_sym)
            array.push item.to_body
          else
            array.push item
          end
        end
        body[value] = array
      else
        if v.respond_to?("to_body".to_sym)
          body[value] = v.to_body
        else
          body[value] = v
        end
      end
    end
  end
  body
end