highlevel-api 0.2.1

Unofficial Rust SDK for the GoHighLevel (HighLevel) API
Documentation
use super::types::*;
use crate::{error::Result, http::HttpClient};
use std::sync::Arc;

pub struct PipelinesApi {
    http: Arc<HttpClient>,
}

impl PipelinesApi {
    pub fn new(http: Arc<HttpClient>) -> Self {
        Self { http }
    }

    pub async fn list(&self, location_id: &str) -> Result<GetPipelinesResponse> {
        #[derive(serde::Serialize)]
        struct Q<'a> {
            #[serde(rename = "locationId")]
            location_id: &'a str,
        }
        self.http
            .get_with_query("/opportunities/pipelines", &Q { location_id })
            .await
    }
}