ghl-models 0.3.1

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.
    pub data: 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.
    pub data: serde_json::Value,
}

/// `FunnelListResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FunnelListResponseDTO {
    /// Required by the API.
    pub funnels: serde_json::Value,
    /// Required by the API.
    pub count: f64,
    /// Required by the API.
    #[serde(rename = "traceId")]
    pub trace_id: String,
}

/// `FunnelPageCountResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FunnelPageCountResponseDTO {
    /// Required by the API.
    pub count: f64,
}

/// `FunnelPageResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FunnelPageResponseDTO {
    /// Required by the API.
    #[serde(rename = "_id")]
    pub id: String,
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// Required by the API.
    #[serde(rename = "funnelId")]
    pub funnel_id: String,
    /// Required by the API.
    pub name: String,
    /// Required by the API.
    #[serde(rename = "stepId")]
    pub step_id: String,
    /// Required by the API.
    pub deleted: String,
    /// Required by the API.
    #[serde(rename = "updatedAt")]
    pub updated_at: 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.
    pub data: 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.
    pub id: String,
    /// Identifier of the location associated with the redirect
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// Domain where the redirect occurs
    /// Required by the API.
    pub domain: String,
    /// Original path that will be redirected
    /// Required by the API.
    pub path: String,
    /// Lowercase version of the original path
    /// Required by the API.
    #[serde(rename = "pathLowercase")]
    pub path_lowercase: String,
    /// Type of redirect (e.g., Permanent, Temporary)
    /// Required by the API.
    #[serde(rename = "type")]
    pub type_: String,
    /// Target URL to which the original path will be redirected
    /// Required by the API.
    pub target: String,
    /// Action performed by the redirect
    /// Required by the API.
    pub action: 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.
    pub data: RedirectResponseDTO,
}