Module twitch_api2::helix::hypetrain::get_hypetrain_events
source · [−]Available on crate feature
helix
only.Expand description
Gets the information of the most recent Hype Train of the given channel ID.
get-hype-train-events
Accessing the endpoint
Request: GetHypeTrainEventsRequest
To use this endpoint, construct a GetHypeTrainEventsRequest
with the GetHypeTrainEventsRequest::builder()
method.
use twitch_api2::helix::hypetrain::get_hypetrain_events;
let request = get_hypetrain_events::GetHypeTrainEventsRequest::builder()
.broadcaster_id("4321".to_string())
.build();
Response: HypeTrainEvent
Send the request to receive the response with HelixClient::req_get()
.
use twitch_api2::helix::{self, hypetrain::get_hypetrain_events};
let request = get_hypetrain_events::GetHypeTrainEventsRequest::builder()
.broadcaster_id("4321".to_string())
.build();
let response: Vec<get_hypetrain_events::HypeTrainEvent> = client.req_get(request, &token).await?.data;
You can also get the http::Request
with request.create_request(&token, &client_id)
and parse the http::Response
with GetHypeTrainEventsRequest::parse_response(None, &request.get_uri(), response)
Structs
Enums
Type of Hype Train event