Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add new pubsub hype fields #577

Merged
merged 1 commit into from May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -371,7 +371,7 @@ protected void onConnected() {
// 3) allow other threads to update subscribedTopics again
// 4) send unlisten requests for the old elements of subscribedTopics (optional?)
// 5) call listenOnTopic for each new PubSubRequest
subscribedTopics.forEach(topic -> queueRequest(topic));
subscribedTopics.forEach(this::queueRequest);
}

protected void onTextMessage(String text) {
Expand Down Expand Up @@ -594,6 +594,9 @@ protected void onTextMessage(String text) {
case "hype-train-cooldown-expiration":
eventManager.publish(new HypeTrainCooldownExpirationEvent(lastTopicIdentifier));
break;
case "last-x-experiment-event":
// ignore for now (experiment is not publicly deployed)
break;
default:
log.warn("Unparsable Message: " + message.getType() + "|" + message.getData());
break;
Expand Down
@@ -1,8 +1,10 @@
package com.github.twitch4j.pubsub.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.github.twitch4j.common.util.MilliInstantDeserializer;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.Instant;

Expand All @@ -11,4 +13,7 @@ public class HypeLevelUp {
@JsonDeserialize(using = MilliInstantDeserializer.class)
private Instant timeToExpire;
private HypeTrainProgress progress;
@Accessors(fluent = true)
@JsonProperty("is_boost_train")
private Boolean isBoostTrain;
}
@@ -1,6 +1,8 @@
package com.github.twitch4j.pubsub.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
public class HypeProgression {
Expand All @@ -10,4 +12,7 @@ public class HypeProgression {
private String source;
private Integer quantity;
private HypeTrainProgress progress;
@Accessors(fluent = true)
@JsonProperty("is_boost_train")
private Boolean isBoostTrain;
}
@@ -1,8 +1,10 @@
package com.github.twitch4j.pubsub.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.github.twitch4j.common.util.MilliInstantDeserializer;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.Instant;

Expand All @@ -11,4 +13,7 @@ public class HypeTrainEnd {
@JsonDeserialize(using = MilliInstantDeserializer.class)
private Instant endedAt;
private String endingReason;
@Accessors(fluent = true)
@JsonProperty("is_boost_train")
private Boolean isBoostTrain;
}
Expand Up @@ -9,4 +9,5 @@ public class HypeTrainLevel {
private Integer value;
private Integer goal;
private List<HypeTrainReward> rewards;
private Integer impressions;
}
@@ -1,8 +1,10 @@
package com.github.twitch4j.pubsub.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.github.twitch4j.common.util.MilliInstantDeserializer;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.Instant;

Expand All @@ -19,4 +21,7 @@ public class HypeTrainStart {
private Instant expiresAt;
@JsonDeserialize(using = MilliInstantDeserializer.class)
private Instant updatedAt;
@Accessors(fluent = true)
@JsonProperty("is_boost_train")
private Boolean isBoostTrain;
}