lib/VoucherifySdk/models/voucher_redemption.rb in voucherify-5.0.0 vs lib/VoucherifySdk/models/voucher_redemption.rb in voucherify-6.0.0
- old
+ new
@@ -20,28 +20,24 @@
attr_accessor :quantity
# How many times a voucher has already been redeemed.
attr_accessor :redeemed_quantity
- # Total amount redeemed. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 balance is written as 10000.
- attr_accessor :redeemed_amount
-
# Total loyalty points redeemed.
attr_accessor :redeemed_points
- # The type of object represented is by default `list`. To get this list, you need to make a call to the endpoint returned in the url attribute.
+ # The type of the object represented is by default `list`. To get this list, you need to make a call to the endpoint returned in the url attribute.
attr_accessor :object
# The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`
attr_accessor :url
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'quantity' => :'quantity',
:'redeemed_quantity' => :'redeemed_quantity',
- :'redeemed_amount' => :'redeemed_amount',
:'redeemed_points' => :'redeemed_points',
:'object' => :'object',
:'url' => :'url'
}
end
@@ -54,35 +50,32 @@
# Attribute type mapping.
def self.openapi_types
{
:'quantity' => :'Integer',
:'redeemed_quantity' => :'Integer',
- :'redeemed_amount' => :'Integer',
:'redeemed_points' => :'Integer',
:'object' => :'String',
:'url' => :'String'
}
end
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
+ :'quantity',
+ :'redeemed_quantity',
+ :'redeemed_points',
+ :'object',
+ :'url'
])
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::VoucherRedemption` 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::VoucherRedemption`. 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?(:'quantity')
self.quantity = attributes[:'quantity']
@@ -90,14 +83,10 @@
if attributes.key?(:'redeemed_quantity')
self.redeemed_quantity = attributes[:'redeemed_quantity']
end
- if attributes.key?(:'redeemed_amount')
- self.redeemed_amount = attributes[:'redeemed_amount']
- end
-
if attributes.key?(:'redeemed_points')
self.redeemed_points = attributes[:'redeemed_points']
end
if attributes.key?(:'object')
@@ -131,11 +120,10 @@
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
quantity == o.quantity &&
redeemed_quantity == o.redeemed_quantity &&
- redeemed_amount == o.redeemed_amount &&
redeemed_points == o.redeemed_points &&
object == o.object &&
url == o.url
end
@@ -146,10 +134,10 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [quantity, redeemed_quantity, redeemed_amount, redeemed_points, object, url].hash
+ [quantity, redeemed_quantity, redeemed_points, object, url].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself