bw_web_api_rs/endpoints/
matchmaker_gameinfo_playerinfo.rs1use crate::endpoints::Endpoint;
2use crate::error::ApiError;
3use crate::models::MatchmakerPlayerInfo;
4
5pub struct MatchmakerPlayerInfoEndpoint {
6 match_id: String,
7}
8
9impl MatchmakerPlayerInfoEndpoint {
10 pub fn new(match_id: String) -> Self {
11 Self { match_id }
12 }
13}
14
15impl Endpoint for MatchmakerPlayerInfoEndpoint {
16 type Request = ();
17 type Response = MatchmakerPlayerInfo;
18
19 fn endpoint(&self) -> String {
20 format!(
21 "/web-api/v1/matchmaker-gameinfo-playerinfo/{}",
22 urlencoding::encode(&self.match_id)
23 )
24 }
25}
26
27impl crate::client::ApiClient {
28 pub async fn get_matchmaker_player_info(
32 &self,
33 match_id: String,
34 ) -> Result<MatchmakerPlayerInfo, ApiError> {
35 let endpoint = MatchmakerPlayerInfoEndpoint::new(match_id);
36 self.request(&endpoint, &()).await
37 }
38}