use super::types::*;
use crate::{error::Result, http::HttpClient};
use std::sync::Arc;
pub struct CampaignsApi {
http: Arc<HttpClient>,
}
impl CampaignsApi {
pub fn new(http: Arc<HttpClient>) -> Self {
Self { http }
}
pub async fn list(&self, location_id: &str) -> Result<GetCampaignsResponse> {
#[derive(serde::Serialize)]
struct Q<'a> {
#[serde(rename = "locationId")]
location_id: &'a str,
}
self.http
.get_with_query("/campaigns", &Q { location_id })
.await
}
}