lib/VoucherifySdk/models/category.rb in voucherify-6.0.0 vs lib/VoucherifySdk/models/category.rb in voucherify-7.0.0

- old
+ new

@@ -20,11 +20,11 @@ attr_accessor :id # Category name. attr_accessor :name - # Category hierarchy. + # Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value. attr_accessor :hierarchy # The type of the object represented by the JSON. This object stores information about the category. attr_accessor :object @@ -32,13 +32,10 @@ attr_accessor :created_at # Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format. attr_accessor :updated_at - # The type of the stacking rule eligibility. - attr_accessor :stacking_rules_type - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values def initialize(datatype, allowable_values) @@ -65,12 +62,11 @@ :'id' => :'id', :'name' => :'name', :'hierarchy' => :'hierarchy', :'object' => :'object', :'created_at' => :'created_at', - :'updated_at' => :'updated_at', - :'stacking_rules_type' => :'stacking_rules_type' + :'updated_at' => :'updated_at' } end # Returns all the JSON keys this model knows about def self.acceptable_attributes @@ -83,12 +79,11 @@ :'id' => :'String', :'name' => :'String', :'hierarchy' => :'Integer', :'object' => :'String', :'created_at' => :'Time', - :'updated_at' => :'Time', - :'stacking_rules_type' => :'String' + :'updated_at' => :'Time' } end # List of attributes with nullable: true def self.openapi_nullable @@ -96,12 +91,11 @@ :'id', :'name', :'hierarchy', :'object', :'created_at', - :'updated_at', - :'stacking_rules_type' + :'updated_at' ]) end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -134,32 +128,31 @@ end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end - - if attributes.key?(:'stacking_rules_type') - self.stacking_rules_type = attributes[:'stacking_rules_type'] - 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 !@hierarchy.nil? && @hierarchy < 0 + invalid_properties.push('invalid value for "hierarchy", must be greater than or equal to 0.') + 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 !@hierarchy.nil? && @hierarchy < 0 object_validator = EnumAttributeValidator.new('String', ["category"]) return false unless object_validator.valid?(@object) - stacking_rules_type_validator = EnumAttributeValidator.new('String', ["JOINT", "EXCLUSIVE"]) - return false unless stacking_rules_type_validator.valid?(@stacking_rules_type) true end # Checks equality by comparing each attribute. # @param [Object] Object to be compared @@ -169,12 +162,11 @@ id == o.id && name == o.name && hierarchy == o.hierarchy && object == o.object && created_at == o.created_at && - updated_at == o.updated_at && - stacking_rules_type == o.stacking_rules_type + updated_at == o.updated_at end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -182,10 +174,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, hierarchy, object, created_at, updated_at, stacking_rules_type].hash + [id, name, hierarchy, object, created_at, updated_at].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself