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 SocialResource<'a> {
pub(crate) t: &'a Transport,
}
impl SocialResource<'_> {
pub async fn dismiss_suggestion(self, handle: &str) -> Result<Value, MisarDevError> {
self.t.request(Method::POST, &format!("/social/suggestions/{}/dismiss", encode_path(handle)), "", None).await
}
pub async fn list_suggestions(self, query: Option<Value>) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, "/social/suggestions", &build_query(query.as_ref(), &[]), None).await
}
pub async fn me_mutuals(self, query: Option<Value>) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, "/social/me/mutuals", &build_query(query.as_ref(), &[]), None).await
}
pub async fn relationship(self, handle: &str) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, &format!("/social/relationship/{}", encode_path(handle)), "", None).await
}
}