Skip to main content

ghl_models/v2/
emails.rs

1//! `emails` data models for GoHighLevel API V2 (12 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Emails** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`emails` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/emails.md).
7//!
8//! Enable with `features = ["emails"]`.
9// @generated by xtask/generate_models.py — do not edit by hand.
10// Source: https://github.com/GoHighLevel/highlevel-api-docs
11// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
12// they aren't held to rustdoc's markdown conventions.
13#![allow(
14    missing_docs,
15    clippy::doc_lazy_continuation,
16    clippy::doc_overindented_list_items
17)]
18
19use serde::{Deserialize, Serialize};
20
21/// `BuilderUpdateSuccessfulDTO` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct BuilderUpdateSuccessfulDTO {
24    /// ok
25    #[serde(default, skip_serializing_if = "Option::is_none")]
26    pub ok: Option<String>,
27    /// trace id
28    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
29    pub trace_id: Option<String>,
30    /// preview url
31    #[serde(
32        rename = "previewUrl",
33        default,
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub preview_url: Option<String>,
37    /// template data download url
38    #[serde(
39        rename = "templateDownloadUrl",
40        default,
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub template_download_url: Option<String>,
44}
45
46/// `CreateBuilderDto` from the GoHighLevel OpenAPI spec.
47#[derive(Debug, Clone, Default, Serialize, Deserialize)]
48pub struct CreateBuilderDto {
49    /// Required by the API.
50    #[serde(rename = "locationId")]
51    pub location_id: String,
52    #[serde(default, skip_serializing_if = "Option::is_none")]
53    pub title: Option<String>,
54    /// Allowed values: `html`, `folder`, `import`, `builder`, `blank`.
55    /// Required by the API.
56    #[serde(rename = "type")]
57    pub type_: String,
58    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
59    pub updated_by: Option<String>,
60    /// Allowed values: `1`, `2`.
61    #[serde(
62        rename = "builderVersion",
63        default,
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub builder_version: Option<String>,
67    #[serde(default, skip_serializing_if = "Option::is_none")]
68    pub name: Option<String>,
69    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
70    pub parent_id: Option<String>,
71    #[serde(
72        rename = "templateDataUrl",
73        default,
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub template_data_url: Option<String>,
77    /// Allowed values: `mailchimp`, `active_campaign`, `kajabi`.
78    /// Required by the API.
79    #[serde(rename = "importProvider")]
80    pub import_provider: String,
81    #[serde(rename = "importURL", default, skip_serializing_if = "Option::is_none")]
82    pub import_url: Option<String>,
83    #[serde(
84        rename = "templateSource",
85        default,
86        skip_serializing_if = "Option::is_none"
87    )]
88    pub template_source: Option<String>,
89    #[serde(
90        rename = "isPlainText",
91        default,
92        skip_serializing_if = "Option::is_none"
93    )]
94    pub is_plain_text: Option<bool>,
95}
96
97/// `CreateBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
98#[derive(Debug, Clone, Default, Serialize, Deserialize)]
99pub struct CreateBuilderSuccesfulResponseDto {
100    /// template id
101    /// Required by the API.
102    /// (Optional here so responses that omit it still parse.)
103    #[serde(default, skip_serializing_if = "Option::is_none")]
104    pub redirect: Option<String>,
105    /// trace id
106    /// Required by the API.
107    /// (Optional here so responses that omit it still parse.)
108    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
109    pub trace_id: Option<String>,
110}
111
112/// `DeleteBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
113#[derive(Debug, Clone, Default, Serialize, Deserialize)]
114pub struct DeleteBuilderSuccesfulResponseDto {
115    /// ok
116    #[serde(default, skip_serializing_if = "Option::is_none")]
117    pub ok: Option<String>,
118    /// trace id
119    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
120    pub trace_id: Option<String>,
121}
122
123/// `FetchBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
124#[derive(Debug, Clone, Default, Serialize, Deserialize)]
125pub struct FetchBuilderSuccesfulResponseDto {
126    /// template name
127    #[serde(default, skip_serializing_if = "Option::is_none")]
128    pub name: Option<String>,
129    /// updated by
130    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
131    pub updated_by: Option<String>,
132    /// plain text based template
133    #[serde(
134        rename = "isPlainText",
135        default,
136        skip_serializing_if = "Option::is_none"
137    )]
138    pub is_plain_text: Option<bool>,
139    /// last updated
140    #[serde(
141        rename = "lastUpdated",
142        default,
143        skip_serializing_if = "Option::is_none"
144    )]
145    pub last_updated: Option<String>,
146    /// date added
147    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
148    pub date_added: Option<String>,
149    /// preview url
150    #[serde(
151        rename = "previewUrl",
152        default,
153        skip_serializing_if = "Option::is_none"
154    )]
155    pub preview_url: Option<String>,
156    /// id
157    #[serde(default, skip_serializing_if = "Option::is_none")]
158    pub id: Option<String>,
159    /// version
160    #[serde(default, skip_serializing_if = "Option::is_none")]
161    pub version: Option<String>,
162    /// type
163    #[serde(
164        rename = "templateType",
165        default,
166        skip_serializing_if = "Option::is_none"
167    )]
168    pub template_type: Option<String>,
169}
170
171/// `IBuilderJsonMapper` from the GoHighLevel OpenAPI spec.
172#[derive(Debug, Clone, Default, Serialize, Deserialize)]
173pub struct IBuilderJsonMapper {
174    /// Required by the API.
175    #[serde(default, skip_serializing_if = "Vec::is_empty")]
176    pub elements: Vec<String>,
177    /// Required by the API.
178    pub attrs: serde_json::Value,
179    /// Required by the API.
180    #[serde(rename = "templateSettings")]
181    pub template_settings: TemplateSettings,
182}
183
184/// `InvalidLocationDTO` from the GoHighLevel OpenAPI spec.
185#[derive(Debug, Clone, Default, Serialize, Deserialize)]
186pub struct InvalidLocationDTO {
187    #[serde(
188        rename = "statusCode",
189        default,
190        skip_serializing_if = "Option::is_none"
191    )]
192    pub status_code: Option<f64>,
193    #[serde(default, skip_serializing_if = "Option::is_none")]
194    pub message: Option<String>,
195}
196
197/// `NotFoundDTO` from the GoHighLevel OpenAPI spec.
198#[derive(Debug, Clone, Default, Serialize, Deserialize)]
199pub struct NotFoundDTO {
200    #[serde(
201        rename = "statusCode",
202        default,
203        skip_serializing_if = "Option::is_none"
204    )]
205    pub status_code: Option<f64>,
206    #[serde(default, skip_serializing_if = "Option::is_none")]
207    pub message: Option<String>,
208    #[serde(default, skip_serializing_if = "Option::is_none")]
209    pub error: Option<String>,
210}
211
212/// `SaveBuilderDataDto` from the GoHighLevel OpenAPI spec.
213#[derive(Debug, Clone, Default, Serialize, Deserialize)]
214pub struct SaveBuilderDataDto {
215    /// Required by the API.
216    #[serde(rename = "locationId")]
217    pub location_id: String,
218    /// Required by the API.
219    #[serde(rename = "templateId")]
220    pub template_id: String,
221    /// Required by the API.
222    #[serde(rename = "updatedBy")]
223    pub updated_by: String,
224    /// Required by the API.
225    pub dnd: IBuilderJsonMapper,
226    /// Required by the API.
227    pub html: String,
228    /// Allowed values: `html`, `builder`.
229    /// Required by the API.
230    #[serde(rename = "editorType")]
231    pub editor_type: String,
232    #[serde(
233        rename = "previewText",
234        default,
235        skip_serializing_if = "Option::is_none"
236    )]
237    pub preview_text: Option<String>,
238    #[serde(
239        rename = "isPlainText",
240        default,
241        skip_serializing_if = "Option::is_none"
242    )]
243    pub is_plain_text: Option<bool>,
244}
245
246/// `ScheduleDto` from the GoHighLevel OpenAPI spec.
247#[derive(Debug, Clone, Default, Serialize, Deserialize)]
248pub struct ScheduleDto {
249    /// Required by the API.
250    /// (Optional here so responses that omit it still parse.)
251    #[serde(default, skip_serializing_if = "Option::is_none")]
252    pub name: Option<String>,
253    /// Required by the API.
254    /// (Optional here so responses that omit it still parse.)
255    #[serde(
256        rename = "repeatAfter",
257        default,
258        skip_serializing_if = "Option::is_none"
259    )]
260    pub repeat_after: Option<String>,
261    /// Required by the API.
262    /// (Optional here so responses that omit it still parse.)
263    #[serde(default, skip_serializing_if = "Option::is_none")]
264    pub id: Option<String>,
265    /// Required by the API.
266    /// (Optional here so responses that omit it still parse.)
267    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
268    pub parent_id: Option<String>,
269    /// Required by the API.
270    /// (Optional here so responses that omit it still parse.)
271    #[serde(
272        rename = "childCount",
273        default,
274        skip_serializing_if = "Option::is_none"
275    )]
276    pub child_count: Option<f64>,
277    /// Required by the API.
278    /// (Optional here so responses that omit it still parse.)
279    #[serde(
280        rename = "campaignType",
281        default,
282        skip_serializing_if = "Option::is_none"
283    )]
284    pub campaign_type: Option<String>,
285    /// Required by the API.
286    /// (Optional here so responses that omit it still parse.)
287    #[serde(
288        rename = "bulkActionVersion",
289        default,
290        skip_serializing_if = "Option::is_none"
291    )]
292    pub bulk_action_version: Option<String>,
293    /// Required by the API.
294    /// (Optional here so responses that omit it still parse.)
295    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
296    pub id_alt: Option<String>,
297    /// Required by the API.
298    /// (Optional here so responses that omit it still parse.)
299    #[serde(default, skip_serializing_if = "Option::is_none")]
300    pub status: Option<String>,
301    /// Required by the API.
302    /// (Optional here so responses that omit it still parse.)
303    #[serde(rename = "sendDays", default, skip_serializing_if = "Vec::is_empty")]
304    pub send_days: Vec<String>,
305    /// Required by the API.
306    /// (Optional here so responses that omit it still parse.)
307    #[serde(default, skip_serializing_if = "Option::is_none")]
308    pub deleted: Option<bool>,
309    /// Required by the API.
310    /// (Optional here so responses that omit it still parse.)
311    #[serde(default, skip_serializing_if = "Option::is_none")]
312    pub migrated: Option<bool>,
313    /// Required by the API.
314    /// (Optional here so responses that omit it still parse.)
315    #[serde(default, skip_serializing_if = "Option::is_none")]
316    pub archived: Option<bool>,
317    /// Required by the API.
318    /// (Optional here so responses that omit it still parse.)
319    #[serde(
320        rename = "hasTracking",
321        default,
322        skip_serializing_if = "Option::is_none"
323    )]
324    pub has_tracking: Option<bool>,
325    /// Required by the API.
326    /// (Optional here so responses that omit it still parse.)
327    #[serde(
328        rename = "isPlainText",
329        default,
330        skip_serializing_if = "Option::is_none"
331    )]
332    pub is_plain_text: Option<bool>,
333    /// Required by the API.
334    /// (Optional here so responses that omit it still parse.)
335    #[serde(
336        rename = "hasUtmTracking",
337        default,
338        skip_serializing_if = "Option::is_none"
339    )]
340    pub has_utm_tracking: Option<bool>,
341    /// Required by the API.
342    /// (Optional here so responses that omit it still parse.)
343    #[serde(
344        rename = "enableResendToUnopened",
345        default,
346        skip_serializing_if = "Option::is_none"
347    )]
348    pub enable_resend_to_unopened: Option<bool>,
349    /// Required by the API.
350    /// (Optional here so responses that omit it still parse.)
351    #[serde(
352        rename = "locationId",
353        default,
354        skip_serializing_if = "Option::is_none"
355    )]
356    pub location_id: Option<String>,
357    /// Required by the API.
358    /// (Optional here so responses that omit it still parse.)
359    #[serde(
360        rename = "templateId",
361        default,
362        skip_serializing_if = "Option::is_none"
363    )]
364    pub template_id: Option<String>,
365    /// Required by the API.
366    /// (Optional here so responses that omit it still parse.)
367    #[serde(
368        rename = "templateType",
369        default,
370        skip_serializing_if = "Option::is_none"
371    )]
372    pub template_type: Option<String>,
373    /// Required by the API.
374    /// (Optional here so responses that omit it still parse.)
375    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
376    pub created_at: Option<String>,
377    /// Required by the API.
378    /// (Optional here so responses that omit it still parse.)
379    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
380    pub updated_at: Option<String>,
381    /// Required by the API.
382    /// (Optional here so responses that omit it still parse.)
383    #[serde(rename = "__v", default, skip_serializing_if = "Option::is_none")]
384    pub v: Option<f64>,
385    /// Required by the API.
386    /// (Optional here so responses that omit it still parse.)
387    #[serde(
388        rename = "documentId",
389        default,
390        skip_serializing_if = "Option::is_none"
391    )]
392    pub document_id: Option<String>,
393    /// Required by the API.
394    /// (Optional here so responses that omit it still parse.)
395    #[serde(
396        rename = "downloadUrl",
397        default,
398        skip_serializing_if = "Option::is_none"
399    )]
400    pub download_url: Option<String>,
401    /// Required by the API.
402    /// (Optional here so responses that omit it still parse.)
403    #[serde(
404        rename = "templateDataDownloadUrl",
405        default,
406        skip_serializing_if = "Option::is_none"
407    )]
408    pub template_data_download_url: Option<String>,
409    /// Required by the API.
410    /// (Optional here so responses that omit it still parse.)
411    #[serde(default, skip_serializing_if = "Vec::is_empty")]
412    pub child: Vec<String>,
413}
414
415/// `ScheduleFetchSuccessfulDTO` from the GoHighLevel OpenAPI spec.
416#[derive(Debug, Clone, Default, Serialize, Deserialize)]
417pub struct ScheduleFetchSuccessfulDTO {
418    /// The list of campaigns
419    /// Required by the API.
420    /// (Optional here so responses that omit it still parse.)
421    #[serde(default, skip_serializing_if = "Vec::is_empty")]
422    pub schedules: Vec<ScheduleDto>,
423    /// The total number of campaigns
424    /// Required by the API.
425    /// (Optional here so responses that omit it still parse.)
426    #[serde(default, skip_serializing_if = "Vec::is_empty")]
427    pub total: Vec<String>,
428    /// Trace Id
429    /// Required by the API.
430    /// (Optional here so responses that omit it still parse.)
431    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
432    pub trace_id: Option<String>,
433}
434
435/// `TemplateSettings` from the GoHighLevel OpenAPI spec.
436#[derive(Debug, Clone, Default, Serialize, Deserialize)]
437pub struct TemplateSettings {
438    /// The spec defines no fields for this schema.
439    #[serde(flatten)]
440    pub extra: serde_json::Map<String, serde_json::Value>,
441}