Struct CloudAgentPython

Source
pub struct CloudAgentPython {
    pub endpoint: String,
    pub api_key: Option<String>,
    pub auth_token: Option<String>,
    pub version: CloudAgentPythonVersion,
}
Expand description

Cloudagent Python Agent

Fields§

§endpoint: String

base url of the cloudagent

§api_key: Option<String>

admin Api key for the cloudagent

§auth_token: Option<String>

Authorization token for a multi tenancy agent

§version: CloudAgentPythonVersion

Agent version

Implementations§

Source§

impl CloudAgentPython

Call logic for http calls

Source

pub async fn get<T: DeserializeOwned + Debug>( &self, url: Url, query: Option<Vec<(&str, String)>>, ) -> Result<T>

Builds a get request and calls the sender

§Errors

When it could not fulfill a GET request

Source

pub async fn patch<T: DeserializeOwned + Debug>( &self, url: Url, query: Option<Vec<(&str, String)>>, ) -> Result<T>

Builds a patch request and calls the sender

§Errors

When it could not fulfill a PATCH request

Source

pub async fn post<T: DeserializeOwned + Debug>( &self, url: Url, query: Option<Vec<(&str, String)>>, body: Option<Value>, ) -> Result<T>

Builds a post request and calls the sender

§Errors

When it could not fulfill a POST request

Source

pub async fn send<T: DeserializeOwned + Debug>( &self, client: RequestBuilder, ) -> Result<T>

Sends any request

§Errors

When it could not fulfill the given request

Source§

impl CloudAgentPython

Source

pub const fn new( endpoint: String, version: CloudAgentPythonVersion, api_key: Option<String>, auth_token: Option<String>, ) -> Self

Create a new instance of an aries cloudagent python

Source

pub fn create_url(&self, paths: &[&str]) -> Result<Url>

Create a url based on the base url and a list of paths

§Errors

When the url could not be constructed

Trait Implementations§

Source§

impl BasicMessageModule for CloudAgentPython

Source§

fn send_message<'life0, 'async_trait>( &'life0 self, options: SendBasicMessageOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a basic message to another agent via the connection id
Source§

impl ConnectionModule for CloudAgentPython

Source§

fn get_all<'life0, 'async_trait>( &'life0 self, options: ConnectionGetAllOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<Connection>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets all the connections
Source§

fn get_by_id<'life0, 'async_trait>( &'life0 self, id: String, ) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a connection by id
Source§

fn create_invitation<'life0, 'async_trait>( &'life0 self, options: ConnectionCreateInvitationOptions, ) -> Pin<Box<dyn Future<Output = Result<Invitation>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an invitation
Source§

fn receive_invitation<'life0, 'async_trait>( &'life0 self, invitation: ConnectionReceiveInvitationOptions, ) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receive and accept a connection
Source§

impl CredentialDefinitionModule for CloudAgentPython

Source§

fn create<'life0, 'async_trait>( &'life0 self, options: CredentialDefinitionCreateOptions, ) -> Pin<Box<dyn Future<Output = Result<CredentialDefinitionCreateResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Register a credential definition on the ledger
Source§

fn get_by_id<'life0, 'async_trait>( &'life0 self, id: String, ) -> Pin<Box<dyn Future<Output = Result<CredentialDefinition>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the registered credential definition by id
Source§

fn get_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CredentialDefinitionGetAllResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all the registered credential definitions
Source§

impl CredentialModule for CloudAgentPython

Source§

fn send_offer<'life0, 'async_trait>( &'life0 self, options: CredentialOfferOptions, ) -> Pin<Box<dyn Future<Output = Result<CredentialOfferResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a credential offer to the connection id supplied in the options
Source§

impl Debug for CloudAgentPython

Source§

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

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

impl FeatureModule for CloudAgentPython

Source§

fn discover_features<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<DiscoverFeaturesResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Requests all the features from the cloudagent
Source§

impl MultitenancyModule for CloudAgentPython

Source§

fn create<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<MultitenancyCreateResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

TODO: this only returns the wallet id for now

Source§

fn remove<'life0, 'async_trait>( &'life0 self, wallet_id: String, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove a subwallet
Source§

impl OobModule for CloudAgentPython

Source§

fn create_invitation<'life0, 'async_trait>( &'life0 self, options: OobConnectionCreateInvitationOptions, ) -> Pin<Box<dyn Future<Output = Result<OobConnectionCreateInvitationResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an oob invitation
Source§

fn receive_invitation<'life0, 'async_trait>( &'life0 self, invitation: OobConnectionReceiveInvitationOptions, ) -> Pin<Box<dyn Future<Output = Result<OobConnection>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receive and accept an oob connection
Source§

impl ProofModule for CloudAgentPython

Source§

fn send_request<'life0, 'async_trait>( &'life0 self, options: ProofRequestOptions, ) -> Pin<Box<dyn Future<Output = Result<ProofRequestResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a proof request via the connection id to another agent
Source§

impl SchemaModule for CloudAgentPython

Source§

fn create<'life0, 'async_trait>( &'life0 self, options: SchemaCreateOptions, ) -> Pin<Box<dyn Future<Output = Result<Schema>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a schema on the ledger
Source§

fn get_by_id<'life0, 'async_trait>( &'life0 self, id: String, ) -> Pin<Box<dyn Future<Output = Result<Schema>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request the schema by the id
Source§

fn get_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SchemasGetAllResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all the registerd schemas
Source§

impl WalletModule for CloudAgentPython

Source§

fn get_wallet_dids<'life0, 'async_trait>( &'life0 self, options: Did, ) -> Pin<Box<dyn Future<Output = Result<DidList>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query a wallet for DIDs
Source§

fn create_local_did<'life0, 'async_trait>( &'life0 self, options: CreateLocalDidOptions, ) -> Pin<Box<dyn Future<Output = Result<Did>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a local DID
Source§

fn rotate_keypair<'life0, 'async_trait>( &'life0 self, did: String, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rotate key pair
Source§

fn fetch_public_did<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Did>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch public did
Source§

fn assign_public_did<'life0, 'async_trait>( &'life0 self, did: String, ) -> Pin<Box<dyn Future<Output = Result<Did>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Assign the current public DID
Source§

fn fetch_did_endpoint<'life0, 'async_trait>( &'life0 self, did: String, ) -> Pin<Box<dyn Future<Output = Result<DidEndpoint>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query DID endpoint of wallet
Source§

fn set_did_endpoint<'life0, 'async_trait>( &'life0 self, options: SetDidEndpointOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set DID endpoint of wallet
Source§

impl WebhookModule for CloudAgentPython

Source§

fn listen<'life0, 'async_trait>( &'life0 self, on_event: fn(Value), ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Listen to all incoming webhook

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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,