Skip to main content

ghl_models/v2/
links.rs

1//! `links` data models for GoHighLevel API V2 (6 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Links** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`links` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/links.md).
7//!
8//! Enable with `features = ["links"]`.
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/// `DeleteLinksSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct DeleteLinksSuccessfulResponseDto {
24    #[serde(default, skip_serializing_if = "Option::is_none")]
25    pub succeded: Option<bool>,
26}
27
28/// `GetLinkSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
29#[derive(Debug, Clone, Default, Serialize, Deserialize)]
30pub struct GetLinkSuccessfulResponseDto {
31    #[serde(default, skip_serializing_if = "Option::is_none")]
32    pub link: Option<LinkSchema>,
33}
34
35/// `GetLinksSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
36#[derive(Debug, Clone, Default, Serialize, Deserialize)]
37pub struct GetLinksSuccessfulResponseDto {
38    #[serde(default, skip_serializing_if = "Vec::is_empty")]
39    pub links: Vec<LinkSchema>,
40}
41
42/// `LinkSchema` from the GoHighLevel OpenAPI spec.
43#[derive(Debug, Clone, Default, Serialize, Deserialize)]
44pub struct LinkSchema {
45    #[serde(default, skip_serializing_if = "Option::is_none")]
46    pub id: Option<String>,
47    #[serde(default, skip_serializing_if = "Option::is_none")]
48    pub name: Option<String>,
49    #[serde(
50        rename = "redirectTo",
51        default,
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub redirect_to: Option<String>,
55    #[serde(rename = "fieldKey", default, skip_serializing_if = "Option::is_none")]
56    pub field_key: Option<String>,
57    #[serde(
58        rename = "locationId",
59        default,
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub location_id: Option<String>,
63}
64
65/// `LinkUpdateDto` from the GoHighLevel OpenAPI spec.
66#[derive(Debug, Clone, Default, Serialize, Deserialize)]
67pub struct LinkUpdateDto {
68    /// Required by the API.
69    pub name: String,
70    /// Required by the API.
71    #[serde(rename = "redirectTo")]
72    pub redirect_to: String,
73}
74
75/// `LinksDto` from the GoHighLevel OpenAPI spec.
76#[derive(Debug, Clone, Default, Serialize, Deserialize)]
77pub struct LinksDto {
78    /// Required by the API.
79    #[serde(rename = "locationId")]
80    pub location_id: String,
81    /// Required by the API.
82    pub name: String,
83    /// Required by the API.
84    #[serde(rename = "redirectTo")]
85    pub redirect_to: String,
86}