Struct Client

Source
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

Source

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");
Source

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

Source§

type Container<T: Value> = Inner<T>

The Api supports implementors with different so-called “container” types. Read more
Source§

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
Source§

async fn delete(&self, url: Url) -> Result<Response, Error>

Source§

async fn post<S>(&self, url: Url, msg: S) -> Result<Response, Error>
where S: Serialize + Sync + Send,

Lower level method, not intended for direct use
Source§

fn config(&self) -> &Config

Returns the freedom configuration for the API
Source§

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 + Sync
where 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>>
where T: 'static + Value + Send + Sync,

Creates a stream of items from a paginated endpoint. Read more
Source§

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

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

Request to delete the satellite configuration matching the provided id Read more
Source§

fn delete_satellite( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send

Request to delete the satellite object matching the provided id Read more
Source§

fn delete_override( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send

Request to delete the override matching the provided id Read more
Source§

fn delete_user( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send

Request to delete the user matching the provided id Read more
Source§

fn delete_task_request( &self, id: i32, ) -> impl Future<Output = Result<Response, Error>> + Send

Request to delete the user matching the provided id Read more
Source§

fn post_deserialize<S, T>( &self, url: Url, msg: S, ) -> impl Future<Output = Result<T, Error>> + Send + Sync
where S: Serialize + Send + Sync, T: Value,

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

Produces a single Account matching the provided ID. Read more
Source§

fn get_file_by_task_id_and_name( &self, task_id: i32, file_name: &str, ) -> impl Future<Output = Result<Bytes, Error>> + Send + Sync

Produces a single Account matching the provided ID. Read more
Source§

fn get_account_by_id( &self, account_id: i32, ) -> impl Future<Output = Result<Self::Container<Account>, Error>> + Send + Sync

Produces a single Account matching the provided ID. Read more
Source§

fn get_accounts(&self) -> PaginatedStream<'_, Self::Container<Account>>

Produces a paginated stream of Account objects. Read more
Source§

fn get_satellite_bands(&self) -> PaginatedStream<'_, Self::Container<Band>>

Produces a paginated stream of Band objects. Read more
Source§

fn get_satellite_band_by_id( &self, satellite_band_id: i32, ) -> impl Future<Output = Result<Self::Container<Band>, Error>> + Send + Sync

Produces a single Band matching the provided ID. Read more
Source§

fn get_satellite_band_by_name( &self, satellite_band_name: &str, ) -> impl Future<Output = Result<Self::Container<Band>, Error>> + Send + Sync

Produces a single Band matching the provided name. Read more
Source§

fn get_satellite_bands_by_account_name( &self, account_name: &str, ) -> PaginatedStream<'_, Self::Container<Band>>

Produces a paginated stream of Band objects matching the provided account name. Read more
Source§

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 more
Source§

fn get_satellite_configurations( &self, ) -> PaginatedStream<'_, Self::Container<SatelliteConfiguration>>

Produces a paginated stream of SatelliteConfiguration objects. Read more
Source§

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

Produces a single satellite configuration matching the provided satellite configuration name
Source§

fn get_sites(&self) -> PaginatedStream<'_, Self::Container<Site>>

Produces a paginated stream of Site objects. Read more
Source§

fn get_site_by_id( &self, id: i32, ) -> impl Future<Output = Result<Self::Container<Site>, Error>> + Send + Sync

Produces a single Site object matching the provided ID. Read more
Source§

fn get_site_by_name( &self, name: impl AsRef<str> + Send + Sync, ) -> impl Future<Output = Result<Self::Container<Site>, Error>> + Send + Sync

Produces a single Site object matching the provided name. Read more
Source§

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 more
Source§

fn get_requests(&self) -> PaginatedStream<'_, Self::Container<TaskRequest>>

Produces a paginated stream of TaskRequest objects. Read more
Source§

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>>
where T: AsRef<str> + Send + Sync,

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 more
Source§

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 more
Source§

fn get_requests_by_configuration<T>( &self, configuration_uri: T, ) -> PaginatedStream<'_, Self::Container<TaskRequest>>
where T: AsRef<str> + Send + Sync,

Produces a paginated stream of TaskRequest objects whose satellite configuration matches that of the configuration at the configuration_uri endpoint. Read more
Source§

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
where T: AsRef<str> + Send + Sync, I: IntoIterator<Item = S> + Send + Sync, S: AsRef<str> + 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 more
Source§

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
where T: AsRef<str> + 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 more
Source§

fn get_requests_by_ids<I, S>( &self, ids: I, ) -> impl Future<Output = Result<Self::Container<Vec<TaskRequest>>, Error>> + Send + Sync
where I: IntoIterator<Item = S> + Send + Sync, S: AsRef<str> + 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 more
Source§

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 more
Source§

fn get_requests_by_satellite_name<T>( &self, satellite_name: T, ) -> PaginatedStream<'_, Self::Container<TaskRequest>>
where T: AsRef<str> + Send + Sync,

Produces a paginated stream of TaskRequest objects whose satellite name matches one of the names provided as part of satellite_name. Read more
Source§

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
where T: AsRef<str> + 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 more
Source§

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 more
Source§

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>>
where T: AsRef<str> + Send + Sync, U: AsRef<str> + Send + Sync,

Produces a paginated stream of TaskRequest, representing all the task requests which match the provided status, account, and overlap the provided time range. Read more
Source§

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
where T: TryInto<TaskType> + Send + Sync, Error: From<<T as TryInto<TaskType>>::Error>,

Produces a vector of TaskRequest items, representing all the tasks which match the provided type, overlap with the provided time range. Read more
Source§

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 more
Source§

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 more
Source§

fn get_satellites(&self) -> PaginatedStream<'_, Self::Container<Satellite>>

Produces a paginated stream of Satellite objects. Read more
Source§

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

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

Produces a single Task matching the provided ID. Read more
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
where T: AsRef<str> + Send + Sync,

Produces a vector of Task items, representing all the tasks which match the provided account, and intersect with the provided time frame. Read more
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
where T: AsRef<str> + Send + Sync, U: AsRef<str> + Send + Sync, V: AsRef<str> + Send + Sync,

Produces a vector of Task items, representing all the tasks which match the provided account, satellite, band, and intersect with the provided time frame. Read more
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
where T: AsRef<str> + Send + Sync, U: AsRef<str> + Send + Sync, V: AsRef<str> + Send + Sync,

Produces a vector of Task representing all the tasks which match the provided account, site configuration, band, and intersect with the provided time frame. Read more
Source§

fn get_tasks_by_pass_window( &self, start: OffsetDateTime, end: OffsetDateTime, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync

Produces a vector of Task items, representing all the tasks contained within the provided time frame. Read more
Source§

fn get_tasks_by_pass_overlapping( &self, start: OffsetDateTime, end: OffsetDateTime, ) -> PaginatedStream<'_, Self::Container<Task>>

Produces a paginated stream of Task items, representing all the tasks which overlap the provided time frame. Read more
Source§

fn get_tasks_passed_today( &self, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync

Produces a vector of Task items, representing the list of tasks which have already occurred today. Read more
Source§

fn get_tasks_upcoming_today( &self, ) -> impl Future<Output = Result<Self::Container<Vec<Task>>, Error>> + Send + Sync

Produces a vector of Task items, representing the list of tasks which will occur later today. Read more
Source§

fn get_users(&self) -> PaginatedStream<'_, Self::Container<User>>

Produces a paginated stream of User objects. Read more
Source§

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,

Create a new satellite configuration Read more
Source§

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,

Create a new override Read more
Source§

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,

Create a new task request Read more
Source§

fn new_token_by_site_configuration_id( &self, band_id: u32, site_configuration_id: u32, ) -> impl Future<Output = Result<String, Error>> + Send + Sync

Fetch an FPS token for the provided band ID and site configuration ID Read more
Source§

fn new_token_by_satellite_id( &self, band_id: u32, satellite_id: u32, ) -> impl Future<Output = Result<String, Error>> + Send + Sync

Fetch an FPS token for the provided band ID and satellite ID Read more
Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Client

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T