esi_openapi/groups/
status.rs1use crate::prelude::*;
2
3pub struct StatusGroup<'a> {
5 pub(crate) esi: &'a Esi,
6}
7
8#[derive(Debug, Clone, PartialEq, Deserialize)]
10#[allow(missing_docs)]
11pub struct ServerStatus {
12 pub players: i64,
13 pub server_version: String,
14 pub start_time: String,
15 pub vip: bool,
16}
17
18impl StatusGroup<'_> {
19 api_get!(
20 get_status,
22 "GetStatus",
23 RequestType::Public,
24 ServerStatus,
25 );
26}
27
28#[cfg(test)]
29mod tests {
30 use super::ServerStatus;
31
32 #[test]
33 fn test_parse_server_status() {
34 let json = r#"{"players":12345,"server_version":"2951234","start_time":"2026-10-07T11:00:00Z","vip":false}"#;
35 let status: ServerStatus = serde_json::from_str(json).unwrap();
36 assert_eq!(status.players, 12345);
37 assert!(!status.vip);
38 }
39}