Struct ConnectorClient

Source
pub struct ConnectorClient<'a> { /* private fields */ }
Expand description

The connector client implements all relevant functions to communicate with an enmeshed connector.

Implementations§

Source§

impl<'a> ConnectorClient<'a>

Source

pub fn new(base_url: &'a str, api_key: &str) -> Self

To construct a connector client a base url the connector is listening to and the configured api key is needed.

Source§

impl<'a> ConnectorClient<'a>

All endpoints related to the enmeshed account.

Source

pub async fn get_identity_info(&self) -> Result<IdentityInfo, Error>

Retrieves the IdentityInfo of the connector the client is connected to.

Source

pub async fn get_sync_info(&self) -> Result<SyncInfo, Error>

Retrieves the date of the last sync ran if there has been one.

Source

pub async fn sync(&self) -> Result<ConnectorSyncResult, Error>

Syncs the connector with the backbone retrieving all messages and relationships that have been received since the last sync.

Source§

impl<'a> ConnectorClient<'a>

All endpoints to manage the attributes of the connector.

Source

pub async fn create_attribute( &self, attribute: &CreateAttributeRequest, ) -> Result<ConnectorAttribute, Error>

Source

pub async fn get_attributes( &self, query: &GetAttributesRequest<'a>, ) -> Result<Vec<ConnectorAttribute>, Error>

Source

pub async fn get_attribute_by_id( &self, id: &str, ) -> Result<ConnectorAttribute, Error>

Source

pub async fn get_valid_attributes( &self, query: &GetValidAttributesRequest<'a>, ) -> Result<Vec<ConnectorAttribute>, Error>

Source

pub async fn execute_identity_query( &self, body: &ExecuteIdentityAttributeQueryRequest<'a>, ) -> Result<Vec<ConnectorAttribute>, Error>

Source§

impl<'a> ConnectorClient<'a>

All endpoints related to creating and verifying challenges.

Source§

impl<'a> ConnectorClient<'a>

All endpoints related to file management, like upload or download of files.

Source

pub async fn get_files( &self, files_query: &GetAllFilesRequest<'_>, ) -> Result<Vec<ConnectorFile>, Error>

Source

pub async fn upload_file( &self, upload_body: &UploadFileRequest<'_>, ) -> Result<ConnectorFile, Error>

Source

pub async fn get_own_files( &self, files_query: &GetOwnFilesRequest<'_>, ) -> Result<Vec<ConnectorFile>, Error>

Source

pub async fn load_peer_file( &self, file_reference: &LoadPeerFileRequest, ) -> Result<Vec<ConnectorFile>, Error>

Source

pub async fn get_peer_files( &self, peer_req: &GetPeerFilesRequest<'_>, ) -> Result<Vec<ConnectorFile>, Error>

Source

pub async fn get_file(&self, file_id: &str) -> Result<Vec<ConnectorFile>, Error>

Source

pub async fn get_file_data(&self, file_id: &str) -> Result<Vec<u8>, Error>

Source

pub async fn get_file_qr_code(&self, file_id: &str) -> Result<Vec<u8>, Error>

Source

pub async fn get_file_token( &self, file_id: &str, req: Option<CreateTokenForFileRequest<'_>>, ) -> Result<ConnectorToken<FileToken>, Error>

Source

pub async fn get_file_token_qr_code( &self, file_id: &str, req: Option<CreateTokenQrCodeForFileRequest<'_>>, ) -> Result<Vec<u8>, Error>

Source§

impl<'a> ConnectorClient<'a>

All endpoints related to managing incomming requests.

Source

pub async fn get_incomming_request( &self, id: &str, ) -> Result<Vec<ConnectorRequest>, Error>

Source

pub async fn get_incomming_requests( &self, req: &GetRequestsRequest<'_>, ) -> Result<Vec<ConnectorRequest>, Error>

Source

pub async fn can_accept( &self, request_id: &str, req: &DecideRequest, ) -> Result<ConnectorRequestValidationResult, Error>

Source

pub async fn can_reject( &self, request_id: &str, req: &DecideRequest, ) -> Result<ConnectorRequestValidationResult, Error>

Source

pub async fn accept( &self, request_id: &str, req: &DecideRequest, ) -> Result<ConnectorRequest, Error>

Source

pub async fn reject( &self, request_id: &str, req: &DecideRequest, ) -> Result<ConnectorRequest, Error>

Source§

impl<'a> ConnectorClient<'a>

All endpoints related to managing messages.

Source

pub async fn get_messages( &self, attribute_query: &GetMessagesRequest, ) -> Result<Vec<ConnectorMessage<Value>>, Error>

Source

pub async fn send_message<'i, T: Serialize + DeserializeOwned>( &self, send_message: &SendMessageRequest<'i, T>, ) -> Result<ConnectorMessage<T>, Error>

Source

pub async fn get_message<T: DeserializeOwned>( &self, id: &str, ) -> Result<ConnectorMessageWithAttachments<T>, Error>

Source

pub async fn get_attachment( &self, message_id: &str, attachment_id: &str, ) -> Result<ConnectorFile, Error>

Source

pub async fn get_attachment_data( &self, message_id: &str, attachment_id: &str, ) -> Result<Vec<u8>, Error>

Source§

impl ConnectorClient<'_>

All endpoints related to monotoring the connector status.

Source

pub async fn check_health(&self) -> Result<ConnectorHealth, Error>

Source

pub async fn check_version(&self) -> Result<ConnectorVersionInfo, Error>

Source

pub async fn check_request_stats(&self) -> Result<ConnectorRequestCount, Error>

Source

pub async fn get_support(&self) -> Result<ConnectorSupport, Error>

Source§

impl<'a> ConnectorClient<'a>

All endpoints related to creating and managing outgoing requests.

Source

pub async fn can_create_request( &self, req: &CanCreateOutgoingRequestRequest, ) -> Result<ConnectorRequestValidationResult, Error>

Source

pub async fn create_request( &self, req: &CreateOutgoingRequestRequest, ) -> Result<ConnectorRequest, Error>

Source

pub async fn get_request(&self, req_id: &str) -> Result<ConnectorRequest, Error>

Source

pub async fn get_requests( &self, req: &GetRequestsRequest<'_>, ) -> Result<ConnectorRequest, Error>

Source§

impl<'a> ConnectorClient<'a>

Source§

impl<'a> ConnectorClient<'a>

Source

pub async fn create_relationship<T: Serialize + DeserializeOwned>( &self, req: CreateRelationshipRequest<'_, T>, ) -> Result<ConnectorRelationship<T, Value>, Error>

Source

pub async fn get_relationship<T: DeserializeOwned>( &self, id: &str, ) -> Result<ConnectorRelationship<T, Value>, Error>

Source

pub async fn get_relationships( &self, req: GetRelationshipsRequest<'_>, ) -> Result<Vec<ConnectorRelationship<Value, Value>>, Error>

Source

pub async fn accept_relationship_change<C: Serialize>( &self, rel_id: &str, change_id: &str, req: &DecideRelationshipChangeRequest<C>, ) -> Result<Vec<ConnectorRelationship<Value, Value>>, Error>

Source

pub async fn reject_relationship_change<C: Serialize>( &self, rel_id: &str, change_id: &str, req: &DecideRelationshipChangeRequest<C>, ) -> Result<Vec<ConnectorRelationship<Value, Value>>, Error>

Auto Trait Implementations§

§

impl<'a> Freeze for ConnectorClient<'a>

§

impl<'a> !RefUnwindSafe for ConnectorClient<'a>

§

impl<'a> Send for ConnectorClient<'a>

§

impl<'a> Sync for ConnectorClient<'a>

§

impl<'a> Unpin for ConnectorClient<'a>

§

impl<'a> !UnwindSafe for ConnectorClient<'a>

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