From 55fe71710cf0743d7c93f24cdb5e1cdae15c2f5a Mon Sep 17 00:00:00 2001 From: Caleb Leinz Date: Fri, 23 Aug 2024 13:53:17 -0700 Subject: [PATCH] refactor!: Rename token fetch methods --- examples/fetch_token.rs | 2 +- src/api.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/fetch_token.rs b/examples/fetch_token.rs index fc1a53f..9cf6ef6 100644 --- a/examples/fetch_token.rs +++ b/examples/fetch_token.rs @@ -5,7 +5,7 @@ use freedom_config::Config; async fn main() -> Result<(), Box> { let config = Config::from_env()?; let client = Client::from_config(config); - let tkn = client.get_token_by_satellite(2017, 1016).await?; + let tkn = client.new_token_by_satellite_id(2017, 1016).await?; println!("{:?}", tkn); Ok(()) diff --git a/src/api.rs b/src/api.rs index 159abca..3d50813 100644 --- a/src/api.rs +++ b/src/api.rs @@ -1141,9 +1141,9 @@ pub trait FreedomApi: Send + Sync { /// /// # Warning /// - /// Do not use this method, directly. Instead prefer [`FreedomApi::get_token_by_satellite`] or - /// [`FreedomApi::get_token_by_site_configuration`] - async fn get_token( + /// Do not use this method, directly. Instead prefer [`FreedomApi::new_token_by_satellite_id`] or + /// [`FreedomApi::new_token_by_site_configuration_id`] + async fn new_token( &self, post_val: S, ) -> Result { @@ -1163,7 +1163,7 @@ pub trait FreedomApi: Send + Sync { } /// Fetch an FPS token for the provided band ID and site configuration ID - async fn get_token_by_site_configuration( + async fn new_token_by_site_configuration_id( &self, band_id: u32, site_configuration_id: u32, @@ -1173,11 +1173,11 @@ pub trait FreedomApi: Send + Sync { "configuration": format!("/api/configurations/{}", site_configuration_id), }); - self.get_token(&payload).await + self.new_token(&payload).await } /// Fetch an FPS token for the provided band ID and satellite ID - async fn get_token_by_satellite( + async fn new_token_by_satellite_id( &self, band_id: u32, satellite_id: u32, @@ -1187,7 +1187,7 @@ pub trait FreedomApi: Send + Sync { "satellite": format!("/api/satellites/{}", satellite_id), }); - self.get_token(&payload).await + self.new_token(&payload).await } /// Produces a paginated stream of [`User`] objects.