use crate::{send_and_translate_response, Deepgram};
use response::Message;
pub mod response;
#[derive(Debug, Clone)]
pub struct Invitations<'a>(&'a Deepgram);
impl Deepgram {
pub fn invitations(&self) -> Invitations<'_> {
self.into()
}
}
impl<'a> From<&'a Deepgram> for Invitations<'a> {
fn from(deepgram: &'a Deepgram) -> Self {
Self(deepgram)
}
}
impl Invitations<'_> {
pub async fn leave_project(&self, project_id: &str) -> crate::Result<Message> {
let url = format!("https://api.deepgram.com/v1/projects/{project_id}/leave",);
send_and_translate_response(self.0.client.delete(url)).await
}
}