Skip to main content

fume_core/player/
get_steam_level.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{Api, Param, Response, user::SteamId};
4
5use super::INTERFACE;
6
7#[derive(Clone, Debug)]
8pub struct GetSteamLevel {
9    pub steamid: SteamId,
10}
11
12impl GetSteamLevel {
13    pub const METHOD: &str = "GetSteamLevel";
14    pub const VERSION: &str = "v1";
15}
16
17impl Api for GetSteamLevel {
18    fn interface() -> &'static str {
19        INTERFACE
20    }
21
22    fn method() -> &'static str {
23        Self::METHOD
24    }
25
26    fn version() -> &'static str {
27        Self::VERSION
28    }
29
30    type Response = Response<SteamLevel>;
31
32    fn parameters(&self) -> impl Iterator<Item = (&str, String)> {
33        std::iter::once(self.steamid.param())
34    }
35}
36
37#[derive(Clone, Debug, Deserialize, Serialize)]
38#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
39pub struct SteamLevel {
40    pub player_level: u64,
41}