#![doc = "Transport-independent service interface for local and remote calls."]
use async_trait::async_trait;
use spiral_contract::auth::AuthHeader;
use spiral_contract::call::CallError;
use uuid::Uuid;
use crate::api::connections::objects::*;
#[async_trait]
pub trait ConnectionsApi: Send + Sync + 'static {
async fn create_connection(
&self,
auth_header: AuthHeader,
request: CreateConnectionRequest,
) -> Result<CreateConnectionResponse, CallError<ConnectionsError>>;
async fn drop_connection(
&self,
auth_header: AuthHeader,
connection_id: Uuid,
) -> Result<DropResponse, CallError<ConnectionsError>>;
async fn read_connection(
&self,
auth_header: AuthHeader,
connection_id: Uuid,
) -> Result<ConnectionResponse, CallError<ConnectionsError>>;
async fn test_connection(
&self,
auth_header: AuthHeader,
connection_id: Uuid,
) -> Result<TestResponse, CallError<ConnectionsError>>;
async fn update_allowed_access(
&self,
auth_header: AuthHeader,
connection_id: Uuid,
request: UpdateAllowedAccessRequest,
) -> Result<ConnectionResponse, CallError<ConnectionsError>>;
async fn update_credential(
&self,
auth_header: AuthHeader,
connection_id: Uuid,
request: UpdateCredentialRequest,
) -> Result<ConnectionResponse, CallError<ConnectionsError>>;
async fn update_description(
&self,
auth_header: AuthHeader,
connection_id: Uuid,
request: UpdateDescriptionRequest,
) -> Result<ConnectionResponse, CallError<ConnectionsError>>;
async fn vend_credential(
&self,
auth_header: AuthHeader,
connection_id: Uuid,
request: VendRequest,
) -> Result<VendResponse, CallError<ConnectionsError>>;
}