class Taxamo::SettlementDailyStatsSchema

Attributes

b2b[RW]
b2c[RW]
count[RW]
day[RW]
day_raw[RW]
eu_b2b[RW]
eu_taxed[RW]
eu_total[RW]
untaxed[RW]

Public Class Methods

attribute_map() click to toggle source

:internal => :external

# File lib/taxamo/models/settlementdailystatsschema.rb, line 18
def self.attribute_map
  {
    :b2c => :b2c,
    :untaxed => :untaxed,
    :eu_taxed => :eu_taxed,
    :eu_b2b => :eu_b2b,
    :count => :count,
    :eu_total => :eu_total,
    :day_raw => :day_raw,
    :b2b => :b2b,
    :day => :day

  }
end
new(attributes = {}) click to toggle source
# File lib/taxamo/models/settlementdailystatsschema.rb, line 33
def initialize(attributes = {})
  return if attributes.nil? or attributes.empty?
  # Morph attribute keys into undescored rubyish style
  if attributes.key?("b2c")
    @b2c = attributes["b2c"]
      
  end
  if attributes.key?("untaxed")
    @untaxed = attributes["untaxed"]
      
  end
  if attributes.key?("eu_taxed")
    @eu_taxed = attributes["eu_taxed"]
      
  end
  if attributes.key?("eu_b2b")
    @eu_b2b = attributes["eu_b2b"]
      
  end
  if attributes.key?("count")
    @count = attributes["count"]
      
  end
  if attributes.key?("eu_total")
    @eu_total = attributes["eu_total"]
      
  end
  if attributes.key?("day_raw")
    @day_raw = attributes["day_raw"]
      
  end
  if attributes.key?("b2b")
    @b2b = attributes["b2b"]
      
  end
  if attributes.key?("day")
    @day = attributes["day"]
      
  end
  

end

Public Instance Methods

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