Class EarningRule

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

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

  • Constructor Details

    • EarningRule

      public EarningRule()
  • Method Details

    • id

      public EarningRule id(String id)
    • getId

      @Nullable public String getId()
      Assigned by the Voucherify API, identifies the earning rule object.
      Returns:
      id
    • setId

      public void setId(String id)
    • createdAt

      public EarningRule createdAt(OffsetDateTime createdAt)
    • getCreatedAt

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

      public void setCreatedAt(OffsetDateTime createdAt)
    • loyalty

      public EarningRule loyalty(EarningRuleLoyalty loyalty)
    • getLoyalty

      @Nullable public EarningRuleLoyalty getLoyalty()
      Get loyalty
      Returns:
      loyalty
    • setLoyalty

      public void setLoyalty(EarningRuleLoyalty loyalty)
    • event

      public EarningRule event(String event)
    • getEvent

      @Nullable public String getEvent()
      Get event
      Returns:
      event
    • setEvent

      public void setEvent(String event)
    • customEvent

      public EarningRule customEvent(EarningRuleCustomEvent customEvent)
    • getCustomEvent

      @Nullable public EarningRuleCustomEvent getCustomEvent()
      Get customEvent
      Returns:
      customEvent
    • setCustomEvent

      public void setCustomEvent(EarningRuleCustomEvent customEvent)
    • segment

      public EarningRule segment(EarningRuleSegment segment)
    • getSegment

      @Nullable public EarningRuleSegment getSegment()
      Get segment
      Returns:
      segment
    • setSegment

      public void setSegment(EarningRuleSegment segment)
    • loyaltyTier

      public EarningRule loyaltyTier(EarningRuleLoyaltyTier loyaltyTier)
    • getLoyaltyTier

      @Nullable public EarningRuleLoyaltyTier getLoyaltyTier()
      Get loyaltyTier
      Returns:
      loyaltyTier
    • setLoyaltyTier

      public void setLoyaltyTier(EarningRuleLoyaltyTier loyaltyTier)
    • source

      public EarningRule source(EarningRuleSource source)
    • getSource

      @Nullable public EarningRuleSource getSource()
      Get source
      Returns:
      source
    • setSource

      public void setSource(EarningRuleSource source)
    • _object

      public EarningRule _object(EarningRule.ObjectEnum _object)
    • getObject

      @Nullable public EarningRule.ObjectEnum getObject()
      The type of the object represented by JSON. Default is earning_rule.
      Returns:
      _object
    • setObject

      public void setObject(EarningRule.ObjectEnum _object)
    • automationId

      public EarningRule automationId(String automationId)
    • getAutomationId

      @Nullable public String getAutomationId()
      For internal use by Voucherify.
      Returns:
      automationId
    • setAutomationId

      public void setAutomationId(String automationId)
    • startDate

      public EarningRule startDate(String startDate)
    • getStartDate

      @Nullable public String getStartDate()
      Start date defines when the earning rule starts to be active. Activation timestamp is presented in the ISO 8601 format. The earning rule is inactive before this date. If you do not define the start date for an earning rule, it will inherit the campaign start date by default.
      Returns:
      startDate
    • setStartDate

      public void setStartDate(String startDate)
    • expirationDate

      public EarningRule expirationDate(String expirationDate)
    • getExpirationDate

      @Nullable public String getExpirationDate()
      Expiration date defines when the earning rule expires. Expiration timestamp is presented in the ISO 8601 format. The earning rule is inactive after this date. If you do not define the expiration date for an earning rule, it will inherit the campaign expiration date by default.
      Returns:
      expirationDate
    • setExpirationDate

      public void setExpirationDate(String expirationDate)
    • validityTimeframe

      public EarningRule validityTimeframe(ValidityTimeframe validityTimeframe)
    • getValidityTimeframe

      @Nullable public ValidityTimeframe getValidityTimeframe()
      Get validityTimeframe
      Returns:
      validityTimeframe
    • setValidityTimeframe

      public void setValidityTimeframe(ValidityTimeframe validityTimeframe)
    • validityDayOfWeek

      public EarningRule validityDayOfWeek(List<EarningRule.ValidityDayOfWeekEnum> validityDayOfWeek)
    • addValidityDayOfWeekItem

      public EarningRule addValidityDayOfWeekItem(EarningRule.ValidityDayOfWeekEnum validityDayOfWeekItem)
    • getValidityDayOfWeek

      @Nullable public List<EarningRule.ValidityDayOfWeekEnum> getValidityDayOfWeek()
      Integer array corresponding to the particular days of the week in which the voucher is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday
      Returns:
      validityDayOfWeek
    • setValidityDayOfWeek

      public void setValidityDayOfWeek(List<EarningRule.ValidityDayOfWeekEnum> validityDayOfWeek)
    • validityHours

      public EarningRule validityHours(ValidityHours validityHours)
    • getValidityHours

      @Nullable public ValidityHours getValidityHours()
      Get validityHours
      Returns:
      validityHours
    • setValidityHours

      public void setValidityHours(ValidityHours validityHours)
    • metadata

      public EarningRule metadata(Object metadata)
    • getMetadata

      @Nullable public Object getMetadata()
      The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format.
      Returns:
      metadata
    • setMetadata

      public void setMetadata(Object metadata)
    • validationRuleId

      public EarningRule validationRuleId(String validationRuleId)
    • getValidationRuleId

      @Nullable public String getValidationRuleId()
      A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.
      Returns:
      validationRuleId
    • setValidationRuleId

      public void setValidationRuleId(String validationRuleId)
    • updatedAt

      public EarningRule updatedAt(OffsetDateTime updatedAt)
    • getUpdatedAt

      @Nullable public OffsetDateTime getUpdatedAt()
      Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.
      Returns:
      updatedAt
    • setUpdatedAt

      public void setUpdatedAt(OffsetDateTime updatedAt)
    • active

      public EarningRule active(Boolean active)
    • getActive

      @Nullable public Boolean getActive()
      A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date. - `true` indicates an active earning rule - `false` indicates an inactive earning rule
      Returns:
      active
    • setActive

      public void setActive(Boolean active)
    • 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 EarningRule fromJson(String jsonString) throws IOException
      Create an instance of EarningRule given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of EarningRule
      Throws:
      IOException - if the JSON string is invalid with respect to EarningRule
    • toJson

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