lib/VoucherifySdk/models/category.rb in voucherify-5.0.0 vs lib/VoucherifySdk/models/category.rb in voucherify-6.0.0
- old
+ new
@@ -23,17 +23,17 @@
attr_accessor :name
# Category hierarchy.
attr_accessor :hierarchy
- # The type of object represented by the JSON. This object stores information about the category.
+ # The type of the object represented by the JSON. This object stores information about the category.
attr_accessor :object
- # Timestamp representing the date and time when the category was created in ISO 8601 format.
+ # Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
attr_accessor :created_at
- # Timestamp representing the date and time when the category was updated in ISO 8601 format.
+ # 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
@@ -91,56 +91,48 @@
end
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
+ :'id',
+ :'name',
+ :'hierarchy',
+ :'object',
+ :'created_at',
+ :'updated_at',
+ :'stacking_rules_type'
])
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::Category` 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::Category`. 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?(:'id')
self.id = attributes[:'id']
- else
- self.id = nil
end
if attributes.key?(:'name')
self.name = attributes[:'name']
- else
- self.name = nil
end
if attributes.key?(:'hierarchy')
self.hierarchy = attributes[:'hierarchy']
- else
- self.hierarchy = nil
end
if attributes.key?(:'object')
self.object = attributes[:'object']
else
self.object = 'category'
end
if attributes.key?(:'created_at')
self.created_at = attributes[:'created_at']
- else
- self.created_at = nil
end
if attributes.key?(:'updated_at')
self.updated_at = attributes[:'updated_at']
end
@@ -153,66 +145,21 @@
# 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 @id.nil?
- invalid_properties.push('invalid value for "id", id cannot be nil.')
- end
-
- if @name.nil?
- invalid_properties.push('invalid value for "name", name cannot be nil.')
- end
-
- if @hierarchy.nil?
- invalid_properties.push('invalid value for "hierarchy", hierarchy cannot be nil.')
- end
-
- if @object.nil?
- invalid_properties.push('invalid value for "object", object cannot be nil.')
- end
-
- if @created_at.nil?
- invalid_properties.push('invalid value for "created_at", created_at 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 @id.nil?
- return false if @name.nil?
- return false if @hierarchy.nil?
- return false if @object.nil?
object_validator = EnumAttributeValidator.new('String', ["category"])
return false unless object_validator.valid?(@object)
- return false if @created_at.nil?
stacking_rules_type_validator = EnumAttributeValidator.new('String', ["JOINT", "EXCLUSIVE"])
return false unless stacking_rules_type_validator.valid?(@stacking_rules_type)
true
- end
-
- # Custom attribute writer method checking allowed values (enum).
- # @param [Object] object Object to be assigned
- def object=(object)
- validator = EnumAttributeValidator.new('String', ["category"])
- unless validator.valid?(object)
- fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}."
- end
- @object = object
- end
-
- # Custom attribute writer method checking allowed values (enum).
- # @param [Object] stacking_rules_type Object to be assigned
- def stacking_rules_type=(stacking_rules_type)
- validator = EnumAttributeValidator.new('String', ["JOINT", "EXCLUSIVE"])
- unless validator.valid?(stacking_rules_type)
- fail ArgumentError, "invalid value for \"stacking_rules_type\", must be one of #{validator.allowable_values}."
- end
- @stacking_rules_type = stacking_rules_type
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)