use crate::error::Error;
use crate::http::Client;
pub struct Match<'a> {
match_id: String,
client: &'a Client,
}
impl<'a> Match<'a> {
pub fn new(match_id: impl Into<String>, client: &'a Client) -> Self {
Self {
match_id: match_id.into(),
client,
}
}
pub fn id(&self) -> &str {
&self.match_id
}
pub async fn get(&self) -> Result<crate::types::Match, Error> {
self.client.get_match(&self.match_id).await
}
pub async fn stats(&self) -> Result<crate::types::MatchStats, Error> {
self.client.get_match_stats(&self.match_id).await
}
}