lib/VoucherifySdk/models/voucher_gift.rb in voucherify-5.0.0 vs lib/VoucherifySdk/models/voucher_gift.rb in voucherify-6.0.0
- old
+ new
@@ -71,25 +71,21 @@
end
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
+ :'amount',
+ :'balance',
+ :'effect'
])
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::VoucherGift` 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::VoucherGift`. 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?(:'amount')
self.amount = attributes[:'amount']
@@ -117,19 +113,9 @@
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
effect_validator = EnumAttributeValidator.new('String', ["APPLY_TO_ORDER", "APPLY_TO_ITEMS"])
return false unless effect_validator.valid?(@effect)
true
- end
-
- # Custom attribute writer method checking allowed values (enum).
- # @param [Object] effect Object to be assigned
- def effect=(effect)
- validator = EnumAttributeValidator.new('String', ["APPLY_TO_ORDER", "APPLY_TO_ITEMS"])
- unless validator.valid?(effect)
- fail ArgumentError, "invalid value for \"effect\", must be one of #{validator.allowable_values}."
- end
- @effect = effect
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)