bw_web_api_rs/endpoints/
leaderboard.rs1use crate::endpoints::Endpoint;
2use crate::error::ApiError;
3use crate::models::LeaderboardMetadata;
4
5pub struct Leaderboard;
6
7impl Leaderboard {
8 pub fn new() -> Self {
9 Self
10 }
11}
12
13impl Endpoint for Leaderboard {
14 type Request = ();
15 type Response = LeaderboardMetadata;
16
17 fn endpoint(&self) -> String {
18 "/web-api/v1/leaderboard".to_string()
19 }
20}
21
22impl crate::client::ApiClient {
23 pub async fn get_leaderboard(&self) -> Result<LeaderboardMetadata, ApiError> {
27 let endpoint = Leaderboard::new();
28 self.request(&endpoint, &()).await
29 }
30}