Skip to main content

ghl_models/v3/
custom_menus.rs

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