lib/VoucherifySdk/models/customer_loyalty.rb in voucherify-5.0.0 vs lib/VoucherifySdk/models/customer_loyalty.rb in voucherify-6.0.0
- old
+ new
@@ -41,82 +41,57 @@
# Attribute type mapping.
def self.openapi_types
{
:'points' => :'Integer',
:'referred_customers' => :'Integer',
- :'campaigns' => :'Hash<String, CustomerLoyaltyCampaignsValue>'
+ :'campaigns' => :'Hash<String, CustomerLoyaltyCampaignsEntry>'
}
end
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
+ :'points',
+ :'referred_customers',
+ :'campaigns'
])
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::CustomerLoyalty` 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::CustomerLoyalty`. 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?(:'points')
self.points = attributes[:'points']
- else
- self.points = nil
end
if attributes.key?(:'referred_customers')
self.referred_customers = attributes[:'referred_customers']
- else
- self.referred_customers = nil
end
if attributes.key?(:'campaigns')
if (value = attributes[:'campaigns']).is_a?(Hash)
self.campaigns = value
end
- else
- self.campaigns = 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 @points.nil?
- invalid_properties.push('invalid value for "points", points cannot be nil.')
- end
-
- if @referred_customers.nil?
- invalid_properties.push('invalid value for "referred_customers", referred_customers cannot be nil.')
- end
-
- if @campaigns.nil?
- invalid_properties.push('invalid value for "campaigns", campaigns 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 @points.nil?
- return false if @referred_customers.nil?
- return false if @campaigns.nil?
true
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared