Struct remoteit_api::R3Client

source ·
pub struct R3Client { /* private fields */ }
Expand description

A client for the remote.it API.

§Example

You can create a new R3Client using the builder pattern:

let credentials = Credentials::load_from_disk()
    .call()
    .unwrap()
    .take_profile("default")
    .expect("Couldn't parse secret access key!")
    .expect("Profile with given name does not exist!");
let client = R3Client::builder().credentials(credentials).build();
// Start making API calls
let devices = client.get_devices().call().unwrap();

Implementations§

source§

impl R3Client

source

pub async fn send_remoteit_graphql_request_async<V: Serialize, R: for<'a> Deserialize<'a>>( &self, query_body: &QueryBody<V>, ) -> Result<Response<R>, Box<dyn Error>>

Sends a signed GraphQL request to the remote.it API in a blocking way.

You probably don’t want to use this function directly, but rather use the other functions in this module like R3Client::get_files().

§Errors
  • Any error that occurs during the request.
  • Any error that occurs during deserialization of the response.
source

pub fn get_files_async<'__f0>( &'__f0 self, ) -> R3ClientGetFilesAsyncBuilder<'__f0>

Get a list of files that were uploaded to remote.it.

source

pub fn delete_file_async<'__f0>( &'__f0 self, ) -> R3ClientDeleteFileAsyncBuilder<'__f0>

Delete a file from remote.it. Deletes all versions of the file.

source

pub fn delete_file_version_async<'__f0>( &'__f0 self, ) -> R3ClientDeleteFileVersionAsyncBuilder<'__f0>

Delete a version of a file from remote.it. (Not the whole file)

source

pub fn start_job_async<'__f0>( &'__f0 self, ) -> R3ClientStartJobAsyncBuilder<'__f0>

Start scripting jobs on one or more devices.

source

pub fn cancel_job_async<'__f0>( &'__f0 self, ) -> R3ClientCancelJobAsyncBuilder<'__f0>

Cancel a job. See remote.it docs on more information on when jobs can be cancelled.

source

pub fn get_jobs_async<'__f0>(&'__f0 self) -> R3ClientGetJobsAsyncBuilder<'__f0>

Get a list of jobs that were started on remote.it.

source

pub fn get_owned_organization_async<'__f0>( &'__f0 self, ) -> R3ClientGetOwnedOrganizationAsyncBuilder<'__f0>

Get data on your own organization, which belongs to the current user. This Organization may or may not exist. You can create and configure your organization through the remote.it Web UI.

§Returns

Data on your organization, if you have one.

source

pub fn get_application_types_async<'__f0>( &'__f0 self, ) -> R3ClientGetApplicationTypesAsyncBuilder<'__f0>

Get a list of application types that are available on remote.it.

source

pub fn get_devices_async<'__f0>( &'__f0 self, ) -> R3ClientGetDevicesAsyncBuilder<'__f0>

Get a list of devices.

source§

impl R3Client

Impl block for blocking API calls.

source

pub fn send_remoteit_graphql_request<V: Serialize, R: for<'a> Deserialize<'a>>( &self, query_body: &QueryBody<V>, ) -> Result<Response<R>, Box<dyn Error>>

Sends a signed GraphQL request to the remote.it API in a blocking way.

You probably don’t want to use this function directly, but rather use the other functions in this module like R3Client::get_files().

§Errors
  • Any error that occurs during the request.
  • Any error that occurs during deserialization of the response.
source

pub fn get_files<'__f0>(&'__f0 self) -> R3ClientGetFilesBuilder<'__f0>

Get a list of files that were uploaded to remote.it.

source

pub fn delete_file<'__f0>(&'__f0 self) -> R3ClientDeleteFileBuilder<'__f0>

Delete a file from remote.it. Deletes all versions of the file.

source

pub fn delete_file_version<'__f0>( &'__f0 self, ) -> R3ClientDeleteFileVersionBuilder<'__f0>

Delete a version of a file from remote.it. (Not the whole file)

source

pub fn start_job<'__f0>(&'__f0 self) -> R3ClientStartJobBuilder<'__f0>

Start scripting jobs on one or more devices.

source

pub fn cancel_job<'__f0>(&'__f0 self) -> R3ClientCancelJobBuilder<'__f0>

Cancel a job. See remote.it docs on more information on when jobs can be cancelled.

source

pub fn get_jobs<'__f0>(&'__f0 self) -> R3ClientGetJobsBuilder<'__f0>

Get a list of jobs that were started on remote.it.

source

pub fn get_owned_organization<'__f0>( &'__f0 self, ) -> R3ClientGetOwnedOrganizationBuilder<'__f0>

Get data on your own organization, which belongs to the current user. This Organization may or may not exist. You can create and configure your organization through the remote.it Web UI.

§Returns

Data on your organization, if you have one.

source

pub fn get_organization_self_membership<'__f0>( &'__f0 self, ) -> R3ClientGetOrganizationSelfMembershipBuilder<'__f0>

Get a list of organization memberships for the current user.

§Returns

A list of organizations that you are a member of.

source

pub fn get_application_types<'__f0>( &'__f0 self, ) -> R3ClientGetApplicationTypesBuilder<'__f0>

Get a list of application types that are available on remote.it.

source

pub fn get_devices<'__f0>(&'__f0 self) -> R3ClientGetDevicesBuilder<'__f0>

Get a list of devices.

source§

impl R3Client

source

pub fn builder() -> R3ClientBuilder

Use builder syntax to create an instance of R3Client

source§

impl R3Client

source

pub fn credentials(&self) -> &Credentials

§Returns

A reference to the credentials used by the client.

Auto Trait Implementations§

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> 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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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