use crate::client::AgentTrustClient;
use crate::error::Result;
use crate::models::{InitSessionRequest, Session};
pub struct SessionsAPI<'a> {
pub(crate) client: &'a AgentTrustClient,
}
impl<'a> SessionsAPI<'a> {
pub fn init_session(&self, agent_id: &str, server_id: &str) -> Result<Session> {
let req = InitSessionRequest {
agent_id: agent_id.to_string(),
server_id: server_id.to_string(),
};
self.client
.request("POST", "/mcp/sessions/init", Some(&req))
}
pub fn get_session(&self, session_id: &str) -> Result<Session> {
let path = format!("/mcp/sessions/{}", session_id);
self.client.request("GET", &path, None::<&()>)
}
}