Rewrite to a API trait.

This commit is contained in:
2026-01-11 14:12:54 +01:00
parent ea9f05b048
commit 88f8cf76ef
45 changed files with 1384 additions and 1030 deletions

View File

@@ -1,7 +1,7 @@
use std::{ffi::OsStr, fmt::Display};
use async_trait::async_trait;
use gamenight_api_client_rs::{apis::default_api::{location_authorize_post, location_post}, models::{authorize_location_request_body::Op::Grant, AddLocationRequestBody, AuthorizeLocationRequestBody}};
use gamenight_api_client_rs::models::{authorize_location_request_body::Op::Grant, AddLocationRequestBody, AuthorizeLocationRequestBody};
use inquire::{Editor, Text};
@@ -44,7 +44,7 @@ impl<'a> Flow<'a> for AddLocation {
note
};
let location_id = location_post(&state.api_configuration, Some(add_location_request)).await?;
let location_id = state.api.location_post(Some(add_location_request)).await?;
let add_authorize_request = AuthorizeLocationRequestBody {
location_id: location_id.location_id.to_string(),
@@ -52,7 +52,7 @@ impl<'a> Flow<'a> for AddLocation {
op: Grant
};
location_authorize_post(&state.api_configuration, Some(add_authorize_request)).await?;
state.api.location_authorize_post(Some(add_authorize_request)).await?;
}
Ok((FlowOutcome::Cancelled, state))
}