Enum twitch_api::eventsub::Event
source · [−]pub enum Event {
Show 33 variants
ChannelUpdateV1(Payload<ChannelUpdateV1>),
ChannelFollowV1(Payload<ChannelFollowV1>),
ChannelSubscribeV1(Payload<ChannelSubscribeV1>),
ChannelCheerV1(Payload<ChannelCheerV1>),
ChannelBanV1(Payload<ChannelBanV1>),
ChannelUnbanV1(Payload<ChannelUnbanV1>),
ChannelPointsCustomRewardAddV1(Payload<ChannelPointsCustomRewardAddV1>),
ChannelPointsCustomRewardUpdateV1(Payload<ChannelPointsCustomRewardUpdateV1>),
ChannelPointsCustomRewardRemoveV1(Payload<ChannelPointsCustomRewardRemoveV1>),
ChannelPointsCustomRewardRedemptionAddV1(Payload<ChannelPointsCustomRewardRedemptionAddV1>),
ChannelPointsCustomRewardRedemptionUpdateV1(Payload<ChannelPointsCustomRewardRedemptionUpdateV1>),
ChannelPollBeginV1(Payload<ChannelPollBeginV1>),
ChannelPollProgressV1(Payload<ChannelPollProgressV1>),
ChannelPollEndV1(Payload<ChannelPollEndV1>),
ChannelPredictionBeginV1(Payload<ChannelPredictionBeginV1>),
ChannelPredictionProgressV1(Payload<ChannelPredictionProgressV1>),
ChannelPredictionLockV1(Payload<ChannelPredictionLockV1>),
ChannelPredictionEndV1(Payload<ChannelPredictionEndV1>),
ChannelGoalBeginV1(Payload<ChannelGoalBeginV1>),
ChannelGoalProgressV1(Payload<ChannelGoalProgressV1>),
ChannelGoalEndV1(Payload<ChannelGoalEndV1>),
ChannelHypeTrainBeginV1(Payload<ChannelHypeTrainBeginV1>),
ChannelHypeTrainProgressV1(Payload<ChannelHypeTrainProgressV1>),
ChannelHypeTrainEndV1(Payload<ChannelHypeTrainEndV1>),
StreamOnlineV1(Payload<StreamOnlineV1>),
StreamOfflineV1(Payload<StreamOfflineV1>),
UserUpdateV1(Payload<UserUpdateV1>),
UserAuthorizationGrantV1(Payload<UserAuthorizationGrantV1>),
UserAuthorizationRevokeV1(Payload<UserAuthorizationRevokeV1>),
ChannelRaidV1(Payload<ChannelRaidV1>),
ChannelSubscriptionEndV1(Payload<ChannelSubscriptionEndV1>),
ChannelSubscriptionGiftV1(Payload<ChannelSubscriptionGiftV1>),
ChannelSubscriptionMessageV1(Payload<ChannelSubscriptionMessageV1>),
}
eventsub
only.Expand description
A notification with an event payload. Enumerates all possible Payload
s
Parse with Event::parse
or parse the whole http request your server receives with Payload::parse_http
Variants
ChannelUpdateV1(Payload<ChannelUpdateV1>)
Channel Update V1 Event
ChannelFollowV1(Payload<ChannelFollowV1>)
Channel Follow V1 Event
ChannelSubscribeV1(Payload<ChannelSubscribeV1>)
Channel Subscribe V1 Event
ChannelCheerV1(Payload<ChannelCheerV1>)
Channel Cheer V1 Event
ChannelBanV1(Payload<ChannelBanV1>)
Channel Ban V1 Event
ChannelUnbanV1(Payload<ChannelUnbanV1>)
Channel Unban V1 Event
ChannelPointsCustomRewardAddV1(Payload<ChannelPointsCustomRewardAddV1>)
Channel Points Custom Reward Add V1 Event
ChannelPointsCustomRewardUpdateV1(Payload<ChannelPointsCustomRewardUpdateV1>)
Channel Points Custom Reward Update V1 Event
ChannelPointsCustomRewardRemoveV1(Payload<ChannelPointsCustomRewardRemoveV1>)
Channel Points Custom Reward Remove V1 Event
ChannelPointsCustomRewardRedemptionAddV1(Payload<ChannelPointsCustomRewardRedemptionAddV1>)
Channel Points Custom Reward Redemption Add V1 Event
ChannelPointsCustomRewardRedemptionUpdateV1(Payload<ChannelPointsCustomRewardRedemptionUpdateV1>)
Channel Points Custom Reward Redemption Update V1 Event
ChannelPollBeginV1(Payload<ChannelPollBeginV1>)
Channel Poll Begin V1 Event
ChannelPollProgressV1(Payload<ChannelPollProgressV1>)
Channel Poll Progress V1 Event
ChannelPollEndV1(Payload<ChannelPollEndV1>)
Channel Poll End V1 Event
ChannelPredictionBeginV1(Payload<ChannelPredictionBeginV1>)
Channel Prediction Begin V1 Event
ChannelPredictionProgressV1(Payload<ChannelPredictionProgressV1>)
Channel Prediction Progress V1 Event
ChannelPredictionLockV1(Payload<ChannelPredictionLockV1>)
Channel Prediction Lock V1 Event
ChannelPredictionEndV1(Payload<ChannelPredictionEndV1>)
Channel Prediction End V1 Event
ChannelGoalBeginV1(Payload<ChannelGoalBeginV1>)
Channel Goal Begin V1 Event
ChannelGoalProgressV1(Payload<ChannelGoalProgressV1>)
Channel Goal Progress V1 Event
ChannelGoalEndV1(Payload<ChannelGoalEndV1>)
Channel Goal End V1 Event
ChannelHypeTrainBeginV1(Payload<ChannelHypeTrainBeginV1>)
Channel Hype Train Begin V1 Event
ChannelHypeTrainProgressV1(Payload<ChannelHypeTrainProgressV1>)
Channel Hype Train Progress V1 Event
ChannelHypeTrainEndV1(Payload<ChannelHypeTrainEndV1>)
Channel Hype Train End V1 Event
StreamOnlineV1(Payload<StreamOnlineV1>)
StreamOnline V1 Event
StreamOfflineV1(Payload<StreamOfflineV1>)
StreamOffline V1 Event
UserUpdateV1(Payload<UserUpdateV1>)
User Update V1 Event
UserAuthorizationGrantV1(Payload<UserAuthorizationGrantV1>)
User Authorization Grant V1 Event
UserAuthorizationRevokeV1(Payload<UserAuthorizationRevokeV1>)
User Authorization Revoke V1 Event
ChannelRaidV1(Payload<ChannelRaidV1>)
Channel Raid V1 Event
ChannelSubscriptionEndV1(Payload<ChannelSubscriptionEndV1>)
Channel Subscription End V1 Event
ChannelSubscriptionGiftV1(Payload<ChannelSubscriptionGiftV1>)
Channel Subscription Gift V1 Event
ChannelSubscriptionMessageV1(Payload<ChannelSubscriptionMessageV1>)
Channel Subscription Message V1 Event
Implementations
sourceimpl Event
impl Event
sourcepub fn parse(source: &str) -> Result<Event, PayloadParseError>
pub fn parse(source: &str) -> Result<Event, PayloadParseError>
Parse string slice as an Event
. Consider using Event::parse_http
instead.
sourcepub fn is_notification(&self) -> bool
pub fn is_notification(&self) -> bool
Returns true
if the message in the Payload
is Revocation
.
sourcepub fn is_revocation(&self) -> bool
pub fn is_revocation(&self) -> bool
Returns true
if the message in the Payload
is Revocation
.
sourcepub fn is_verification_request(&self) -> bool
pub fn is_verification_request(&self) -> bool
Returns true
if the message in the Payload
is Revocation
.
sourcepub fn get_verification_request(&self) -> Option<&VerificationRequest>
pub fn get_verification_request(&self) -> Option<&VerificationRequest>
If this event is a VerificationRequest
, return the VerificationRequest
message, including the message.
sourcepub fn subscription(&self) -> Result<EventSubSubscription, Error>
pub fn subscription(&self) -> Result<EventSubSubscription, Error>
Make a EventSubSubscription
from this notification.
sourcepub fn verify_payload<B>(request: &Request<B>, secret: &[u8]) -> boolwhere
B: AsRef<[u8]>,
Available on crate feature hmac
only.
pub fn verify_payload<B>(request: &Request<B>, secret: &[u8]) -> boolwhere
B: AsRef<[u8]>,
hmac
only.Verify that this event is authentic using HMAC-SHA256
.
HMAC key is secret
, HMAC message is a concatenation of Twitch-Eventsub-Message-Id
header, Twitch-Eventsub-Message-Timestamp
header and the request body.
HMAC signature is Twitch-Eventsub-Message-Signature
header.