Struct twitch_api::helix::predictions::end_prediction::EndPredictionBody
source · [−]#[non_exhaustive]pub struct EndPredictionBody<'a> {
pub broadcaster_id: Cow<'a, UserIdRef>,
pub id: Cow<'a, PredictionIdRef>,
pub status: PredictionStatus,
pub winning_outcome_id: Option<Cow<'a, PredictionIdRef>>,
}
helix
only.Expand description
Body Parameters for End Prediction
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 broadcaster running predictions. Provided broadcaster_id must match the user_id in the user OAuth token.
id: Cow<'a, PredictionIdRef>
ID of the prediction.
status: PredictionStatus
The Prediction status to be set. Valid values:
RESOLVED
: A winning outcome has been chosen and the Channel Points have been distributed to the users who predicted the correct outcome.
CANCELED
: The Prediction has been canceled and the Channel Points have been refunded to participants.
LOCKED
: The Prediction has been locked and viewers can no longer make predictions.
winning_outcome_id: Option<Cow<'a, PredictionIdRef>>
ID of the winning outcome for the Prediction. This parameter is required if status is being set to RESOLVED
.
Implementations
sourceimpl<'a> EndPredictionBody<'a>
impl<'a> EndPredictionBody<'a>
sourcepub fn builder() -> EndPredictionBodyBuilder<'a, ((), (), (), ())>
pub fn builder() -> EndPredictionBodyBuilder<'a, ((), (), (), ())>
Create a builder for building EndPredictionBody
.
On the builder, call .broadcaster_id(...)
, .id(...)
, .status(...)
, .winning_outcome_id(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of EndPredictionBody
.
sourceimpl<'a> EndPredictionBody<'a>
impl<'a> EndPredictionBody<'a>
sourcepub fn new(
broadcaster_id: impl IntoCow<'a, UserIdRef> + 'a,
id: impl IntoCow<'a, PredictionIdRef> + 'a,
status: impl Into<PredictionStatus>
) -> Self
pub fn new(
broadcaster_id: impl IntoCow<'a, UserIdRef> + 'a,
id: impl IntoCow<'a, PredictionIdRef> + 'a,
status: impl Into<PredictionStatus>
) -> Self
End given prediction that is currently active.
sourcepub fn winning_outcome_id(
self,
winning_outcome_id: impl IntoCow<'a, PredictionIdRef> + 'a
) -> Self
pub fn winning_outcome_id(
self,
winning_outcome_id: impl IntoCow<'a, PredictionIdRef> + 'a
) -> Self
ID of the winning outcome for the Prediction
This parameter is required if status is being set to RESOLVED
.
Trait Implementations
sourceimpl<'a> Clone for EndPredictionBody<'a>
impl<'a> Clone for EndPredictionBody<'a>
sourcefn clone(&self) -> EndPredictionBody<'a>
fn clone(&self) -> EndPredictionBody<'a>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<'a> Debug for EndPredictionBody<'a>
impl<'a> Debug for EndPredictionBody<'a>
sourceimpl<'de: 'a, 'a> Deserialize<'de> for EndPredictionBody<'a>
impl<'de: 'a, 'a> Deserialize<'de> for EndPredictionBody<'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<EndPredictionBody<'a>> for EndPredictionBody<'a>
impl<'a> PartialEq<EndPredictionBody<'a>> for EndPredictionBody<'a>
sourcefn eq(&self, other: &EndPredictionBody<'a>) -> bool
fn eq(&self, other: &EndPredictionBody<'a>) -> bool
sourceimpl<'a> Serialize for EndPredictionBody<'a>
impl<'a> Serialize for EndPredictionBody<'a>
impl<'a> Eq for EndPredictionBody<'a>
impl<'a> StructuralEq for EndPredictionBody<'a>
impl<'a> StructuralPartialEq for EndPredictionBody<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for EndPredictionBody<'a>
impl<'a> Send for EndPredictionBody<'a>
impl<'a> Sync for EndPredictionBody<'a>
impl<'a> Unpin for EndPredictionBody<'a>
impl<'a> UnwindSafe for EndPredictionBody<'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.sourceimpl<T> HelixRequestBody for Twhere
T: Serialize + SealedSerialize,
impl<T> HelixRequestBody for Twhere
T: Serialize + SealedSerialize,
sourcefn try_to_body(&self) -> Result<Bytes, BodyError>
fn try_to_body(&self) -> Result<Bytes, BodyError>
helix
only.