use super::types::*;
use crate::{error::Result, http::HttpClient};
use std::sync::Arc;
pub struct MediasApi {
http: Arc<HttpClient>,
}
impl MediasApi {
pub fn new(http: Arc<HttpClient>) -> Self {
Self { http }
}
pub async fn list(&self, params: &GetMediasParams) -> Result<GetMediasResponse> {
self.http.get_with_query("/medias/files", params).await
}
pub async fn delete(&self, media_id: &str) -> Result<DeleteMediaResponse> {
self.http.delete(&format!("/medias/{media_id}")).await
}
}