Skip to main content

ghl_models/
lib.rs

1// @generated by xtask/generate_models.py — do not edit by hand.
2//! # ghl-models
3//!
4//! Rust data models (DTOs) for the [GoHighLevel](https://www.gohighlevel.com)
5//! API, generated from HighLevel's official OpenAPI specifications.
6//!
7//! Both API versions are covered: [`v2`] (the current stable API, `Version:
8//! 2021-07-28`) and [`v3`] (`Version: v3`). Every API module is behind a cargo
9//! feature so you compile only the models you use — enabling everything means
10//! thousands of structs.
11//!
12//! ```toml
13//! [dependencies]
14//! ghl-models = { version = "0.1", features = ["contacts", "invoices"] }
15//! ```
16//!
17//! ## How these types are generated
18//!
19//! * Fields the spec marks `required` are non-`Option`; the rest are
20//!   `Option<T>` that skip serialization when `None`, so partial updates work.
21//! * Arrays are `Vec<T>` with `#[serde(default)]` — an absent list reads as empty.
22//! * String enums are `String` with the allowed values in the doc comment.
23//!   GoHighLevel introduces new values without notice, and a closed Rust enum
24//!   would turn that into a deserialization failure.
25//! * Anonymous nested objects and multi-branch compositions are
26//!   `serde_json::Value`.
27//! * Unknown fields in responses are ignored, never rejected, so upstream
28//!   additions can't break your build.
29//!
30//! Regenerate with `xtask/generate_models.py` after HighLevel updates its specs.
31//!
32//! *Not affiliated with HighLevel Inc.*
33
34#![cfg_attr(docsrs, feature(doc_cfg))]
35
36pub mod v2;
37pub mod v3;