lib/cloudsmith-api/models/files_validate.rb in cloudsmith-api-0.21.4 vs lib/cloudsmith-api/models/files_validate.rb in cloudsmith-api-0.30.7

- old
+ new

@@ -13,30 +13,30 @@ require 'date' module CloudsmithApi class FilesValidate - # MD5 checksum for the package file upload. - attr_accessor :md5_checksum - # Filename for the package file upload. attr_accessor :filename + # MD5 checksum for the package file upload. + attr_accessor :md5_checksum + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'md5_checksum' => :'md5_checksum', - :'filename' => :'filename' + :'filename' => :'filename', + :'md5_checksum' => :'md5_checksum' } end # Attribute type mapping. def self.swagger_types { - :'md5_checksum' => :'String', - :'filename' => :'String' + :'filename' => :'String', + :'md5_checksum' => :'String' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -44,50 +44,50 @@ return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} - if attributes.has_key?(:'md5_checksum') - self.md5_checksum = attributes[:'md5_checksum'] - end - if attributes.has_key?(:'filename') self.filename = attributes[:'filename'] end + if attributes.has_key?(:'md5_checksum') + self.md5_checksum = attributes[:'md5_checksum'] + end + end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properies with the reasons def list_invalid_properties invalid_properties = Array.new - if @md5_checksum.nil? - invalid_properties.push("invalid value for 'md5_checksum', md5_checksum cannot be nil.") - end - if @filename.nil? invalid_properties.push("invalid value for 'filename', filename cannot be nil.") end + if @md5_checksum.nil? + invalid_properties.push("invalid value for 'md5_checksum', md5_checksum cannot be nil.") + end + return 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 @md5_checksum.nil? return false if @filename.nil? + return false if @md5_checksum.nil? return 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 && - md5_checksum == o.md5_checksum && - filename == o.filename + filename == o.filename && + md5_checksum == o.md5_checksum end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -95,10 +95,10 @@ end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [md5_checksum, filename].hash + [filename, md5_checksum].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself