chore(repo): prune dead code and duplicate abstractions (#3413)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-12 13:09:42 +02:00
1 parent c17091768c
commit c9fdf8fead
2937 files changed
+42233 -176793

No files matched your search

+8 -6
View File
@@ -1,5 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
use crate::api::generated::bool_param;
use reqwest::Method;
use crate::api::generated::types as generated_types;
use super::client::{AdminApiClient, ApiError, ApiResult};
@@ -57,7 +61,8 @@ impl AdminApiClient {
let region_id = required_field(params, "id")?;
let body = voice_request_body(params, &["id"])?;
validate_against::<generated_types::UpdateVoiceRegionRequestBody>(&body)?;
self.patch_with_reason(
self.send(
Method::PATCH,
&format!("/admin/voice/regions/{}", urlencoding::encode(&region_id)),
Some(&body),
None,
@@ -110,7 +115,8 @@ impl AdminApiClient {
paired_coordinates(params)?;
let body = voice_request_body(params, &["region_id", "server_id"])?;
validate_against::<generated_types::UpdateVoiceServerRequestBody>(&body)?;
self.patch_with_reason(
self.send(
Method::PATCH,
&format!(
"/admin/voice/regions/{}/servers/{}",
urlencoding::encode(&region_id),
@@ -136,10 +142,6 @@ impl AdminApiClient {
}
}
fn bool_param(value: bool) -> &'static str {
if value { "true" } else { "false" }
}
fn validate_against<T: serde::de::DeserializeOwned>(params: &serde_json::Value) -> ApiResult<()> {
serde_json::from_value::<T>(params.clone())
.map(drop)