use serde_json::Value;
use crate::client::{encode_path_segment, Client};
use crate::error::Error;
use crate::types::{CreateHashtagSetParams, UpdateHashtagSetParams};
#[derive(Debug, Clone, Copy)]
pub struct HashtagSets<'a> {
pub(crate) client: &'a Client,
}
impl HashtagSets<'_> {
pub async fn list(&self) -> Result<Value, Error> {
self.client.get("/hashtag-sets", Vec::new()).await
}
pub async fn get(&self, id: &str) -> Result<Value, Error> {
self.client
.get(&format!("/hashtag-sets/{}", encode_path_segment(id)), Vec::new())
.await
}
pub async fn create(&self, params: CreateHashtagSetParams) -> Result<Value, Error> {
self.client.post_json("/hashtag-sets", ¶ms).await
}
pub async fn update(&self, id: &str, params: UpdateHashtagSetParams) -> Result<Value, Error> {
self.client
.patch_json(&format!("/hashtag-sets/{}", encode_path_segment(id)), ¶ms)
.await
}
pub async fn delete(&self, id: &str) -> Result<Value, Error> {
self.client
.delete(&format!("/hashtag-sets/{}", encode_path_segment(id)))
.await
}
}