Class SendPubSubMessageInput

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

public class SendPubSubMessageInput extends Object
  • Field Details

    • BROADCAST_TARGET

      public static final String BROADCAST_TARGET
      Target a specific public channel.
      See Also:
    • GLOBAL_TARGET

      public static final String GLOBAL_TARGET
      Target all channels that have the extension active.
      See Also:
    • WHISPER_TARGET_PREFIX

      public static final String WHISPER_TARGET_PREFIX
      Target a user via private message.
      See Also:
  • Constructor Details

    • SendPubSubMessageInput

      public SendPubSubMessageInput()
    • SendPubSubMessageInput

      public SendPubSubMessageInput(List<String> targets, @Nullable @Nullable String broadcasterId, boolean globalBroadcast, String message)
  • Method Details

    • validate

      public boolean validate()
      Returns:
      whether the constructed input complies with twitch requirements.
    • builder

    • toBuilder

    • withTargets

      public SendPubSubMessageInput withTargets(List<String> targets)
      Strings for valid PubSub targets. Valid values: "broadcast", "global", "whisper-<user-id>"
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withBroadcasterId

      public SendPubSubMessageInput withBroadcasterId(@Nullable @Nullable String broadcasterId)
      ID of the broadcaster receiving the payload. This is not required if is_global_broadcast is set to true.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withGlobalBroadcast

      public SendPubSubMessageInput withGlobalBroadcast(boolean globalBroadcast)
      Indicates if the message should be sent to all channels where your Extension is active.

      Default: false.

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

      public SendPubSubMessageInput withMessage(String message)
      String-encoded JSON message to be sent.

      Must not exceed 5 KB in size.

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

      public List<String> getTargets()
      Strings for valid PubSub targets. Valid values: "broadcast", "global", "whisper-<user-id>"
    • getBroadcasterId

      @Nullable public @Nullable String getBroadcasterId()
      ID of the broadcaster receiving the payload. This is not required if is_global_broadcast is set to true.
    • isGlobalBroadcast

      public boolean isGlobalBroadcast()
      Indicates if the message should be sent to all channels where your Extension is active.

      Default: false.

    • getMessage

      public String getMessage()
      String-encoded JSON message to be sent.

      Must not exceed 5 KB in size.

    • equals

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

      protected boolean canEqual(Object other)
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object