highlevel_api/apis/campaigns/
client.rs1use super::types::*;
2use crate::{error::Result, http::HttpClient};
3use std::sync::Arc;
4
5pub struct CampaignsApi {
6 http: Arc<HttpClient>,
7}
8
9impl CampaignsApi {
10 pub fn new(http: Arc<HttpClient>) -> Self {
11 Self { http }
12 }
13
14 pub async fn list(&self, location_id: &str) -> Result<GetCampaignsResponse> {
15 #[derive(serde::Serialize)]
16 struct Q<'a> {
17 #[serde(rename = "locationId")]
18 location_id: &'a str,
19 }
20 self.http
21 .get_with_query("/campaigns", &Q { location_id })
22 .await
23 }
24}