Skip to main content

ghl_models/v2/
emails.rs

1// @generated by xtask/generate_models.py — do not edit by hand.
2// Source: https://github.com/GoHighLevel/highlevel-api-docs
3// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
4// they aren't held to rustdoc's markdown conventions.
5#![allow(
6    missing_docs,
7    clippy::doc_lazy_continuation,
8    clippy::doc_overindented_list_items
9)]
10
11use serde::{Deserialize, Serialize};
12
13/// `BuilderUpdateSuccessfulDTO` from the GoHighLevel OpenAPI spec.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct BuilderUpdateSuccessfulDTO {
16    /// ok
17    #[serde(default, skip_serializing_if = "Option::is_none")]
18    pub ok: Option<String>,
19    /// trace id
20    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
21    pub trace_id: Option<String>,
22    /// preview url
23    #[serde(
24        rename = "previewUrl",
25        default,
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub preview_url: Option<String>,
29    /// template data download url
30    #[serde(
31        rename = "templateDownloadUrl",
32        default,
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub template_download_url: Option<String>,
36}
37
38/// `CreateBuilderDto` from the GoHighLevel OpenAPI spec.
39#[derive(Debug, Clone, Default, Serialize, Deserialize)]
40pub struct CreateBuilderDto {
41    /// Required by the API.
42    #[serde(rename = "locationId")]
43    pub location_id: String,
44    #[serde(default, skip_serializing_if = "Option::is_none")]
45    pub title: Option<String>,
46    /// Allowed values: `html`, `folder`, `import`, `builder`, `blank`.
47    /// Required by the API.
48    #[serde(rename = "type")]
49    pub type_: String,
50    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
51    pub updated_by: Option<String>,
52    /// Allowed values: `1`, `2`.
53    #[serde(
54        rename = "builderVersion",
55        default,
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub builder_version: Option<String>,
59    #[serde(default, skip_serializing_if = "Option::is_none")]
60    pub name: Option<String>,
61    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
62    pub parent_id: Option<String>,
63    #[serde(
64        rename = "templateDataUrl",
65        default,
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub template_data_url: Option<String>,
69    /// Allowed values: `mailchimp`, `active_campaign`, `kajabi`.
70    /// Required by the API.
71    #[serde(rename = "importProvider")]
72    pub import_provider: String,
73    #[serde(rename = "importURL", default, skip_serializing_if = "Option::is_none")]
74    pub import_url: Option<String>,
75    #[serde(
76        rename = "templateSource",
77        default,
78        skip_serializing_if = "Option::is_none"
79    )]
80    pub template_source: Option<String>,
81    #[serde(
82        rename = "isPlainText",
83        default,
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub is_plain_text: Option<bool>,
87}
88
89/// `CreateBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
90#[derive(Debug, Clone, Default, Serialize, Deserialize)]
91pub struct CreateBuilderSuccesfulResponseDto {
92    /// template id
93    /// Required by the API.
94    pub redirect: String,
95    /// trace id
96    /// Required by the API.
97    #[serde(rename = "traceId")]
98    pub trace_id: String,
99}
100
101/// `DeleteBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
102#[derive(Debug, Clone, Default, Serialize, Deserialize)]
103pub struct DeleteBuilderSuccesfulResponseDto {
104    /// ok
105    #[serde(default, skip_serializing_if = "Option::is_none")]
106    pub ok: Option<String>,
107    /// trace id
108    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
109    pub trace_id: Option<String>,
110}
111
112/// `FetchBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
113#[derive(Debug, Clone, Default, Serialize, Deserialize)]
114pub struct FetchBuilderSuccesfulResponseDto {
115    /// template name
116    #[serde(default, skip_serializing_if = "Option::is_none")]
117    pub name: Option<String>,
118    /// updated by
119    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
120    pub updated_by: Option<String>,
121    /// plain text based template
122    #[serde(
123        rename = "isPlainText",
124        default,
125        skip_serializing_if = "Option::is_none"
126    )]
127    pub is_plain_text: Option<bool>,
128    /// last updated
129    #[serde(
130        rename = "lastUpdated",
131        default,
132        skip_serializing_if = "Option::is_none"
133    )]
134    pub last_updated: Option<String>,
135    /// date added
136    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
137    pub date_added: Option<String>,
138    /// preview url
139    #[serde(
140        rename = "previewUrl",
141        default,
142        skip_serializing_if = "Option::is_none"
143    )]
144    pub preview_url: Option<String>,
145    /// id
146    #[serde(default, skip_serializing_if = "Option::is_none")]
147    pub id: Option<String>,
148    /// version
149    #[serde(default, skip_serializing_if = "Option::is_none")]
150    pub version: Option<String>,
151    /// type
152    #[serde(
153        rename = "templateType",
154        default,
155        skip_serializing_if = "Option::is_none"
156    )]
157    pub template_type: Option<String>,
158}
159
160/// `IBuilderJsonMapper` from the GoHighLevel OpenAPI spec.
161#[derive(Debug, Clone, Default, Serialize, Deserialize)]
162pub struct IBuilderJsonMapper {
163    /// Required by the API.
164    #[serde(default, skip_serializing_if = "Vec::is_empty")]
165    pub elements: Vec<String>,
166    /// Required by the API.
167    pub attrs: serde_json::Value,
168    /// Required by the API.
169    #[serde(rename = "templateSettings")]
170    pub template_settings: TemplateSettings,
171}
172
173/// `InvalidLocationDTO` from the GoHighLevel OpenAPI spec.
174#[derive(Debug, Clone, Default, Serialize, Deserialize)]
175pub struct InvalidLocationDTO {
176    #[serde(
177        rename = "statusCode",
178        default,
179        skip_serializing_if = "Option::is_none"
180    )]
181    pub status_code: Option<f64>,
182    #[serde(default, skip_serializing_if = "Option::is_none")]
183    pub message: Option<String>,
184}
185
186/// `NotFoundDTO` from the GoHighLevel OpenAPI spec.
187#[derive(Debug, Clone, Default, Serialize, Deserialize)]
188pub struct NotFoundDTO {
189    #[serde(
190        rename = "statusCode",
191        default,
192        skip_serializing_if = "Option::is_none"
193    )]
194    pub status_code: Option<f64>,
195    #[serde(default, skip_serializing_if = "Option::is_none")]
196    pub message: Option<String>,
197    #[serde(default, skip_serializing_if = "Option::is_none")]
198    pub error: Option<String>,
199}
200
201/// `SaveBuilderDataDto` from the GoHighLevel OpenAPI spec.
202#[derive(Debug, Clone, Default, Serialize, Deserialize)]
203pub struct SaveBuilderDataDto {
204    /// Required by the API.
205    #[serde(rename = "locationId")]
206    pub location_id: String,
207    /// Required by the API.
208    #[serde(rename = "templateId")]
209    pub template_id: String,
210    /// Required by the API.
211    #[serde(rename = "updatedBy")]
212    pub updated_by: String,
213    /// Required by the API.
214    pub dnd: IBuilderJsonMapper,
215    /// Required by the API.
216    pub html: String,
217    /// Allowed values: `html`, `builder`.
218    /// Required by the API.
219    #[serde(rename = "editorType")]
220    pub editor_type: String,
221    #[serde(
222        rename = "previewText",
223        default,
224        skip_serializing_if = "Option::is_none"
225    )]
226    pub preview_text: Option<String>,
227    #[serde(
228        rename = "isPlainText",
229        default,
230        skip_serializing_if = "Option::is_none"
231    )]
232    pub is_plain_text: Option<bool>,
233}
234
235/// `ScheduleDto` from the GoHighLevel OpenAPI spec.
236#[derive(Debug, Clone, Default, Serialize, Deserialize)]
237pub struct ScheduleDto {
238    /// Required by the API.
239    pub name: String,
240    /// Required by the API.
241    #[serde(rename = "repeatAfter")]
242    pub repeat_after: String,
243    /// Required by the API.
244    pub id: String,
245    /// Required by the API.
246    #[serde(rename = "parentId")]
247    pub parent_id: String,
248    /// Required by the API.
249    #[serde(rename = "childCount")]
250    pub child_count: f64,
251    /// Required by the API.
252    #[serde(rename = "campaignType")]
253    pub campaign_type: String,
254    /// Required by the API.
255    #[serde(rename = "bulkActionVersion")]
256    pub bulk_action_version: String,
257    /// Required by the API.
258    #[serde(rename = "_id")]
259    pub id_alt: String,
260    /// Required by the API.
261    pub status: String,
262    /// Required by the API.
263    #[serde(rename = "sendDays", default, skip_serializing_if = "Vec::is_empty")]
264    pub send_days: Vec<String>,
265    /// Required by the API.
266    pub deleted: bool,
267    /// Required by the API.
268    pub migrated: bool,
269    /// Required by the API.
270    pub archived: bool,
271    /// Required by the API.
272    #[serde(rename = "hasTracking")]
273    pub has_tracking: bool,
274    /// Required by the API.
275    #[serde(rename = "isPlainText")]
276    pub is_plain_text: bool,
277    /// Required by the API.
278    #[serde(rename = "hasUtmTracking")]
279    pub has_utm_tracking: bool,
280    /// Required by the API.
281    #[serde(rename = "enableResendToUnopened")]
282    pub enable_resend_to_unopened: bool,
283    /// Required by the API.
284    #[serde(rename = "locationId")]
285    pub location_id: String,
286    /// Required by the API.
287    #[serde(rename = "templateId")]
288    pub template_id: String,
289    /// Required by the API.
290    #[serde(rename = "templateType")]
291    pub template_type: String,
292    /// Required by the API.
293    #[serde(rename = "createdAt")]
294    pub created_at: String,
295    /// Required by the API.
296    #[serde(rename = "updatedAt")]
297    pub updated_at: String,
298    /// Required by the API.
299    #[serde(rename = "__v")]
300    pub v: f64,
301    /// Required by the API.
302    #[serde(rename = "documentId")]
303    pub document_id: String,
304    /// Required by the API.
305    #[serde(rename = "downloadUrl")]
306    pub download_url: String,
307    /// Required by the API.
308    #[serde(rename = "templateDataDownloadUrl")]
309    pub template_data_download_url: String,
310    /// Required by the API.
311    #[serde(default, skip_serializing_if = "Vec::is_empty")]
312    pub child: Vec<String>,
313}
314
315/// `ScheduleFetchSuccessfulDTO` from the GoHighLevel OpenAPI spec.
316#[derive(Debug, Clone, Default, Serialize, Deserialize)]
317pub struct ScheduleFetchSuccessfulDTO {
318    /// The list of campaigns
319    /// Required by the API.
320    #[serde(default, skip_serializing_if = "Vec::is_empty")]
321    pub schedules: Vec<ScheduleDto>,
322    /// The total number of campaigns
323    /// Required by the API.
324    #[serde(default, skip_serializing_if = "Vec::is_empty")]
325    pub total: Vec<String>,
326    /// Trace Id
327    /// Required by the API.
328    #[serde(rename = "traceId")]
329    pub trace_id: String,
330}
331
332/// `TemplateSettings` from the GoHighLevel OpenAPI spec.
333#[derive(Debug, Clone, Default, Serialize, Deserialize)]
334pub struct TemplateSettings {
335    /// The spec defines no fields for this schema.
336    #[serde(flatten)]
337    pub extra: serde_json::Map<String, serde_json::Value>,
338}