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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
//! `medias` data models for GoHighLevel API V3 (10 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Medias** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`medias` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/medias.md).
//!
//! Enable with `features = ["medias"]`.
// @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};
/// `CreateFolderParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateFolderParams {
/// Location Id
/// Required by the API.
#[serde(rename = "altId")]
pub alt_id: String,
/// Type of entity (location only)
/// Allowed values: `location`.
/// Required by the API.
#[serde(rename = "altType")]
pub alt_type: String,
/// Name of the folder to be created
/// Required by the API.
pub name: String,
/// ID of the parent folder (optional)
#[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
}
/// `DeleteMediaObjectItem` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteMediaObjectItem {
/// Unique identifier of the file or folder to be deleted
/// Required by the API.
#[serde(rename = "_id")]
pub id: String,
}
/// `DeleteMediaObjectsBodyParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteMediaObjectsBodyParams {
/// Array of file objects to be deleted or trashed
/// Required by the API.
#[serde(
rename = "filesToBeDeleted",
default,
skip_serializing_if = "Vec::is_empty"
)]
pub files_to_be_deleted: Vec<DeleteMediaObjectItem>,
/// Type of entity that owns the files
/// Allowed values: `location`.
/// Required by the API.
#[serde(rename = "altType")]
pub alt_type: String,
/// Location identifier
/// Required by the API.
#[serde(rename = "altId")]
pub alt_id: String,
/// Status to set for the files (deleted or trashed)
/// Allowed values: `deleted`, `trashed`.
/// Required by the API.
pub status: String,
}
/// `FolderDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FolderDTO {
/// Location identifier that owns this folder
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
pub alt_id: Option<String>,
/// Type of entity that owns the folder
/// Allowed values: `location`.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "altType", default, skip_serializing_if = "Option::is_none")]
pub alt_type: Option<String>,
/// Name of the folder
/// 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>,
/// ID of the parent folder (null for root folders)
#[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
/// Type of the object (always 'folder' for folders)
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
/// Whether the folder has been deleted
#[serde(default, skip_serializing_if = "Option::is_none")]
pub deleted: Option<bool>,
/// Whether there are pending uploads to this folder
#[serde(
rename = "pendingUpload",
default,
skip_serializing_if = "Option::is_none"
)]
pub pending_upload: Option<bool>,
/// Primary category of content stored in the folder
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
/// Sub-category of content stored in the folder
#[serde(
rename = "subCategory",
default,
skip_serializing_if = "Option::is_none"
)]
pub sub_category: Option<String>,
/// Whether the folder is private and not publicly accessible
#[serde(rename = "isPrivate", default, skip_serializing_if = "Option::is_none")]
pub is_private: Option<bool>,
/// Whether the folder has been moved from its original location
#[serde(
rename = "relocatedFolder",
default,
skip_serializing_if = "Option::is_none"
)]
pub relocated_folder: Option<bool>,
/// Whether the data migration process has been completed for this folder
#[serde(
rename = "migrationCompleted",
default,
skip_serializing_if = "Option::is_none"
)]
pub migration_completed: Option<bool>,
/// Whether this is a system-generated application folder
#[serde(rename = "appFolder", default, skip_serializing_if = "Option::is_none")]
pub app_folder: Option<bool>,
/// Whether the folder is essential and should not be deleted
#[serde(
rename = "isEssential",
default,
skip_serializing_if = "Option::is_none"
)]
pub is_essential: Option<bool>,
/// Current status of the folder
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// ID of the user who last updated the folder
#[serde(
rename = "lastUpdatedBy",
default,
skip_serializing_if = "Option::is_none"
)]
pub last_updated_by: Option<String>,
}
/// `GetFilesResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetFilesResponseDTO {
/// Array of File Objects
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub files: Vec<String>,
}
/// `MoveOrDeleteObjectParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct MoveOrDeleteObjectParams {
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "altType", default, skip_serializing_if = "Option::is_none")]
pub alt_type: Option<String>,
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
pub alt_id: Option<String>,
/// 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>,
}
/// `UpdateMediaObject` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateMediaObject {
/// Unique identifier of the file or folder to be updated
/// Required by the API.
pub id: String,
/// New name for the file or folder
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
/// `UpdateMediaObjects` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateMediaObjects {
/// Location identifier
/// Required by the API.
#[serde(rename = "altId")]
pub alt_id: String,
/// Type of entity that owns the files
/// Allowed values: `location`.
/// Required by the API.
#[serde(rename = "altType")]
pub alt_type: String,
/// Array of file objects to be updated
/// Required by the API.
#[serde(
rename = "filesToBeUpdated",
default,
skip_serializing_if = "Vec::is_empty"
)]
pub files_to_be_updated: Vec<UpdateMediaObject>,
}
/// `UpdateObject` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateObject {
/// New name for the file or folder
/// Required by the API.
pub name: String,
/// Type of entity that owns the file or folder
/// Allowed values: `location`.
/// Required by the API.
#[serde(rename = "altType")]
pub alt_type: String,
/// Location identifier that owns the file or folder
/// Required by the API.
#[serde(rename = "altId")]
pub alt_id: String,
}
/// `UploadFileResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UploadFileResponseDTO {
/// ID of the uploaded file
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "fileId", default, skip_serializing_if = "Option::is_none")]
pub file_id: Option<String>,
/// Google Cloud Storage URL of the uploaded file
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}