1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//! `associations` data models for GoHighLevel API V2 (5 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Associations** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`associations` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/associations.md).
//!
//! Enable with `features = ["associations"]`.
// @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};
/// `DeleteAssociationsResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteAssociationsResponseDTO {
/// Deletion status
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub deleted: Option<bool>,
/// Association Id
/// 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>,
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
/// `GetPostSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetPostSuccessfulResponseDto {
/// 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(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// First Objects Association Label (custom_objects.children)
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
/// First Objects Association Label (custom_objects.children)
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "firstObjectLabel",
default,
skip_serializing_if = "Option::is_none"
)]
pub first_object_label: Option<serde_json::Value>,
/// First Objects Key
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "firstObjectKey",
default,
skip_serializing_if = "Option::is_none"
)]
pub first_object_key: Option<serde_json::Value>,
/// Second Object Association Label (contact)
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "secondObjectLabel",
default,
skip_serializing_if = "Option::is_none"
)]
pub second_object_label: Option<serde_json::Value>,
/// Second Objects Key
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "secondObjectKey",
default,
skip_serializing_if = "Option::is_none"
)]
pub second_object_key: Option<serde_json::Value>,
/// Association Type can be USER_DEFINED or SYSTEM_DEFINED
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "associationType",
default,
skip_serializing_if = "Option::is_none"
)]
pub association_type: Option<serde_json::Value>,
}
/// `UpdateAssociationReqDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateAssociationReqDto {
/// Required by the API.
#[serde(rename = "firstObjectLabel")]
pub first_object_label: serde_json::Value,
/// Required by the API.
#[serde(rename = "secondObjectLabel")]
pub second_object_label: serde_json::Value,
}
/// `createAssociationReqDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateAssociationReqDto {
/// Required by the API.
#[serde(rename = "locationId")]
pub location_id: String,
/// Association's Unique key
/// Required by the API.
pub key: String,
/// First Objects Association Label (custom_objects.children)
/// Required by the API.
#[serde(rename = "firstObjectLabel")]
pub first_object_label: serde_json::Value,
/// First Objects Key
/// Required by the API.
#[serde(rename = "firstObjectKey")]
pub first_object_key: serde_json::Value,
/// Second Object Association Label (contact)
/// Required by the API.
#[serde(rename = "secondObjectLabel")]
pub second_object_label: serde_json::Value,
/// Second Objects Key
/// Required by the API.
#[serde(rename = "secondObjectKey")]
pub second_object_key: serde_json::Value,
}
/// `createRelationReqDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateRelationReqDto {
/// Your Sub Account's ID
/// Required by the API.
#[serde(rename = "locationId")]
pub location_id: String,
/// Association's Id
/// Required by the API.
#[serde(rename = "associationId")]
pub association_id: String,
/// First Record's Id. For instance, if you have an association between a contact and a
/// custom object, and you specify the contact as the first object while creating the
/// association, then your firstRecordId would be the contactId
/// Required by the API.
#[serde(rename = "firstRecordId")]
pub first_record_id: String,
/// Second Record's Id.For instance, if you have an association between a contact and a
/// custom object, and you specify the custom object as the second entity while creating the
/// association, then your secondRecordId would be the customObject record Id
/// Required by the API.
#[serde(rename = "secondRecordId")]
pub second_record_id: String,
}