ghl-models 0.5.2

Rust data models (DTOs) for the GoHighLevel (HighLevel) API v2 and v3, generated from the official OpenAPI specifications
Documentation
//! `custom-menus` data models for GoHighLevel API V2 (9 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Custom Menus** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`custom-menus` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/custom-menus.md).
//!
//! Enable with `features = ["custom-menus"]`.
// @generated by xtask/generate_models.py — do not edit by hand.
// Source: https://github.com/GoHighLevel/highlevel-api-docs
// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
// they aren't held to rustdoc's markdown conventions.
#![allow(
    missing_docs,
    clippy::doc_lazy_continuation,
    clippy::doc_overindented_list_items
)]

use serde::{Deserialize, Serialize};

/// `CreateCustomMenuDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateCustomMenuDTO {
    /// Title of the custom menu
    /// Required by the API.
    pub title: String,
    /// URL of the custom menu
    /// Required by the API.
    pub url: String,
    /// Icon information for the custom menu
    /// Required by the API.
    pub icon: IconSchema,
    /// Whether the menu must be displayed on the agency's level
    /// Required by the API.
    #[serde(rename = "showOnCompany")]
    pub show_on_company: bool,
    /// Whether the menu must be displayed for sub-accounts level
    /// Required by the API.
    #[serde(rename = "showOnLocation")]
    pub show_on_location: bool,
    /// Whether the menu must be displayed to all sub-accounts
    /// Required by the API.
    #[serde(rename = "showToAllLocations")]
    pub show_to_all_locations: bool,
    /// Mode for opening the menu link
    /// Allowed values: `iframe`, `new_tab`, `current_tab`.
    /// Required by the API.
    #[serde(rename = "openMode")]
    pub open_mode: String,
    /// List of sub-account IDs where the menu should be shown. This list is applicable only
    /// when showOnLocation is true and showToAllLocations is false
    /// Required by the API.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub locations: Vec<String>,
    /// Which user-roles should the menu be accessible to?
    /// Allowed values: `all`, `admin`, `user`.
    /// Required by the API.
    #[serde(rename = "userRole")]
    pub user_role: String,
    /// Whether to allow camera access (only for iframe mode)
    #[serde(
        rename = "allowCamera",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_camera: Option<bool>,
    /// Whether to allow microphone access (only for iframe mode)
    #[serde(
        rename = "allowMicrophone",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_microphone: Option<bool>,
}

/// `CustomMenuSchema` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CustomMenuSchema {
    /// Unique identifier for the custom menu
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Icon information for the menu item
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub icon: Option<IconSchemaOptional>,
    /// Title of the custom menu
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// URL of the custom menu
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Order of the custom menu
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub order: Option<f64>,
    /// Filter to show only agency-level menu links. When omitted, fetches both agency and
    /// sub-account menu links. Ignored if locationId is provided
    #[serde(
        rename = "showOnCompany",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_on_company: Option<bool>,
    /// Whether the menu must be displayed for sub-accounts level
    #[serde(
        rename = "showOnLocation",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_on_location: Option<bool>,
    /// Whether the menu must be displayed to all sub-accounts
    #[serde(
        rename = "showToAllLocations",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_to_all_locations: Option<bool>,
    /// List of sub-account IDs where the menu should be shown. This list is applicable only
    /// when showOnLocation is true and showToAllLocations is false
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub locations: Vec<String>,
    /// Mode for opening the menu link
    /// Allowed values: `iframe`, `new_tab`, `current_tab`.
    #[serde(rename = "openMode", default, skip_serializing_if = "Option::is_none")]
    pub open_mode: Option<String>,
    /// Which user-roles should the menu be accessible to?
    /// Allowed values: `all`, `admin`, `user`.
    #[serde(rename = "userRole", default, skip_serializing_if = "Option::is_none")]
    pub user_role: Option<String>,
    /// Indicates if camera access is allowed for this menu
    #[serde(
        rename = "allowCamera",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_camera: Option<bool>,
    /// Indicates if microphone access is allowed for this menu
    #[serde(
        rename = "allowMicrophone",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_microphone: Option<bool>,
}

/// `DeleteCustomMenuSuccessfulResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteCustomMenuSuccessfulResponseDTO {
    /// Indicates whether the custom menu was successfully deleted
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// A message providing additional information about the deletion operation
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// The ID of the deleted custom menu
    #[serde(
        rename = "deletedMenuId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub deleted_menu_id: Option<String>,
    /// Timestamp of when the deletion was performed
    /// Format: date-time (ISO-8601 string).
    #[serde(rename = "deletedAt", default, skip_serializing_if = "Option::is_none")]
    pub deleted_at: Option<String>,
}

/// `GetCustomMenusResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetCustomMenusResponseDTO {
    /// Array of custom menu links
    #[serde(rename = "customMenus", default, skip_serializing_if = "Vec::is_empty")]
    pub custom_menus: Vec<CustomMenuSchema>,
    /// Total number of custom menu records
    #[serde(
        rename = "totalLinks",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub total_links: Option<f64>,
}

/// `GetSingleCustomMenusSuccessfulResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetSingleCustomMenusSuccessfulResponseDTO {
    /// Single Custom menu link object
    #[serde(
        rename = "customMenu",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub custom_menu: Option<CustomMenuSchema>,
}

/// `IconSchema` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct IconSchema {
    /// Name of the icon
    /// Required by the API.
    pub name: String,
    /// Font family of the icon
    /// Allowed values: `fab`, `fas`, `far`.
    /// Required by the API.
    #[serde(rename = "fontFamily")]
    pub font_family: String,
}

/// `IconSchemaOptional` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct IconSchemaOptional {
    /// Name of the icon
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Font family of the icon
    /// Allowed values: `fab`, `fas`, `far`.
    #[serde(
        rename = "fontFamily",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub font_family: Option<String>,
}

/// `UpdateCustomMenuDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateCustomMenuDTO {
    /// Title of the custom menu
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// URL of the custom menu
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Icon information for the custom menu
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub icon: Option<IconSchemaOptional>,
    /// Whether the menu must be displayed on the agency's level
    #[serde(
        rename = "showOnCompany",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_on_company: Option<bool>,
    /// Whether the menu must be displayed for sub-accounts level
    #[serde(
        rename = "showOnLocation",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_on_location: Option<bool>,
    /// Whether the menu must be displayed to all sub-accounts
    #[serde(
        rename = "showToAllLocations",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_to_all_locations: Option<bool>,
    /// Mode for opening the menu link
    /// Allowed values: `iframe`, `new_tab`, `current_tab`.
    #[serde(rename = "openMode", default, skip_serializing_if = "Option::is_none")]
    pub open_mode: Option<String>,
    /// List of sub-account IDs where the menu should be shown. This list is applicable only
    /// when showOnLocation is true and showToAllLocations is false
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub locations: Vec<String>,
    /// Which user-roles should the menu be accessible to?
    /// Allowed values: `all`, `admin`, `user`.
    #[serde(rename = "userRole", default, skip_serializing_if = "Option::is_none")]
    pub user_role: Option<String>,
    /// Whether to allow camera access (only for iframe mode)
    #[serde(
        rename = "allowCamera",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_camera: Option<bool>,
    /// Whether to allow microphone access (only for iframe mode)
    #[serde(
        rename = "allowMicrophone",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_microphone: Option<bool>,
}

/// `UpdateCustomMenuLinkResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateCustomMenuLinkResponseDTO {
    /// Status of update
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// Updated custom menu link
    #[serde(
        rename = "customMenu",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub custom_menu: Option<CustomMenuSchema>,
}