#[non_exhaustive]pub struct CheckAutoModStatusBody<'a> {
pub msg_id: Cow<'a, MsgIdRef>,
pub msg_text: Cow<'a, str>,
pub user_id: Option<Cow<'a, UserIdRef>>,
}
Available on crate feature
helix
only.Expand description
Body Parameters for Check AutoMod Status
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.msg_id: Cow<'a, MsgIdRef>
Developer-generated identifier for mapping messages to results.
msg_text: Cow<'a, str>
Message text.
user_id: Option<Cow<'a, UserIdRef>>
👎Deprecated since 0.7.0: user_id in automod check is no longer read
User ID of the sender.
Implementations
sourceimpl<'a> CheckAutoModStatusBody<'a>
impl<'a> CheckAutoModStatusBody<'a>
sourcepub fn builder() -> CheckAutoModStatusBodyBuilder<'a, ((), (), ())>
pub fn builder() -> CheckAutoModStatusBodyBuilder<'a, ((), (), ())>
Create a builder for building CheckAutoModStatusBody
.
On the builder, call .msg_id(...)
, .msg_text(...)
, .user_id(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of CheckAutoModStatusBody
.
sourceimpl<'a> CheckAutoModStatusBody<'a>
impl<'a> CheckAutoModStatusBody<'a>
sourcepub fn new(
msg_id: impl IntoCow<'a, MsgIdRef> + 'a,
msg_text: impl Into<Cow<'a, str>>
) -> Self
pub fn new(
msg_id: impl IntoCow<'a, MsgIdRef> + 'a,
msg_text: impl Into<Cow<'a, str>>
) -> Self
Create a new CheckAutoModStatusBody
Examples found in repository?
examples/automod_check.rs (line 39)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
async fn run() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
let _ = dotenvy::dotenv();
let mut args = std::env::args().skip(1);
let client: HelixClient<reqwest::Client> = HelixClient::default();
let token = UserToken::from_existing(
&client,
std::env::var("TWITCH_TOKEN")
.ok()
.or_else(|| args.next())
.map(AccessToken::new)
.expect("Please set env: TWITCH_TOKEN or pass token as first argument"),
None,
None,
)
.await?;
let broadcaster_id = token.user_id.as_str();
let req =
twitch_api::helix::moderation::CheckAutoModStatusRequest::broadcaster_id(broadcaster_id);
let text = args.collect::<String>();
let data = twitch_api::helix::moderation::CheckAutoModStatusBody::new("123", &text);
println!("data: {:?}", data);
let response = client.req_post(req, &[&data], &token).await?.data;
println!("{response:?}");
Ok(())
}
Trait Implementations
sourceimpl<'a> Clone for CheckAutoModStatusBody<'a>
impl<'a> Clone for CheckAutoModStatusBody<'a>
sourcefn clone(&self) -> CheckAutoModStatusBody<'a>
fn clone(&self) -> CheckAutoModStatusBody<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'a> Debug for CheckAutoModStatusBody<'a>
impl<'a> Debug for CheckAutoModStatusBody<'a>
sourceimpl<'de: 'a, 'a> Deserialize<'de> for CheckAutoModStatusBody<'a>
impl<'de: 'a, 'a> Deserialize<'de> for CheckAutoModStatusBody<'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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'a> PartialEq<CheckAutoModStatusBody<'a>> for CheckAutoModStatusBody<'a>
impl<'a> PartialEq<CheckAutoModStatusBody<'a>> for CheckAutoModStatusBody<'a>
sourcefn eq(&self, other: &CheckAutoModStatusBody<'a>) -> bool
fn eq(&self, other: &CheckAutoModStatusBody<'a>) -> bool
sourceimpl<'a> Serialize for CheckAutoModStatusBody<'a>
impl<'a> Serialize for CheckAutoModStatusBody<'a>
impl<'a> Eq for CheckAutoModStatusBody<'a>
impl<'a> StructuralEq for CheckAutoModStatusBody<'a>
impl<'a> StructuralPartialEq for CheckAutoModStatusBody<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for CheckAutoModStatusBody<'a>
impl<'a> Send for CheckAutoModStatusBody<'a>
impl<'a> Sync for CheckAutoModStatusBody<'a>
impl<'a> Unpin for CheckAutoModStatusBody<'a>
impl<'a> UnwindSafe for CheckAutoModStatusBody<'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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.