1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// @generated by xtask/generate_models.py — do not edit by hand.
//! Rust data models (DTOs) for the [GoHighLevel](https://www.gohighlevel.com)
//! (HighLevel) CRM API — **2417 types** generated from
//! [HighLevel's official OpenAPI specifications](https://github.com/GoHighLevel/highlevel-api-docs).
//!
//! Both API versions are covered side by side: [`v2`] (1081 types, the
//! current stable API, `Version: 2021-07-28`) and [`v3`] (1336 types,
//! `Version: v3`).
//!
//! ```toml
//! [dependencies]
//! ghl-models = { version = "0.3", features = ["invoices", "payments"] }
//! ```
//!
//! ```ignore
//! use ghl_models::v2::invoices::{CreateInvoiceDto, InvoiceItemDto};
//!
//! let invoice = CreateInvoiceDto {
//! alt_id: location_id,
//! alt_type: "location".into(), // the only legal value
//! name: "August retainer".into(),
//! currency: "USD".into(),
//! ..Default::default()
//! };
//! ```
//!
//! # Every module is a cargo feature
//!
//! Nothing is enabled by default, because compiling everything means thousands
//! of structs: **one module builds in ~1.3s, all 45 take ~30s.** Use
//! `features = ["full"]` only for exploration.
//!
//! | Feature | API v2 module (structs) | API v3 module (structs) |
//! |---|---|---|
//! | `ad-manager` | [`v2::ad_manager`] (107) | — |
//! | `ad-publishing` | — | [`v3::ad_publishing`] (108) |
//! | `affiliate-manager` | [`v2::affiliate_manager`] (13) | [`v3::affiliate_manager`] (13) |
//! | `agent-studio` | [`v2::agent_studio`] (14) | [`v3::agent_studio`] (14) |
//! | `associations` | [`v2::associations`] (5) | [`v3::associations`] (5) |
//! | `blogs` | [`v2::blogs`] (13) | [`v3::blogs`] (13) |
//! | `brand-boards` | [`v2::brand_boards`] (11) | [`v3::brand_boards`] (24) |
//! | `businesses` | [`v2::businesses`] (8) | [`v3::businesses`] (8) |
//! | `calendars` | [`v2::calendars`] (62) | [`v3::calendars`] (94) |
//! | `campaigns` | [`v2::campaigns`] (2) | [`v3::campaigns`] (2) |
//! | `chat-widget` | — | [`v3::chat_widget`] (15) |
//! | `companies` | [`v2::companies`] (3) | [`v3::companies`] (3) |
//! | `contacts` | [`v2::contacts`] (61) | [`v3::contacts`] (60) |
//! | `conversation-ai` | [`v2::conversation_ai`] (28) | [`v3::conversation_ai`] (28) |
//! | `conversations` | [`v2::conversations`] (44) | [`v3::conversations`] (44) |
//! | `courses` | [`v2::courses`] (10) | [`v3::courses`] (10) |
//! | `custom-fields` | [`v2::custom_fields`] (10) | [`v3::custom_fields`] (10) |
//! | `custom-menus` | [`v2::custom_menus`] (9) | [`v3::custom_menus`] (9) |
//! | `email-isv` | [`v2::email_isv`] (4) | [`v3::email_isv`] (4) |
//! | `emails` | [`v2::emails`] (12) | [`v3::emails`] (67) |
//! | `forms` | [`v2::forms`] (9) | [`v3::forms`] (9) |
//! | `funnels` | [`v2::funnels`] (10) | [`v3::funnels`] (10) |
//! | `invoices` | [`v2::invoices`] (104) | [`v3::invoices`] (104) |
//! | `knowledge-base` | [`v2::knowledge_base`] (38) | [`v3::knowledge_base`] (38) |
//! | `links` | [`v2::links`] (6) | [`v3::links`] (6) |
//! | `locations` | [`v2::locations`] (47) | [`v3::locations`] (53) |
//! | `marketplace` | [`v2::marketplace`] (13) | [`v3::marketplace`] (13) |
//! | `medias` | [`v2::medias`] (10) | [`v3::medias`] (10) |
//! | `oauth` | [`v2::oauth`] (6) | [`v3::oauth`] (12) |
//! | `objects` | [`v2::objects`] (20) | [`v3::objects`] (20) |
//! | `opportunities` | [`v2::opportunities`] (25) | [`v3::opportunities`] (26) |
//! | `payments` | [`v2::payments`] (55) | [`v3::payments`] (55) |
//! | `phone-system` | [`v2::phone_system`] (6) | [`v3::phone_system`] (8) |
//! | `products` | [`v2::products`] (64) | [`v3::products`] (64) |
//! | `proposals` | [`v2::proposals`] (21) | [`v3::proposals`] (21) |
//! | `saas` | — | [`v3::saas`] (25) |
//! | `saas-api` | [`v2::saas_api`] (20) | — |
//! | `snapshots` | [`v2::snapshots`] (8) | [`v3::snapshots`] (8) |
//! | `social-media-posting` | [`v2::social_media_posting`] (107) | — |
//! | `social-planner` | — | [`v3::social_planner`] (228) |
//! | `store` | [`v2::store`] (40) | [`v3::store`] (40) |
//! | `surveys` | [`v2::surveys`] (9) | [`v3::surveys`] (9) |
//! | `users` | [`v2::users`] (10) | [`v3::users`] (9) |
//! | `voice-ai` | [`v2::voice_ai`] (35) | [`v3::voice_ai`] (35) |
//! | `workflows` | [`v2::workflows`] (2) | [`v3::workflows`] (2) |
//!
//! v3 renames three modules and adds one: `ad-manager`→`ad-publishing`,
//! `social-media-posting`→`social-planner`, `saas-api`→`saas`, plus a new
//! `chat-widget`.
//!
//! # Generation conventions
//!
//! | Convention | Why |
//! |---|---|
//! | Fields the spec marks `required` are non-`Option` | Matches the spec; you can't forget a mandatory field |
//! | Everything else is `Option<T>` with `skip_serializing_if` | Partial updates serialize to only what you set |
//! | Arrays are `Vec<T>` with `#[serde(default)]` | An absent list reads as empty rather than erroring |
//! | **String enums stay `String`** — allowed values are in each field's doc comment | GoHighLevel adds enum values without notice; a closed Rust enum would turn that into a deserialization failure |
//! | Anonymous nested objects and multi-branch compositions are `serde_json::Value` | The spec doesn't name them |
//! | A single-`$ref` `allOf` wrapper resolves to the referenced type | Those are description wrappers, not real composition |
//! | Unknown response fields are ignored, never rejected | Upstream additions can't break your build |
//!
//! # Related crates
//!
//! - [`ghl-sdk`](https://docs.rs/ghl-sdk) — the async API client (auth, retries,
//! rate limits, pagination). Re-exports this crate under its `models` feature.
//! - [`ghl-mcp`](https://crates.io/crates/ghl-mcp) — MCP server exposing
//! GoHighLevel to AI agents.
//!
//! # Further reading
//!
//! - [Usage guide](https://github.com/Shahroz/ghl-rs/blob/main/docs/GUIDE.md)
//! - [Full API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/README.md)
//! — every endpoint, struct, and enum value, per module
//!
//! Regenerate with `xtask/generate_models.py` after HighLevel updates its specs.
//!
//! *Not affiliated with HighLevel Inc.*