use crate::{Client, Error, execute_wrapper};
use typesense_codegen::{apis::stopwords_api, models};
pub struct Stopword<'a> {
pub(super) client: &'a Client,
pub(super) set_id: &'a str,
}
impl<'a> Stopword<'a> {
#[inline]
pub(super) fn new(client: &'a Client, set_id: &'a str) -> Self {
Self { client, set_id }
}
pub async fn retrieve(
&self,
) -> Result<models::StopwordsSetRetrieveSchema, Error<stopwords_api::RetrieveStopwordsSetError>>
{
let params = stopwords_api::RetrieveStopwordsSetParams {
set_id: self.set_id.into(),
};
execute_wrapper!(self, stopwords_api::retrieve_stopwords_set, params)
}
pub async fn delete(
&self,
) -> Result<models::DeleteStopwordsSet200Response, Error<stopwords_api::DeleteStopwordsSetError>>
{
let params = stopwords_api::DeleteStopwordsSetParams {
set_id: self.set_id.into(),
};
execute_wrapper!(self, stopwords_api::delete_stopwords_set, params)
}
}