highlevel-api 0.2.0

Unofficial Rust SDK for the GoHighLevel (HighLevel) API
Documentation
use serde::{Deserialize, Serialize};

// ── Association types ───────────────────────────────────────────────────────

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Association {
    pub id: String,
    pub name: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    pub location_id: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ListAssociationsResponse {
    pub associations: Vec<Association>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GetAssociationResponse {
    pub association: Association,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CreateAssociationParams {
    pub name: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
}

// ── Relation types ──────────────────────────────────────────────────────────

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Relation {
    pub id: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub association_id: Option<String>,
    pub record_id: String,
    pub related_record_id: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ListRelationsResponse {
    pub relations: Vec<Relation>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GetRelationResponse {
    pub relation: Relation,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CreateRelationParams {
    pub association_id: String,
    pub record_id: String,
    pub related_record_id: String,
}