Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add unofficial chatrooms user pubsub topic (#515)
- Loading branch information
Showing
7 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
pubsub/src/main/java/com/github/twitch4j/pubsub/domain/AliasRestrictionUpdateData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.github.twitch4j.pubsub.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAlias; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.github.twitch4j.common.annotation.Unofficial; | ||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.Setter; | ||
import lombok.experimental.Accessors; | ||
|
||
@Data | ||
@Setter(AccessLevel.PRIVATE) | ||
@Unofficial | ||
public class AliasRestrictionUpdateData { | ||
|
||
@Accessors(fluent = true) | ||
@JsonProperty("user_is_restricted") | ||
private Boolean isRestricted; | ||
|
||
@JsonAlias("ChannelID") | ||
private String channelId; | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
pubsub/src/main/java/com/github/twitch4j/pubsub/domain/UserModerationActionData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.github.twitch4j.pubsub.domain; | ||
|
||
import com.github.twitch4j.common.annotation.Unofficial; | ||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.Setter; | ||
|
||
@Data | ||
@Setter(AccessLevel.PRIVATE) | ||
@Unofficial | ||
public class UserModerationActionData { | ||
|
||
private String action; | ||
private String targetId; | ||
private String channelId; | ||
|
||
public boolean isBan() { | ||
return "ban".equals(action); | ||
} | ||
|
||
public boolean isUnban() { | ||
return "unban".equals(action); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
pubsub/src/main/java/com/github/twitch4j/pubsub/events/AliasRestrictionUpdateEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.github.twitch4j.pubsub.events; | ||
|
||
import com.github.twitch4j.common.events.TwitchEvent; | ||
import com.github.twitch4j.pubsub.domain.AliasRestrictionUpdateData; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Value; | ||
|
||
@Value | ||
@EqualsAndHashCode(callSuper = false) | ||
public class AliasRestrictionUpdateEvent extends TwitchEvent { | ||
String userId; | ||
AliasRestrictionUpdateData data; | ||
} |
13 changes: 13 additions & 0 deletions
13
pubsub/src/main/java/com/github/twitch4j/pubsub/events/UserModerationActionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.github.twitch4j.pubsub.events; | ||
|
||
import com.github.twitch4j.common.events.TwitchEvent; | ||
import com.github.twitch4j.pubsub.domain.UserModerationActionData; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Value; | ||
|
||
@Value | ||
@EqualsAndHashCode(callSuper = false) | ||
public class UserModerationActionEvent extends TwitchEvent { | ||
String userId; | ||
UserModerationActionData data; | ||
} |