Available on crate feature
helix
only.Expand description
Gets game information by game ID or name.
get-games
Accessing the endpoint
Request: GetGamesRequest
To use this endpoint, construct a GetGamesRequest
with the GetGamesRequest::builder()
method.
use twitch_api2::helix::games::get_games;
let request = get_games::GetGamesRequest::builder()
.id(vec!["4321".into()])
.build();
Response: Game
Send the request to receive the response with HelixClient::req_get()
.
use twitch_api2::helix::{self, games::get_games};
let request = get_games::GetGamesRequest::builder()
.id(vec!["4321".into()])
.build();
let response: Vec<get_games::Game> = 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 GetGamesRequest::parse_response(None, &request.get_uri(), response)
Structs
Query Parameters for Get Games