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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
//! `oauth` data models for GoHighLevel API V2 (6 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Oauth** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`oauth` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/oauth.md).
//!
//! Enable with `features = ["oauth"]`.
// @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};
/// `GetAccessCodeSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetAccessCodeSuccessfulResponseDto {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub access_token: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_type: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_in: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refresh_token: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope: Option<String>,
#[serde(rename = "userType", default, skip_serializing_if = "Option::is_none")]
pub user_type: Option<String>,
/// Location ID - Present only for Sub-Account Access Token
#[serde(
rename = "locationId",
default,
skip_serializing_if = "Option::is_none"
)]
pub location_id: Option<String>,
/// Company ID
#[serde(rename = "companyId", default, skip_serializing_if = "Option::is_none")]
pub company_id: Option<String>,
/// Approved locations to generate location access token
#[serde(
rename = "approvedLocations",
default,
skip_serializing_if = "Vec::is_empty"
)]
pub approved_locations: Vec<String>,
/// USER ID - Represent user id of person who performed installation
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
/// Plan Id of the subscribed plan in paid apps.
#[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")]
pub plan_id: Option<String>,
#[serde(
rename = "isBulkInstallation",
default,
skip_serializing_if = "Option::is_none"
)]
pub is_bulk_installation: Option<bool>,
/// Boolean to control if user wants app to be automatically installed to future locations
/// (only for company tokens)
#[serde(
rename = "installToFutureLocations",
default,
skip_serializing_if = "Option::is_none"
)]
pub install_to_future_locations: Option<bool>,
/// Boolean indicating if user approved all locations during bulk installation (only for
/// company tokens)
#[serde(
rename = "approveAllLocations",
default,
skip_serializing_if = "Option::is_none"
)]
pub approve_all_locations: Option<bool>,
}
/// `GetAccessCodebodyDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetAccessCodebodyDto {
/// The ID provided by GHL for your integration
/// Required by the API.
pub client_id: String,
/// Required by the API.
pub client_secret: String,
/// Allowed values: `authorization_code`, `refresh_token`, `client_credentials`.
/// Required by the API.
pub grant_type: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refresh_token: Option<String>,
/// The type of token to be requested
/// Allowed values: `Company`, `Location`.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub user_type: Option<String>,
/// The redirect URI for your application
#[serde(default, skip_serializing_if = "Option::is_none")]
pub redirect_uri: Option<String>,
}
/// `GetInstalledLocationsSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetInstalledLocationsSuccessfulResponseDto {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub locations: Vec<InstalledLocationSchema>,
/// Total location count under the company
#[serde(default, skip_serializing_if = "Option::is_none")]
pub count: Option<f64>,
/// Boolean to control if user wants app to be automatically installed to future locations
#[serde(
rename = "installToFutureLocations",
default,
skip_serializing_if = "Option::is_none"
)]
pub install_to_future_locations: Option<bool>,
}
/// `GetLocationAccessCodeBodyDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetLocationAccessCodeBodyDto {
/// Company Id of location you want to request token for
/// Required by the API.
#[serde(rename = "companyId")]
pub company_id: String,
/// The location ID for which you want to obtain accessToken
/// Required by the API.
#[serde(rename = "locationId")]
pub location_id: String,
}
/// `GetLocationAccessTokenSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetLocationAccessTokenSuccessfulResponseDto {
/// Location access token which can be used to authenticate & authorize API under following
/// scope
#[serde(default, skip_serializing_if = "Option::is_none")]
pub access_token: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_type: Option<String>,
/// Time in seconds remaining for token to expire
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_in: Option<f64>,
/// Scopes the following accessToken have access to
#[serde(default, skip_serializing_if = "Option::is_none")]
pub scope: Option<String>,
/// Location ID - Present only for Sub-Account Access Token
#[serde(
rename = "locationId",
default,
skip_serializing_if = "Option::is_none"
)]
pub location_id: Option<String>,
/// Plan Id of the subscribed plan in paid apps.
#[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")]
pub plan_id: Option<String>,
/// USER ID - Represent user id of person who performed installation
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
/// App ID of the installed application
#[serde(rename = "appId", default, skip_serializing_if = "Option::is_none")]
pub app_id: Option<String>,
/// Version ID of the installed app version
#[serde(rename = "versionId", default, skip_serializing_if = "Option::is_none")]
pub version_id: Option<String>,
}
/// `InstalledLocationSchema` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct InstalledLocationSchema {
/// Location ID
/// 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>,
/// Name of the location
/// 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>,
/// Address linked to location
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
/// Check if the requested app is installed for following location
#[serde(
rename = "isInstalled",
default,
skip_serializing_if = "Option::is_none"
)]
pub is_installed: Option<bool>,
/// Version ID of the installed app version for this location
#[serde(rename = "versionId", default, skip_serializing_if = "Option::is_none")]
pub version_id: Option<String>,
/// Timestamp when the app was installed on this location
/// Format: date-time (ISO-8601 string).
#[serde(
rename = "installedAt",
default,
skip_serializing_if = "Option::is_none"
)]
pub installed_at: Option<String>,
}