diff --git a/eventsub-common/src/main/java/com/github/twitch4j/eventsub/condition/ChannelFromToEventSubCondition.java b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/condition/ChannelFromToEventSubCondition.java new file mode 100644 index 000000000..213849598 --- /dev/null +++ b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/condition/ChannelFromToEventSubCondition.java @@ -0,0 +1,30 @@ +package com.github.twitch4j.eventsub.condition; + +import lombok.AccessLevel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Setter; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; + +/** + * Generic condition when a broadcaster can be either on the receiving or giving end of the event type. + */ +@Data +@Setter(AccessLevel.PRIVATE) +@SuperBuilder +@EqualsAndHashCode(callSuper = false) +@Jacksonized +public class ChannelFromToEventSubCondition extends EventSubCondition { + + /** + * The broadcaster user ID that triggered the channel event you want to get notifications for. + */ + private String fromBroadcasterUserId; + + /** + * The broadcaster user ID that received the channel event you want to get notifications for. + */ + private String toBroadcasterUserId; + +} diff --git a/eventsub-common/src/main/java/com/github/twitch4j/eventsub/condition/ChannelRaidCondition.java b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/condition/ChannelRaidCondition.java new file mode 100644 index 000000000..6a0ceb606 --- /dev/null +++ b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/condition/ChannelRaidCondition.java @@ -0,0 +1,12 @@ +package com.github.twitch4j.eventsub.condition; + +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; + +@SuperBuilder +@Jacksonized +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ChannelRaidCondition extends ChannelFromToEventSubCondition {} diff --git a/eventsub-common/src/main/java/com/github/twitch4j/eventsub/events/ChannelRaidEvent.java b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/events/ChannelRaidEvent.java new file mode 100644 index 000000000..ce7f81478 --- /dev/null +++ b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/events/ChannelRaidEvent.java @@ -0,0 +1,22 @@ +package com.github.twitch4j.eventsub.events; + +import lombok.AccessLevel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Data +@Setter(AccessLevel.PRIVATE) +@NoArgsConstructor +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class ChannelRaidEvent extends EventSubChannelFromToEvent { + + /** + * The number of viewers in the raid. + */ + private Integer viewers; + +} diff --git a/eventsub-common/src/main/java/com/github/twitch4j/eventsub/events/EventSubChannelFromToEvent.java b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/events/EventSubChannelFromToEvent.java new file mode 100644 index 000000000..eb8cf08e7 --- /dev/null +++ b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/events/EventSubChannelFromToEvent.java @@ -0,0 +1,45 @@ +package com.github.twitch4j.eventsub.events; + +import lombok.AccessLevel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Data +@Setter(AccessLevel.PRIVATE) +@NoArgsConstructor +@EqualsAndHashCode(callSuper = false) +public class EventSubChannelFromToEvent extends EventSubEvent { + + /** + * The broadcaster ID that triggered the event. + */ + private String fromBroadcasterUserId; + + /** + * The broadcaster login that triggered the event. + */ + private String fromBroadcasterUserLogin; + + /** + * The broadcaster display name that triggered the event. + */ + private String fromBroadcasterUserName; + + /** + * The broadcaster ID that received the event. + */ + private String toBroadcasterUserId; + + /** + * The broadcaster login that received the event. + */ + private String toBroadcasterUserLogin; + + /** + * The broadcaster display name that received the event. + */ + private String toBroadcasterUserName; + +} diff --git a/eventsub-common/src/main/java/com/github/twitch4j/eventsub/subscriptions/BetaChannelRaidType.java b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/subscriptions/BetaChannelRaidType.java new file mode 100644 index 000000000..c5c905afb --- /dev/null +++ b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/subscriptions/BetaChannelRaidType.java @@ -0,0 +1,37 @@ +package com.github.twitch4j.eventsub.subscriptions; + +import com.github.twitch4j.common.annotation.Unofficial; +import com.github.twitch4j.eventsub.condition.ChannelRaidCondition; +import com.github.twitch4j.eventsub.events.ChannelRaidEvent; + +/** + * A broadcaster raids another broadcaster’s channel. + *
+ * No authorization required. + *
+ * This {@link SubscriptionType} is marked as {@link Unofficial} due to Twitch indicating that it is not intended for use in production environments.
+ */
+@Unofficial
+public class BetaChannelRaidType implements SubscriptionType