pub struct Client { /* private fields */ }
Expand description
An asynchronous Client
for interfacing with the ATLAS freedom API.
The client is primarily defined based on it’s Env
and it’s credentials (username and password).
Implementations§
Source§impl Client
impl Client
Sourcepub fn from_config(config: Config) -> Self
pub fn from_config(config: Config) -> Self
Construct an API client from the provided Freedom config
§Example
let config = Config::builder()
.environment(Test)
.key("foo")
.secret("bar")
.build()
.unwrap();
let client = Client::from_config(config);
assert_eq!(client.config().key(), "foo");
Sourcepub fn from_env() -> Result<Self, Error>
pub fn from_env() -> Result<Self, Error>
A convenience method for constructing an FPS client from environment variables.
This function expects the following environment variables:
- ATLAS_ENV: [possible values: test, prod]
- ATLAS_KEY: The ATLAS freedom key registered with an account
- ATLAS_SECRET: The ATLAS freedom secret registered with an account
Trait Implementations§
Source§impl Api for Client
impl Api for Client
Source§async fn get(&self, url: Url) -> Result<(Bytes, StatusCode), Error>
async fn get(&self, url: Url) -> Result<(Bytes, StatusCode), Error>
Creates a get request at the provided absolute URI for the client’s environment, using basic
authentication. Read more
async fn delete(&self, url: Url) -> Result<Response, Error>
Source§async fn post<S>(&self, url: Url, msg: S) -> Result<Response, Error>
async fn post<S>(&self, url: Url, msg: S) -> Result<Response, Error>
Lower level method, not intended for direct use
Source§fn config_mut(&mut self) -> &mut Config
fn config_mut(&mut self) -> &mut Config
Returns a mutable reference to the freedom configuration for the API
Source§fn get_json_map<T>(
&self,
url: Url,
) -> impl Future<Output = Result<T, Error>> + Send + Syncwhere
T: Value,
fn get_json_map<T>(
&self,
url: Url,
) -> impl Future<Output = Result<T, Error>> + Send + Syncwhere
T: Value,
Creates a get request at the provided absolute URI for the client’s environment, using basic
authentication. Read more
Source§fn get_paginated<T>(
&self,
head_url: Url,
) -> PaginatedStream<'_, Self::Container<T>>
fn get_paginated<T>( &self, head_url: Url, ) -> PaginatedStream<'_, Self::Container<T>>
Creates a stream of items from a paginated endpoint. Read more
Source§fn path_to_url(&self, path: impl AsRef<str>) -> Url
fn path_to_url(&self, path: impl AsRef<str>) -> Url
Fetch the URL from the given path Read more
Source§fn delete_band_details(
&self,
id: i32,
) -> impl Future<Output = Result<Response, Error>> + Send
fn delete_band_details( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send
Request to delete the band details object matching the provided id Read more
Source§fn delete_satellite_configuration(
&self,
id: i32,
) -> impl Future<Output = Result<Response, Error>> + Send
fn delete_satellite_configuration( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send
Request to delete the satellite configuration matching the provided
id
Read moreSource§fn delete_satellite(
&self,
id: i32,
) -> impl Future<Output = Result<Response, Error>> + Send
fn delete_satellite( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send
Request to delete the satellite object matching the provided
id
Read moreSource§fn delete_override(
&self,
id: i32,
) -> impl Future<Output = Result<Response, Error>> + Send
fn delete_override( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send
Request to delete the override matching the provided
id
Read moreSource§fn delete_user(
&self,
id: i32,
) -> impl Future<Output = Result<Response, Error>> + Send
fn delete_user( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send
Request to delete the user matching the provided
id
Read moreSource§fn delete_task_request(
&self,
id: i32,
) -> impl Future<Output = Result<Response, Error>> + Send
fn delete_task_request( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send
Request to delete the user matching the provided
id
Read moreSource§fn post_deserialize<S, T>(
&self,
url: Url,
msg: S,
) -> impl Future<Output = Result<T, Error>> + Send + Sync
fn post_deserialize<S, T>( &self, url: Url, msg: S, ) -> impl Future<Output = Result<T, Error>> + Send + Sync
Lower level method, not intended for direct use
Source§fn get_account_by_name(
&self,
account_name: &str,
) -> impl Future<Output = Result<Self::Container<Account>, Error>> + Send + Sync
fn get_account_by_name( &self, account_name: &str, ) -> impl Future<Output = Result<Self::Container<Account>, Error>> + Send + Sync
Source§fn get_file_by_task_id_and_name(
&self,
task_id: i32,
file_name: &str,
) -> impl Future<Output = Result<Bytes, Error>> + Send + Sync
fn get_file_by_task_id_and_name( &self, task_id: i32, file_name: &str, ) -> impl Future<Output = Result<Bytes, Error>> + Send + Sync
Source§fn get_account_by_id(
&self,
account_id: i32,
) -> impl Future<Output = Result<Self::Container<Account>, Error>> + Send + Sync
fn get_account_by_id( &self, account_id: i32, ) -> impl Future<Output = Result<Self::Container<Account>, Error>> + Send + Sync
Source§fn get_accounts(&self) -> PaginatedStream<'_, Self::Container<Account>>
fn get_accounts(&self) -> PaginatedStream<'_, Self::Container<Account>>
Source§fn get_satellite_bands(&self) -> PaginatedStream<'_, Self::Container<Band>>
fn get_satellite_bands(&self) -> PaginatedStream<'_, Self::Container<Band>>
Source§fn get_satellite_band_by_id(
&self,
satellite_band_id: i32,
) -> impl Future<Output = Result<Self::Container<Band>, Error>> + Send + Sync
fn get_satellite_band_by_id( &self, satellite_band_id: i32, ) -> impl Future<Output = Result<Self::Container<Band>, Error>> + Send + Sync
Source§fn get_satellite_band_by_name(
&self,
satellite_band_name: &str,
) -> impl Future<Output = Result<Self::Container<Band>, Error>> + Send + Sync
fn get_satellite_band_by_name( &self, satellite_band_name: &str, ) -> impl Future<Output = Result<Self::Container<Band>, Error>> + Send + Sync
Source§fn get_satellite_bands_by_account_name(
&self,
account_name: &str,
) -> PaginatedStream<'_, Self::Container<Band>>
fn get_satellite_bands_by_account_name( &self, account_name: &str, ) -> PaginatedStream<'_, Self::Container<Band>>
Source§fn get_satellite_configurations_by_account_name(
&self,
account_name: &str,
) -> PaginatedStream<'_, Self::Container<SatelliteConfiguration>>
fn get_satellite_configurations_by_account_name( &self, account_name: &str, ) -> PaginatedStream<'_, Self::Container<SatelliteConfiguration>>
Produces a paginated stream of
SatelliteConfiguration
objects matching the provided
account name. Read moreSource§fn get_satellite_configurations(
&self,
) -> PaginatedStream<'_, Self::Container<SatelliteConfiguration>>
fn get_satellite_configurations( &self, ) -> PaginatedStream<'_, Self::Container<SatelliteConfiguration>>
Produces a paginated stream of
SatelliteConfiguration
objects. Read moreSource§fn get_satellite_configuration_by_id(
&self,
satellite_configuration_id: i32,
) -> impl Future<Output = Result<Self::Container<SatelliteConfiguration>, Error>> + Send + Sync
fn get_satellite_configuration_by_id( &self, satellite_configuration_id: i32, ) -> impl Future<Output = Result<Self::Container<SatelliteConfiguration>, Error>> + Send + Sync
Produces a single satellite configuration matching the provided satellite configuration ID
Source§fn get_satellite_configuration_by_name(
&self,
satellite_configuration_name: &str,
) -> impl Future<Output = Result<Self::Container<SatelliteConfiguration>, Error>> + Send + Sync
fn get_satellite_configuration_by_name( &self, satellite_configuration_name: &str, ) -> impl Future<Output = Result<Self::Container<SatelliteConfiguration>, Error>> + Send + Sync
Produces a single satellite configuration matching the provided satellite configuration name
Source§fn get_site_by_id(
&self,
id: i32,
) -> impl Future<Output = Result<Self::Container<Site>, Error>> + Send + Sync
fn get_site_by_id( &self, id: i32, ) -> impl Future<Output = Result<Self::Container<Site>, Error>> + Send + Sync
Source§fn get_site_by_name(
&self,
name: impl AsRef<str> + Send + Sync,
) -> impl Future<Output = Result<Self::Container<Site>, Error>> + Send + Sync
fn get_site_by_name( &self, name: impl AsRef<str> + Send + Sync, ) -> impl Future<Output = Result<Self::Container<Site>, Error>> + Send + Sync
Source§fn get_request_by_id(
&self,
task_request_id: i32,
) -> impl Future<Output = Result<Self::Container<TaskRequest>, Error>> + Send + Sync
fn get_request_by_id( &self, task_request_id: i32, ) -> impl Future<Output = Result<Self::Container<TaskRequest>, Error>> + Send + Sync
Produces a single
TaskRequest
matching the provided ID. Read moreSource§fn get_requests(&self) -> PaginatedStream<'_, Self::Container<TaskRequest>>
fn get_requests(&self) -> PaginatedStream<'_, Self::Container<TaskRequest>>
Produces a paginated stream of
TaskRequest
objects. Read moreSource§fn get_requests_by_target_date_between(
&self,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
fn get_requests_by_target_date_between( &self, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
Produces a vector of
TaskRequest
items, representing all the task requests matching the
target time overlapping with the provided time range.Source§fn get_requests_by_account_and_target_date_between<T>(
&self,
account_uri: T,
start: OffsetDateTime,
end: OffsetDateTime,
) -> PaginatedStream<'_, Self::Container<TaskRequest>>
fn get_requests_by_account_and_target_date_between<T>( &self, account_uri: T, start: OffsetDateTime, end: OffsetDateTime, ) -> PaginatedStream<'_, Self::Container<TaskRequest>>
Produces a vector of
TaskRequest
items,
representing all the task requests matching the account at the provided URI and whose
target time overlaps with the provided time range. Read moreSource§fn get_requests_by_account_and_upcoming_today(
&self,
) -> PaginatedStream<'_, Self::Container<TaskRequest>>
fn get_requests_by_account_and_upcoming_today( &self, ) -> PaginatedStream<'_, Self::Container<TaskRequest>>
Produces a paginated stream of
TaskRequest
objects whose account name matches the provided name, and whose pass will occur today. Read moreSource§fn get_requests_by_configuration<T>(
&self,
configuration_uri: T,
) -> PaginatedStream<'_, Self::Container<TaskRequest>>
fn get_requests_by_configuration<T>( &self, configuration_uri: T, ) -> PaginatedStream<'_, Self::Container<TaskRequest>>
Produces a paginated stream of
TaskRequest
objects whose satellite configuration matches that of the configuration at the
configuration_uri
endpoint. Read moreSource§fn get_requests_by_configuration_and_satellite_names_and_target_date_between<T, I, S>(
&self,
configuration_uri: T,
satellites: I,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
fn get_requests_by_configuration_and_satellite_names_and_target_date_between<T, I, S>( &self, configuration_uri: T, satellites: I, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
Produces a vector of
TaskRequest
items, representing all the task requests which match
the provided configuration, whose satellite name matches one of the names provided as part
of satellite_name
, and which overlaps the provided time range. Read moreSource§fn get_requests_by_configuration_and_target_date_between<T>(
&self,
configuration_uri: T,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
fn get_requests_by_configuration_and_target_date_between<T>( &self, configuration_uri: T, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
Produces a vector of
TaskRequest
items, representing all the task requests matching the
configuration at the provided URI and whose target time overlaps with the provided time
range. Read moreSource§fn get_requests_by_ids<I, S>(
&self,
ids: I,
) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
fn get_requests_by_ids<I, S>( &self, ids: I, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
Produces a vector of
TaskRequest
items,
representing all the task requests whose ID matches one of the IDs provided as part of
ids
. Read moreSource§fn get_requests_by_overlapping_public(
&self,
start: OffsetDateTime,
end: OffsetDateTime,
) -> PaginatedStream<'_, Self::Container<TaskRequest>>
fn get_requests_by_overlapping_public( &self, start: OffsetDateTime, end: OffsetDateTime, ) -> PaginatedStream<'_, Self::Container<TaskRequest>>
Produces a paginated stream of
TaskRequest
objects which are public, and which overlap
with the provided time range. Read moreSource§fn get_requests_by_satellite_name<T>(
&self,
satellite_name: T,
) -> PaginatedStream<'_, Self::Container<TaskRequest>>
fn get_requests_by_satellite_name<T>( &self, satellite_name: T, ) -> PaginatedStream<'_, Self::Container<TaskRequest>>
Produces a paginated stream of
TaskRequest
objects whose satellite name matches one of
the names provided as part of satellite_name
. Read moreSource§fn get_requests_by_satellite_name_and_target_date_between<T>(
&self,
satellite_name: T,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
fn get_requests_by_satellite_name_and_target_date_between<T>( &self, satellite_name: T, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
Produces a vector of
TaskRequest
items, representing all the task requests whose
satellite name matches the provided name and whose target time overlaps with the provided
time range. Read moreSource§fn get_requests_by_status<T>(
&self,
status: T,
) -> Result<PaginatedStream<'_, Self::Container<TaskRequest>>, Error>
fn get_requests_by_status<T>( &self, status: T, ) -> Result<PaginatedStream<'_, Self::Container<TaskRequest>>, Error>
Produces a paginated stream of
TaskRequest
objects whose status matches the provided
status. Read moreSource§fn get_requests_by_status_and_account_and_target_date_between<T, U>(
&self,
status: T,
account_uri: U,
start: OffsetDateTime,
end: OffsetDateTime,
) -> PaginatedStream<'_, Self::Container<TaskRequest>>
fn get_requests_by_status_and_account_and_target_date_between<T, U>( &self, status: T, account_uri: U, start: OffsetDateTime, end: OffsetDateTime, ) -> PaginatedStream<'_, Self::Container<TaskRequest>>
Produces a paginated stream of
TaskRequest
, representing all the task requests which
match the provided status, account, and overlap the provided time range. Read moreSource§fn get_requests_by_type_and_target_date_between<T>(
&self,
typ: T,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
fn get_requests_by_type_and_target_date_between<T>( &self, typ: T, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
Produces a vector of
TaskRequest
items, representing all the tasks which match the
provided type, overlap with the provided time range. Read moreSource§fn get_requests_passed_today(
&self,
) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
fn get_requests_passed_today( &self, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
Produces a vector of
TaskRequest
items, representing the list of tasks which have
already occurred today. Read moreSource§fn get_requests_upcoming_today(
&self,
) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
fn get_requests_upcoming_today( &self, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
Produces a vector of
TaskRequest
items, representing the list of tasks which will occur
later today. Read moreSource§fn get_satellites(&self) -> PaginatedStream<'_, Self::Container<Satellite>>
fn get_satellites(&self) -> PaginatedStream<'_, Self::Container<Satellite>>
Source§fn get_satellite_by_id(
&self,
satellite_id: i32,
) -> impl Future<Output = Result<Self::Container<Satellite>, Error>> + Send + Sync
fn get_satellite_by_id( &self, satellite_id: i32, ) -> impl Future<Output = Result<Self::Container<Satellite>, Error>> + Send + Sync
Produces single satellite object matching the provided satellite ID
Source§fn get_satellite_by_name(
&self,
satellite_name: &str,
) -> impl Future<Output = Result<Self::Container<Satellite>, Error>> + Send + Sync
fn get_satellite_by_name( &self, satellite_name: &str, ) -> impl Future<Output = Result<Self::Container<Satellite>, Error>> + Send + Sync
Produces single satellite object matching the provided satellite name
Source§fn get_task_by_id(
&self,
task_id: i32,
) -> impl Future<Output = Result<Self::Container<Task>, Error>> + Send + Sync
fn get_task_by_id( &self, task_id: i32, ) -> impl Future<Output = Result<Self::Container<Task>, Error>> + Send + Sync
Source§fn get_tasks_by_account_and_pass_overlapping<T>(
&self,
account_uri: T,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
fn get_tasks_by_account_and_pass_overlapping<T>( &self, account_uri: T, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
Source§fn get_tasks_by_account_and_satellite_and_band_and_pass_overlapping<T, U, V>(
&self,
account_uri: T,
satellite_config_uri: U,
band: V,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
fn get_tasks_by_account_and_satellite_and_band_and_pass_overlapping<T, U, V>( &self, account_uri: T, satellite_config_uri: U, band: V, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
Source§fn get_tasks_by_account_and_site_configuration_and_band_and_pass_overlapping<T, U, V>(
&self,
account_uri: T,
site_config_uri: U,
band: V,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
fn get_tasks_by_account_and_site_configuration_and_band_and_pass_overlapping<T, U, V>( &self, account_uri: T, site_config_uri: U, band: V, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
Source§fn get_tasks_by_pass_window(
&self,
start: OffsetDateTime,
end: OffsetDateTime,
) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
fn get_tasks_by_pass_window( &self, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
Source§fn get_tasks_by_pass_overlapping(
&self,
start: OffsetDateTime,
end: OffsetDateTime,
) -> PaginatedStream<'_, Self::Container<Task>>
fn get_tasks_by_pass_overlapping( &self, start: OffsetDateTime, end: OffsetDateTime, ) -> PaginatedStream<'_, Self::Container<Task>>
Source§fn get_tasks_passed_today(
&self,
) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
fn get_tasks_passed_today( &self, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
Source§fn get_tasks_upcoming_today(
&self,
) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
fn get_tasks_upcoming_today( &self, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync
Source§fn new_band_details(&self) -> BandDetailsBuilder<'_, Self, NoName>where
Self: Sized,
fn new_band_details(&self) -> BandDetailsBuilder<'_, Self, NoName>where
Self: Sized,
Create a new satellite band object Read more
Source§fn new_satellite_configuration(
&self,
) -> SatelliteConfigurationBuilder<'_, Self, NoName>where
Self: Sized,
fn new_satellite_configuration(
&self,
) -> SatelliteConfigurationBuilder<'_, Self, NoName>where
Self: Sized,
Create a new satellite configuration Read more
Source§fn new_satellite(&self) -> SatelliteBuilder<'_, Self, NoName>where
Self: Sized,
fn new_satellite(&self) -> SatelliteBuilder<'_, Self, NoName>where
Self: Sized,
Create a new satellite Read more
Source§fn new_override(&self) -> OverrideBuilder<'_, Self, NoName>where
Self: Sized,
fn new_override(&self) -> OverrideBuilder<'_, Self, NoName>where
Self: Sized,
Create a new override Read more
Source§fn new_user(&self) -> UserBuilder<'_, Self, NoAccount>where
Self: Sized,
fn new_user(&self) -> UserBuilder<'_, Self, NoAccount>where
Self: Sized,
Create a new user Read more
Source§fn new_task_request(&self) -> TaskRequestBuilder<'_, Self, NoType>where
Self: Sized,
fn new_task_request(&self) -> TaskRequestBuilder<'_, Self, NoType>where
Self: Sized,
Create a new task request Read more
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more