lib/VoucherifySdk/models/loyalties_transfer_points.rb in voucherify-5.0.0 vs lib/VoucherifySdk/models/loyalties_transfer_points.rb in voucherify-6.0.0

- old
+ new

@@ -22,11 +22,11 @@ attr_accessor :points # Reason for the transfer. attr_accessor :reason - # The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. + # The merchant's transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. attr_accessor :source_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -53,77 +53,53 @@ end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'code', + :'points', + :'reason', + :'source_id' ]) end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `VoucherifySdk::LoyaltiesTransferPoints` initialize method" - end - # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `VoucherifySdk::LoyaltiesTransferPoints`. 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?(:'code') self.code = attributes[:'code'] - else - self.code = nil end if attributes.key?(:'points') self.points = attributes[:'points'] - else - self.points = nil end if attributes.key?(:'reason') self.reason = attributes[:'reason'] end if attributes.key?(:'source_id') self.source_id = attributes[:'source_id'] - else - self.source_id = nil 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 warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @points.nil? - invalid_properties.push('invalid value for "points", points cannot be nil.') - end - - if @source_id.nil? - invalid_properties.push('invalid value for "source_id", source_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? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @code.nil? - return false if @points.nil? - return false if @source_id.nil? true end # Checks equality by comparing each attribute. # @param [Object] Object to be compared