lib/VoucherifySdk/models/sku.rb in voucherify-5.0.0 vs lib/VoucherifySdk/models/sku.rb in voucherify-6.0.0
- old
+ new
@@ -41,17 +41,17 @@
attr_accessor :image_url
# The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format.
attr_accessor :metadata
- # Timestamp representing the date and time when the SKU was created in ISO 8601 format.
+ # Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.
attr_accessor :created_at
- # Timestamp representing the date and time when the SKU was updated in ISO 8601 format.
+ # Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.
attr_accessor :updated_at
- # The type of object represented by JSON. This object stores information about the `SKU`.
+ # The type of the object represented by JSON. This object stores information about the `SKU`.
attr_accessor :object
class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
@@ -116,96 +116,75 @@
end
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
+ :'id',
:'source_id',
+ :'product_id',
:'sku',
:'price',
:'currency',
+ :'attributes',
:'image_url',
+ :'metadata',
+ :'created_at',
:'updated_at',
+ :'object'
])
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::Sku` 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::Sku`. 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?(:'source_id')
self.source_id = attributes[:'source_id']
- else
- self.source_id = nil
end
if attributes.key?(:'product_id')
self.product_id = attributes[:'product_id']
- else
- self.product_id = nil
end
if attributes.key?(:'sku')
self.sku = attributes[:'sku']
- else
- self.sku = nil
end
if attributes.key?(:'price')
self.price = attributes[:'price']
- else
- self.price = nil
end
if attributes.key?(:'currency')
self.currency = attributes[:'currency']
end
if attributes.key?(:'attributes')
self.attributes = attributes[:'attributes']
- else
- self.attributes = nil
end
if attributes.key?(:'image_url')
self.image_url = attributes[:'image_url']
- else
- self.image_url = nil
end
if attributes.key?(:'metadata')
self.metadata = attributes[:'metadata']
- else
- self.metadata = nil
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']
- else
- self.updated_at = nil
end
if attributes.key?(:'object')
self.object = attributes[:'object']
else
@@ -216,59 +195,19 @@
# 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 @product_id.nil?
- invalid_properties.push('invalid value for "product_id", product_id cannot be nil.')
- end
-
- if @attributes.nil?
- invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
- end
-
- if @metadata.nil?
- invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
- end
-
- if @created_at.nil?
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
- end
-
- if @object.nil?
- invalid_properties.push('invalid value for "object", object 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 @product_id.nil?
- return false if @attributes.nil?
- return false if @metadata.nil?
- return false if @created_at.nil?
- return false if @object.nil?
object_validator = EnumAttributeValidator.new('String', ["sku"])
return false unless object_validator.valid?(@object)
true
- end
-
- # Custom attribute writer method checking allowed values (enum).
- # @param [Object] object Object to be assigned
- def object=(object)
- validator = EnumAttributeValidator.new('String', ["sku"])
- unless validator.valid?(object)
- fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}."
- end
- @object = object
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)