Struct remoteit_api::R3Client
source · pub struct R3Client { /* private fields */ }
Expand description
A client for the remote.it API.
§Example
You can instantiate a new R3Client
using the builder pattern:
let credentials = Credentials::load_from_disk().call().unwrap().take_profile("default").unwrap().unwrap();
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(self) -> R3ClientGetFilesAsyncBuilder
pub fn get_files_async(self) -> R3ClientGetFilesAsyncBuilder
Get a list of files that were uploaded to remote.it.
sourcepub fn delete_file_async(self) -> R3ClientDeleteFileAsyncBuilder
pub fn delete_file_async(self) -> R3ClientDeleteFileAsyncBuilder
Delete a file from remote.it. Deletes all versions of the file.
sourcepub fn delete_file_version_async(self) -> R3ClientDeleteFileVersionAsyncBuilder
pub fn delete_file_version_async(self) -> R3ClientDeleteFileVersionAsyncBuilder
Delete a version of a file from remote.it. (Not the whole file)
sourcepub fn start_job_async(self) -> R3ClientStartJobAsyncBuilder
pub fn start_job_async(self) -> R3ClientStartJobAsyncBuilder
Start scripting jobs on one or more devices.
sourcepub fn cancel_job_async(self) -> R3ClientCancelJobAsyncBuilder
pub fn cancel_job_async(self) -> R3ClientCancelJobAsyncBuilder
Cancel a job. See remote.it docs on more information on when jobs can be cancelled.
sourcepub fn get_jobs_async(self) -> R3ClientGetJobsAsyncBuilder
pub fn get_jobs_async(self) -> R3ClientGetJobsAsyncBuilder
Get a list of jobs that were started on remote.it.
sourcepub fn get_application_types_async(
self,
) -> R3ClientGetApplicationTypesAsyncBuilder
pub fn get_application_types_async( self, ) -> R3ClientGetApplicationTypesAsyncBuilder
Get a list of application types that are available on remote.it.
sourcepub fn get_devices_async(self) -> R3ClientGetDevicesAsyncBuilder
pub fn get_devices_async(self) -> R3ClientGetDevicesAsyncBuilder
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(self) -> R3ClientGetFilesBuilder
pub fn get_files(self) -> R3ClientGetFilesBuilder
Get a list of files that were uploaded to remote.it.
sourcepub fn delete_file(self) -> R3ClientDeleteFileBuilder
pub fn delete_file(self) -> R3ClientDeleteFileBuilder
Delete a file from remote.it. Deletes all versions of the file.
sourcepub fn delete_file_version(self) -> R3ClientDeleteFileVersionBuilder
pub fn delete_file_version(self) -> R3ClientDeleteFileVersionBuilder
Delete a version of a file from remote.it. (Not the whole file)
sourcepub fn start_job(self) -> R3ClientStartJobBuilder
pub fn start_job(self) -> R3ClientStartJobBuilder
Start scripting jobs on one or more devices.
sourcepub fn cancel_job(self) -> R3ClientCancelJobBuilder
pub fn cancel_job(self) -> R3ClientCancelJobBuilder
Cancel a job. See remote.it docs on more information on when jobs can be cancelled.
sourcepub fn get_jobs(self) -> R3ClientGetJobsBuilder
pub fn get_jobs(self) -> R3ClientGetJobsBuilder
Get a list of jobs that were started on remote.it.
sourcepub fn get_application_types(self) -> R3ClientGetApplicationTypesBuilder
pub fn get_application_types(self) -> R3ClientGetApplicationTypesBuilder
Get a list of application types that are available on remote.it.
sourcepub fn get_devices(self) -> R3ClientGetDevicesBuilder
pub fn get_devices(self) -> R3ClientGetDevicesBuilder
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.