Method: VoucherifySdk::ManagementProjectsStackingRules#valid?

Defined in:
lib/VoucherifySdk/models/management_projects_stacking_rules.rb

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/VoucherifySdk/models/management_projects_stacking_rules.rb', line 261

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if !@redeemables_limit.nil? && @redeemables_limit > 30
  return false if !@redeemables_limit.nil? && @redeemables_limit < 1
  return false if !@applicable_redeemables_limit.nil? && @applicable_redeemables_limit < 1
  return false if !@applicable_exclusive_redeemables_limit.nil? && @applicable_exclusive_redeemables_limit > 5
  return false if !@applicable_exclusive_redeemables_limit.nil? && @applicable_exclusive_redeemables_limit < 1
  discount_calculation_mode_validator = EnumAttributeValidator.new('String', ["INITIAL_AMOUNT", "DISCOUNTED_AMOUNT"])
  return false unless discount_calculation_mode_validator.valid?(@discount_calculation_mode)
  redeemables_application_mode_validator = EnumAttributeValidator.new('String', ["ALL", "PARTIAL"])
  return false unless redeemables_application_mode_validator.valid?(@redeemables_application_mode)
  redeemables_sorting_rule_validator = EnumAttributeValidator.new('String', ["CATEGORY_HIERARCHY", "REQUESTED_ORDER"])
  return false unless redeemables_sorting_rule_validator.valid?(@redeemables_sorting_rule)
  true
end