Skip to main content

highlevel_api/apis/snapshots/
client.rs

1use std::sync::Arc;
2use crate::{error::Result, http::HttpClient};
3use super::types::*;
4
5pub struct SnapshotsApi {
6    http: Arc<HttpClient>,
7}
8
9impl SnapshotsApi {
10    pub fn new(http: Arc<HttpClient>) -> Self {
11        Self { http }
12    }
13
14    pub async fn list(&self, company_id: &str) -> Result<GetSnapshotsResponse> {
15        #[derive(serde::Serialize)]
16        struct Q<'a> {
17            #[serde(rename = "companyId")]
18            company_id: &'a str,
19        }
20        self.http.get_with_query("/snapshots", &Q { company_id }).await
21    }
22
23    pub async fn create_share_link(
24        &self,
25        params: &SnapshotShareLinkParams,
26    ) -> Result<SnapshotShareLinkResponse> {
27        self.http.post("/snapshots/share/link", params).await
28    }
29}