use crate::error::MisarDevError;
use crate::transport::Transport;
use crate::transport::encode_path;
use reqwest::Method;
use serde_json::Value;
#[derive(Debug, Clone, Copy)]
pub struct ProfileResource<'a> {
pub(crate) t: &'a Transport,
}
impl ProfileResource<'_> {
pub async fn follow(self, handle: &str) -> Result<Value, MisarDevError> {
self.t.request(Method::POST, &format!("/follow/{}", encode_path(handle)), "", None).await
}
pub async fn get(self, handle: &str) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, &format!("/profile/{}", encode_path(handle)), "", None).await
}
pub async fn unfollow(self, handle: &str) -> Result<Value, MisarDevError> {
self.t.request(Method::DELETE, &format!("/follow/{}", encode_path(handle)), "", None).await
}
}