use crate::{DisplayName, UserId, UserName};
manual_braid! {
pub struct RewardId;
pub struct RewardIdRef;
}
impl_extra!(RewardId, RewardIdRef);
manual_braid! {
pub struct RedemptionId;
pub struct RedemptionIdRef;
}
impl_extra!(RedemptionId, RedemptionIdRef);
manual_braid! {
pub struct PollId;
pub struct PollIdRef;
}
impl_extra!(PollId, PollIdRef);
manual_braid! {
pub struct PollChoiceId;
pub struct PollChoiceIdRef;
}
impl_extra!(PollChoiceId, PollChoiceIdRef);
manual_braid! {
pub struct PredictionId;
pub struct PredictionIdRef;
}
impl_extra!(PredictionId, PredictionIdRef);
manual_braid! {
pub struct PredictionOutcomeId;
pub struct PredictionOutcomeIdRef;
}
impl_extra!(PredictionOutcomeId, PredictionOutcomeIdRef);
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[cfg_attr(feature = "serde", serde(untagged))]
#[non_exhaustive]
pub enum Max {
MaxPerStream {
is_enabled: bool,
#[cfg_attr(feature = "serde", serde(alias = "value"))]
max_per_stream: u32,
},
MaxPerUserPerStream {
is_enabled: bool,
#[cfg_attr(feature = "serde", serde(alias = "value"))]
max_per_user_per_stream: u32,
},
}
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct GlobalCooldown {
pub is_enabled: bool,
#[cfg_attr(feature = "serde", serde(alias = "seconds"))]
pub global_cooldown_seconds: u32,
}
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct PollChoice {
pub id: String,
pub title: String,
pub votes: Option<i64>,
pub channel_points_votes: Option<i64>,
pub bits_votes: Option<i64>,
}
#[derive(PartialEq, Eq, Debug, Clone)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[cfg_attr(feature = "serde", serde(rename_all = "UPPERCASE"))]
#[non_exhaustive]
pub enum PollStatus {
#[cfg_attr(feature = "serde", serde(alias = "active"))]
Active,
#[cfg_attr(feature = "serde", serde(alias = "completed"))]
Completed,
#[cfg_attr(feature = "serde", serde(alias = "terminated"))]
Terminated,
#[cfg_attr(feature = "serde", serde(alias = "archived"))]
Archived,
#[cfg_attr(feature = "serde", serde(alias = "moderated"))]
Moderated,
#[cfg_attr(feature = "serde", serde(alias = "invalid"))]
Invalid,
}
#[derive(PartialEq, Eq, Debug, Clone)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[cfg_attr(feature = "serde", serde(rename_all = "UPPERCASE"))]
#[non_exhaustive]
pub enum PredictionStatus {
#[cfg_attr(feature = "serde", serde(alias = "resolved"))]
Resolved,
#[cfg_attr(feature = "serde", serde(alias = "active"))]
Active,
#[cfg_attr(feature = "serde", serde(alias = "canceled"))]
Canceled,
#[cfg_attr(feature = "serde", serde(alias = "locked"))]
Locked,
}
#[derive(PartialEq, Eq, Debug, Clone)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct PredictionOutcome {
pub id: String,
pub title: String,
pub users: Option<i64>,
pub channel_points: Option<i64>,
pub top_predictors: Option<Vec<PredictionTopPredictors>>,
pub color: String,
}
#[derive(PartialEq, Eq, Debug, Clone)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct PredictionTopPredictors {
#[cfg_attr(feature = "serde", serde(alias = "user_id"))]
pub id: UserId,
#[cfg_attr(feature = "serde", serde(alias = "user_name"))]
pub name: DisplayName,
#[cfg_attr(feature = "serde", serde(alias = "user_login"))]
pub login: UserName,
pub channel_points_used: i64,
pub channel_points_won: Option<i64>,
}