Skip to main content

ghl_models/v3/
custom_menus.rs

1//! `custom-menus` data models for GoHighLevel API V3 (9 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Custom Menus** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`custom-menus` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/custom-menus.md).
7//!
8//! Enable with `features = ["custom-menus"]`.
9// @generated by xtask/generate_models.py — do not edit by hand.
10// Source: https://github.com/GoHighLevel/highlevel-api-docs
11// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
12// they aren't held to rustdoc's markdown conventions.
13#![allow(
14    missing_docs,
15    clippy::doc_lazy_continuation,
16    clippy::doc_overindented_list_items
17)]
18
19use serde::{Deserialize, Serialize};
20
21/// `CreateCustomMenuDTO` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct CreateCustomMenuDTO {
24    /// Title of the custom menu
25    /// Required by the API.
26    pub title: String,
27    /// URL of the custom menu
28    /// Required by the API.
29    pub url: String,
30    /// Icon information for the custom menu
31    /// Required by the API.
32    pub icon: IconSchema,
33    /// Whether the menu must be displayed on the agency's level
34    /// Required by the API.
35    #[serde(rename = "showOnCompany")]
36    pub show_on_company: bool,
37    /// Whether the menu must be displayed for sub-accounts level
38    /// Required by the API.
39    #[serde(rename = "showOnLocation")]
40    pub show_on_location: bool,
41    /// Whether the menu must be displayed to all sub-accounts
42    /// Required by the API.
43    #[serde(rename = "showToAllLocations")]
44    pub show_to_all_locations: bool,
45    /// Mode for opening the menu link
46    /// Allowed values: `iframe`, `new_tab`, `current_tab`.
47    /// Required by the API.
48    #[serde(rename = "openMode")]
49    pub open_mode: String,
50    /// List of sub-account IDs where the menu should be shown. This list is applicable only
51    /// when showOnLocation is true and showToAllLocations is false
52    /// Required by the API.
53    #[serde(default, skip_serializing_if = "Vec::is_empty")]
54    pub locations: Vec<String>,
55    /// Which user-roles should the menu be accessible to?
56    /// Allowed values: `all`, `admin`, `user`.
57    /// Required by the API.
58    #[serde(rename = "userRole")]
59    pub user_role: String,
60    /// Whether to allow camera access (only for iframe mode)
61    #[serde(
62        rename = "allowCamera",
63        default,
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub allow_camera: Option<bool>,
67    /// Whether to allow microphone access (only for iframe mode)
68    #[serde(
69        rename = "allowMicrophone",
70        default,
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub allow_microphone: Option<bool>,
74}
75
76/// `CustomMenuSchema` from the GoHighLevel OpenAPI spec.
77#[derive(Debug, Clone, Default, Serialize, Deserialize)]
78pub struct CustomMenuSchema {
79    /// Unique identifier for the custom menu
80    #[serde(default, skip_serializing_if = "Option::is_none")]
81    pub id: Option<String>,
82    /// Icon information for the menu item
83    #[serde(default, skip_serializing_if = "Option::is_none")]
84    pub icon: Option<IconSchemaOptional>,
85    /// Title of the custom menu
86    #[serde(default, skip_serializing_if = "Option::is_none")]
87    pub title: Option<String>,
88    /// URL of the custom menu
89    #[serde(default, skip_serializing_if = "Option::is_none")]
90    pub url: Option<String>,
91    /// Order of the custom menu
92    #[serde(default, skip_serializing_if = "Option::is_none")]
93    pub order: Option<f64>,
94    /// Filter to show only agency-level menu links. When omitted, fetches both agency and
95    /// sub-account menu links. Ignored if locationId is provided
96    #[serde(
97        rename = "showOnCompany",
98        default,
99        skip_serializing_if = "Option::is_none"
100    )]
101    pub show_on_company: Option<bool>,
102    /// Whether the menu must be displayed for sub-accounts level
103    #[serde(
104        rename = "showOnLocation",
105        default,
106        skip_serializing_if = "Option::is_none"
107    )]
108    pub show_on_location: Option<bool>,
109    /// Whether the menu must be displayed to all sub-accounts
110    #[serde(
111        rename = "showToAllLocations",
112        default,
113        skip_serializing_if = "Option::is_none"
114    )]
115    pub show_to_all_locations: Option<bool>,
116    /// List of sub-account IDs where the menu should be shown. This list is applicable only
117    /// when showOnLocation is true and showToAllLocations is false
118    #[serde(default, skip_serializing_if = "Vec::is_empty")]
119    pub locations: Vec<String>,
120    /// Mode for opening the menu link
121    /// Allowed values: `iframe`, `new_tab`, `current_tab`.
122    #[serde(rename = "openMode", default, skip_serializing_if = "Option::is_none")]
123    pub open_mode: Option<String>,
124    /// Which user-roles should the menu be accessible to?
125    /// Allowed values: `all`, `admin`, `user`.
126    #[serde(rename = "userRole", default, skip_serializing_if = "Option::is_none")]
127    pub user_role: Option<String>,
128    /// Indicates if camera access is allowed for this menu
129    #[serde(
130        rename = "allowCamera",
131        default,
132        skip_serializing_if = "Option::is_none"
133    )]
134    pub allow_camera: Option<bool>,
135    /// Indicates if microphone access is allowed for this menu
136    #[serde(
137        rename = "allowMicrophone",
138        default,
139        skip_serializing_if = "Option::is_none"
140    )]
141    pub allow_microphone: Option<bool>,
142}
143
144/// `DeleteCustomMenuSuccessfulResponseDTO` from the GoHighLevel OpenAPI spec.
145#[derive(Debug, Clone, Default, Serialize, Deserialize)]
146pub struct DeleteCustomMenuSuccessfulResponseDTO {
147    /// Indicates whether the custom menu was successfully deleted
148    #[serde(default, skip_serializing_if = "Option::is_none")]
149    pub success: Option<bool>,
150    /// A message providing additional information about the deletion operation
151    #[serde(default, skip_serializing_if = "Option::is_none")]
152    pub message: Option<String>,
153    /// The ID of the deleted custom menu
154    #[serde(
155        rename = "deletedMenuId",
156        default,
157        skip_serializing_if = "Option::is_none"
158    )]
159    pub deleted_menu_id: Option<String>,
160    /// Timestamp of when the deletion was performed
161    /// Format: date-time (ISO-8601 string).
162    #[serde(rename = "deletedAt", default, skip_serializing_if = "Option::is_none")]
163    pub deleted_at: Option<String>,
164}
165
166/// `GetCustomMenusResponseDTO` from the GoHighLevel OpenAPI spec.
167#[derive(Debug, Clone, Default, Serialize, Deserialize)]
168pub struct GetCustomMenusResponseDTO {
169    /// Array of custom menu links
170    #[serde(rename = "customMenus", default, skip_serializing_if = "Vec::is_empty")]
171    pub custom_menus: Vec<CustomMenuSchema>,
172    /// Total number of custom menu records
173    #[serde(
174        rename = "totalLinks",
175        default,
176        skip_serializing_if = "Option::is_none"
177    )]
178    pub total_links: Option<f64>,
179}
180
181/// `GetSingleCustomMenusSuccessfulResponseDTO` from the GoHighLevel OpenAPI spec.
182#[derive(Debug, Clone, Default, Serialize, Deserialize)]
183pub struct GetSingleCustomMenusSuccessfulResponseDTO {
184    /// Single Custom menu link object
185    #[serde(
186        rename = "customMenu",
187        default,
188        skip_serializing_if = "Option::is_none"
189    )]
190    pub custom_menu: Option<CustomMenuSchema>,
191}
192
193/// `IconSchema` from the GoHighLevel OpenAPI spec.
194#[derive(Debug, Clone, Default, Serialize, Deserialize)]
195pub struct IconSchema {
196    /// Name of the icon
197    /// Required by the API.
198    pub name: String,
199    /// Font family of the icon
200    /// Allowed values: `fab`, `fas`, `far`.
201    /// Required by the API.
202    #[serde(rename = "fontFamily")]
203    pub font_family: String,
204}
205
206/// `IconSchemaOptional` from the GoHighLevel OpenAPI spec.
207#[derive(Debug, Clone, Default, Serialize, Deserialize)]
208pub struct IconSchemaOptional {
209    /// Name of the icon
210    #[serde(default, skip_serializing_if = "Option::is_none")]
211    pub name: Option<String>,
212    /// Font family of the icon
213    /// Allowed values: `fab`, `fas`, `far`.
214    #[serde(
215        rename = "fontFamily",
216        default,
217        skip_serializing_if = "Option::is_none"
218    )]
219    pub font_family: Option<String>,
220}
221
222/// `UpdateCustomMenuDTO` from the GoHighLevel OpenAPI spec.
223#[derive(Debug, Clone, Default, Serialize, Deserialize)]
224pub struct UpdateCustomMenuDTO {
225    /// Title of the custom menu
226    #[serde(default, skip_serializing_if = "Option::is_none")]
227    pub title: Option<String>,
228    /// URL of the custom menu
229    #[serde(default, skip_serializing_if = "Option::is_none")]
230    pub url: Option<String>,
231    /// Icon information for the custom menu
232    #[serde(default, skip_serializing_if = "Option::is_none")]
233    pub icon: Option<IconSchemaOptional>,
234    /// Whether the menu must be displayed on the agency's level
235    #[serde(
236        rename = "showOnCompany",
237        default,
238        skip_serializing_if = "Option::is_none"
239    )]
240    pub show_on_company: Option<bool>,
241    /// Whether the menu must be displayed for sub-accounts level
242    #[serde(
243        rename = "showOnLocation",
244        default,
245        skip_serializing_if = "Option::is_none"
246    )]
247    pub show_on_location: Option<bool>,
248    /// Whether the menu must be displayed to all sub-accounts
249    #[serde(
250        rename = "showToAllLocations",
251        default,
252        skip_serializing_if = "Option::is_none"
253    )]
254    pub show_to_all_locations: Option<bool>,
255    /// Mode for opening the menu link
256    /// Allowed values: `iframe`, `new_tab`, `current_tab`.
257    #[serde(rename = "openMode", default, skip_serializing_if = "Option::is_none")]
258    pub open_mode: Option<String>,
259    /// List of sub-account IDs where the menu should be shown. This list is applicable only
260    /// when showOnLocation is true and showToAllLocations is false
261    #[serde(default, skip_serializing_if = "Vec::is_empty")]
262    pub locations: Vec<String>,
263    /// Which user-roles should the menu be accessible to?
264    /// Allowed values: `all`, `admin`, `user`.
265    #[serde(rename = "userRole", default, skip_serializing_if = "Option::is_none")]
266    pub user_role: Option<String>,
267    /// Whether to allow camera access (only for iframe mode)
268    #[serde(
269        rename = "allowCamera",
270        default,
271        skip_serializing_if = "Option::is_none"
272    )]
273    pub allow_camera: Option<bool>,
274    /// Whether to allow microphone access (only for iframe mode)
275    #[serde(
276        rename = "allowMicrophone",
277        default,
278        skip_serializing_if = "Option::is_none"
279    )]
280    pub allow_microphone: Option<bool>,
281}
282
283/// `UpdateCustomMenuLinkResponseDTO` from the GoHighLevel OpenAPI spec.
284#[derive(Debug, Clone, Default, Serialize, Deserialize)]
285pub struct UpdateCustomMenuLinkResponseDTO {
286    /// Status of update
287    #[serde(default, skip_serializing_if = "Option::is_none")]
288    pub success: Option<bool>,
289    /// Updated custom menu link
290    #[serde(
291        rename = "customMenu",
292        default,
293        skip_serializing_if = "Option::is_none"
294    )]
295    pub custom_menu: Option<CustomMenuSchema>,
296}