#![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 crate::api::authorization::objects::*;
#[async_trait]
pub trait AuthorizationApi: Send + Sync + 'static {
async fn approve_installation(
&self,
auth_header: AuthHeader,
installation_id: String,
) -> Result<ReviewResponse, CallError<AuthorizationError>>;
async fn grant_role(
&self,
auth_header: AuthHeader,
project_id: String,
request: GrantRoleRequest,
) -> Result<GrantResponse, CallError<AuthorizationError>>;
async fn list_grants(
&self,
auth_header: AuthHeader,
project_id: String,
request: ListGrantsRequest,
) -> Result<GrantPage, CallError<AuthorizationError>>;
async fn read_grant(
&self,
auth_header: AuthHeader,
grant_id: String,
) -> Result<Grant, CallError<AuthorizationError>>;
async fn read_installation(
&self,
auth_header: AuthHeader,
installation_id: String,
) -> Result<InstallationResponse, CallError<AuthorizationError>>;
async fn reject_installation(
&self,
auth_header: AuthHeader,
installation_id: String,
) -> Result<ReviewResponse, CallError<AuthorizationError>>;
async fn review_installation(
&self,
auth_header: AuthHeader,
installation_id: String,
request: ReviewRequest,
) -> Result<ReviewResponse, CallError<AuthorizationError>>;
async fn revoke_grant(
&self,
auth_header: AuthHeader,
grant_id: String,
) -> Result<(), CallError<AuthorizationError>>;
}