diff --git a/CHANGELOG.md b/CHANGELOG.md index 1741e234a7..0012f0e417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ * Added function `get_follow_relationships`, `get_broadcaster_subscribers`, `get_global_emotes`, `get_channel_emotes_from_id`, `get_channel_emotes_from_login` and `get_emote_sets` to `HelixClient` * Added fields `format`, `scale`, `theme_mode` and `template` to `ChannelEmote`, `GetEmoteSets` and `GlobalEmote` * Added functions `HelixClient::req__custom` to return a specific struct/enum defined by the user. This also enables references in responses for these functions. +* Added `HypeTrainId` to relevant eventsub and helix endpoints ### Changed diff --git a/src/eventsub/channel/hypetrain/begin.rs b/src/eventsub/channel/hypetrain/begin.rs index cd5ecb4809..4bedcd6baf 100644 --- a/src/eventsub/channel/hypetrain/begin.rs +++ b/src/eventsub/channel/hypetrain/begin.rs @@ -27,6 +27,8 @@ impl EventSubscription for ChannelHypeTrainBeginV1 { #[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))] #[non_exhaustive] pub struct ChannelHypeTrainBeginV1Payload { + /// The Hype Train ID. + pub id: types::HypeTrainId, /// The requested broadcaster ID. pub broadcaster_user_id: types::UserId, /// The requested broadcaster login. @@ -71,6 +73,7 @@ fn parse_payload() { "created_at": "2019-11-16T10:11:12.123Z" }, "event": { + "id": "1b0AsbInCHZW2SQFQkCzqN07Ib2", "broadcaster_user_id": "1337", "broadcaster_user_login": "cool_user", "broadcaster_user_name": "Cool_User", diff --git a/src/eventsub/channel/hypetrain/end.rs b/src/eventsub/channel/hypetrain/end.rs index 34c79558f0..797e46db2a 100644 --- a/src/eventsub/channel/hypetrain/end.rs +++ b/src/eventsub/channel/hypetrain/end.rs @@ -27,6 +27,8 @@ impl EventSubscription for ChannelHypeTrainEndV1 { #[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))] #[non_exhaustive] pub struct ChannelHypeTrainEndV1Payload { + /// The Hype Train ID. + pub id: types::HypeTrainId, /// The requested broadcaster ID. pub broadcaster_user_id: types::UserId, /// The requested broadcaster login. @@ -68,6 +70,7 @@ fn parse_payload() { "created_at": "2019-11-16T10:11:12.123Z" }, "event": { + "id": "1b0AsbInCHZW2SQFQkCzqN07Ib2", "broadcaster_user_id": "1337", "broadcaster_user_login": "cool_user", "broadcaster_user_name": "Cool_User", diff --git a/src/eventsub/channel/hypetrain/progress.rs b/src/eventsub/channel/hypetrain/progress.rs index acc65841f6..73ebc9d40c 100644 --- a/src/eventsub/channel/hypetrain/progress.rs +++ b/src/eventsub/channel/hypetrain/progress.rs @@ -27,6 +27,8 @@ impl EventSubscription for ChannelHypeTrainProgressV1 { #[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))] #[non_exhaustive] pub struct ChannelHypeTrainProgressV1Payload { + /// The Hype Train ID. + pub id: types::HypeTrainId, /// The requested broadcaster ID. pub broadcaster_user_id: types::UserId, /// The requested broadcaster login. @@ -73,6 +75,7 @@ fn parse_payload() { "created_at": "2019-11-16T10:11:12.123Z" }, "event": { + "id": "1b0AsbInCHZW2SQFQkCzqN07Ib2", "broadcaster_user_id": "1337", "broadcaster_user_login": "cool_user", "broadcaster_user_name": "Cool_User", diff --git a/src/helix/hypetrain/get_hypetrain_events.rs b/src/helix/hypetrain/get_hypetrain_events.rs index a38c8b66cd..021ae1dcad 100644 --- a/src/helix/hypetrain/get_hypetrain_events.rs +++ b/src/helix/hypetrain/get_hypetrain_events.rs @@ -113,7 +113,7 @@ pub struct HypeTrainEventData { /// Total points contributed to the hype train. pub total: i64, /// The distinct ID of this Hype Train - pub id: String, + pub id: types::HypeTrainId, } impl Request for GetHypeTrainEventsRequest { diff --git a/src/pubsub/hypetrain.rs b/src/pubsub/hypetrain.rs index a77f34a0b4..aa9a25b4e8 100644 --- a/src/pubsub/hypetrain.rs +++ b/src/pubsub/hypetrain.rs @@ -106,6 +106,12 @@ pub struct HypeTrainEnd { pub ending_reason: EndingReason, } +/// Hype train cooldown expired +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))] +#[non_exhaustive] +pub struct HypeTrainCooldownExpiration {} + /// Hype train conductor updated #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))] @@ -199,8 +205,12 @@ pub enum HypeTrainEventsV1Reply { #[serde(rename = "hype-train-end")] HypeTrainEnd(HypeTrainEnd), /// Hype train cooldown expired + /// + /// # Note + /// + /// There is no data associated with this event. #[serde(rename = "hype-train-cooldown-expiration")] - HypeTrainCooldownExpiration(#[doc(hidden)] Option<()>), + HypeTrainCooldownExpiration(Option), /// Hype train conductor updated #[serde(rename = "hype-train-conductor-update")] HypeTrainConductorUpdate(HypeTrainConductorUpdate), diff --git a/src/types.rs b/src/types.rs index 359bdad812..1eb507b81a 100644 --- a/src/types.rs +++ b/src/types.rs @@ -666,6 +666,10 @@ pub struct EmoteSetId; #[aliri_braid::braid(serde)] pub struct StreamSegmentId; +/// A Hype Train ID +#[aliri_braid::braid(serde)] +pub struct HypeTrainId; + /// An emote index as defined by eventsub, similar to IRC `emotes` twitch tag. #[derive(PartialEq, Eq, Deserialize, Serialize, Debug, Clone)] #[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]