From 1c9b4123c3aa22a5ace50286470f710ce9133e20 Mon Sep 17 00:00:00 2001 From: pyrite Date: Wed, 28 May 2025 11:11:58 +0200 Subject: [PATCH] fix(api): removed missing properties from personalstats --- Cargo.lock | 2 +- torn-api/Cargo.toml | 2 +- torn-api/openapi.json | 7 +------ torn-api/src/scopes.rs | 24 ++++++++++++++++++++++-- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e095454..58df819 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2294,7 +2294,7 @@ dependencies = [ [[package]] name = "torn-api" -version = "1.6.4" +version = "1.6.5" dependencies = [ "bon", "bytes", diff --git a/torn-api/Cargo.toml b/torn-api/Cargo.toml index 5b0558c..2b4f0a2 100644 --- a/torn-api/Cargo.toml +++ b/torn-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-api" -version = "1.6.4" +version = "1.6.5" edition = "2021" description = "Auto-generated bindings for the v2 torn api" license-file = { workspace = true } diff --git a/torn-api/openapi.json b/torn-api/openapi.json index b45e528..2cbd3cb 100644 --- a/torn-api/openapi.json +++ b/torn-api/openapi.json @@ -13928,8 +13928,7 @@ "awards", "merits_bought", "refills", - "donator_days", - "ranked_war_wins" + "donator_days" ], "properties": { "activity": { @@ -13991,10 +13990,6 @@ "donator_days": { "type": "integer", "format": "int32" - }, - "ranked_war_wins": { - "type": "integer", - "format": "int32" } }, "type": "object" diff --git a/torn-api/src/scopes.rs b/torn-api/src/scopes.rs index 5db9418..a3da78d 100644 --- a/torn-api/src/scopes.rs +++ b/torn-api/src/scopes.rs @@ -9,8 +9,9 @@ pub(super) mod test { use crate::{ executor::{ExecutorExt, ReqwestClient}, models::{ - faction_selection_name::FactionSelectionNameVariant, AttackCode, - PersonalStatsCategoryEnum, PersonalStatsStatName, UserListEnum, + faction_selection_name::FactionSelectionNameVariant, + user_selection_name::UserSelectionNameVariant, AttackCode, PersonalStatsCategoryEnum, + PersonalStatsStatName, UserListEnum, UserPersonalStatsPopular, }, }; @@ -918,6 +919,25 @@ pub(super) mod test { .unwrap(); } + #[tokio::test] + async fn user_personalstats_popular() { + let client = test_client().await; + + let resp = client + .user() + .for_selections(|b| { + b.selections([UserSelectionNameVariant::Personalstats]) + .cat(PersonalStatsCategoryEnum::Popular) + }) + .await + .unwrap(); + + assert!(resp + .user_personal_stats_response() + .unwrap() + .is_user_personal_stats_popular()); + } + #[tokio::test] async fn user_personalstats_for_id() { let client = test_client().await;