Struct twitch_api::helix::chat::get_chat_settings::GetChatSettingsRequest
source · [−]#[non_exhaustive]pub struct GetChatSettingsRequest<'a> {
pub broadcaster_id: Cow<'a, UserIdRef>,
pub moderator_id: Option<Cow<'a, UserIdRef>>,
}
helix
only.Expand description
Query Parameters for Get Chat Settings
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.broadcaster_id: Cow<'a, UserIdRef>
The ID of the broadcaster whose chat settings you want to get.
moderator_id: Option<Cow<'a, UserIdRef>>
Required only to access the non_moderator_chat_delay
or non_moderator_chat_delay_duration
settings.
If you want to access these settings, you need to provide a valid moderator_id
and a user token with the moderator:read:chat_settings
scope.
The ID of a user that has permission to moderate the broadcaster’s chat room. This ID must match the user ID associated with the user OAuth token.
If the broadcaster wants to get their own settings (instead of having the moderator do it), set this parameter to the broadcaster’s ID, too.
Implementations
sourceimpl<'a> GetChatSettingsRequest<'a>
impl<'a> GetChatSettingsRequest<'a>
sourcepub fn builder() -> GetChatSettingsRequestBuilder<'a, ((), ())>
pub fn builder() -> GetChatSettingsRequestBuilder<'a, ((), ())>
Create a builder for building GetChatSettingsRequest
.
On the builder, call .broadcaster_id(...)
, .moderator_id(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of GetChatSettingsRequest
.
sourceimpl<'a> GetChatSettingsRequest<'a>
impl<'a> GetChatSettingsRequest<'a>
sourcepub fn broadcaster_id(broadcaster_id: impl IntoCow<'a, UserIdRef> + 'a) -> Self
pub fn broadcaster_id(broadcaster_id: impl IntoCow<'a, UserIdRef> + 'a) -> Self
Get chat settings for broadcasters channel
Examples found in repository?
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649
pub async fn get_chat_settings<'b, T>(
&'a self,
broadcaster_id: impl types::IntoCow<'b, types::UserIdRef> + 'b,
moderator_id: impl Into<Option<&'b types::UserIdRef>> + 'b,
token: &T,
) -> Result<helix::chat::ChatSettings, ClientError<'a, C>>
where
T: TwitchToken + ?Sized,
{
let mut req = helix::chat::GetChatSettingsRequest::broadcaster_id(broadcaster_id);
if let Some(moderator_id) = moderator_id.into() {
req = req.moderator_id(moderator_id);
}
Ok(self.req_get(req, token).await?.data)
}
sourcepub fn moderator_id(self, moderator_id: impl IntoCow<'a, UserIdRef> + 'a) -> Self
pub fn moderator_id(self, moderator_id: impl IntoCow<'a, UserIdRef> + 'a) -> Self
The ID of a user that has permission to moderate the broadcaster’s chat room.
Required only to access the non_moderator_chat_delay
or non_moderator_chat_delay_duration
settings.
Examples found in repository?
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649
pub async fn get_chat_settings<'b, T>(
&'a self,
broadcaster_id: impl types::IntoCow<'b, types::UserIdRef> + 'b,
moderator_id: impl Into<Option<&'b types::UserIdRef>> + 'b,
token: &T,
) -> Result<helix::chat::ChatSettings, ClientError<'a, C>>
where
T: TwitchToken + ?Sized,
{
let mut req = helix::chat::GetChatSettingsRequest::broadcaster_id(broadcaster_id);
if let Some(moderator_id) = moderator_id.into() {
req = req.moderator_id(moderator_id);
}
Ok(self.req_get(req, token).await?.data)
}
Trait Implementations
sourceimpl<'a> Clone for GetChatSettingsRequest<'a>
impl<'a> Clone for GetChatSettingsRequest<'a>
sourcefn clone(&self) -> GetChatSettingsRequest<'a>
fn clone(&self) -> GetChatSettingsRequest<'a>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<'a> Debug for GetChatSettingsRequest<'a>
impl<'a> Debug for GetChatSettingsRequest<'a>
sourceimpl<'de: 'a, 'a> Deserialize<'de> for GetChatSettingsRequest<'a>
impl<'de: 'a, 'a> Deserialize<'de> for GetChatSettingsRequest<'a>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl<'a> PartialEq<GetChatSettingsRequest<'a>> for GetChatSettingsRequest<'a>
impl<'a> PartialEq<GetChatSettingsRequest<'a>> for GetChatSettingsRequest<'a>
sourcefn eq(&self, other: &GetChatSettingsRequest<'a>) -> bool
fn eq(&self, other: &GetChatSettingsRequest<'a>) -> bool
sourceimpl Request for GetChatSettingsRequest<'_>
impl Request for GetChatSettingsRequest<'_>
type Response = ChatSettings
type Response = ChatSettings
sourceconst OPT_SCOPE: &'static [Scope] = _
const OPT_SCOPE: &'static [Scope] = _
twitch_oauth2
only.sourceconst PATH: &'static str = "chat/settings"
const PATH: &'static str = "chat/settings"
channels
for Get Channel Informationsourceconst SCOPE: &'static [Scope] = _
const SCOPE: &'static [Scope] = _
twitch_oauth2
only.sourcefn query(&self) -> Result<String, SerializeError>
fn query(&self) -> Result<String, SerializeError>
sourcefn get_uri(&self) -> Result<Uri, InvalidUri>
fn get_uri(&self) -> Result<Uri, InvalidUri>
sourcefn get_bare_uri() -> Result<Uri, InvalidUri>
fn get_bare_uri() -> Result<Uri, InvalidUri>
sourceimpl RequestGet for GetChatSettingsRequest<'_>
impl RequestGet for GetChatSettingsRequest<'_>
sourcefn parse_inner_response(
request: Option<Self>,
uri: &Uri,
response: &str,
status: StatusCode
) -> Result<Response<Self, <Self as Request>::Response>, HelixRequestGetError>where
Self: Sized,
fn parse_inner_response(
request: Option<Self>,
uri: &Uri,
response: &str,
status: StatusCode
) -> Result<Response<Self, <Self as Request>::Response>, HelixRequestGetError>where
Self: Sized,
sourcefn create_request(
&self,
token: &str,
client_id: &str
) -> Result<Request<Bytes>, CreateRequestError>
fn create_request(
&self,
token: &str,
client_id: &str
) -> Result<Request<Bytes>, CreateRequestError>
http::Request
from this Request
in your clientsourceimpl<'a> Serialize for GetChatSettingsRequest<'a>
impl<'a> Serialize for GetChatSettingsRequest<'a>
impl<'a> Eq for GetChatSettingsRequest<'a>
impl<'a> StructuralEq for GetChatSettingsRequest<'a>
impl<'a> StructuralPartialEq for GetChatSettingsRequest<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for GetChatSettingsRequest<'a>
impl<'a> Send for GetChatSettingsRequest<'a>
impl<'a> Sync for GetChatSettingsRequest<'a>
impl<'a> Unpin for GetChatSettingsRequest<'a>
impl<'a> UnwindSafe for GetChatSettingsRequest<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.