lib/patch_ruby/models/photo.rb in patch_ruby-1.2.4 vs lib/patch_ruby/models/photo.rb in patch_ruby-1.2.5
- old
+ new
@@ -14,24 +14,35 @@
module Patch
class Photo
attr_accessor :url
+ attr_accessor :id
+
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
- :'url' => :'url'
+ :'url' => :'url',
+ :'id' => :'id'
}
end
# Attribute type mapping.
def self.openapi_types
{
- :'url' => :'String'
+ :'url' => :'String',
+ :'id' => :'String'
}
end
+ # Set with nullable attributes.
+ def self.openapi_nullable
+ nullable_properties = Set.new
+
+ nullable_properties
+ end
+
# Allows models with corresponding API classes to delegate API operations to those API classes
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
# Eg. Order.create_order delegates to OrdersApi.new.create_order
def self.method_missing(message, *args, &block)
if Object.const_defined?('Patch::PhotosApi::OPERATIONS') && Patch::PhotosApi::OPERATIONS.include?(message)
@@ -67,26 +78,32 @@
invalid_properties = Array.new
if @url.nil?
invalid_properties.push('invalid value for "url", url cannot be nil.')
end
+ if @id.nil?
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
+ end
+
invalid_properties
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
return false if @url.nil?
+ return false if @id.nil?
true
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
- url == o.url
+ url == o.url &&
+ id == o.id
end
# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
@@ -94,10 +111,10 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [url].hash
+ [url, id].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself