class Taxamo::UsTaxExemptionCertificateDetailsSchema

Attributes

exempt_states[RW]
purchaser_address1[RW]
purchaser_address2[RW]
purchaser_business_type[RW]
purchaser_business_type_other_value[RW]
purchaser_city[RW]
purchaser_exemption_reason[RW]
purchaser_exemption_reason_value[RW]
purchaser_first_name[RW]
purchaser_last_name[RW]
purchaser_state[RW]
purchaser_tax_id[RW]
purchaser_title[RW]
purchaser_zip[RW]
single_purchase[RW]
single_purchase_order_identifier[RW]

Public Class Methods

attribute_map() click to toggle source

:internal => :external

# File lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb, line 18
def self.attribute_map
  {
    :single_purchase_order_identifier => :single_purchase_order_identifier,
    :purchaser_business_type => :purchaser_business_type,
    :purchaser_exemption_reason_value => :purchaser_exemption_reason_value,
    :purchaser_state => :purchaser_state,
    :purchaser_zip => :purchaser_zip,
    :purchaser_city => :purchaser_city,
    :purchaser_last_name => :purchaser_last_name,
    :purchaser_exemption_reason => :purchaser_exemption_reason,
    :single_purchase => :single_purchase,
    :purchaser_tax_id => :purchaser_tax_id,
    :purchaser_address2 => :purchaser_address2,
    :purchaser_address1 => :purchaser_address1,
    :purchaser_business_type_other_value => :purchaser_business_type_other_value,
    :purchaser_first_name => :purchaser_first_name,
    :exempt_states => :exempt_states,
    :purchaser_title => :purchaser_title

  }
end
new(attributes = {}) click to toggle source
# File lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb, line 40
def initialize(attributes = {})
  return if attributes.nil? or attributes.empty?
  # Morph attribute keys into undescored rubyish style
  if attributes.key?("single_purchase_order_identifier")
    @single_purchase_order_identifier = attributes["single_purchase_order_identifier"]
      
  end
  if attributes.key?("purchaser_business_type")
    @purchaser_business_type = attributes["purchaser_business_type"]
      
  end
  if attributes.key?("purchaser_exemption_reason_value")
    @purchaser_exemption_reason_value = attributes["purchaser_exemption_reason_value"]
      
  end
  if attributes.key?("purchaser_state")
    @purchaser_state = attributes["purchaser_state"]
      
  end
  if attributes.key?("purchaser_zip")
    @purchaser_zip = attributes["purchaser_zip"]
      
  end
  if attributes.key?("purchaser_city")
    @purchaser_city = attributes["purchaser_city"]
      
  end
  if attributes.key?("purchaser_last_name")
    @purchaser_last_name = attributes["purchaser_last_name"]
      
  end
  if attributes.key?("purchaser_exemption_reason")
    @purchaser_exemption_reason = attributes["purchaser_exemption_reason"]
      
  end
  if attributes.key?("single_purchase")
    @single_purchase = attributes["single_purchase"]
      
  end
  if attributes.key?("purchaser_tax_id")
    @purchaser_tax_id = UsTaxId.new(attributes["purchaser_tax_id"])
      
  end
  if attributes.key?("purchaser_address2")
    @purchaser_address2 = attributes["purchaser_address2"]
      
  end
  if attributes.key?("purchaser_address1")
    @purchaser_address1 = attributes["purchaser_address1"]
      
  end
  if attributes.key?("purchaser_business_type_other_value")
    @purchaser_business_type_other_value = attributes["purchaser_business_type_other_value"]
      
  end
  if attributes.key?("purchaser_first_name")
    @purchaser_first_name = attributes["purchaser_first_name"]
      
  end
  if attributes.key?("exempt_states")
    if (value = attributes["exempt_states"]).is_a?(Array)
        @exempt_states = value.map{ |v| UsTaxExemptState.new(v) }
      end
    end
  if attributes.key?("purchaser_title")
    @purchaser_title = attributes["purchaser_title"]
      
  end
  

end

Public Instance Methods

to_body() click to toggle source
# File lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb, line 112
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