Skip to main content

ghl_models/v3/
funnels.rs

1//! `funnels` data models for GoHighLevel API V3 (10 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Funnels** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`funnels` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/funnels.md).
7//!
8//! Enable with `features = ["funnels"]`.
9// @generated by xtask/generate_models.py — do not edit by hand.
10// Source: https://github.com/GoHighLevel/highlevel-api-docs
11// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
12// they aren't held to rustdoc's markdown conventions.
13#![allow(
14    missing_docs,
15    clippy::doc_lazy_continuation,
16    clippy::doc_overindented_list_items
17)]
18
19use serde::{Deserialize, Serialize};
20
21/// `CreateRedirectParams` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct CreateRedirectParams {
24    /// Required by the API.
25    #[serde(rename = "locationId")]
26    pub location_id: String,
27    /// Required by the API.
28    pub domain: String,
29    /// Required by the API.
30    pub path: String,
31    /// Required by the API.
32    pub target: String,
33    /// Allowed values: `funnel`, `website`, `url`, `all`.
34    /// Required by the API.
35    pub action: String,
36}
37
38/// `CreateRedirectResponseDTO` from the GoHighLevel OpenAPI spec.
39#[derive(Debug, Clone, Default, Serialize, Deserialize)]
40pub struct CreateRedirectResponseDTO {
41    /// Data containing details of the created redirect
42    /// Required by the API.
43    /// (Optional here so responses that omit it still parse.)
44    #[serde(default, skip_serializing_if = "Option::is_none")]
45    pub data: Option<RedirectResponseDTO>,
46}
47
48/// `DeleteRedirectResponseDTO` from the GoHighLevel OpenAPI spec.
49#[derive(Debug, Clone, Default, Serialize, Deserialize)]
50pub struct DeleteRedirectResponseDTO {
51    /// Status of the delete operation
52    /// Required by the API.
53    /// (Optional here so responses that omit it still parse.)
54    #[serde(default, skip_serializing_if = "Option::is_none")]
55    pub data: Option<serde_json::Value>,
56}
57
58/// `FunnelListResponseDTO` from the GoHighLevel OpenAPI spec.
59#[derive(Debug, Clone, Default, Serialize, Deserialize)]
60pub struct FunnelListResponseDTO {
61    /// Required by the API.
62    /// (Optional here so responses that omit it still parse.)
63    #[serde(default, skip_serializing_if = "Option::is_none")]
64    pub funnels: Option<serde_json::Value>,
65    /// Required by the API.
66    /// (Optional here so responses that omit it still parse.)
67    #[serde(default, skip_serializing_if = "Option::is_none")]
68    pub count: Option<f64>,
69    /// Required by the API.
70    /// (Optional here so responses that omit it still parse.)
71    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
72    pub trace_id: Option<String>,
73}
74
75/// `FunnelPageCountResponseDTO` from the GoHighLevel OpenAPI spec.
76#[derive(Debug, Clone, Default, Serialize, Deserialize)]
77pub struct FunnelPageCountResponseDTO {
78    /// Required by the API.
79    /// (Optional here so responses that omit it still parse.)
80    #[serde(default, skip_serializing_if = "Option::is_none")]
81    pub count: Option<f64>,
82}
83
84/// `FunnelPageResponseDTO` from the GoHighLevel OpenAPI spec.
85#[derive(Debug, Clone, Default, Serialize, Deserialize)]
86pub struct FunnelPageResponseDTO {
87    /// Required by the API.
88    /// (Optional here so responses that omit it still parse.)
89    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
90    pub id: Option<String>,
91    /// Required by the API.
92    /// (Optional here so responses that omit it still parse.)
93    #[serde(
94        rename = "locationId",
95        default,
96        skip_serializing_if = "Option::is_none"
97    )]
98    pub location_id: Option<String>,
99    /// Required by the API.
100    /// (Optional here so responses that omit it still parse.)
101    #[serde(rename = "funnelId", default, skip_serializing_if = "Option::is_none")]
102    pub funnel_id: Option<String>,
103    /// Required by the API.
104    /// (Optional here so responses that omit it still parse.)
105    #[serde(default, skip_serializing_if = "Option::is_none")]
106    pub name: Option<String>,
107    /// Required by the API.
108    /// (Optional here so responses that omit it still parse.)
109    #[serde(rename = "stepId", default, skip_serializing_if = "Option::is_none")]
110    pub step_id: Option<String>,
111    /// Required by the API.
112    /// (Optional here so responses that omit it still parse.)
113    #[serde(default, skip_serializing_if = "Option::is_none")]
114    pub deleted: Option<String>,
115    /// Required by the API.
116    /// (Optional here so responses that omit it still parse.)
117    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
118    pub updated_at: Option<String>,
119}
120
121/// `RedirectListResponseDTO` from the GoHighLevel OpenAPI spec.
122#[derive(Debug, Clone, Default, Serialize, Deserialize)]
123pub struct RedirectListResponseDTO {
124    /// Object containing the count of redirects and an array of redirect data
125    /// Required by the API.
126    /// (Optional here so responses that omit it still parse.)
127    #[serde(default, skip_serializing_if = "Option::is_none")]
128    pub data: Option<serde_json::Value>,
129}
130
131/// `RedirectResponseDTO` from the GoHighLevel OpenAPI spec.
132#[derive(Debug, Clone, Default, Serialize, Deserialize)]
133pub struct RedirectResponseDTO {
134    /// Unique identifier of the redirect
135    /// Required by the API.
136    /// (Optional here so responses that omit it still parse.)
137    #[serde(default, skip_serializing_if = "Option::is_none")]
138    pub id: Option<String>,
139    /// Identifier of the location associated with the redirect
140    /// Required by the API.
141    /// (Optional here so responses that omit it still parse.)
142    #[serde(
143        rename = "locationId",
144        default,
145        skip_serializing_if = "Option::is_none"
146    )]
147    pub location_id: Option<String>,
148    /// Domain where the redirect occurs
149    /// Required by the API.
150    /// (Optional here so responses that omit it still parse.)
151    #[serde(default, skip_serializing_if = "Option::is_none")]
152    pub domain: Option<String>,
153    /// Original path that will be redirected
154    /// Required by the API.
155    /// (Optional here so responses that omit it still parse.)
156    #[serde(default, skip_serializing_if = "Option::is_none")]
157    pub path: Option<String>,
158    /// Lowercase version of the original path
159    /// Required by the API.
160    /// (Optional here so responses that omit it still parse.)
161    #[serde(
162        rename = "pathLowercase",
163        default,
164        skip_serializing_if = "Option::is_none"
165    )]
166    pub path_lowercase: Option<String>,
167    /// Type of redirect (e.g., Permanent, Temporary)
168    /// Required by the API.
169    /// (Optional here so responses that omit it still parse.)
170    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
171    pub type_: Option<String>,
172    /// Target URL to which the original path will be redirected
173    /// Required by the API.
174    /// (Optional here so responses that omit it still parse.)
175    #[serde(default, skip_serializing_if = "Option::is_none")]
176    pub target: Option<String>,
177    /// Action performed by the redirect
178    /// Required by the API.
179    /// (Optional here so responses that omit it still parse.)
180    #[serde(default, skip_serializing_if = "Option::is_none")]
181    pub action: Option<String>,
182}
183
184/// `UpdateRedirectParams` from the GoHighLevel OpenAPI spec.
185#[derive(Debug, Clone, Default, Serialize, Deserialize)]
186pub struct UpdateRedirectParams {
187    /// Required by the API.
188    pub target: String,
189    /// Allowed values: `funnel`, `website`, `url`, `all`.
190    /// Required by the API.
191    pub action: String,
192    /// Required by the API.
193    #[serde(rename = "locationId")]
194    pub location_id: String,
195}
196
197/// `UpdateRedirectResponseDTO` from the GoHighLevel OpenAPI spec.
198#[derive(Debug, Clone, Default, Serialize, Deserialize)]
199pub struct UpdateRedirectResponseDTO {
200    /// Data containing details of the updated redirect
201    /// Required by the API.
202    /// (Optional here so responses that omit it still parse.)
203    #[serde(default, skip_serializing_if = "Option::is_none")]
204    pub data: Option<RedirectResponseDTO>,
205}