2012-09-26 20:02:27 +00:00
|
|
|
class Order
|
|
|
|
attr_accessor :id, :pet_id, :status, :quantity, :ship_date
|
|
|
|
|
|
|
|
# :internal => :external
|
|
|
|
def self.attribute_map
|
|
|
|
{
|
|
|
|
:id => :id, :pet_id => :petId, :status => :status, :quantity => :quantity, :ship_date => :shipDate
|
|
|
|
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(attributes = {})
|
|
|
|
# Morph attribute keys into undescored rubyish style
|
|
|
|
if attributes.to_s != ""
|
|
|
|
|
|
|
|
if Order.attribute_map["id".to_sym] != nil
|
|
|
|
name = "id".to_sym
|
|
|
|
value = attributes["id"]
|
2012-09-26 20:43:38 +00:00
|
|
|
send("#{name}=", value) if self.respond_to?(name)
|
2012-09-26 20:02:27 +00:00
|
|
|
end
|
|
|
|
if Order.attribute_map["pet_id".to_sym] != nil
|
|
|
|
name = "pet_id".to_sym
|
|
|
|
value = attributes["petId"]
|
2012-09-26 20:43:38 +00:00
|
|
|
send("#{name}=", value) if self.respond_to?(name)
|
2012-09-26 20:02:27 +00:00
|
|
|
end
|
|
|
|
if Order.attribute_map["status".to_sym] != nil
|
|
|
|
name = "status".to_sym
|
|
|
|
value = attributes["status"]
|
2012-09-26 20:43:38 +00:00
|
|
|
send("#{name}=", value) if self.respond_to?(name)
|
2012-09-26 20:02:27 +00:00
|
|
|
end
|
|
|
|
if Order.attribute_map["quantity".to_sym] != nil
|
|
|
|
name = "quantity".to_sym
|
|
|
|
value = attributes["quantity"]
|
2012-09-26 20:43:38 +00:00
|
|
|
send("#{name}=", value) if self.respond_to?(name)
|
2012-09-26 20:02:27 +00:00
|
|
|
end
|
|
|
|
if Order.attribute_map["ship_date".to_sym] != nil
|
|
|
|
name = "ship_date".to_sym
|
|
|
|
value = attributes["shipDate"]
|
2012-09-26 20:43:38 +00:00
|
|
|
send("#{name}=", value) if self.respond_to?(name)
|
2012-09-26 20:02:27 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def to_body
|
|
|
|
body = {}
|
|
|
|
Order.attribute_map.each_pair do |key,value|
|
|
|
|
body[value] = self.send(key) unless self.send(key).nil?
|
|
|
|
end
|
|
|
|
body
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|