Class ValidationRule

java.lang.Object
io.voucherify.client.model.ValidationRule

@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class ValidationRule extends Object
ValidationRule
  • Field Details

  • Constructor Details

    • ValidationRule

      public ValidationRule()
  • Method Details

    • name

      public ValidationRule name(String name)
    • getName

      @Nullable public String getName()
      Custom, unique name for set of validation rules.
      Returns:
      name
    • setName

      public void setName(String name)
    • rules

      public ValidationRule rules(Object rules)
    • getRules

      @Nullable public Object getRules()
      Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consecutively beginning from `1`. The values are objects containing the rule conditions.
      Returns:
      rules
    • setRules

      public void setRules(Object rules)
    • error

      public ValidationRule error(ValidationRuleError error)
    • getError

      @Nullable public ValidationRuleError getError()
      Get error
      Returns:
      error
    • setError

      public void setError(ValidationRuleError error)
    • applicableTo

      public ValidationRule applicableTo(ValidationRuleApplicableTo applicableTo)
    • getApplicableTo

      @Nullable public ValidationRuleApplicableTo getApplicableTo()
      Get applicableTo
      Returns:
      applicableTo
    • setApplicableTo

      public void setApplicableTo(ValidationRuleApplicableTo applicableTo)
    • type

    • getType

      @Nullable public ValidationRule.TypeEnum getType()
      Type of validation rule.
      Returns:
      type
    • setType

      public void setType(ValidationRule.TypeEnum type)
    • contextType

      public ValidationRule contextType(ValidationRule.ContextTypeEnum contextType)
    • getContextType

      @Nullable public ValidationRule.ContextTypeEnum getContextType()
      Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |
      Returns:
      contextType
    • setContextType

      public void setContextType(ValidationRule.ContextTypeEnum contextType)
    • id

      public ValidationRule id(String id)
    • getId

      @Nullable public String getId()
      Unique validation rule ID.
      Returns:
      id
    • setId

      public void setId(String id)
    • createdAt

      public ValidationRule createdAt(OffsetDateTime createdAt)
    • getCreatedAt

      @Nullable public OffsetDateTime getCreatedAt()
      Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.
      Returns:
      createdAt
    • setCreatedAt

      public void setCreatedAt(OffsetDateTime createdAt)
    • updatedAt

      public ValidationRule updatedAt(OffsetDateTime updatedAt)
    • getUpdatedAt

      @Nullable public OffsetDateTime getUpdatedAt()
      Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format.
      Returns:
      updatedAt
    • setUpdatedAt

      public void setUpdatedAt(OffsetDateTime updatedAt)
    • assignmentsCount

      public ValidationRule assignmentsCount(Integer assignmentsCount)
    • getAssignmentsCount

      @Nullable public Integer getAssignmentsCount()
      The number of instances the validation rule has been assigned to different types of redeemables.
      Returns:
      assignmentsCount
    • setAssignmentsCount

      public void setAssignmentsCount(Integer assignmentsCount)
    • _object

      public ValidationRule _object(String _object)
    • getObject

      @Nullable public String getObject()
      The type of the object represented by JSON. This object stores information about the validation rule.
      Returns:
      _object
    • setObject

      public void setObject(String _object)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fromJson

      public static ValidationRule fromJson(String jsonString) throws IOException
      Create an instance of ValidationRule given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of ValidationRule
      Throws:
      IOException - if the JSON string is invalid with respect to ValidationRule
    • toJson

      public String toJson()
      Convert an instance of ValidationRule to an JSON string
      Returns:
      JSON string