use crate::{
helix::{self, Request},
types::{self, EmoteUrlBuilder},
};
use serde_derive::{Deserialize, Serialize};
use std::borrow::Cow;
pub mod get_channel_chat_badges;
pub mod get_channel_emotes;
pub mod get_chat_settings;
pub mod get_chatters;
pub mod get_emote_sets;
pub mod get_global_chat_badges;
pub mod get_global_emotes;
pub mod get_shared_chat_session;
pub mod get_user_chat_color;
pub mod get_user_emotes;
pub mod send_a_shoutout;
pub mod send_chat_announcement;
pub mod send_chat_message;
pub mod update_chat_settings;
pub mod update_user_chat_color;
#[doc(inline)]
pub use get_channel_chat_badges::GetChannelChatBadgesRequest;
#[doc(inline)]
pub use get_channel_emotes::GetChannelEmotesRequest;
#[doc(inline)]
pub use get_chat_settings::GetChatSettingsRequest;
#[doc(inline)]
pub use get_chatters::{Chatter, GetChattersRequest};
#[doc(inline)]
pub use get_emote_sets::GetEmoteSetsRequest;
#[doc(inline)]
pub use get_global_chat_badges::GetGlobalChatBadgesRequest;
#[doc(inline)]
pub use get_global_emotes::GetGlobalEmotesRequest;
#[doc(inline)]
pub use get_shared_chat_session::{
GetSharedChatSessionRequest, SharedChatParticipant, SharedChatSession,
};
#[doc(inline)]
pub use get_user_chat_color::{GetUserChatColorRequest, UserChatColor};
#[doc(inline)]
pub use get_user_emotes::{GetUserEmotesRequest, UserEmote};
#[doc(inline)]
pub use send_a_shoutout::{SendAShoutoutRequest, SendAShoutoutResponse};
#[doc(inline)]
pub use send_chat_announcement::{
SendChatAnnouncementBody, SendChatAnnouncementRequest, SendChatAnnouncementResponse,
};
#[doc(inline)]
pub use send_chat_message::{
ChatMessageDropCode, ChatMessageDropReason, SendChatMessageBody, SendChatMessageRequest,
SendChatMessageResponse,
};
#[doc(inline)]
pub use update_chat_settings::{UpdateChatSettingsBody, UpdateChatSettingsRequest};
#[doc(inline)]
pub use update_user_chat_color::{UpdateUserChatColorRequest, UpdateUserChatColorResponse};
#[doc(inline)]
pub use crate::extra::AnnouncementColor;
#[derive(PartialEq, Eq, Deserialize, Serialize, Debug, Clone)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct BadgeSet {
pub set_id: types::BadgeSetId,
pub versions: Vec<ChatBadge>,
}
#[derive(PartialEq, Eq, Deserialize, Serialize, Debug, Clone)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct ChatBadge {
pub id: types::ChatBadgeId,
pub image_url_1x: String,
pub image_url_2x: String,
pub image_url_4x: String,
pub title: String,
pub description: String,
}
#[derive(PartialEq, Eq, Deserialize, Serialize, Debug, Clone)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct ChannelEmote {
pub id: types::EmoteId,
pub name: String,
pub images: types::Image,
#[serde(
default,
deserialize_with = "crate::deserialize_none_from_empty_string"
)]
pub tier: Option<types::SubscriptionTier>,
pub emote_type: String,
pub emote_set_id: types::EmoteSetId,
pub format: Vec<types::EmoteAnimationSetting>,
pub scale: Vec<types::EmoteScale>,
pub theme_mode: Vec<types::EmoteThemeMode>,
}
impl ChannelEmote {
pub fn url(&self) -> types::EmoteUrlBuilder<'_> { EmoteUrlBuilder::new(&self.id) }
}
#[derive(PartialEq, Eq, Deserialize, Serialize, Debug, Clone)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct GlobalEmote {
pub id: types::EmoteId,
pub name: String,
pub images: types::Image,
pub format: Vec<types::EmoteAnimationSetting>,
pub scale: Vec<types::EmoteScale>,
pub theme_mode: Vec<types::EmoteThemeMode>,
}
#[derive(PartialEq, Eq, Deserialize, Serialize, Debug, Clone)]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct ChatSettings {
pub broadcaster_id: types::UserId,
pub emote_mode: bool,
pub follower_mode: bool,
pub follower_mode_duration: Option<u64>,
pub moderator_id: Option<types::UserId>,
pub non_moderator_chat_delay: Option<bool>,
pub non_moderator_chat_delay_duration: Option<u64>,
pub slow_mode: bool,
pub slow_mode_wait_time: Option<u64>,
pub subscriber_mode: bool,
pub unique_chat_mode: bool,
}