1use std::sync::Arc;
2
3pub use covert_types::methods::system::{
4 InitializeParams, InitializeResponse, SealResponse, UnsealParams, UnsealResponse,
5};
6
7use crate::base::BaseClient;
8
9pub struct Client {
10 client: Arc<BaseClient>,
11}
12
13impl Client {
14 pub(crate) fn new(client: Arc<BaseClient>) -> Self {
15 Self { client }
16 }
17
18 pub async fn initialize(
19 &self,
20 params: &InitializeParams,
21 ) -> Result<InitializeResponse, String> {
22 self.client.post("/sys/init".into(), params).await
23 }
24
25 pub async fn unseal(&self, params: &UnsealParams) -> Result<UnsealResponse, String> {
26 self.client.post("/sys/unseal".into(), params).await
27 }
28
29 pub async fn seal(&self) -> Result<SealResponse, String> {
30 self.client.post("/sys/seal".into(), &()).await
31 }
32}