use std::collections::HashSet;
use super::Scope;
pub trait AdScopes {
fn ads_api(&mut self) -> &mut Self;
fn start_commercial(&mut self) -> &mut Self;
fn get_ad_schedule(&mut self) -> &mut Self;
fn snooze_next_ad(&mut self) -> &mut Self;
}
pub trait AnalyticScopes {
fn analytics_api(&mut self) -> &mut Self;
fn get_extension_analytics(&mut self) -> &mut Self;
fn get_game_analytics(&mut self) -> &mut Self;
}
pub trait BitScopes {
fn bits_api(&mut self) -> &mut Self;
fn get_bits_leaderboard(&mut self) -> &mut Self;
fn get_cheermotes(&mut self) -> &mut Self;
fn get_extension_transactions(&mut self) -> &mut Self;
}
pub trait ChannelScopes {
fn channel_api(&mut self) -> &mut Self;
fn get_channel_info(&mut self) -> &mut Self;
fn modify_channel_info(&mut self) -> &mut Self;
fn get_channel_editors(&mut self) -> &mut Self;
fn get_followed_channels(&mut self) -> &mut Self;
fn get_channel_followers(&mut self) -> &mut Self;
fn channel_ban_unban(&mut self) -> &mut Self;
}
pub trait ChannelPointScopes {
fn channel_points_api(&mut self) -> &mut Self;
fn create_custom_reward(&mut self) -> &mut Self;
fn delete_custom_reward(&mut self) -> &mut Self;
fn get_custom_reward(&mut self) -> &mut Self;
fn get_custom_reward_redemption(&mut self) -> &mut Self;
fn update_custom_reward(&mut self) -> &mut Self;
fn update_redemption_status(&mut self) -> &mut Self;
}
pub trait CharityScopes {
fn charity_api(&mut self) -> &mut Self;
fn get_charity_campaign(&mut self) -> &mut Self;
fn get_charity_campaign_donations(&mut self) -> &mut Self;
}
pub trait ChatScopes {
fn chat_api(&mut self) -> &mut Self;
fn get_chatters(&mut self) -> &mut Self;
fn get_channel_emotes(&mut self) -> &mut Self;
fn get_global_emotes(&mut self) -> &mut Self;
fn get_emote_sets(&mut self) -> &mut Self;
fn get_channel_chat_badges(&mut self) -> &mut Self;
fn get_global_chat_badges(&mut self) -> &mut Self;
fn get_chat_settings(&mut self) -> &mut Self;
fn get_shard_chat_session(&mut self) -> &mut Self;
fn get_user_emotes(&mut self) -> &mut Self;
fn update_chat_settings(&mut self) -> &mut Self;
fn send_chat_announcement(&mut self) -> &mut Self;
fn send_shoutout(&mut self) -> &mut Self;
fn send_chat_message(&mut self) -> &mut Self;
fn get_user_chat_color(&mut self) -> &mut Self;
fn update_user_chat_color(&mut self) -> &mut Self;
}
pub trait ClipScopes {
fn clips_api(&mut self) -> &mut Self;
fn create_clip(&mut self) -> &mut Self;
fn get_clip(&mut self) -> &mut Self;
}
pub trait ConduitScopes {
fn conduits_api(&mut self) -> &mut Self;
fn get_conduits(&mut self) -> &mut Self;
fn create_conduits(&mut self) -> &mut Self;
fn update_conduits(&mut self) -> &mut Self;
fn delete_conduit(&mut self) -> &mut Self;
fn get_conduit_shards(&mut self) -> &mut Self;
fn update_conduit_shards(&mut self) -> &mut Self;
}
pub trait CCLScopes {
fn ccl_api(&mut self) -> &mut Self;
fn get_content_classification_labels(&mut self) -> &mut Self;
}
pub trait EntitlementScopes {
fn entitlements_api(&mut self) -> &mut Self;
fn get_drops_entitlements(&mut self) -> &mut Self;
fn update_drops_entitlements(&mut self) -> &mut Self;
}
pub trait ExtensionScopes {
fn extensions_api(&mut self) -> &mut Self;
fn get_extension_configuration_segment(&mut self) -> &mut Self;
fn set_extension_configuration_segment(&mut self) -> &mut Self;
fn set_extension_required_configuration(&mut self) -> &mut Self;
fn send_extension_pubsub_message(&mut self) -> &mut Self;
fn get_extension_live_channels(&mut self) -> &mut Self;
fn get_extension_secrets(&mut self) -> &mut Self;
fn create_extension_secret(&mut self) -> &mut Self;
fn send_extension_chat_message(&mut self) -> &mut Self;
fn get_extensions(&mut self) -> &mut Self;
fn get_released_extensions(&mut self) -> &mut Self;
fn get_extension_bits_products(&mut self) -> &mut Self;
fn update_extension_bits_product(&mut self) -> &mut Self;
}
pub trait EventSubScopes {
fn eventsub_api(&mut self) -> &mut Self;
fn create_eventsub(&mut self) -> &mut Self;
fn delete_eventsub(&mut self) -> &mut Self;
fn get_eventsub(&mut self) -> &mut Self;
}
pub trait GameScopes {
fn games_api(&mut self) -> &mut Self;
fn get_top_games(&mut self) -> &mut Self;
fn get_games(&mut self) -> &mut Self;
}
pub trait GoalScopes {
fn goals_api(&mut self) -> &mut Self;
fn get_creator_goals(&mut self) -> &mut Self;
}
pub trait GuestStarScopes {
fn guest_star_api(&mut self) -> &mut Self;
fn get_channel_guest_star_setings(&mut self) -> &mut Self;
fn update_channel_guest_star_setings(&mut self) -> &mut Self;
fn get_guest_star_session(&mut self) -> &mut Self;
fn create_guest_star_session(&mut self) -> &mut Self;
fn end_guest_star_session(&mut self) -> &mut Self;
fn get_guest_star_invites(&mut self) -> &mut Self;
fn send_guest_star_invite(&mut self) -> &mut Self;
fn delete_guest_star_invite(&mut self) -> &mut Self;
fn assign_guest_star_slot(&mut self) -> &mut Self;
fn update_guest_star_slot(&mut self) -> &mut Self;
fn delete_guest_star_slot(&mut self) -> &mut Self;
fn update_guest_star_slot_settings(&mut self) -> &mut Self;
}
pub trait HypeTrainScopes {
fn hype_train_api(&mut self) -> &mut Self;
fn get_hype_train_events(&mut self) -> &mut Self;
fn get_hype_train_status(&mut self) -> &mut Self;
}
pub trait ModerationScopes {
fn moderation_api(&mut self) -> &mut Self;
fn check_automod_status(&mut self) -> &mut Self;
fn manage_held_automod_messages(&mut self) -> &mut Self;
fn get_automod_settings(&mut self) -> &mut Self;
fn update_automod_settings(&mut self) -> &mut Self;
fn get_banned_users(&mut self) -> &mut Self;
fn ban_user(&mut self) -> &mut Self;
fn unban_user(&mut self) -> &mut Self;
fn get_unban_requests(&mut self) -> &mut Self;
fn resolve_unban_requests(&mut self) -> &mut Self;
fn get_blocked_terms(&mut self) -> &mut Self;
fn add_blocked_term(&mut self) -> &mut Self;
fn remove_blocked_term(&mut self) -> &mut Self;
fn delete_chat_messages(&mut self) -> &mut Self;
fn get_moderated_channels(&mut self) -> &mut Self;
fn get_moderators(&mut self) -> &mut Self;
fn add_channel_moderator(&mut self) -> &mut Self;
fn remove_channel_moderator(&mut self) -> &mut Self;
fn get_vips(&mut self) -> &mut Self;
fn add_channel_vip(&mut self) -> &mut Self;
fn remove_channel_vip(&mut self) -> &mut Self;
fn update_shield_mode_status(&mut self) -> &mut Self;
fn get_shield_mode_status(&mut self) -> &mut Self;
fn warn_chat_user(&mut self) -> &mut Self;
fn add_suspicious_status_to_chat_user(&mut self) -> &mut Self;
}
pub trait PollScopes {
fn polls_api(&mut self) -> &mut Self;
fn get_polls(&mut self) -> &mut Self;
fn create_poll(&mut self) -> &mut Self;
fn end_poll(&mut self) -> &mut Self;
}
pub trait PredictionScopes {
fn predictions_api(&mut self) -> &mut Self;
fn get_predictions(&mut self) -> &mut Self;
fn create_prediction(&mut self) -> &mut Self;
fn end_prediction(&mut self) -> &mut Self;
}
pub trait RaidScopes {
fn raids_api(&mut self) -> &mut Self;
fn start_raid(&mut self) -> &mut Self;
fn cancel_raid(&mut self) -> &mut Self;
}
pub trait ScheduleScopes {
fn schedule_api(&mut self) -> &mut Self;
fn get_channel_stream_schedule(&mut self) -> &mut Self;
fn get_channel_icalendar(&mut self) -> &mut Self;
fn update_channel_stream_schedule(&mut self) -> &mut Self;
fn create_channel_stream_schedule_segment(&mut self) -> &mut Self;
fn update_channel_stream_schedule_segment(&mut self) -> &mut Self;
fn delete_channel_stream_schedule_segment(&mut self) -> &mut Self;
}
pub trait SearchScopes {
fn search_api(&mut self) -> &mut Self;
fn search_categories(&mut self) -> &mut Self;
fn channels_search(&mut self) -> &mut Self;
}
pub trait StreamScopes {
fn streams_api(&mut self) -> &mut Self;
fn get_stream_key(&mut self) -> &mut Self;
fn get_streams(&mut self) -> &mut Self;
fn get_followed_streams(&mut self) -> &mut Self;
fn create_stream_marker(&mut self) -> &mut Self;
fn get_stream_markers(&mut self) -> &mut Self;
}
pub trait SubscriptionScopes {
fn subscriptions_api(&mut self) -> &mut Self;
fn get_broadcaster_subscriptions(&mut self) -> &mut Self;
fn check_user_subscription(&mut self) -> &mut Self;
}
pub trait TagScopes {
fn tags_api(&mut self) -> &mut Self;
fn get_all_stream_tags(&mut self) -> &mut Self;
fn get_stream_tags(&mut self) -> &mut Self;
}
pub trait TeamScopes {
fn teams_api(&mut self) -> &mut Self;
fn get_channel_teams(&mut self) -> &mut Self;
fn get_teams(&mut self) -> &mut Self;
}
pub trait UserScopes {
fn users_api(&mut self) -> &mut Self;
fn get_users(&mut self) -> &mut Self;
fn update_user(&mut self) -> &mut Self;
fn get_user_block_list(&mut self) -> &mut Self;
fn block_unblock_user(&mut self) -> &mut Self;
fn get_user_active_extensions(&mut self) -> &mut Self;
fn update_user_extensions(&mut self) -> &mut Self;
}
pub trait VideoScopes {
fn videos_api(&mut self) -> &mut Self;
fn get_videos(&mut self) -> &mut Self;
fn delete_videos(&mut self) -> &mut Self;
}
pub trait WhisperScopes {
fn whisper_api(&mut self) -> &mut Self;
fn send_whisper(&mut self) -> &mut Self;
}
pub trait IRCScopes {
fn irc_all(&mut self) -> &mut Self;
fn irc_chat_edit(&mut self) -> &mut Self;
fn irc_chat_read(&mut self) -> &mut Self;
}
pub trait ChatbotScopes {
fn cloud_chatbot_account(&mut self) -> &mut Self;
fn cloud_chatbot_broadcaster(&mut self) -> &mut Self;
fn installed_chatbot(&mut self) -> &mut Self;
fn chat_client(&mut self) -> &mut Self;
}
impl AdScopes for ScopesMut<'_> {
fn ads_api(&mut self) -> &mut Self {
self.start_commercial().get_ad_schedule().snooze_next_ad()
}
fn start_commercial(&mut self) -> &mut Self {
self.push(Scope::ChannelEditCommercial);
self
}
fn get_ad_schedule(&mut self) -> &mut Self {
self.push(Scope::ChannelReadAds);
self
}
fn snooze_next_ad(&mut self) -> &mut Self {
self.push(Scope::ChannelManageAds);
self
}
}
impl AnalyticScopes for ScopesMut<'_> {
fn analytics_api(&mut self) -> &mut Self {
self.get_extension_analytics().get_game_analytics()
}
fn get_extension_analytics(&mut self) -> &mut Self {
self.push(Scope::AnalyticsReadExtensions);
self
}
fn get_game_analytics(&mut self) -> &mut Self {
self.push(Scope::AnalyticsReadGames);
self
}
}
impl BitScopes for ScopesMut<'_> {
fn bits_api(&mut self) -> &mut Self {
self.get_bits_leaderboard()
.get_cheermotes()
.get_extension_transactions()
}
fn get_bits_leaderboard(&mut self) -> &mut Self {
self.push(Scope::BitsRead);
self
}
fn get_cheermotes(&mut self) -> &mut Self {
self
}
fn get_extension_transactions(&mut self) -> &mut Self {
self
}
}
impl ChannelScopes for ScopesMut<'_> {
fn channel_api(&mut self) -> &mut Self {
self.get_channel_info()
.modify_channel_info()
.get_channel_editors()
.get_followed_channels()
.get_channel_followers()
}
fn get_channel_info(&mut self) -> &mut Self {
self
}
fn modify_channel_info(&mut self) -> &mut Self {
self.push(Scope::ChannelManageBroadcast);
self
}
fn get_channel_editors(&mut self) -> &mut Self {
self.push(Scope::ChannelReadEditors);
self
}
fn get_followed_channels(&mut self) -> &mut Self {
self.push(Scope::UserReadFollows);
self
}
fn get_channel_followers(&mut self) -> &mut Self {
self.push(Scope::ModeratorReadFollowers);
self
}
fn channel_ban_unban(&mut self) -> &mut Self {
self.push(Scope::ChannelModerate);
self
}
}
impl ChannelPointScopes for ScopesMut<'_> {
fn channel_points_api(&mut self) -> &mut Self {
self.create_custom_reward()
.delete_custom_reward()
.get_custom_reward()
.get_custom_reward_redemption()
.update_custom_reward()
.update_redemption_status()
}
fn create_custom_reward(&mut self) -> &mut Self {
self.push(Scope::ChannelManageRedemptions);
self
}
fn delete_custom_reward(&mut self) -> &mut Self {
self.push(Scope::ChannelManageRedemptions);
self
}
fn get_custom_reward(&mut self) -> &mut Self {
self.push(Scope::ChannelReadRedemptions);
self
}
fn get_custom_reward_redemption(&mut self) -> &mut Self {
self.push(Scope::ChannelReadRedemptions);
self
}
fn update_custom_reward(&mut self) -> &mut Self {
self.push(Scope::ChannelManageRedemptions);
self
}
fn update_redemption_status(&mut self) -> &mut Self {
self.push(Scope::ChannelManageRedemptions);
self
}
}
impl CharityScopes for ScopesMut<'_> {
fn charity_api(&mut self) -> &mut Self {
self.get_charity_campaign().get_charity_campaign_donations()
}
fn get_charity_campaign(&mut self) -> &mut Self {
self.push(Scope::ChannelReadCharity);
self
}
fn get_charity_campaign_donations(&mut self) -> &mut Self {
self.push(Scope::ChannelReadCharity);
self
}
}
impl ChatScopes for ScopesMut<'_> {
fn chat_api(&mut self) -> &mut Self {
self.get_chatters()
.get_channel_emotes()
.get_global_emotes()
.get_channel_chat_badges()
.get_global_chat_badges()
.get_chat_settings()
.get_shard_chat_session()
.get_user_emotes()
.update_chat_settings()
.send_chat_announcement()
.send_shoutout()
.send_chat_message()
.get_user_chat_color()
.update_user_chat_color()
}
fn get_chatters(&mut self) -> &mut Self {
self.push(Scope::ModeratorReadChatters);
self
}
fn get_channel_emotes(&mut self) -> &mut Self {
self
}
fn get_global_emotes(&mut self) -> &mut Self {
self
}
fn get_emote_sets(&mut self) -> &mut Self {
self
}
fn get_channel_chat_badges(&mut self) -> &mut Self {
self
}
fn get_global_chat_badges(&mut self) -> &mut Self {
self
}
fn get_chat_settings(&mut self) -> &mut Self {
self
}
fn get_shard_chat_session(&mut self) -> &mut Self {
self
}
fn get_user_emotes(&mut self) -> &mut Self {
self.push(Scope::UserReadEmotes);
self
}
fn update_chat_settings(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageChatSettings);
self
}
fn send_chat_announcement(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageAnnouncements);
self
}
fn send_shoutout(&mut self) -> &mut Self {
self
}
fn send_chat_message(&mut self) -> &mut Self {
self.push(Scope::UserWriteChat);
self
}
fn get_user_chat_color(&mut self) -> &mut Self {
self
}
fn update_user_chat_color(&mut self) -> &mut Self {
self.push(Scope::UserManageChatColor);
self
}
}
impl ClipScopes for ScopesMut<'_> {
fn clips_api(&mut self) -> &mut Self {
self.create_clip().get_clip()
}
fn create_clip(&mut self) -> &mut Self {
self.push(Scope::ClipsEdit);
self
}
fn get_clip(&mut self) -> &mut Self {
self
}
}
impl ConduitScopes for ScopesMut<'_> {
fn conduits_api(&mut self) -> &mut Self {
self.get_conduits()
.create_conduits()
.update_conduits()
.delete_conduit()
.get_conduit_shards()
.update_conduit_shards()
}
fn get_conduits(&mut self) -> &mut Self {
self
}
fn create_conduits(&mut self) -> &mut Self {
self
}
fn update_conduits(&mut self) -> &mut Self {
self
}
fn delete_conduit(&mut self) -> &mut Self {
self
}
fn get_conduit_shards(&mut self) -> &mut Self {
self
}
fn update_conduit_shards(&mut self) -> &mut Self {
self
}
}
impl CCLScopes for ScopesMut<'_> {
fn ccl_api(&mut self) -> &mut Self {
self.get_content_classification_labels()
}
fn get_content_classification_labels(&mut self) -> &mut Self {
self
}
}
impl EntitlementScopes for ScopesMut<'_> {
fn entitlements_api(&mut self) -> &mut Self {
self.get_drops_entitlements().update_drops_entitlements()
}
fn get_drops_entitlements(&mut self) -> &mut Self {
self
}
fn update_drops_entitlements(&mut self) -> &mut Self {
self
}
}
impl ExtensionScopes for ScopesMut<'_> {
fn extensions_api(&mut self) -> &mut Self {
self.get_extension_configuration_segment()
.set_extension_configuration_segment()
.set_extension_required_configuration()
.send_extension_pubsub_message()
.get_extension_live_channels()
.get_extension_secrets()
.create_extension_secret()
.send_extension_chat_message()
.get_extensions()
.get_released_extensions()
.get_extension_bits_products()
.update_extension_bits_product()
}
fn get_extension_configuration_segment(&mut self) -> &mut Self {
self
}
fn set_extension_configuration_segment(&mut self) -> &mut Self {
self
}
fn set_extension_required_configuration(&mut self) -> &mut Self {
self
}
fn send_extension_pubsub_message(&mut self) -> &mut Self {
self
}
fn get_extension_live_channels(&mut self) -> &mut Self {
self
}
fn get_extension_secrets(&mut self) -> &mut Self {
self
}
fn create_extension_secret(&mut self) -> &mut Self {
self
}
fn send_extension_chat_message(&mut self) -> &mut Self {
self
}
fn get_extensions(&mut self) -> &mut Self {
self
}
fn get_released_extensions(&mut self) -> &mut Self {
self
}
fn get_extension_bits_products(&mut self) -> &mut Self {
self
}
fn update_extension_bits_product(&mut self) -> &mut Self {
self
}
}
impl EventSubScopes for ScopesMut<'_> {
fn eventsub_api(&mut self) -> &mut Self {
self.create_eventsub().delete_eventsub().get_eventsub()
}
fn create_eventsub(&mut self) -> &mut Self {
self
}
fn delete_eventsub(&mut self) -> &mut Self {
self
}
fn get_eventsub(&mut self) -> &mut Self {
self
}
}
impl GameScopes for ScopesMut<'_> {
fn games_api(&mut self) -> &mut Self {
self.get_top_games().get_games()
}
fn get_top_games(&mut self) -> &mut Self {
self
}
fn get_games(&mut self) -> &mut Self {
self
}
}
impl GoalScopes for ScopesMut<'_> {
fn goals_api(&mut self) -> &mut Self {
self.get_creator_goals()
}
fn get_creator_goals(&mut self) -> &mut Self {
self.push(Scope::ChannelReadGoals);
self
}
}
impl GuestStarScopes for ScopesMut<'_> {
fn guest_star_api(&mut self) -> &mut Self {
self.get_channel_guest_star_setings()
.update_channel_guest_star_setings()
.get_guest_star_session()
.create_guest_star_session()
.end_guest_star_session()
.get_guest_star_invites()
.send_guest_star_invite()
.delete_guest_star_invite()
.assign_guest_star_slot()
.update_guest_star_slot()
.delete_guest_star_slot()
.update_guest_star_slot_settings()
}
fn get_channel_guest_star_setings(&mut self) -> &mut Self {
self.extend([
Scope::ChannelReadGuestStar,
Scope::ChannelManageGuestStar,
Scope::ModeratorReadGuestStar,
]);
self
}
fn update_channel_guest_star_setings(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
fn get_guest_star_session(&mut self) -> &mut Self {
self.extend([
Scope::ChannelReadGuestStar,
Scope::ChannelManageGuestStar,
Scope::ModeratorReadGuestStar,
]);
self
}
fn create_guest_star_session(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
fn end_guest_star_session(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
fn get_guest_star_invites(&mut self) -> &mut Self {
self.extend([
Scope::ChannelReadGuestStar,
Scope::ChannelManageGuestStar,
Scope::ModeratorReadGuestStar,
]);
self
}
fn send_guest_star_invite(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
fn delete_guest_star_invite(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
fn assign_guest_star_slot(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
fn update_guest_star_slot(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
fn delete_guest_star_slot(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
fn update_guest_star_slot_settings(&mut self) -> &mut Self {
self.push(Scope::ChannelManageGuestStar);
self
}
}
impl HypeTrainScopes for ScopesMut<'_> {
fn hype_train_api(&mut self) -> &mut Self {
self.get_hype_train_events().get_hype_train_status()
}
fn get_hype_train_events(&mut self) -> &mut Self {
self.push(Scope::ChannelReadHypeTrain);
self
}
fn get_hype_train_status(&mut self) -> &mut Self {
self.push(Scope::ChannelReadHypeTrain);
self
}
}
impl ModerationScopes for ScopesMut<'_> {
fn moderation_api(&mut self) -> &mut Self {
self.check_automod_status()
.manage_held_automod_messages()
.get_automod_settings()
.update_automod_settings()
.get_banned_users()
.ban_user()
.unban_user()
.get_unban_requests()
.resolve_unban_requests()
.get_blocked_terms()
.add_blocked_term()
.remove_blocked_term()
.delete_chat_messages()
.get_moderated_channels()
.get_moderators()
.add_channel_moderator()
.remove_channel_moderator()
.get_vips()
.add_channel_vip()
.remove_channel_vip()
.update_shield_mode_status()
.get_shield_mode_status()
.warn_chat_user()
}
fn check_automod_status(&mut self) -> &mut Self {
self.push(Scope::ModerationRead);
self
}
fn manage_held_automod_messages(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageAutomod);
self
}
fn get_automod_settings(&mut self) -> &mut Self {
self.push(Scope::ModeratorReadAutomodSettings);
self
}
fn update_automod_settings(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageAutomodSettings);
self
}
fn get_banned_users(&mut self) -> &mut Self {
self.push(Scope::ModerationRead);
self
}
fn ban_user(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageBannedUsers);
self
}
fn unban_user(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageBannedUsers);
self
}
fn get_unban_requests(&mut self) -> &mut Self {
self.push(Scope::ModeratorReadUnbanRequests);
self
}
fn resolve_unban_requests(&mut self) -> &mut Self {
self.push(Scope::ModeratorReadUnbanRequests);
self
}
fn get_blocked_terms(&mut self) -> &mut Self {
self.push(Scope::ModeratorReadBlockedTerms);
self
}
fn add_blocked_term(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageBlockedTerms);
self
}
fn remove_blocked_term(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageBlockedTerms);
self
}
fn delete_chat_messages(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageChatMessages);
self
}
fn get_moderated_channels(&mut self) -> &mut Self {
self.push(Scope::UserReadModeratedChannels);
self
}
fn get_moderators(&mut self) -> &mut Self {
self.push(Scope::ModerationRead);
self
}
fn add_channel_moderator(&mut self) -> &mut Self {
self.push(Scope::ChannelManageModerators);
self
}
fn remove_channel_moderator(&mut self) -> &mut Self {
self.push(Scope::ChannelManageModerators);
self
}
fn get_vips(&mut self) -> &mut Self {
self.push(Scope::ChannelReadVips);
self
}
fn add_channel_vip(&mut self) -> &mut Self {
self.push(Scope::ChannelManageVips);
self
}
fn remove_channel_vip(&mut self) -> &mut Self {
self.push(Scope::ChannelManageVips);
self
}
fn update_shield_mode_status(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageShieldMode);
self
}
fn get_shield_mode_status(&mut self) -> &mut Self {
self.push(Scope::ModeratorReadShieldMode);
self
}
fn warn_chat_user(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageWarnings);
self
}
fn add_suspicious_status_to_chat_user(&mut self) -> &mut Self {
self.push(Scope::ModeratorManageSuspiciousUsers);
self
}
}
impl PollScopes for ScopesMut<'_> {
fn polls_api(&mut self) -> &mut Self {
self.get_polls().create_poll().end_poll()
}
fn get_polls(&mut self) -> &mut Self {
self.push(Scope::ChannelReadPolls);
self
}
fn create_poll(&mut self) -> &mut Self {
self.push(Scope::ChannelManagePolls);
self
}
fn end_poll(&mut self) -> &mut Self {
self.push(Scope::ChannelManagePolls);
self
}
}
impl PredictionScopes for ScopesMut<'_> {
fn predictions_api(&mut self) -> &mut Self {
self.get_predictions().create_prediction().end_prediction()
}
fn get_predictions(&mut self) -> &mut Self {
self.push(Scope::ChannelReadPredictions);
self
}
fn create_prediction(&mut self) -> &mut Self {
self.push(Scope::ChannelManagePredictions);
self
}
fn end_prediction(&mut self) -> &mut Self {
self.push(Scope::ChannelManagePredictions);
self
}
}
impl RaidScopes for ScopesMut<'_> {
fn raids_api(&mut self) -> &mut Self {
self.start_raid().cancel_raid()
}
fn start_raid(&mut self) -> &mut Self {
self.push(Scope::ChannelManageRaids);
self
}
fn cancel_raid(&mut self) -> &mut Self {
self.push(Scope::ChannelManageRaids);
self
}
}
impl ScheduleScopes for ScopesMut<'_> {
fn schedule_api(&mut self) -> &mut Self {
self.get_channel_stream_schedule()
.get_channel_icalendar()
.update_channel_stream_schedule()
.create_channel_stream_schedule_segment()
.update_channel_stream_schedule_segment()
.delete_channel_stream_schedule_segment()
}
fn get_channel_stream_schedule(&mut self) -> &mut Self {
self
}
fn get_channel_icalendar(&mut self) -> &mut Self {
self
}
fn update_channel_stream_schedule(&mut self) -> &mut Self {
self.push(Scope::ChannelManageSchedule);
self
}
fn create_channel_stream_schedule_segment(&mut self) -> &mut Self {
self.push(Scope::ChannelManageSchedule);
self
}
fn update_channel_stream_schedule_segment(&mut self) -> &mut Self {
self.push(Scope::ChannelManageSchedule);
self
}
fn delete_channel_stream_schedule_segment(&mut self) -> &mut Self {
self.push(Scope::ChannelManageSchedule);
self
}
}
impl SearchScopes for ScopesMut<'_> {
fn search_api(&mut self) -> &mut Self {
self.search_categories().channels_search()
}
fn search_categories(&mut self) -> &mut Self {
self
}
fn channels_search(&mut self) -> &mut Self {
self
}
}
impl StreamScopes for ScopesMut<'_> {
fn streams_api(&mut self) -> &mut Self {
self.get_stream_key()
.get_streams()
.get_followed_streams()
.create_stream_marker()
.get_stream_markers()
}
fn get_stream_key(&mut self) -> &mut Self {
self.push(Scope::ChannelReadStreamKey);
self
}
fn get_streams(&mut self) -> &mut Self {
self
}
fn get_followed_streams(&mut self) -> &mut Self {
self.push(Scope::UserReadFollows);
self
}
fn create_stream_marker(&mut self) -> &mut Self {
self.push(Scope::ChannelManageBroadcast);
self
}
fn get_stream_markers(&mut self) -> &mut Self {
self.push(Scope::UserReadBroadcast);
self
}
}
impl SubscriptionScopes for ScopesMut<'_> {
fn subscriptions_api(&mut self) -> &mut Self {
self.get_broadcaster_subscriptions()
.check_user_subscription()
}
fn get_broadcaster_subscriptions(&mut self) -> &mut Self {
self.push(Scope::ChannelReadSubscriptions);
self
}
fn check_user_subscription(&mut self) -> &mut Self {
self.push(Scope::UserReadSubscriptions);
self
}
}
impl TagScopes for ScopesMut<'_> {
fn tags_api(&mut self) -> &mut Self {
self.get_all_stream_tags().get_stream_tags()
}
fn get_all_stream_tags(&mut self) -> &mut Self {
self
}
fn get_stream_tags(&mut self) -> &mut Self {
self
}
}
impl TeamScopes for ScopesMut<'_> {
fn teams_api(&mut self) -> &mut Self {
self.get_channel_teams().get_teams()
}
fn get_channel_teams(&mut self) -> &mut Self {
self
}
fn get_teams(&mut self) -> &mut Self {
self
}
}
impl UserScopes for ScopesMut<'_> {
fn users_api(&mut self) -> &mut Self {
self.get_users()
.update_user()
.get_user_block_list()
.block_unblock_user()
.get_user_active_extensions()
.update_user_extensions()
}
fn get_users(&mut self) -> &mut Self {
self.push(Scope::UserReadEmail);
self
}
fn update_user(&mut self) -> &mut Self {
self.extend([Scope::UserReadEmail, Scope::UserEdit]);
self
}
fn get_user_block_list(&mut self) -> &mut Self {
self.push(Scope::UserReadBlockedUsers);
self
}
fn block_unblock_user(&mut self) -> &mut Self {
self.push(Scope::UserManageBlockedUsers);
self
}
fn get_user_active_extensions(&mut self) -> &mut Self {
self.extend([Scope::UserReadBroadcast, Scope::UserEditBroadcast]);
self
}
fn update_user_extensions(&mut self) -> &mut Self {
self.push(Scope::UserEditBroadcast);
self
}
}
impl VideoScopes for ScopesMut<'_> {
fn videos_api(&mut self) -> &mut Self {
self.get_videos().delete_videos()
}
fn get_videos(&mut self) -> &mut Self {
self
}
fn delete_videos(&mut self) -> &mut Self {
self.push(Scope::ChannelManageVideos);
self
}
}
impl WhisperScopes for ScopesMut<'_> {
fn whisper_api(&mut self) -> &mut Self {
self.send_whisper()
}
fn send_whisper(&mut self) -> &mut Self {
self.push(Scope::UserManageWhispers);
self
}
}
impl IRCScopes for ScopesMut<'_> {
fn irc_all(&mut self) -> &mut Self {
self.extend([Scope::ChatEdit, Scope::ChatRead]);
self
}
fn irc_chat_edit(&mut self) -> &mut Self {
self.push(Scope::ChatEdit);
self
}
fn irc_chat_read(&mut self) -> &mut Self {
self.push(Scope::ChatRead);
self
}
}
impl ChatbotScopes for ScopesMut<'_> {
fn cloud_chatbot_account(&mut self) -> &mut Self {
self.extend([Scope::UserReadChat, Scope::UserWriteChat, Scope::UserBot]);
self
}
fn cloud_chatbot_broadcaster(&mut self) -> &mut Self {
self.push(Scope::ChannelBot);
self
}
fn installed_chatbot(&mut self) -> &mut Self {
self.extend([Scope::UserReadChat, Scope::UserWriteChat]);
self
}
fn chat_client(&mut self) -> &mut Self {
self.extend([Scope::UserReadChat, Scope::UserWriteChat]);
self
}
}
#[derive(Debug)]
pub struct ScopesMut<'a> {
scopes: &'a mut HashSet<Scope>,
}
pub fn new(scopes: &mut HashSet<Scope>) -> ScopesMut<'_> {
ScopesMut { scopes }
}
impl ScopesMut<'_> {
pub fn clear(&mut self) -> &mut Self {
self.scopes.clear();
self
}
pub fn push(&mut self, s: Scope) -> &mut Self {
self.scopes.insert(s);
self
}
pub fn extend<I>(&mut self, scopes: I) -> &mut Self
where
I: IntoIterator<Item = Scope>,
{
self.scopes.extend(scopes);
self
}
}