Interface Entitlement

All Superinterfaces:
ISnowflake

public interface Entitlement extends ISnowflake
Represents a user or guild that has access to a premium offering in your application.
See Also:
  • Method Details

    • getSkuIdLong

      long getSkuIdLong()
      The id of the SKU related to this Entitlement
      Returns:
      The id of the SKU related to this Entitlement
    • getSkuId

      @Nonnull default String getSkuId()
      The id of the SKU related to this Entitlement
      Returns:
      The id of the SKU related to this Entitlement
    • getApplicationIdLong

      long getApplicationIdLong()
      The id of the parent application of this Entitlement
      Returns:
      The id of the parent application of this Entitlement
    • getApplicationId

      @Nonnull default String getApplicationId()
      The id of the parent application of this Entitlement
      Returns:
      The id of the parent application of this Entitlement
    • getUserIdLong

      long getUserIdLong()
      The id of the user that purchased the Entitlement
      Returns:
      The id of the user that purchased the Entitlement
    • getUserId

      @Nonnull default String getUserId()
      The id of the user that purchased the Entitlement
      Returns:
      The id of the user that purchased the Entitlement
    • getGuildIdLong

      long getGuildIdLong()
      The guild id that is granted access to the Entitlements SKU
      Returns:
      The id of the guild that purchased the Entitlement or 0 if this is not a guild subscription
    • getGuildId

      @Nullable default String getGuildId()
      The guild id that is granted access to the Entitlements SKU
      Returns:
      The id of the guild that purchased the Entitlement or null if this is not a guild subscription
    • getType

      @Nonnull Entitlement.EntitlementType getType()
      The type of the Entitlement
      Returns:
      the Entitlement type
    • isDeleted

      boolean isDeleted()
      Whether the Entitlement has been deleted or not.
      Returns:
      True if the Entitlement was deleted, False otherwise
      See Also:
    • getTimeStarting

      @Nullable OffsetDateTime getTimeStarting()
      The start date at which the Entitlement is valid.
      Returns:
      Start date at which the Entitlement is valid. Not present when using test entitlements.
    • getTimeEnding

      @Nullable OffsetDateTime getTimeEnding()
      Date at which the Entitlement is no longer valid.
      Returns:
      Date at which the Entitlement is no longer valid. Not present when using test entitlements.
    • isConsumed

      boolean isConsumed()
      Whether the Entitlement was consumed or not.
      Returns:
      True if the Entitlement was consumed, False otherwise
    • consume

      @Nonnull @CheckReturnValue RestAction<Void> consume()
      Consumes the Entitlement if it has not already been consumed.
      Only One-Time Purchase consumable Entitlements can be consumed.
      After the Entitlement has been consumed, it will be marked as consumed.
      Returns:
      A RestAction that will consume the Entitlement