Class CustomReward

java.lang.Object
com.github.twitch4j.helix.domain.CustomReward

public class CustomReward
extends java.lang.Object
  • Constructor Details

    • CustomReward

      public CustomReward()
    • CustomReward

      public CustomReward​(java.lang.String broadcasterId, java.lang.String broadcasterLogin, java.lang.String broadcasterName, java.lang.String id, java.lang.String title, java.lang.String prompt, java.lang.Integer cost, @Nullable com.github.twitch4j.eventsub.domain.Reward.Image image, com.github.twitch4j.eventsub.domain.Reward.Image defaultImage, java.lang.Boolean isEnabled, java.lang.String backgroundColor, java.lang.Boolean isUserInputRequired, CustomReward.MaxPerStreamSetting maxPerStreamSetting, CustomReward.MaxPerUserPerStreamSetting maxPerUserPerStreamSetting, CustomReward.GlobalCooldownSetting globalCooldownSetting, java.lang.Boolean isPaused, java.lang.Boolean isInStock, java.lang.Boolean shouldRedemptionsSkipRequestQueue, @Nullable @Nullable java.lang.Integer redemptionsRedeemedCurrentStream, @Nullable @Nullable java.time.Instant cooldownExpiresAt)
  • Method Details

    • builder

      public static CustomReward.CustomRewardBuilder builder()
    • toBuilder

    • getBroadcasterId

      public java.lang.String getBroadcasterId()
      ID of the channel the reward is for.
    • getBroadcasterLogin

      public java.lang.String getBroadcasterLogin()
      Login of the channel the reward is for.
    • getBroadcasterName

      public java.lang.String getBroadcasterName()
      Display name of the channel the reward is for.
    • getId

      public java.lang.String getId()
      ID of the reward.
    • getTitle

      public java.lang.String getTitle()
      The title of the reward.
    • getPrompt

      public java.lang.String getPrompt()
      The prompt for the viewer when they are redeeming the reward.
    • getCost

      public java.lang.Integer getCost()
      The cost of the reward.
    • getImage

      @Nullable public com.github.twitch4j.eventsub.domain.Reward.Image getImage()
      Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded.
    • getDefaultImage

      public com.github.twitch4j.eventsub.domain.Reward.Image getDefaultImage()
      Set of default images of 1x, 2x and 4x sizes for the reward
    • isEnabled

      public java.lang.Boolean isEnabled()
      Whether the reward currently enabled; if false the reward won’t show up to viewers. Default: true.
    • getBackgroundColor

      public java.lang.String getBackgroundColor()
      Custom background color for the reward.

      Format: Hex with # prefix, ideally in ALL CAPS.

    • isUserInputRequired

      public java.lang.Boolean isUserInputRequired()
      Does the user need to enter information when redeeming the reward. Default: false.
    • getMaxPerStreamSetting

      public CustomReward.MaxPerStreamSetting getMaxPerStreamSetting()
      Whether a maximum per stream is enabled and what the maximum is.
    • getMaxPerUserPerStreamSetting

      public CustomReward.MaxPerUserPerStreamSetting getMaxPerUserPerStreamSetting()
      Whether a maximum per user per stream is enabled and what the maximum is.
    • getGlobalCooldownSetting

      public CustomReward.GlobalCooldownSetting getGlobalCooldownSetting()
      Whether a cooldown is enabled and what the cooldown is.
    • isPaused

      public java.lang.Boolean isPaused()
      Whether the reward is currently paused; if true viewers can’t redeem.
    • isInStock

      public java.lang.Boolean isInStock()
      Whether the reward is currently in stock; if false viewers can’t redeem.
    • getShouldRedemptionsSkipRequestQueue

      public java.lang.Boolean getShouldRedemptionsSkipRequestQueue()
      Whether redemptions should be set to FULFILLED status immediately when redeemed and skip the request queue instead of the normal UNFULFILLED status.
    • getRedemptionsRedeemedCurrentStream

      @Nullable public @Nullable java.lang.Integer getRedemptionsRedeemedCurrentStream()
      The number of redemptions redeemed during the current live stream. Counts against the max_per_stream_setting limit. Null if the broadcasters stream isn’t live or max_per_stream_setting isn’t enabled.
    • getCooldownExpiresAt

      @Nullable public @Nullable java.time.Instant getCooldownExpiresAt()
      Timestamp of the cooldown expiration. Null if the reward isn’t on cooldown.
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • canEqual

      protected boolean canEqual​(java.lang.Object other)
    • hashCode

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

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • withBroadcasterId

      public CustomReward withBroadcasterId​(java.lang.String broadcasterId)
      ID of the channel the reward is for.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withBroadcasterLogin

      public CustomReward withBroadcasterLogin​(java.lang.String broadcasterLogin)
      Login of the channel the reward is for.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withBroadcasterName

      public CustomReward withBroadcasterName​(java.lang.String broadcasterName)
      Display name of the channel the reward is for.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withId

      public CustomReward withId​(java.lang.String id)
      ID of the reward.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withTitle

      public CustomReward withTitle​(java.lang.String title)
      The title of the reward.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withPrompt

      public CustomReward withPrompt​(java.lang.String prompt)
      The prompt for the viewer when they are redeeming the reward.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withCost

      public CustomReward withCost​(java.lang.Integer cost)
      The cost of the reward.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withImage

      public CustomReward withImage​(@Nullable com.github.twitch4j.eventsub.domain.Reward.Image image)
      Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withDefaultImage

      public CustomReward withDefaultImage​(com.github.twitch4j.eventsub.domain.Reward.Image defaultImage)
      Set of default images of 1x, 2x and 4x sizes for the reward
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withIsEnabled

      public CustomReward withIsEnabled​(java.lang.Boolean isEnabled)
      Whether the reward currently enabled; if false the reward won’t show up to viewers. Default: true.
      Returns:
      this.
    • withBackgroundColor

      public CustomReward withBackgroundColor​(java.lang.String backgroundColor)
      Custom background color for the reward.

      Format: Hex with # prefix, ideally in ALL CAPS.

      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withIsUserInputRequired

      public CustomReward withIsUserInputRequired​(java.lang.Boolean isUserInputRequired)
      Does the user need to enter information when redeeming the reward. Default: false.
      Returns:
      this.
    • withMaxPerStreamSetting

      public CustomReward withMaxPerStreamSetting​(CustomReward.MaxPerStreamSetting maxPerStreamSetting)
      Whether a maximum per stream is enabled and what the maximum is.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withMaxPerUserPerStreamSetting

      public CustomReward withMaxPerUserPerStreamSetting​(CustomReward.MaxPerUserPerStreamSetting maxPerUserPerStreamSetting)
      Whether a maximum per user per stream is enabled and what the maximum is.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withGlobalCooldownSetting

      public CustomReward withGlobalCooldownSetting​(CustomReward.GlobalCooldownSetting globalCooldownSetting)
      Whether a cooldown is enabled and what the cooldown is.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withIsPaused

      public CustomReward withIsPaused​(java.lang.Boolean isPaused)
      Whether the reward is currently paused; if true viewers can’t redeem.
      Returns:
      this.
    • withIsInStock

      public CustomReward withIsInStock​(java.lang.Boolean isInStock)
      Whether the reward is currently in stock; if false viewers can’t redeem.
      Returns:
      this.
    • withShouldRedemptionsSkipRequestQueue

      public CustomReward withShouldRedemptionsSkipRequestQueue​(java.lang.Boolean shouldRedemptionsSkipRequestQueue)
      Whether redemptions should be set to FULFILLED status immediately when redeemed and skip the request queue instead of the normal UNFULFILLED status.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withRedemptionsRedeemedCurrentStream

      public CustomReward withRedemptionsRedeemedCurrentStream​(@Nullable @Nullable java.lang.Integer redemptionsRedeemedCurrentStream)
      The number of redemptions redeemed during the current live stream. Counts against the max_per_stream_setting limit. Null if the broadcasters stream isn’t live or max_per_stream_setting isn’t enabled.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withCooldownExpiresAt

      public CustomReward withCooldownExpiresAt​(@Nullable @Nullable java.time.Instant cooldownExpiresAt)
      Timestamp of the cooldown expiration. Null if the reward isn’t on cooldown.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).