ghl-models 0.4.1

Rust data models (DTOs) for the GoHighLevel (HighLevel) API v2 and v3, generated from the official OpenAPI specifications
Documentation
//! `brand-boards` data models for GoHighLevel API V2 (11 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Brand Boards** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`brand-boards` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/brand-boards.md).
//!
//! Enable with `features = ["brand-boards"]`.
// @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};

/// `BrandBoardListItemDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BrandBoardListItemDTO {
    /// Brand board ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Brand board name
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Last update timestamp
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// Whether this is the default brand board for the location
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub default: Option<bool>,
    /// Metadata about the brand board
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub meta: Option<MetaData>,
}

/// `Color` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct Color {
    /// Unique identifier for the color
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Color in HEXA format (with alpha)
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hexa: Option<String>,
    /// Color in RGBA format
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rgba: Option<String>,
    /// Color in HEX format
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hex: Option<String>,
    /// Color in RGB format
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rgb: Option<String>,
    /// Display label for the color
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
}

/// `CreateBrandBoardParam` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateBrandBoardParam {
    /// Location ID where the brand board will be created
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// Name of the brand board
    /// Required by the API.
    pub name: String,
    /// Array of logos for the brand board
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub logos: Vec<Logo>,
    /// Array of colors for the brand board
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub colors: Vec<Color>,
    /// Array of fonts for the brand board
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub fonts: Vec<Font>,
    /// Set as the default brand board for this location
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub default: Option<bool>,
    /// Source brand board ID to copy from (creates a new brand board based on this template)
    #[serde(
        rename = "brandBoardId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub brand_board_id: Option<String>,
    /// Parent folder ID in media library for organizing brand boards
    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
    pub parent_id: Option<String>,
    /// Source type indicating how the brand board was created
    /// Allowed values: `template`, `blank`, `snapshot`.
    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
    pub type_: Option<String>,
}

/// `Font` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct Font {
    /// Unique identifier for the font
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Font family name
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub font: Option<String>,
    /// Fallback font family
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub fallback: Option<String>,
    /// Display label for the font
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
}

/// `GetBrandBoardSuccessDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetBrandBoardSuccessDTO {
    /// Brand board ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Location ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Brand board name
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Array of logos
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub logos: Vec<Logo>,
    /// Array of brand colors
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub colors: Vec<Color>,
    /// Array of brand fonts
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub fonts: Vec<Font>,
    /// Whether this is the default brand board for the location
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub default: Option<bool>,
    /// Whether the brand board has been soft deleted
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub deleted: Option<bool>,
    /// Parent folder ID in media library
    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
    pub parent_id: Option<String>,
    /// Media library folder ID for this brand board
    #[serde(rename = "folderId", default, skip_serializing_if = "Option::is_none")]
    pub folder_id: Option<String>,
    /// Original brand board ID if cloned from snapshot
    #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")]
    pub origin_id: Option<String>,
    /// Metadata about the brand board
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub meta: Option<MetaData>,
    /// Creation timestamp
    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Last update timestamp
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
}

/// `GetBrandBoardsByLocationSuccessDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetBrandBoardsByLocationSuccessDTO {
    /// Array of brand boards for the location
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "brandBoards", default, skip_serializing_if = "Vec::is_empty")]
    pub brand_boards: Vec<BrandBoardListItemDTO>,
    /// Total number of brand boards matching the query
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "totalCount",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub total_count: Option<f64>,
}

/// `InvalidLocationDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct InvalidLocationDTO {
    #[serde(
        rename = "statusCode",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub status_code: Option<f64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
}

/// `Logo` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct Logo {
    /// Unique identifier for the logo
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Public URL of the logo image. Used for uploading to the brand board folder in media
    /// library
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Display label for the logo (e.g., Primary, Secondary)
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    /// Storage path of the logo in the media library
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
}

/// `MetaData` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct MetaData {
    /// User ID who last updated the brand board
    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
    pub updated_by: Option<String>,
    /// Last action performed on the brand board
    #[serde(
        rename = "lastAction",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub last_action: Option<String>,
    /// Source brand board ID if created from a template
    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
    pub source_id: Option<String>,
    /// How the brand board was created
    /// Allowed values: `template`, `blank`, `snapshot`.
    #[serde(
        rename = "sourceType",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub source_type: Option<String>,
}

/// `NotFoundDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct NotFoundDTO {
    #[serde(
        rename = "statusCode",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub status_code: Option<f64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
}

/// `UpdateBrandBoardBody` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateBrandBoardBody {
    /// Name of the brand board
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Array of logos for the brand board
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub logos: Vec<Logo>,
    /// Array of colors for the brand board
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub colors: Vec<Color>,
    /// Array of fonts for the brand board
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub fonts: Vec<Font>,
    /// Set as the default brand board for this location
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub default: Option<bool>,
    /// Parent folder ID in media library (reserved for future use)
    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
    pub parent_id: Option<String>,
}