ghl-models 0.4.1

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 V2 (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 {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub succeded: Option<bool>,
}

/// `GetLinkSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetLinkSuccessfulResponseDto {
    #[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 {
    #[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 {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(
        rename = "redirectTo",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub redirect_to: Option<String>,
    #[serde(rename = "fieldKey", default, skip_serializing_if = "Option::is_none")]
    pub field_key: Option<String>,
    #[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 {
    /// Required by the API.
    pub name: String,
    /// 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 {
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// Required by the API.
    pub name: String,
    /// Required by the API.
    #[serde(rename = "redirectTo")]
    pub redirect_to: String,
}