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
impl R3Client
sourcepub 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>>
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.
sourcepub fn get_files_async<'__f0>(
&'__f0 self,
) -> R3ClientGetFilesAsyncBuilder<'__f0>
pub fn get_files_async<'__f0>( &'__f0 self, ) -> R3ClientGetFilesAsyncBuilder<'__f0>
Get a list of files that were uploaded to remote.it.
sourcepub fn delete_file_async<'__f0>(
&'__f0 self,
) -> R3ClientDeleteFileAsyncBuilder<'__f0>
pub fn delete_file_async<'__f0>( &'__f0 self, ) -> R3ClientDeleteFileAsyncBuilder<'__f0>
Delete a file from remote.it. Deletes all versions of the file.
sourcepub fn delete_file_version_async<'__f0>(
&'__f0 self,
) -> R3ClientDeleteFileVersionAsyncBuilder<'__f0>
pub fn delete_file_version_async<'__f0>( &'__f0 self, ) -> R3ClientDeleteFileVersionAsyncBuilder<'__f0>
Delete a version of a file from remote.it. (Not the whole file)
sourcepub fn start_job_async<'__f0>(
&'__f0 self,
) -> R3ClientStartJobAsyncBuilder<'__f0>
pub fn start_job_async<'__f0>( &'__f0 self, ) -> R3ClientStartJobAsyncBuilder<'__f0>
Start scripting jobs on one or more devices.
sourcepub fn cancel_job_async<'__f0>(
&'__f0 self,
) -> R3ClientCancelJobAsyncBuilder<'__f0>
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.
sourcepub fn get_jobs_async<'__f0>(&'__f0 self) -> R3ClientGetJobsAsyncBuilder<'__f0>
pub fn get_jobs_async<'__f0>(&'__f0 self) -> R3ClientGetJobsAsyncBuilder<'__f0>
Get a list of jobs that were started on remote.it.
sourcepub fn get_owned_organization_async<'__f0>(
&'__f0 self,
) -> R3ClientGetOwnedOrganizationAsyncBuilder<'__f0>
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.
sourcepub fn get_application_types_async<'__f0>(
&'__f0 self,
) -> R3ClientGetApplicationTypesAsyncBuilder<'__f0>
pub fn get_application_types_async<'__f0>( &'__f0 self, ) -> R3ClientGetApplicationTypesAsyncBuilder<'__f0>
Get a list of application types that are available on remote.it.
sourcepub fn get_devices_async<'__f0>(
&'__f0 self,
) -> R3ClientGetDevicesAsyncBuilder<'__f0>
pub fn get_devices_async<'__f0>( &'__f0 self, ) -> R3ClientGetDevicesAsyncBuilder<'__f0>
Get a list of devices.
source§impl R3Client
impl R3Client
Impl block for blocking API calls.
sourcepub fn send_remoteit_graphql_request<V: Serialize, R: for<'a> Deserialize<'a>>(
&self,
query_body: &QueryBody<V>,
) -> Result<Response<R>, Box<dyn Error>>
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.
sourcepub fn get_files<'__f0>(&'__f0 self) -> R3ClientGetFilesBuilder<'__f0>
pub fn get_files<'__f0>(&'__f0 self) -> R3ClientGetFilesBuilder<'__f0>
Get a list of files that were uploaded to remote.it.
sourcepub fn delete_file<'__f0>(&'__f0 self) -> R3ClientDeleteFileBuilder<'__f0>
pub fn delete_file<'__f0>(&'__f0 self) -> R3ClientDeleteFileBuilder<'__f0>
Delete a file from remote.it. Deletes all versions of the file.
sourcepub fn delete_file_version<'__f0>(
&'__f0 self,
) -> R3ClientDeleteFileVersionBuilder<'__f0>
pub fn delete_file_version<'__f0>( &'__f0 self, ) -> R3ClientDeleteFileVersionBuilder<'__f0>
Delete a version of a file from remote.it. (Not the whole file)
sourcepub fn start_job<'__f0>(&'__f0 self) -> R3ClientStartJobBuilder<'__f0>
pub fn start_job<'__f0>(&'__f0 self) -> R3ClientStartJobBuilder<'__f0>
Start scripting jobs on one or more devices.
sourcepub fn cancel_job<'__f0>(&'__f0 self) -> R3ClientCancelJobBuilder<'__f0>
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.
sourcepub fn get_jobs<'__f0>(&'__f0 self) -> R3ClientGetJobsBuilder<'__f0>
pub fn get_jobs<'__f0>(&'__f0 self) -> R3ClientGetJobsBuilder<'__f0>
Get a list of jobs that were started on remote.it.
sourcepub fn get_owned_organization<'__f0>(
&'__f0 self,
) -> R3ClientGetOwnedOrganizationBuilder<'__f0>
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.
sourcepub fn get_organization_self_membership<'__f0>(
&'__f0 self,
) -> R3ClientGetOrganizationSelfMembershipBuilder<'__f0>
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.
sourcepub fn get_application_types<'__f0>(
&'__f0 self,
) -> R3ClientGetApplicationTypesBuilder<'__f0>
pub fn get_application_types<'__f0>( &'__f0 self, ) -> R3ClientGetApplicationTypesBuilder<'__f0>
Get a list of application types that are available on remote.it.
sourcepub fn get_devices<'__f0>(&'__f0 self) -> R3ClientGetDevicesBuilder<'__f0>
pub fn get_devices<'__f0>(&'__f0 self) -> R3ClientGetDevicesBuilder<'__f0>
Get a list of devices.
source§impl R3Client
impl R3Client
sourcepub fn builder() -> R3ClientBuilder
pub fn builder() -> R3ClientBuilder
Use builder syntax to create an instance of R3Client
source§impl R3Client
impl R3Client
sourcepub fn credentials(&self) -> &Credentials
pub fn credentials(&self) -> &Credentials
§Returns
A reference to the credentials used by the client.