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    pub redirect: String,
103    /// trace id
104    /// Required by the API.
105    #[serde(rename = "traceId")]
106    pub trace_id: String,
107}
108
109/// `DeleteBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
110#[derive(Debug, Clone, Default, Serialize, Deserialize)]
111pub struct DeleteBuilderSuccesfulResponseDto {
112    /// ok
113    #[serde(default, skip_serializing_if = "Option::is_none")]
114    pub ok: Option<String>,
115    /// trace id
116    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
117    pub trace_id: Option<String>,
118}
119
120/// `FetchBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
121#[derive(Debug, Clone, Default, Serialize, Deserialize)]
122pub struct FetchBuilderSuccesfulResponseDto {
123    /// template name
124    #[serde(default, skip_serializing_if = "Option::is_none")]
125    pub name: Option<String>,
126    /// updated by
127    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
128    pub updated_by: Option<String>,
129    /// plain text based template
130    #[serde(
131        rename = "isPlainText",
132        default,
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub is_plain_text: Option<bool>,
136    /// last updated
137    #[serde(
138        rename = "lastUpdated",
139        default,
140        skip_serializing_if = "Option::is_none"
141    )]
142    pub last_updated: Option<String>,
143    /// date added
144    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
145    pub date_added: Option<String>,
146    /// preview url
147    #[serde(
148        rename = "previewUrl",
149        default,
150        skip_serializing_if = "Option::is_none"
151    )]
152    pub preview_url: Option<String>,
153    /// id
154    #[serde(default, skip_serializing_if = "Option::is_none")]
155    pub id: Option<String>,
156    /// version
157    #[serde(default, skip_serializing_if = "Option::is_none")]
158    pub version: Option<String>,
159    /// type
160    #[serde(
161        rename = "templateType",
162        default,
163        skip_serializing_if = "Option::is_none"
164    )]
165    pub template_type: Option<String>,
166}
167
168/// `IBuilderJsonMapper` from the GoHighLevel OpenAPI spec.
169#[derive(Debug, Clone, Default, Serialize, Deserialize)]
170pub struct IBuilderJsonMapper {
171    /// Required by the API.
172    #[serde(default, skip_serializing_if = "Vec::is_empty")]
173    pub elements: Vec<String>,
174    /// Required by the API.
175    pub attrs: serde_json::Value,
176    /// Required by the API.
177    #[serde(rename = "templateSettings")]
178    pub template_settings: TemplateSettings,
179}
180
181/// `InvalidLocationDTO` from the GoHighLevel OpenAPI spec.
182#[derive(Debug, Clone, Default, Serialize, Deserialize)]
183pub struct InvalidLocationDTO {
184    #[serde(
185        rename = "statusCode",
186        default,
187        skip_serializing_if = "Option::is_none"
188    )]
189    pub status_code: Option<f64>,
190    #[serde(default, skip_serializing_if = "Option::is_none")]
191    pub message: Option<String>,
192}
193
194/// `NotFoundDTO` from the GoHighLevel OpenAPI spec.
195#[derive(Debug, Clone, Default, Serialize, Deserialize)]
196pub struct NotFoundDTO {
197    #[serde(
198        rename = "statusCode",
199        default,
200        skip_serializing_if = "Option::is_none"
201    )]
202    pub status_code: Option<f64>,
203    #[serde(default, skip_serializing_if = "Option::is_none")]
204    pub message: Option<String>,
205    #[serde(default, skip_serializing_if = "Option::is_none")]
206    pub error: Option<String>,
207}
208
209/// `SaveBuilderDataDto` from the GoHighLevel OpenAPI spec.
210#[derive(Debug, Clone, Default, Serialize, Deserialize)]
211pub struct SaveBuilderDataDto {
212    /// Required by the API.
213    #[serde(rename = "locationId")]
214    pub location_id: String,
215    /// Required by the API.
216    #[serde(rename = "templateId")]
217    pub template_id: String,
218    /// Required by the API.
219    #[serde(rename = "updatedBy")]
220    pub updated_by: String,
221    /// Required by the API.
222    pub dnd: IBuilderJsonMapper,
223    /// Required by the API.
224    pub html: String,
225    /// Allowed values: `html`, `builder`.
226    /// Required by the API.
227    #[serde(rename = "editorType")]
228    pub editor_type: String,
229    #[serde(
230        rename = "previewText",
231        default,
232        skip_serializing_if = "Option::is_none"
233    )]
234    pub preview_text: Option<String>,
235    #[serde(
236        rename = "isPlainText",
237        default,
238        skip_serializing_if = "Option::is_none"
239    )]
240    pub is_plain_text: Option<bool>,
241}
242
243/// `ScheduleDto` from the GoHighLevel OpenAPI spec.
244#[derive(Debug, Clone, Default, Serialize, Deserialize)]
245pub struct ScheduleDto {
246    /// Required by the API.
247    pub name: String,
248    /// Required by the API.
249    #[serde(rename = "repeatAfter")]
250    pub repeat_after: String,
251    /// Required by the API.
252    pub id: String,
253    /// Required by the API.
254    #[serde(rename = "parentId")]
255    pub parent_id: String,
256    /// Required by the API.
257    #[serde(rename = "childCount")]
258    pub child_count: f64,
259    /// Required by the API.
260    #[serde(rename = "campaignType")]
261    pub campaign_type: String,
262    /// Required by the API.
263    #[serde(rename = "bulkActionVersion")]
264    pub bulk_action_version: String,
265    /// Required by the API.
266    #[serde(rename = "_id")]
267    pub id_alt: String,
268    /// Required by the API.
269    pub status: String,
270    /// Required by the API.
271    #[serde(rename = "sendDays", default, skip_serializing_if = "Vec::is_empty")]
272    pub send_days: Vec<String>,
273    /// Required by the API.
274    pub deleted: bool,
275    /// Required by the API.
276    pub migrated: bool,
277    /// Required by the API.
278    pub archived: bool,
279    /// Required by the API.
280    #[serde(rename = "hasTracking")]
281    pub has_tracking: bool,
282    /// Required by the API.
283    #[serde(rename = "isPlainText")]
284    pub is_plain_text: bool,
285    /// Required by the API.
286    #[serde(rename = "hasUtmTracking")]
287    pub has_utm_tracking: bool,
288    /// Required by the API.
289    #[serde(rename = "enableResendToUnopened")]
290    pub enable_resend_to_unopened: bool,
291    /// Required by the API.
292    #[serde(rename = "locationId")]
293    pub location_id: String,
294    /// Required by the API.
295    #[serde(rename = "templateId")]
296    pub template_id: String,
297    /// Required by the API.
298    #[serde(rename = "templateType")]
299    pub template_type: String,
300    /// Required by the API.
301    #[serde(rename = "createdAt")]
302    pub created_at: String,
303    /// Required by the API.
304    #[serde(rename = "updatedAt")]
305    pub updated_at: String,
306    /// Required by the API.
307    #[serde(rename = "__v")]
308    pub v: f64,
309    /// Required by the API.
310    #[serde(rename = "documentId")]
311    pub document_id: String,
312    /// Required by the API.
313    #[serde(rename = "downloadUrl")]
314    pub download_url: String,
315    /// Required by the API.
316    #[serde(rename = "templateDataDownloadUrl")]
317    pub template_data_download_url: String,
318    /// Required by the API.
319    #[serde(default, skip_serializing_if = "Vec::is_empty")]
320    pub child: Vec<String>,
321}
322
323/// `ScheduleFetchSuccessfulDTO` from the GoHighLevel OpenAPI spec.
324#[derive(Debug, Clone, Default, Serialize, Deserialize)]
325pub struct ScheduleFetchSuccessfulDTO {
326    /// The list of campaigns
327    /// Required by the API.
328    #[serde(default, skip_serializing_if = "Vec::is_empty")]
329    pub schedules: Vec<ScheduleDto>,
330    /// The total number of campaigns
331    /// Required by the API.
332    #[serde(default, skip_serializing_if = "Vec::is_empty")]
333    pub total: Vec<String>,
334    /// Trace Id
335    /// Required by the API.
336    #[serde(rename = "traceId")]
337    pub trace_id: String,
338}
339
340/// `TemplateSettings` from the GoHighLevel OpenAPI spec.
341#[derive(Debug, Clone, Default, Serialize, Deserialize)]
342pub struct TemplateSettings {
343    /// The spec defines no fields for this schema.
344    #[serde(flatten)]
345    pub extra: serde_json::Map<String, serde_json::Value>,
346}