Class Voucher

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

@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class Voucher extends Object
This is an object representing a voucher with categories and validation rules assignments.
  • Field Details

  • Constructor Details

    • Voucher

      public Voucher()
  • Method Details

    • id

      public Voucher id(String id)
    • getId

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

      public void setId(String id)
    • code

      public Voucher code(String code)
    • getCode

      @Nullable public String getCode()
      A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
      Returns:
      code
    • setCode

      public void setCode(String code)
    • campaign

      public Voucher campaign(String campaign)
    • getCampaign

      @Nullable public String getCampaign()
      A unique campaign name, identifies the voucher's parent campaign.
      Returns:
      campaign
    • setCampaign

      public void setCampaign(String campaign)
    • campaignId

      public Voucher campaignId(String campaignId)
    • getCampaignId

      @Nullable public String getCampaignId()
      Assigned by the Voucherify API, identifies the voucher's parent campaign.
      Returns:
      campaignId
    • setCampaignId

      public void setCampaignId(String campaignId)
    • category

      public Voucher category(String category)
    • getCategory

      @Nullable public String getCategory()
      Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
      Returns:
      category
    • setCategory

      public void setCategory(String category)
    • categoryId

      public Voucher categoryId(String categoryId)
    • getCategoryId

      @Nullable public String getCategoryId()
      Unique category ID assigned by Voucherify.
      Returns:
      categoryId
    • setCategoryId

      public void setCategoryId(String categoryId)
    • type

      public Voucher type(Voucher.TypeEnum type)
    • getType

      @Nullable public Voucher.TypeEnum getType()
      Defines the type of the voucher.
      Returns:
      type
    • setType

      public void setType(Voucher.TypeEnum type)
    • discount

      public Voucher discount(Discount discount)
    • getDiscount

      @Nullable public Discount getDiscount()
      Get discount
      Returns:
      discount
    • setDiscount

      public void setDiscount(Discount discount)
    • gift

      public Voucher gift(VoucherGift gift)
    • getGift

      @Nullable public VoucherGift getGift()
      Get gift
      Returns:
      gift
    • setGift

      public void setGift(VoucherGift gift)
    • loyaltyCard

      public Voucher loyaltyCard(VoucherLoyaltyCard loyaltyCard)
    • getLoyaltyCard

      @Nullable public VoucherLoyaltyCard getLoyaltyCard()
      Get loyaltyCard
      Returns:
      loyaltyCard
    • setLoyaltyCard

      public void setLoyaltyCard(VoucherLoyaltyCard loyaltyCard)
    • startDate

      public Voucher startDate(OffsetDateTime startDate)
    • getStartDate

      @Nullable public OffsetDateTime getStartDate()
      Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date.
      Returns:
      startDate
    • setStartDate

      public void setStartDate(OffsetDateTime startDate)
    • expirationDate

      public Voucher expirationDate(OffsetDateTime expirationDate)
    • getExpirationDate

      @Nullable public OffsetDateTime getExpirationDate()
      Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date.
      Returns:
      expirationDate
    • setExpirationDate

      public void setExpirationDate(OffsetDateTime expirationDate)
    • validityTimeframe

      public Voucher validityTimeframe(ValidityTimeframe validityTimeframe)
    • getValidityTimeframe

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

      public void setValidityTimeframe(ValidityTimeframe validityTimeframe)
    • validityDayOfWeek

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

      public Voucher addValidityDayOfWeekItem(Voucher.ValidityDayOfWeekEnum validityDayOfWeekItem)
    • getValidityDayOfWeek

      @Nullable public List<Voucher.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<Voucher.ValidityDayOfWeekEnum> validityDayOfWeek)
    • validityHours

      public Voucher validityHours(ValidityHours validityHours)
    • getValidityHours

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

      public void setValidityHours(ValidityHours validityHours)
    • active

      public Voucher active(Boolean active)
    • getActive

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

      public void setActive(Boolean active)
    • additionalInfo

      public Voucher additionalInfo(String additionalInfo)
    • getAdditionalInfo

      @Nullable public String getAdditionalInfo()
      An optional field to keep any extra textual information about the code such as a code description and details.
      Returns:
      additionalInfo
    • setAdditionalInfo

      public void setAdditionalInfo(String additionalInfo)
    • metadata

      public Voucher metadata(Object metadata)
    • getMetadata

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

      public void setMetadata(Object metadata)
    • assets

      public Voucher assets(VoucherAssets assets)
    • getAssets

      @Nullable public VoucherAssets getAssets()
      Get assets
      Returns:
      assets
    • setAssets

      public void setAssets(VoucherAssets assets)
    • isReferralCode

      public Voucher isReferralCode(Boolean isReferralCode)
    • getIsReferralCode

      @Nullable public Boolean getIsReferralCode()
      Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`.
      Returns:
      isReferralCode
    • setIsReferralCode

      public void setIsReferralCode(Boolean isReferralCode)
    • createdAt

      public Voucher createdAt(OffsetDateTime createdAt)
    • getCreatedAt

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

      public void setCreatedAt(OffsetDateTime createdAt)
    • updatedAt

      public Voucher updatedAt(OffsetDateTime updatedAt)
    • getUpdatedAt

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

      public void setUpdatedAt(OffsetDateTime updatedAt)
    • holderId

      public Voucher holderId(String holderId)
    • getHolderId

      @Nullable public String getHolderId()
      Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
      Returns:
      holderId
    • setHolderId

      public void setHolderId(String holderId)
    • referrerId

      public Voucher referrerId(String referrerId)
    • getReferrerId

      @Nullable public String getReferrerId()
      Unique identifier of the referring person.
      Returns:
      referrerId
    • setReferrerId

      public void setReferrerId(String referrerId)
    • _object

      public Voucher _object(String _object)
    • getObject

      @Nullable public String getObject()
      The type of the object represented by JSON. Default is `voucher`.
      Returns:
      _object
    • setObject

      public void setObject(String _object)
    • publish

      public Voucher publish(VoucherPublish publish)
    • getPublish

      @Nullable public VoucherPublish getPublish()
      Get publish
      Returns:
      publish
    • setPublish

      public void setPublish(VoucherPublish publish)
    • redemption

      public Voucher redemption(VoucherRedemption redemption)
    • getRedemption

      @Nullable public VoucherRedemption getRedemption()
      Get redemption
      Returns:
      redemption
    • setRedemption

      public void setRedemption(VoucherRedemption redemption)
    • categories

      public Voucher categories(List<Category> categories)
    • addCategoriesItem

      public Voucher addCategoriesItem(Category categoriesItem)
    • getCategories

      @Nullable public List<Category> getCategories()
      Contains details about the category.
      Returns:
      categories
    • setCategories

      public void setCategories(List<Category> categories)
    • validationRulesAssignments

      public Voucher validationRulesAssignments(ValidationRulesAssignmentsList validationRulesAssignments)
    • getValidationRulesAssignments

      @Nullable public ValidationRulesAssignmentsList getValidationRulesAssignments()
      Get validationRulesAssignments
      Returns:
      validationRulesAssignments
    • setValidationRulesAssignments

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

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