ghl-models 0.5.2

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

/// `CreateRedirectParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateRedirectParams {
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// Required by the API.
    pub domain: String,
    /// Required by the API.
    pub path: String,
    /// Required by the API.
    pub target: String,
    /// Allowed values: `funnel`, `website`, `url`, `all`.
    /// Required by the API.
    pub action: String,
}

/// `CreateRedirectResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateRedirectResponseDTO {
    /// Data containing details of the created redirect
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<RedirectResponseDTO>,
}

/// `DeleteRedirectResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteRedirectResponseDTO {
    /// Status of the delete operation
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<serde_json::Value>,
}

/// `FunnelListResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FunnelListResponseDTO {
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub funnels: Option<serde_json::Value>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<f64>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
    pub trace_id: Option<String>,
}

/// `FunnelPageCountResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FunnelPageCountResponseDTO {
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<f64>,
}

/// `FunnelPageResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FunnelPageResponseDTO {
    /// 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>,
    /// 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>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "funnelId", default, skip_serializing_if = "Option::is_none")]
    pub funnel_id: Option<String>,
    /// 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>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "stepId", default, skip_serializing_if = "Option::is_none")]
    pub step_id: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub deleted: Option<String>,
    /// 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>,
}

/// `RedirectListResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct RedirectListResponseDTO {
    /// Object containing the count of redirects and an array of redirect data
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<serde_json::Value>,
}

/// `RedirectResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct RedirectResponseDTO {
    /// Unique identifier of the redirect
    /// 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>,
    /// Identifier of the location associated with the redirect
    /// 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>,
    /// Domain where the redirect occurs
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub domain: Option<String>,
    /// Original path that will be redirected
    /// 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>,
    /// Lowercase version of the original path
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "pathLowercase",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub path_lowercase: Option<String>,
    /// Type of redirect (e.g., Permanent, Temporary)
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
    pub type_: Option<String>,
    /// Target URL to which the original path will be redirected
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub target: Option<String>,
    /// Action performed by the redirect
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub action: Option<String>,
}

/// `UpdateRedirectParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateRedirectParams {
    /// Required by the API.
    pub target: String,
    /// Allowed values: `funnel`, `website`, `url`, `all`.
    /// Required by the API.
    pub action: String,
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
}

/// `UpdateRedirectResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateRedirectResponseDTO {
    /// Data containing details of the updated redirect
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<RedirectResponseDTO>,
}