use crate::error::MisarDevError;
use crate::transport::Transport;
use crate::transport::build_query;
use crate::transport::encode_path;
use reqwest::Method;
use serde_json::Value;
#[derive(Debug, Clone, Copy)]
pub struct GalleryResource<'a> {
pub(crate) t: &'a Transport,
}
impl GalleryResource<'_> {
pub async fn like(self, project_id: &str) -> Result<Value, MisarDevError> {
self.t.request(Method::POST, &format!("/gallery/{}/like", encode_path(project_id)), "", None).await
}
pub async fn list(self, query: Option<Value>) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, "/gallery", &build_query(query.as_ref(), &[]), None).await
}
pub async fn unlike(self, project_id: &str) -> Result<Value, MisarDevError> {
self.t.request(Method::DELETE, &format!("/gallery/{}/like", encode_path(project_id)), "", None).await
}
}