lib/phrase/models/comment_create_parameters.rb in phrase-3.6.0 vs lib/phrase/models/comment_create_parameters.rb in phrase-3.7.0

- old
+ new

@@ -1,28 +1,33 @@ require 'date' module Phrase class CommentCreateParameters + # Comment message + attr_accessor :message + # specify the branch to use attr_accessor :branch - # Comment message - attr_accessor :message + # specify the locales for the comment + attr_accessor :locale_ids # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'message' => :'message', :'branch' => :'branch', - :'message' => :'message' + :'locale_ids' => :'locale_ids' } end # Attribute type mapping. def self.openapi_types { + :'message' => :'String', :'branch' => :'String', - :'message' => :'String' + :'locale_ids' => :'Array<String>' } end # List of attributes with nullable: true def self.openapi_nullable @@ -43,39 +48,51 @@ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::CommentCreateParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + if attributes.key?(:'branch') self.branch = attributes[:'branch'] end - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'locale_ids') + if (value = attributes[:'locale_ids']).is_a?(Array) + self.locale_ids = value + end end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @message.nil? + invalid_properties.push('invalid value for "message", message 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 @message.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 && + message == o.message && branch == o.branch && - message == o.message + locale_ids == o.locale_ids end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -83,10 +100,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [branch, message].hash + [message, branch, locale_ids].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself