Skip to main content

highlevel_api/apis/medias/
client.rs

1use std::sync::Arc;
2use crate::{error::Result, http::HttpClient};
3use super::types::*;
4
5pub struct MediasApi {
6    http: Arc<HttpClient>,
7}
8
9impl MediasApi {
10    pub fn new(http: Arc<HttpClient>) -> Self {
11        Self { http }
12    }
13
14    pub async fn list(&self, params: &GetMediasParams) -> Result<GetMediasResponse> {
15        self.http.get_with_query("/medias/files", params).await
16    }
17
18    pub async fn delete(&self, media_id: &str) -> Result<DeleteMediaResponse> {
19        self.http.delete(&format!("/medias/{media_id}")).await
20    }
21}