lib/patch_ruby/models/estimate.rb in patch_ruby-1.2.5 vs lib/patch_ruby/models/estimate.rb in patch_ruby-1.3.0
- old
+ new
@@ -18,32 +18,37 @@
attr_accessor :id
# A boolean indicating if this estimate is a production or test mode estimate.
attr_accessor :production
- # The type of estimate. Currently mass is the only supported value.
+ # The type of estimate. Available types are mass, flight, shipping, and vehicle.
attr_accessor :type
+ # The estimated mass in grams for this estimate.
+ attr_accessor :mass_g
+
# An object returning the order associated with this estimate. See the [Order section](/?id=orders) for the full schema.
attr_accessor :order
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'id' => :'id',
:'production' => :'production',
:'type' => :'type',
+ :'mass_g' => :'mass_g',
:'order' => :'order'
}
end
# Attribute type mapping.
def self.openapi_types
{
:'id' => :'String',
:'production' => :'Boolean',
:'type' => :'String',
+ :'mass_g' => :'Integer',
:'order' => :'Order'
}
end
# Set with nullable attributes.
@@ -91,10 +96,14 @@
if attributes.key?(:'type')
self.type = attributes[:'type']
end
+ if attributes.key?(:'mass_g')
+ self.mass_g = attributes[:'mass_g']
+ end
+
if attributes.key?(:'order')
self.order = attributes[:'order']
end
end
@@ -132,10 +141,11 @@
return true if self.equal?(o)
self.class == o.class &&
id == o.id &&
production == o.production &&
type == o.type &&
+ mass_g == o.mass_g &&
order == o.order
end
# @see the `==` method
# @param [Object] Object to be compared
@@ -144,11 +154,11 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [id, production, type, order].hash
+ [id, production, type, mass_g, order].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
@@ -237,10 +247,10 @@
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end
-
+
hash[param] = _to_hash(value)
end
hash
end