diff --git a/torn-api/Cargo.toml b/torn-api/Cargo.toml index 06efd8b..be05b29 100644 --- a/torn-api/Cargo.toml +++ b/torn-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-api" -version = "0.5.25" +version = "0.5.26" edition = "2021" authors = ["Pyrit [2111649]"] license = "MIT" diff --git a/torn-api/src/common.rs b/torn-api/src/common.rs index 91789ed..c69a22a 100644 --- a/torn-api/src/common.rs +++ b/torn-api/src/common.rs @@ -3,10 +3,18 @@ use serde::Deserialize; use crate::de_util; +#[derive(Debug, Clone, Deserialize)] +pub enum OnlineStatus { + Online, + Offline, + Idle, +} + #[derive(Debug, Clone, Deserialize)] pub struct LastAction { #[serde(with = "ts_seconds")] pub timestamp: DateTime, + pub status: OnlineStatus, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)] diff --git a/torn-api/src/faction.rs b/torn-api/src/faction.rs index bf4272e..6e0c5e3 100644 --- a/torn-api/src/faction.rs +++ b/torn-api/src/faction.rs @@ -103,6 +103,23 @@ mod tests { response.territory().unwrap(); } + #[async_test] + async fn faction_public() { + let key = setup(); + + let response = Client::default() + .torn_api(key) + .faction(|b| { + b.id(7049) + .selections(&[Selection::Basic, Selection::Territory]) + }) + .await + .unwrap(); + + response.basic().unwrap(); + response.territory().unwrap(); + } + #[async_test] async fn destroyed_faction() { let key = setup();