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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
//! `custom-fields` data models for GoHighLevel API V3 (10 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Custom Fields** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`custom-fields` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/custom-fields.md).
//!
//! Enable with `features = ["custom-fields"]`.
// @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};
/// `CreateCustomFieldsDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateCustomFieldsDTO {
/// Location Id
/// Required by the API.
#[serde(rename = "locationId")]
pub location_id: String,
/// Field name
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Description of the field
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Placeholder text for the field
#[serde(default, skip_serializing_if = "Option::is_none")]
pub placeholder: Option<String>,
/// Whether the field should be shown in forms
/// Required by the API.
#[serde(rename = "showInForms")]
pub show_in_forms: bool,
/// Options for the field (Optional, valid only for SINGLE_OPTIONS, MULTIPLE_OPTIONS, RADIO,
/// CHECKBOX, TEXTBOX_LIST type)
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub options: Vec<OptionDTO>,
/// Allowed file formats for uploads. Options include: .pdf, .docx, .doc, .jpg, .jpeg, .png,
/// .gif, .csv, .xlsx, .xls, all
/// Allowed values: `.pdf`, `.docx`, `.doc`, `.jpg`, `.jpeg`, `.png`, `.gif`, `.csv`,
/// `.xlsx`, `.xls`, `all`.
#[serde(
rename = "acceptedFormats",
default,
skip_serializing_if = "Option::is_none"
)]
pub accepted_formats: Option<String>,
/// Type of field that you are trying to create
/// Allowed values: `TEXT`, `LARGE_TEXT`, `NUMERICAL`, `PHONE`, `MONETORY`, `CHECKBOX`,
/// `SINGLE_OPTIONS`, `MULTIPLE_OPTIONS`, `DATE`, `TEXTBOX_LIST`, `FILE_UPLOAD`, `RADIO`.
/// Required by the API.
#[serde(rename = "dataType")]
pub data_type: String,
/// Field key. For Custom Object it's formatted as "custom_object.{objectKey}.{fieldKey}".
/// "custom_object" is a fixed prefix, "{objectKey}" is your custom object's identifier, and
/// "{fieldKey}" is the unique field name within that object. Example:
/// "custom_object.pet.name" for a "name" field in a "pet" custom object.
/// Required by the API.
#[serde(rename = "fieldKey")]
pub field_key: String,
/// The key for your custom object. This key uniquely identifies the custom object. Example:
/// "custom_object.pet" for a custom object related to pets.
/// Required by the API.
#[serde(rename = "objectKey")]
pub object_key: String,
/// Maximum file limit for uploads. Applicable only for fields with a data type of
/// FILE_UPLOAD.
#[serde(
rename = "maxFileLimit",
default,
skip_serializing_if = "Option::is_none"
)]
pub max_file_limit: Option<f64>,
/// Determines if users can add a custom option value different from the predefined options
/// in records for RADIO type fields. A custom value added in one record does not
/// automatically become an option and will not appear as an option for other records.
#[serde(
rename = "allowCustomOption",
default,
skip_serializing_if = "Option::is_none"
)]
pub allow_custom_option: Option<bool>,
/// ID of the parent folder
/// Required by the API.
#[serde(rename = "parentId")]
pub parent_id: String,
}
/// `CreateFolder` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateFolder {
/// The key for your custom object. This key uniquely identifies the custom object. Example:
/// "custom_object.pet" for a custom object related to pets.
/// Required by the API.
#[serde(rename = "objectKey")]
pub object_key: String,
/// Field name
/// Required by the API.
pub name: String,
/// Location Id
/// Required by the API.
#[serde(rename = "locationId")]
pub location_id: String,
}
/// `CustomFieldSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CustomFieldSuccessfulResponseDto {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub field: Option<ICustomField>,
}
/// `CustomFieldsResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CustomFieldsResponseDTO {
/// Custom Fields for the object.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub fields: Vec<ICustomField>,
/// Custom Fields folder for the object.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub folders: Vec<ICustomField>,
}
/// `CustomFolderDeleteResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CustomFolderDeleteResponseDto {
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub succeded: Option<bool>,
/// 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 key: Option<String>,
}
/// `ICustomField` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ICustomField {
/// Location Id
/// 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>,
/// Field name
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Description of the field
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Placeholder text for the field
#[serde(default, skip_serializing_if = "Option::is_none")]
pub placeholder: Option<String>,
/// Whether the field should be shown in forms
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "showInForms",
default,
skip_serializing_if = "Option::is_none"
)]
pub show_in_forms: Option<bool>,
/// Options for the field (Optional, valid only for SINGLE_OPTIONS, MULTIPLE_OPTIONS, RADIO,
/// CHECKBOX, TEXTBOX_LIST type)
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub options: Vec<OptionDTO>,
/// Allowed file formats for uploads. Options include: .pdf, .docx, .doc, .jpg, .jpeg, .png,
/// .gif, .csv, .xlsx, .xls, all
/// Allowed values: `.pdf`, `.docx`, `.doc`, `.jpg`, `.jpeg`, `.png`, `.gif`, `.csv`,
/// `.xlsx`, `.xls`, `all`.
#[serde(
rename = "acceptedFormats",
default,
skip_serializing_if = "Option::is_none"
)]
pub accepted_formats: Option<String>,
/// Unique identifier of the object
/// 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>,
/// The key for your custom / standard object. This key uniquely identifies the custom
/// object. Example: "custom_object.pet" for a custom object related to pets.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "objectKey", default, skip_serializing_if = "Option::is_none")]
pub object_key: Option<String>,
/// Type of field that you are trying to create
/// Allowed values: `TEXT`, `LARGE_TEXT`, `NUMERICAL`, `PHONE`, `MONETORY`, `CHECKBOX`,
/// `SINGLE_OPTIONS`, `MULTIPLE_OPTIONS`, `DATE`, `TEXTBOX_LIST`, `FILE_UPLOAD`, `RADIO`.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")]
pub data_type: Option<String>,
/// ID of the parent folder
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
/// Field key. For Custom Object it's formatted as "custom_object.{objectKey}.{fieldKey}".
/// "custom_object" is a fixed prefix, "{objectKey}" is your custom object's identifier, and
/// "{fieldName}" is the unique field name within that object. Example:
/// "custom_object.pet.name" for a "name" field in a "pet" custom object.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "fieldKey", default, skip_serializing_if = "Option::is_none")]
pub field_key: Option<String>,
/// Determines if users can add a custom option value different from the predefined options
/// in records for RADIO type fields. A custom value added in one record does not
/// automatically become an option and will not appear as an option for other records.
#[serde(
rename = "allowCustomOption",
default,
skip_serializing_if = "Option::is_none"
)]
pub allow_custom_option: Option<bool>,
/// Maximum file limit for uploads
#[serde(
rename = "maxFileLimit",
default,
skip_serializing_if = "Option::is_none"
)]
pub max_file_limit: Option<f64>,
/// Date and time when the object was added
/// Format: date-time (ISO-8601 string).
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
pub date_added: Option<String>,
/// Date and time when the object was last updated
/// Format: date-time (ISO-8601 string).
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(
rename = "dateUpdated",
default,
skip_serializing_if = "Option::is_none"
)]
pub date_updated: Option<String>,
}
/// `ICustomFieldFolder` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ICustomFieldFolder {
/// Unique identifier of the object
/// 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>,
/// The key for your custom object. This key uniquely identifies the custom object. Example:
/// "custom_object.pet" for a custom object related to pets.
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(rename = "objectKey", default, skip_serializing_if = "Option::is_none")]
pub object_key: Option<String>,
/// Location Id
/// 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>,
/// Field name
/// 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>,
}
/// `OptionDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct OptionDTO {
/// Key of the option (Included in Create and Response, excluded in Update)
/// 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>,
/// Value of the option
/// Required by the API.
/// (Optional here so responses that omit it still parse.)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
/// URL associated with the option (Optional, valid only for RADIO type)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
/// `UpdateCustomFieldsDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateCustomFieldsDTO {
/// Location Id
/// Required by the API.
#[serde(rename = "locationId")]
pub location_id: String,
/// Field name
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Description of the field
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Placeholder text for the field
#[serde(default, skip_serializing_if = "Option::is_none")]
pub placeholder: Option<String>,
/// Whether the field should be shown in forms
/// Required by the API.
#[serde(rename = "showInForms")]
pub show_in_forms: bool,
/// Options for the field. Important: Providing options will completely replace the existing
/// options array. You must include all existing options alongside any new options you wish
/// to add. Removal of options is not supported through this update. Applicable only for
/// SINGLE_OPTIONS, MULTIPLE_OPTIONS, RADIO, CHECKBOX, TEXTBOX_LIST types.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub options: Vec<OptionDTO>,
/// Allowed file formats for uploads. Options include: .pdf, .docx, .doc, .jpg, .jpeg, .png,
/// .gif, .csv, .xlsx, .xls, all
/// Allowed values: `.pdf`, `.docx`, `.doc`, `.jpg`, `.jpeg`, `.png`, `.gif`, `.csv`,
/// `.xlsx`, `.xls`, `all`.
#[serde(
rename = "acceptedFormats",
default,
skip_serializing_if = "Option::is_none"
)]
pub accepted_formats: Option<String>,
/// Maximum file limit for uploads. Applicable only for fields with a data type of
/// FILE_UPLOAD.
#[serde(
rename = "maxFileLimit",
default,
skip_serializing_if = "Option::is_none"
)]
pub max_file_limit: Option<f64>,
}
/// `UpdateFolder` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateFolder {
/// Field name
/// Required by the API.
pub name: String,
/// Location Id
/// Required by the API.
#[serde(rename = "locationId")]
pub location_id: String,
}