ghl-models 0.4.0

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

/// `DeleteLinksSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteLinksSuccessfulResponseDto {
    /// Indicates whether the link was successfully deleted (legacy field, misspelled). Use
    /// `succeeded` with x-api-version: v3.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub succeded: Option<bool>,
    /// Indicates whether the link was successfully deleted.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub succeeded: Option<bool>,
}

/// `GetLinkSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetLinkSuccessfulResponseDto {
    /// The trigger link object
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub link: Option<LinkSchema>,
}

/// `GetLinksSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetLinksSuccessfulResponseDto {
    /// List of trigger links
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub links: Vec<LinkSchema>,
}

/// `LinkSchema` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct LinkSchema {
    /// Unique identifier of the trigger link
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Display name of the trigger link
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// URL or variable to redirect to when the trigger link is clicked
    #[serde(
        rename = "redirectTo",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub redirect_to: Option<String>,
    /// Template variable key used to reference this trigger link
    #[serde(rename = "fieldKey", default, skip_serializing_if = "Option::is_none")]
    pub field_key: Option<String>,
    /// Location ID this trigger link belongs to
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
}

/// `LinkUpdateDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct LinkUpdateDto {
    /// Display name of the trigger link
    /// Required by the API.
    pub name: String,
    /// URL or variable to redirect to when the trigger link is clicked
    /// Required by the API.
    #[serde(rename = "redirectTo")]
    pub redirect_to: String,
}

/// `LinksDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct LinksDto {
    /// Location ID of the business profile
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// Display name of the trigger link
    /// Required by the API.
    pub name: String,
    /// URL or variable to redirect to when the trigger link is clicked
    /// Required by the API.
    #[serde(rename = "redirectTo")]
    pub redirect_to: String,
}