use crate::{
cdk::types::Principal,
dto::{
canister::{
CanisterHistoryResponse, CanisterInspectionOutcome, CanisterInspectionReserveResponse,
},
error::Error,
},
workflow::ic::mgmt::MgmtWorkflow,
};
pub struct MgmtApi;
impl MgmtApi {
pub fn canister_inspection_reserve(
pid: Principal,
) -> Result<CanisterInspectionReserveResponse, Error> {
MgmtWorkflow::canister_inspection_reserve(pid).map_err(Error::from)
}
pub async fn canister_history(pid: Principal) -> Result<CanisterHistoryResponse, Error> {
MgmtWorkflow::canister_history(pid)
.await
.map_err(Error::from)
}
pub async fn canister_inspection(pid: Principal) -> Result<CanisterInspectionOutcome, Error> {
MgmtWorkflow::canister_inspection(pid)
.await
.map_err(Error::from)
}
}