agentmail/client/
agent.rs1use crate::{Client, Error, types::*};
2
3impl Client {
4 pub async fn agent_sign_up(&self, signup: AgentSignup) -> Result<AgentSignupResult, Error> {
9 self.request(
10 reqwest::Method::POST,
11 "/v0/agent/sign-up",
12 &[],
13 Some(&signup),
14 )
15 .await
16 }
17
18 pub async fn agent_verify(&self, otp_code: &str) -> Result<AgentVerifyResult, Error> {
21 self.request(
22 reqwest::Method::POST,
23 "/v0/agent/verify",
24 &[],
25 Some(&serde_json::json!({ "otp_code": otp_code })),
26 )
27 .await
28 }
29
30 pub async fn agent_attach_human(
33 &self,
34 attach: AgentAttachHuman,
35 ) -> Result<AgentAttachHumanResult, Error> {
36 self.request(reqwest::Method::POST, "/v0/agent/human", &[], Some(&attach))
37 .await
38 }
39}