Skip to main content

ghl_models/v3/
emails.rs

1//! `emails` data models for GoHighLevel API V3 (67 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/// `BuilderAttributePublicV2Dto` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct BuilderAttributePublicV2Dto {
24    /// Attribute name
25    /// Required by the API.
26    pub name: String,
27    /// Attribute default value
28    #[serde(default, skip_serializing_if = "Option::is_none")]
29    pub default: Option<serde_json::Value>,
30    /// Attribute unit
31    #[serde(default, skip_serializing_if = "Option::is_none")]
32    pub unit: Option<String>,
33}
34
35/// `BuilderCustomFlagsPublicV2Dto` from the GoHighLevel OpenAPI spec.
36#[derive(Debug, Clone, Default, Serialize, Deserialize)]
37pub struct BuilderCustomFlagsPublicV2Dto {
38    /// Layout ID
39    #[serde(rename = "layoutId", default, skip_serializing_if = "Option::is_none")]
40    pub layout_id: Option<serde_json::Value>,
41    /// Theme name
42    #[serde(default, skip_serializing_if = "Option::is_none")]
43    pub theme: Option<String>,
44    /// Social element rendering type
45    /// Allowed values: `icon`, `icon-text`, `text`.
46    #[serde(
47        rename = "socialElementType",
48        default,
49        skip_serializing_if = "Option::is_none"
50    )]
51    pub social_element_type: Option<String>,
52}
53
54/// `BuilderEditorContentPublicV2Dto` from the GoHighLevel OpenAPI spec.
55#[derive(Debug, Clone, Default, Serialize, Deserialize)]
56pub struct BuilderEditorContentPublicV2Dto {
57    /// Builder elements
58    #[serde(default, skip_serializing_if = "Vec::is_empty")]
59    pub elements: Vec<BuilderElementNodePublicV2Dto>,
60    /// Builder attributes map keyed by element ID
61    #[serde(default, skip_serializing_if = "Option::is_none")]
62    pub attrs: Option<serde_json::Value>,
63    /// Template-level settings map keyed by setting group
64    #[serde(
65        rename = "templateSettings",
66        default,
67        skip_serializing_if = "Option::is_none"
68    )]
69    pub template_settings: Option<serde_json::Value>,
70}
71
72/// `BuilderElementNodePublicV2Dto` from the GoHighLevel OpenAPI spec.
73#[derive(Debug, Clone, Default, Serialize, Deserialize)]
74pub struct BuilderElementNodePublicV2Dto {
75    /// Element ID
76    /// Required by the API.
77    pub id: String,
78    /// Tag name
79    /// Required by the API.
80    #[serde(rename = "tagName")]
81    pub tag_name: String,
82    /// Child elements
83    #[serde(default, skip_serializing_if = "Vec::is_empty")]
84    pub children: Vec<BuilderElementNodePublicV2Dto>,
85}
86
87/// `BuilderNodeAttrsPublicV2Dto` from the GoHighLevel OpenAPI spec.
88#[derive(Debug, Clone, Default, Serialize, Deserialize)]
89pub struct BuilderNodeAttrsPublicV2Dto {
90    /// Tag name
91    /// Required by the API.
92    #[serde(rename = "tagName")]
93    pub tag_name: String,
94    /// Element attributes
95    /// Required by the API.
96    #[serde(default, skip_serializing_if = "Vec::is_empty")]
97    pub attributes: Vec<BuilderAttributePublicV2Dto>,
98    /// Element content
99    #[serde(default, skip_serializing_if = "Option::is_none")]
100    pub content: Option<String>,
101    /// Custom flags
102    #[serde(
103        rename = "customFlags",
104        default,
105        skip_serializing_if = "Option::is_none"
106    )]
107    pub custom_flags: Option<BuilderCustomFlagsPublicV2Dto>,
108}
109
110/// `BuilderUpdateSuccessfulDTO` from the GoHighLevel OpenAPI spec.
111#[derive(Debug, Clone, Default, Serialize, Deserialize)]
112pub struct BuilderUpdateSuccessfulDTO {
113    /// ok
114    #[serde(default, skip_serializing_if = "Option::is_none")]
115    pub ok: Option<String>,
116    /// trace id
117    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
118    pub trace_id: Option<String>,
119    /// preview url
120    #[serde(
121        rename = "previewUrl",
122        default,
123        skip_serializing_if = "Option::is_none"
124    )]
125    pub preview_url: Option<String>,
126    /// template data download url
127    #[serde(
128        rename = "templateDownloadUrl",
129        default,
130        skip_serializing_if = "Option::is_none"
131    )]
132    pub template_download_url: Option<String>,
133    /// version id of the saved template
134    #[serde(rename = "versionId", default, skip_serializing_if = "Option::is_none")]
135    pub version_id: Option<String>,
136}
137
138/// `BulkActionCampaignDto` from the GoHighLevel OpenAPI spec.
139#[derive(Debug, Clone, Default, Serialize, Deserialize)]
140pub struct BulkActionCampaignDto {
141    /// Campaign ID
142    /// Required by the API.
143    pub id: String,
144    /// Campaign name
145    /// Required by the API.
146    pub name: String,
147    /// Campaign status
148    /// Allowed values: `processing`, `scheduled`, `paused`, `complete`, `cancelled`.
149    /// Required by the API.
150    pub status: String,
151    /// Schedule type (NOW or SCHEDULED)
152    /// Required by the API.
153    #[serde(rename = "scheduleType")]
154    pub schedule_type: String,
155    /// User who created the campaign
156    /// Required by the API.
157    #[serde(rename = "createdBy")]
158    pub created_by: String,
159    /// Whether the campaign is deleted
160    /// Required by the API.
161    pub deleted: bool,
162    /// Created at timestamp
163    /// Required by the API.
164    #[serde(rename = "createdAt")]
165    pub created_at: String,
166    /// Last updated timestamp
167    /// Required by the API.
168    #[serde(rename = "updatedAt")]
169    pub updated_at: String,
170    /// Processing completion timestamp
171    #[serde(
172        rename = "completedAt",
173        default,
174        skip_serializing_if = "Option::is_none"
175    )]
176    pub completed_at: Option<String>,
177    /// Email metadata
178    #[serde(
179        rename = "emailMetadata",
180        default,
181        skip_serializing_if = "Option::is_none"
182    )]
183    pub email_metadata: Option<BulkActionCampaignEmailDetailsDto>,
184}
185
186/// `BulkActionCampaignEmailDetailsDto` from the GoHighLevel OpenAPI spec.
187#[derive(Debug, Clone, Default, Serialize, Deserialize)]
188pub struct BulkActionCampaignEmailDetailsDto {
189    /// Email subject line
190    #[serde(default, skip_serializing_if = "Option::is_none")]
191    pub subject: Option<String>,
192    /// Sender (name and email)
193    #[serde(rename = "from", default, skip_serializing_if = "Option::is_none")]
194    pub from_: Option<String>,
195    /// Sender name
196    #[serde(default, skip_serializing_if = "Option::is_none")]
197    pub name: Option<String>,
198    /// Email template ID
199    #[serde(
200        rename = "templateId",
201        default,
202        skip_serializing_if = "Option::is_none"
203    )]
204    pub template_id: Option<String>,
205}
206
207/// `BulkActionCampaignPublicV2Dto` from the GoHighLevel OpenAPI spec.
208#[derive(Debug, Clone, Default, Serialize, Deserialize)]
209pub struct BulkActionCampaignPublicV2Dto {
210    /// Campaign ID
211    /// Required by the API.
212    pub id: String,
213    /// Source of the campaign
214    #[serde(default, skip_serializing_if = "Option::is_none")]
215    pub source: Option<String>,
216    /// Source ID of the campaign
217    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
218    pub source_id: Option<String>,
219    /// Campaign name
220    #[serde(default, skip_serializing_if = "Option::is_none")]
221    pub name: Option<String>,
222    /// Campaign status
223    /// Allowed values: `processing`, `scheduled`, `paused`, `complete`, `cancelled`.
224    /// Required by the API.
225    pub status: String,
226    /// Schedule type (NOW, SCHEDULED, or DRIP)
227    /// Allowed values: `NOW`, `SCHEDULED`, `DRIP`.
228    #[serde(
229        rename = "scheduleType",
230        default,
231        skip_serializing_if = "Option::is_none"
232    )]
233    pub schedule_type: Option<String>,
234    /// Whether the campaign is deleted
235    /// Required by the API.
236    pub deleted: bool,
237    /// Created at timestamp
238    /// Required by the API.
239    #[serde(rename = "createdAt")]
240    pub created_at: String,
241    /// Last updated timestamp
242    /// Required by the API.
243    #[serde(rename = "updatedAt")]
244    pub updated_at: String,
245    /// Processing completion timestamp
246    #[serde(
247        rename = "completedAt",
248        default,
249        skip_serializing_if = "Option::is_none"
250    )]
251    pub completed_at: Option<String>,
252    /// Email metadata
253    #[serde(
254        rename = "emailMetadata",
255        default,
256        skip_serializing_if = "Option::is_none"
257    )]
258    pub email_metadata: Option<BulkActionCampaignEmailDetailsDto>,
259}
260
261/// `CreateBuilderDto` from the GoHighLevel OpenAPI spec.
262#[derive(Debug, Clone, Default, Serialize, Deserialize)]
263pub struct CreateBuilderDto {
264    /// Required by the API.
265    #[serde(rename = "locationId")]
266    pub location_id: String,
267    #[serde(default, skip_serializing_if = "Option::is_none")]
268    pub title: Option<String>,
269    /// Allowed values: `html`, `folder`, `import`, `builder`, `blank`, `ai_template`,
270    /// `vibe-editor`.
271    /// Required by the API.
272    #[serde(rename = "type")]
273    pub type_: String,
274    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
275    pub updated_by: Option<String>,
276    /// Allowed values: `1`, `2`.
277    #[serde(
278        rename = "builderVersion",
279        default,
280        skip_serializing_if = "Option::is_none"
281    )]
282    pub builder_version: Option<String>,
283    #[serde(default, skip_serializing_if = "Option::is_none")]
284    pub name: Option<String>,
285    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
286    pub parent_id: Option<String>,
287    #[serde(
288        rename = "templateDataUrl",
289        default,
290        skip_serializing_if = "Option::is_none"
291    )]
292    pub template_data_url: Option<String>,
293    /// Allowed values: `mailchimp`, `active_campaign`, `kajabi`, `other`,
294    /// `import_with_email_ai`.
295    /// Required by the API.
296    #[serde(rename = "importProvider")]
297    pub import_provider: String,
298    #[serde(rename = "importURL", default, skip_serializing_if = "Option::is_none")]
299    pub import_url: Option<String>,
300    #[serde(
301        rename = "templateSource",
302        default,
303        skip_serializing_if = "Option::is_none"
304    )]
305    pub template_source: Option<String>,
306    #[serde(
307        rename = "isPlainText",
308        default,
309        skip_serializing_if = "Option::is_none"
310    )]
311    pub is_plain_text: Option<bool>,
312    #[serde(
313        rename = "subjectLine",
314        default,
315        skip_serializing_if = "Option::is_none"
316    )]
317    pub subject_line: Option<String>,
318    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
319    pub from_name: Option<String>,
320    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
321    pub from_email: Option<String>,
322    #[serde(
323        rename = "previewText",
324        default,
325        skip_serializing_if = "Option::is_none"
326    )]
327    pub preview_text: Option<String>,
328}
329
330/// `CreateBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
331#[derive(Debug, Clone, Default, Serialize, Deserialize)]
332pub struct CreateBuilderSuccesfulResponseDto {
333    /// template id
334    /// Required by the API.
335    pub redirect: String,
336    /// trace id
337    /// Required by the API.
338    #[serde(rename = "traceId")]
339    pub trace_id: String,
340}
341
342/// `CreateEmailCampaignPublicV2BodyDto` from the GoHighLevel OpenAPI spec.
343#[derive(Debug, Clone, Default, Serialize, Deserialize)]
344pub struct CreateEmailCampaignPublicV2BodyDto {
345    /// Campaign name
346    /// Required by the API.
347    pub name: String,
348    /// Editor type for the campaign content. Use `html` for code-editor campaigns or `text` for
349    /// plain-text campaigns.
350    /// Allowed values: `html`, `text`.
351    /// Required by the API.
352    #[serde(rename = "editorType")]
353    pub editor_type: String,
354    /// Existing template ID to create the campaign from. Omit this field to create a blank
355    /// campaign.
356    #[serde(
357        rename = "templateId",
358        default,
359        skip_serializing_if = "Option::is_none"
360    )]
361    pub template_id: Option<String>,
362    /// Optional initial editor content to persist immediately after campaign creation. Provide
363    /// HTML or plain-text string content.
364    #[serde(
365        rename = "editorContent",
366        default,
367        skip_serializing_if = "Option::is_none"
368    )]
369    pub editor_content: Option<String>,
370    /// Parent folder ID
371    #[serde(
372        rename = "parentFolderId",
373        default,
374        skip_serializing_if = "Option::is_none"
375    )]
376    pub parent_folder_id: Option<String>,
377    /// Timezone for the campaign
378    /// Required by the API.
379    #[serde(rename = "timeZone")]
380    pub time_zone: String,
381    /// ID of the user performing this action
382    /// Required by the API.
383    #[serde(rename = "userId")]
384    pub user_id: String,
385    /// Name of the user performing this action
386    #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")]
387    pub user_name: Option<String>,
388}
389
390/// `CreateEmailCampaignPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
391#[derive(Debug, Clone, Default, Serialize, Deserialize)]
392pub struct CreateEmailCampaignPublicV2ResponseDto {
393    /// Campaign ID
394    /// Required by the API.
395    pub id: String,
396    /// Source of the campaign
397    #[serde(default, skip_serializing_if = "Option::is_none")]
398    pub source: Option<String>,
399    /// Source ID of the campaign
400    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
401    pub source_id: Option<String>,
402    /// Campaign name
403    #[serde(default, skip_serializing_if = "Option::is_none")]
404    pub name: Option<String>,
405    /// Campaign status
406    /// Allowed values: `all`, `sent`, `failed`, `archived`, `draft`, `processing`, `scheduled`,
407    /// `cancelled`, `paused`.
408    #[serde(default, skip_serializing_if = "Option::is_none")]
409    pub status: Option<String>,
410    /// Campaign type
411    #[serde(
412        rename = "campaignType",
413        default,
414        skip_serializing_if = "Option::is_none"
415    )]
416    pub campaign_type: Option<String>,
417    /// Campaign category
418    #[serde(
419        rename = "campaignCategory",
420        default,
421        skip_serializing_if = "Option::is_none"
422    )]
423    pub campaign_category: Option<String>,
424    /// AB test variation identifiers (available only for AB test campaigns)
425    #[serde(default, skip_serializing_if = "Vec::is_empty")]
426    pub variations: Vec<EmailCampaignVariationPublicV2Dto>,
427    /// Whether the campaign is deleted
428    /// Required by the API.
429    pub deleted: bool,
430    /// Created at timestamp
431    /// Required by the API.
432    #[serde(rename = "createdAt")]
433    pub created_at: String,
434    /// Last updated timestamp
435    /// Required by the API.
436    #[serde(rename = "updatedAt")]
437    pub updated_at: String,
438    /// Trace ID of request
439    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
440    pub trace_id: Option<String>,
441}
442
443/// `CreateTemplateFolderPublicV2BodyDto` from the GoHighLevel OpenAPI spec.
444#[derive(Debug, Clone, Default, Serialize, Deserialize)]
445pub struct CreateTemplateFolderPublicV2BodyDto {
446    /// Folder name
447    /// Required by the API.
448    pub name: String,
449    /// ID of the user performing this action
450    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
451    pub user_id: Option<String>,
452}
453
454/// `CreateTemplateFolderPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
455#[derive(Debug, Clone, Default, Serialize, Deserialize)]
456pub struct CreateTemplateFolderPublicV2ResponseDto {
457    /// Folder ID
458    /// Required by the API.
459    pub id: String,
460    /// Folder name
461    /// Required by the API.
462    pub name: String,
463    /// Created timestamp
464    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
465    pub created_at: Option<String>,
466    /// Updated timestamp
467    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
468    pub updated_at: Option<String>,
469    /// Trace ID of request
470    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
471    pub trace_id: Option<String>,
472}
473
474/// `CreateTemplatePublicV2BodyDto` from the GoHighLevel OpenAPI spec.
475#[derive(Debug, Clone, Default, Serialize, Deserialize)]
476pub struct CreateTemplatePublicV2BodyDto {
477    /// Template name
478    /// Required by the API.
479    pub name: String,
480    /// Editor type for the new template. Use `html` for code-editor templates or `text` for
481    /// plain-text templates.
482    /// Allowed values: `html`, `text`.
483    /// Required by the API.
484    #[serde(rename = "editorType")]
485    pub editor_type: String,
486    /// Optional initial editor content. Provide HTML or plain-text string content.
487    #[serde(
488        rename = "editorContent",
489        default,
490        skip_serializing_if = "Option::is_none"
491    )]
492    pub editor_content: Option<String>,
493    /// Parent folder ID
494    #[serde(
495        rename = "parentFolderId",
496        default,
497        skip_serializing_if = "Option::is_none"
498    )]
499    pub parent_folder_id: Option<String>,
500    /// Email subject line
501    #[serde(
502        rename = "subjectLine",
503        default,
504        skip_serializing_if = "Option::is_none"
505    )]
506    pub subject_line: Option<String>,
507    /// Sender name
508    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
509    pub from_name: Option<String>,
510    /// Sender email address
511    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
512    pub from_email: Option<String>,
513    /// Preview text
514    #[serde(
515        rename = "previewText",
516        default,
517        skip_serializing_if = "Option::is_none"
518    )]
519    pub preview_text: Option<String>,
520    /// ID of the user performing this action
521    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
522    pub user_id: Option<String>,
523}
524
525/// `CreateTemplatePublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
526#[derive(Debug, Clone, Default, Serialize, Deserialize)]
527pub struct CreateTemplatePublicV2ResponseDto {
528    /// Template ID
529    /// Required by the API.
530    pub id: String,
531    /// Template name
532    /// Required by the API.
533    pub name: String,
534    /// Editor type
535    /// Allowed values: `html`, `text`.
536    /// Required by the API.
537    #[serde(rename = "editorType")]
538    pub editor_type: String,
539    /// Whether template is plain text
540    /// Required by the API.
541    #[serde(rename = "isPlainText")]
542    pub is_plain_text: bool,
543    /// Parent folder ID
544    #[serde(
545        rename = "parentFolderId",
546        default,
547        skip_serializing_if = "Option::is_none"
548    )]
549    pub parent_folder_id: Option<String>,
550    /// Sender name
551    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
552    pub from_name: Option<String>,
553    /// Sender email address
554    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
555    pub from_email: Option<String>,
556    /// Email subject line
557    #[serde(
558        rename = "subjectLine",
559        default,
560        skip_serializing_if = "Option::is_none"
561    )]
562    pub subject_line: Option<String>,
563    /// Preview text
564    #[serde(
565        rename = "previewText",
566        default,
567        skip_serializing_if = "Option::is_none"
568    )]
569    pub preview_text: Option<String>,
570    /// Preview URL
571    #[serde(
572        rename = "previewUrl",
573        default,
574        skip_serializing_if = "Option::is_none"
575    )]
576    pub preview_url: Option<String>,
577    /// Created timestamp
578    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
579    pub created_at: Option<String>,
580    /// Updated timestamp
581    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
582    pub updated_at: Option<String>,
583    /// Trace ID of request
584    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
585    pub trace_id: Option<String>,
586}
587
588/// `DeleteBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
589#[derive(Debug, Clone, Default, Serialize, Deserialize)]
590pub struct DeleteBuilderSuccesfulResponseDto {
591    /// ok
592    #[serde(default, skip_serializing_if = "Option::is_none")]
593    pub ok: Option<String>,
594    /// trace id
595    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
596    pub trace_id: Option<String>,
597}
598
599/// `DeleteCampaignPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
600#[derive(Debug, Clone, Default, Serialize, Deserialize)]
601pub struct DeleteCampaignPublicV2ResponseDto {
602    /// Whether the campaign was deleted successfully
603    /// Required by the API.
604    pub deleted: bool,
605    /// Trace ID of the request
606    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
607    pub trace_id: Option<String>,
608}
609
610/// `DeleteTemplatePublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
611#[derive(Debug, Clone, Default, Serialize, Deserialize)]
612pub struct DeleteTemplatePublicV2ResponseDto {
613    /// Whether the template was deleted successfully
614    /// Required by the API.
615    pub deleted: bool,
616    /// Trace ID of the request
617    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
618    pub trace_id: Option<String>,
619}
620
621/// `EmailCampaignPublicV2Dto` from the GoHighLevel OpenAPI spec.
622#[derive(Debug, Clone, Default, Serialize, Deserialize)]
623pub struct EmailCampaignPublicV2Dto {
624    /// Campaign ID
625    /// Required by the API.
626    pub id: String,
627    /// Source of the campaign
628    #[serde(default, skip_serializing_if = "Option::is_none")]
629    pub source: Option<String>,
630    /// Source ID of the campaign
631    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
632    pub source_id: Option<String>,
633    /// Campaign name
634    #[serde(default, skip_serializing_if = "Option::is_none")]
635    pub name: Option<String>,
636    /// Campaign status
637    /// Allowed values: `all`, `sent`, `failed`, `archived`, `draft`, `processing`, `scheduled`,
638    /// `cancelled`, `paused`.
639    #[serde(default, skip_serializing_if = "Option::is_none")]
640    pub status: Option<String>,
641    /// Campaign type
642    #[serde(
643        rename = "campaignType",
644        default,
645        skip_serializing_if = "Option::is_none"
646    )]
647    pub campaign_type: Option<String>,
648    /// Campaign category
649    #[serde(
650        rename = "campaignCategory",
651        default,
652        skip_serializing_if = "Option::is_none"
653    )]
654    pub campaign_category: Option<String>,
655    /// AB test variation identifiers (available only for AB test campaigns)
656    #[serde(default, skip_serializing_if = "Vec::is_empty")]
657    pub variations: Vec<EmailCampaignVariationPublicV2Dto>,
658    /// Whether the campaign is deleted
659    /// Required by the API.
660    pub deleted: bool,
661    /// Created at timestamp
662    /// Required by the API.
663    #[serde(rename = "createdAt")]
664    pub created_at: String,
665    /// Last updated timestamp
666    /// Required by the API.
667    #[serde(rename = "updatedAt")]
668    pub updated_at: String,
669}
670
671/// `EmailCampaignVariationPublicV2Dto` from the GoHighLevel OpenAPI spec.
672#[derive(Debug, Clone, Default, Serialize, Deserialize)]
673pub struct EmailCampaignVariationPublicV2Dto {
674    /// Variation source ID for stats lookup
675    /// Required by the API.
676    #[serde(rename = "sourceId")]
677    pub source_id: String,
678    /// Whether this is the winning variation
679    /// Required by the API.
680    #[serde(rename = "isWinner")]
681    pub is_winner: bool,
682}
683
684/// `EmailStatsNumbersDto` from the GoHighLevel OpenAPI spec.
685#[derive(Debug, Clone, Default, Serialize, Deserialize)]
686pub struct EmailStatsNumbersDto {
687    /// Emails delivered
688    /// Required by the API.
689    pub delivered: f64,
690    /// Emails opened
691    /// Required by the API.
692    pub opened: f64,
693    /// Links clicked
694    /// Required by the API.
695    pub clicked: f64,
696    /// Unsubscribes
697    /// Required by the API.
698    pub unsubscribed: f64,
699    /// Spam complaints
700    /// Required by the API.
701    pub complained: f64,
702    /// Hard bounces
703    /// Required by the API.
704    #[serde(rename = "permanentFail")]
705    pub permanent_fail: f64,
706    /// Soft bounces
707    /// Required by the API.
708    #[serde(rename = "temporaryFail")]
709    pub temporary_fail: f64,
710    /// Rejected emails
711    /// Required by the API.
712    pub rejected: f64,
713    /// Failed emails
714    /// Required by the API.
715    pub failed: f64,
716    /// Replies received
717    /// Required by the API.
718    pub replied: f64,
719}
720
721/// `EmailStatsNumbersPublicV2Dto` from the GoHighLevel OpenAPI spec.
722#[derive(Debug, Clone, Default, Serialize, Deserialize)]
723pub struct EmailStatsNumbersPublicV2Dto {
724    /// Total emails sent (delivered + accepted + bounced)
725    /// Required by the API.
726    pub sent: f64,
727    /// Emails accepted by the mail server
728    /// Required by the API.
729    pub accepted: f64,
730    /// Emails delivered to inbox
731    /// Required by the API.
732    pub delivered: f64,
733    /// Emails opened
734    /// Required by the API.
735    pub opened: f64,
736    /// Links clicked
737    /// Required by the API.
738    pub clicked: f64,
739    /// Unsubscribes
740    /// Required by the API.
741    pub unsubscribed: f64,
742    /// Spam complaints
743    /// Required by the API.
744    pub complained: f64,
745    /// Hard bounces
746    /// Required by the API.
747    #[serde(rename = "permanentFail")]
748    pub permanent_fail: f64,
749    /// Soft bounces
750    /// Required by the API.
751    #[serde(rename = "temporaryFail")]
752    pub temporary_fail: f64,
753    /// Rejected emails
754    /// Required by the API.
755    pub rejected: f64,
756    /// Failed emails
757    /// Required by the API.
758    pub failed: f64,
759    /// Replies received
760    /// Required by the API.
761    pub replied: f64,
762    /// Open rate as percentage of delivered
763    /// Required by the API.
764    #[serde(rename = "openRate")]
765    pub open_rate: f64,
766    /// Click rate as percentage of delivered
767    /// Required by the API.
768    #[serde(rename = "clickRate")]
769    pub click_rate: f64,
770    /// Unsubscribe rate as percentage of delivered
771    /// Required by the API.
772    #[serde(rename = "unsubscribeRate")]
773    pub unsubscribe_rate: f64,
774    /// Complaint rate as percentage of delivered
775    /// Required by the API.
776    #[serde(rename = "complaintRate")]
777    pub complaint_rate: f64,
778    /// Bounce rate as percentage of sent
779    /// Required by the API.
780    #[serde(rename = "bounceRate")]
781    pub bounce_rate: f64,
782    /// Reply rate as percentage of delivered
783    /// Required by the API.
784    #[serde(rename = "replyRate")]
785    pub reply_rate: f64,
786}
787
788/// `FetchBuilderSuccesfulResponseDto` from the GoHighLevel OpenAPI spec.
789#[derive(Debug, Clone, Default, Serialize, Deserialize)]
790pub struct FetchBuilderSuccesfulResponseDto {
791    /// template name
792    #[serde(default, skip_serializing_if = "Option::is_none")]
793    pub name: Option<String>,
794    /// updated by
795    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
796    pub updated_by: Option<String>,
797    /// plain text based template
798    #[serde(
799        rename = "isPlainText",
800        default,
801        skip_serializing_if = "Option::is_none"
802    )]
803    pub is_plain_text: Option<bool>,
804    /// last updated
805    #[serde(
806        rename = "lastUpdated",
807        default,
808        skip_serializing_if = "Option::is_none"
809    )]
810    pub last_updated: Option<String>,
811    /// date added
812    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
813    pub date_added: Option<String>,
814    /// preview url
815    #[serde(
816        rename = "previewUrl",
817        default,
818        skip_serializing_if = "Option::is_none"
819    )]
820    pub preview_url: Option<String>,
821    /// id
822    #[serde(default, skip_serializing_if = "Option::is_none")]
823    pub id: Option<String>,
824    /// version
825    #[serde(default, skip_serializing_if = "Option::is_none")]
826    pub version: Option<String>,
827    /// type
828    #[serde(
829        rename = "templateType",
830        default,
831        skip_serializing_if = "Option::is_none"
832    )]
833    pub template_type: Option<String>,
834}
835
836/// `GetBulkActionCampaignPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
837#[derive(Debug, Clone, Default, Serialize, Deserialize)]
838pub struct GetBulkActionCampaignPublicV2ResponseDto {
839    /// Campaign ID
840    /// Required by the API.
841    pub id: String,
842    /// Source of the campaign
843    #[serde(default, skip_serializing_if = "Option::is_none")]
844    pub source: Option<String>,
845    /// Source ID of the campaign
846    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
847    pub source_id: Option<String>,
848    /// Campaign name
849    #[serde(default, skip_serializing_if = "Option::is_none")]
850    pub name: Option<String>,
851    /// Campaign status
852    /// Allowed values: `processing`, `scheduled`, `paused`, `complete`, `cancelled`.
853    /// Required by the API.
854    pub status: String,
855    /// Schedule type (NOW, SCHEDULED, or DRIP)
856    /// Allowed values: `NOW`, `SCHEDULED`, `DRIP`.
857    #[serde(
858        rename = "scheduleType",
859        default,
860        skip_serializing_if = "Option::is_none"
861    )]
862    pub schedule_type: Option<String>,
863    /// Sender name
864    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
865    pub from_name: Option<String>,
866    /// Sender email address
867    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
868    pub from_email: Option<String>,
869    /// Email subject line
870    #[serde(default, skip_serializing_if = "Option::is_none")]
871    pub subject: Option<String>,
872    /// Reply-to email address
873    #[serde(
874        rename = "replyToAddress",
875        default,
876        skip_serializing_if = "Option::is_none"
877    )]
878    pub reply_to_address: Option<String>,
879    /// Preview text
880    #[serde(
881        rename = "previewText",
882        default,
883        skip_serializing_if = "Option::is_none"
884    )]
885    pub preview_text: Option<String>,
886    /// Editor type for this campaign
887    /// Allowed values: `html`, `builder`, `text`.
888    #[serde(
889        rename = "editorType",
890        default,
891        skip_serializing_if = "Option::is_none"
892    )]
893    pub editor_type: Option<String>,
894    /// Whether the campaign uses plain text
895    #[serde(
896        rename = "isPlainText",
897        default,
898        skip_serializing_if = "Option::is_none"
899    )]
900    pub is_plain_text: Option<bool>,
901    /// URL to fetch the rendered campaign content as HTML. Issue a GET against this URL to
902    /// retrieve the body.
903    #[serde(
904        rename = "editorContentUrl",
905        default,
906        skip_serializing_if = "Option::is_none"
907    )]
908    pub editor_content_url: Option<String>,
909    /// Whether the campaign is deleted
910    /// Required by the API.
911    pub deleted: bool,
912    /// Created at timestamp
913    /// Required by the API.
914    #[serde(rename = "createdAt")]
915    pub created_at: String,
916    /// Last updated timestamp
917    /// Required by the API.
918    #[serde(rename = "updatedAt")]
919    pub updated_at: String,
920    /// Processing completion timestamp
921    #[serde(
922        rename = "completedAt",
923        default,
924        skip_serializing_if = "Option::is_none"
925    )]
926    pub completed_at: Option<String>,
927    /// Trace ID of the request
928    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
929    pub trace_id: Option<String>,
930}
931
932/// `GetBulkActionCampaignsResponseDto` from the GoHighLevel OpenAPI spec.
933#[derive(Debug, Clone, Default, Serialize, Deserialize)]
934pub struct GetBulkActionCampaignsResponseDto {
935    /// List of bulk action campaigns
936    /// Required by the API.
937    #[serde(default, skip_serializing_if = "Vec::is_empty")]
938    pub campaigns: Vec<BulkActionCampaignDto>,
939    /// Total count of bulk action campaigns
940    /// Required by the API.
941    pub total: f64,
942}
943
944/// `GetCampaignStatsPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
945#[derive(Debug, Clone, Default, Serialize, Deserialize)]
946pub struct GetCampaignStatsPublicV2ResponseDto {
947    /// Location ID
948    /// Required by the API.
949    #[serde(rename = "locationId")]
950    pub location_id: String,
951    /// Source type
952    /// Allowed values: `email-campaigns`, `workflow-campaigns`, `bulk-actions`.
953    /// Required by the API.
954    pub source: String,
955    /// Source ID
956    /// Required by the API.
957    #[serde(rename = "sourceId")]
958    pub source_id: String,
959    /// Workflow action ID
960    #[serde(
961        rename = "subSourceId",
962        default,
963        skip_serializing_if = "Option::is_none"
964    )]
965    pub sub_source_id: Option<String>,
966    /// Email performance metrics
967    /// Required by the API.
968    pub stats: EmailStatsNumbersPublicV2Dto,
969    /// Trace ID of the request
970    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
971    pub trace_id: Option<String>,
972}
973
974/// `GetCampaignStatsResponseDto` from the GoHighLevel OpenAPI spec.
975#[derive(Debug, Clone, Default, Serialize, Deserialize)]
976pub struct GetCampaignStatsResponseDto {
977    /// Location ID
978    /// Required by the API.
979    #[serde(rename = "locationId")]
980    pub location_id: String,
981    /// Source type
982    /// Allowed values: `email-campaigns`, `workflow-campaigns`, `bulk-actions`.
983    /// Required by the API.
984    pub source: String,
985    /// Source ID
986    /// Required by the API.
987    #[serde(rename = "sourceId")]
988    pub source_id: String,
989    /// Workflow action ID
990    #[serde(
991        rename = "subSourceId",
992        default,
993        skip_serializing_if = "Option::is_none"
994    )]
995    pub sub_source_id: Option<String>,
996    /// Email performance metrics
997    /// Required by the API.
998    pub stats: EmailStatsNumbersDto,
999}
1000
1001/// `GetEmailCampaignPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1002#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1003pub struct GetEmailCampaignPublicV2ResponseDto {
1004    /// Campaign ID
1005    /// Required by the API.
1006    pub id: String,
1007    /// Source of the campaign
1008    #[serde(default, skip_serializing_if = "Option::is_none")]
1009    pub source: Option<String>,
1010    /// Source ID of the campaign
1011    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
1012    pub source_id: Option<String>,
1013    /// Campaign name
1014    #[serde(default, skip_serializing_if = "Option::is_none")]
1015    pub name: Option<String>,
1016    /// Campaign status
1017    /// Allowed values: `all`, `sent`, `failed`, `archived`, `draft`, `processing`, `scheduled`,
1018    /// `cancelled`, `paused`.
1019    #[serde(default, skip_serializing_if = "Option::is_none")]
1020    pub status: Option<String>,
1021    /// Campaign delivery type
1022    #[serde(
1023        rename = "campaignType",
1024        default,
1025        skip_serializing_if = "Option::is_none"
1026    )]
1027    pub campaign_type: Option<String>,
1028    /// Campaign category
1029    #[serde(
1030        rename = "campaignCategory",
1031        default,
1032        skip_serializing_if = "Option::is_none"
1033    )]
1034    pub campaign_category: Option<String>,
1035    /// AB test variation identifiers (available only for AB test campaigns)
1036    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1037    pub variations: Vec<EmailCampaignVariationPublicV2Dto>,
1038    /// Original editor type the campaign was created with
1039    /// Allowed values: `html`, `builder`, `text`.
1040    #[serde(
1041        rename = "editorType",
1042        default,
1043        skip_serializing_if = "Option::is_none"
1044    )]
1045    pub editor_type: Option<String>,
1046    /// Whether the campaign uses plain text
1047    #[serde(
1048        rename = "isPlainText",
1049        default,
1050        skip_serializing_if = "Option::is_none"
1051    )]
1052    pub is_plain_text: Option<bool>,
1053    /// URL to fetch the rendered campaign content as HTML. Issue a GET against this URL to
1054    /// retrieve the body.
1055    #[serde(
1056        rename = "editorContentUrl",
1057        default,
1058        skip_serializing_if = "Option::is_none"
1059    )]
1060    pub editor_content_url: Option<String>,
1061    /// Sender name
1062    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
1063    pub from_name: Option<String>,
1064    /// Sender email address
1065    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
1066    pub from_email: Option<String>,
1067    /// Email subject line
1068    #[serde(default, skip_serializing_if = "Option::is_none")]
1069    pub subject: Option<String>,
1070    /// Reply-to email address
1071    #[serde(
1072        rename = "replyToAddress",
1073        default,
1074        skip_serializing_if = "Option::is_none"
1075    )]
1076    pub reply_to_address: Option<String>,
1077    /// Preview text
1078    #[serde(
1079        rename = "previewText",
1080        default,
1081        skip_serializing_if = "Option::is_none"
1082    )]
1083    pub preview_text: Option<String>,
1084    /// Whether the campaign is deleted
1085    /// Required by the API.
1086    pub deleted: bool,
1087    /// Created at timestamp
1088    /// Required by the API.
1089    #[serde(rename = "createdAt")]
1090    pub created_at: String,
1091    /// Last updated timestamp
1092    /// Required by the API.
1093    #[serde(rename = "updatedAt")]
1094    pub updated_at: String,
1095    /// Trace ID of the request
1096    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1097    pub trace_id: Option<String>,
1098}
1099
1100/// `GetTemplatePublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1101#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1102pub struct GetTemplatePublicV2ResponseDto {
1103    /// Template ID
1104    /// Required by the API.
1105    pub id: String,
1106    /// Template name
1107    /// Required by the API.
1108    pub name: String,
1109    /// Editor type
1110    /// Allowed values: `html`, `builder`, `text`.
1111    /// Required by the API.
1112    #[serde(rename = "editorType")]
1113    pub editor_type: String,
1114    /// Whether template is plain text
1115    /// Required by the API.
1116    #[serde(rename = "isPlainText")]
1117    pub is_plain_text: bool,
1118    /// Parent folder ID
1119    #[serde(
1120        rename = "parentFolderId",
1121        default,
1122        skip_serializing_if = "Option::is_none"
1123    )]
1124    pub parent_folder_id: Option<String>,
1125    /// Sender name
1126    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
1127    pub from_name: Option<String>,
1128    /// Sender email address
1129    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
1130    pub from_email: Option<String>,
1131    /// Email subject line
1132    #[serde(default, skip_serializing_if = "Option::is_none")]
1133    pub subject: Option<String>,
1134    /// Preview text
1135    #[serde(
1136        rename = "previewText",
1137        default,
1138        skip_serializing_if = "Option::is_none"
1139    )]
1140    pub preview_text: Option<String>,
1141    /// URL to fetch the rendered template content as HTML. Issue a GET against this URL to
1142    /// retrieve the body.
1143    #[serde(
1144        rename = "editorContentUrl",
1145        default,
1146        skip_serializing_if = "Option::is_none"
1147    )]
1148    pub editor_content_url: Option<String>,
1149    /// Whether the template is deleted
1150    /// Required by the API.
1151    pub deleted: bool,
1152    /// Created timestamp
1153    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
1154    pub created_at: Option<String>,
1155    /// Updated timestamp
1156    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
1157    pub updated_at: Option<String>,
1158    /// Trace ID of request
1159    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1160    pub trace_id: Option<String>,
1161}
1162
1163/// `GetWorkflowCampaignPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1164#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1165pub struct GetWorkflowCampaignPublicV2ResponseDto {
1166    /// Campaign ID
1167    /// Required by the API.
1168    pub id: String,
1169    /// Campaign name
1170    #[serde(default, skip_serializing_if = "Option::is_none")]
1171    pub name: Option<String>,
1172    /// Campaign status
1173    /// Allowed values: `published`, `draft`.
1174    #[serde(default, skip_serializing_if = "Option::is_none")]
1175    pub status: Option<String>,
1176    /// Source of the campaign
1177    #[serde(default, skip_serializing_if = "Option::is_none")]
1178    pub source: Option<String>,
1179    /// Source ID of the campaign
1180    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
1181    pub source_id: Option<String>,
1182    /// Sub-sources (email-sending steps) within this workflow. Each entry's `id` can be passed
1183    /// as the `subSourceId` query parameter to the campaign stats endpoint to retrieve per-step
1184    /// stats.
1185    #[serde(rename = "subSources", default, skip_serializing_if = "Vec::is_empty")]
1186    pub sub_sources: Vec<WorkflowCampaignSubSourcePublicV2Dto>,
1187    /// Whether the campaign is deleted
1188    #[serde(default, skip_serializing_if = "Option::is_none")]
1189    pub deleted: Option<bool>,
1190    /// Created at timestamp
1191    /// Required by the API.
1192    #[serde(rename = "createdAt")]
1193    pub created_at: String,
1194    /// Updated at timestamp
1195    /// Required by the API.
1196    #[serde(rename = "updatedAt")]
1197    pub updated_at: String,
1198    /// Trace ID of the request
1199    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1200    pub trace_id: Option<String>,
1201}
1202
1203/// `GetWorkflowCampaignsPublicResponseDto` from the GoHighLevel OpenAPI spec.
1204#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1205pub struct GetWorkflowCampaignsPublicResponseDto {
1206    /// List of workflow campaigns
1207    /// Required by the API.
1208    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1209    pub campaigns: Vec<WorkflowCampaignPublicDto>,
1210    /// Total count of campaigns
1211    /// Required by the API.
1212    pub total: f64,
1213}
1214
1215/// `IBuilderJsonMapper` from the GoHighLevel OpenAPI spec.
1216#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1217pub struct IBuilderJsonMapper {
1218    /// Array of VNode elements representing the email structure
1219    /// Required by the API.
1220    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1221    pub elements: Vec<String>,
1222    /// Object mapping element IDs to their attributes and styles
1223    /// Required by the API.
1224    pub attrs: serde_json::Value,
1225    /// Template-level settings and configuration
1226    /// Required by the API.
1227    #[serde(rename = "templateSettings")]
1228    pub template_settings: TemplateSettings,
1229}
1230
1231/// `ImportTemplatePublicV2BodyDto` from the GoHighLevel OpenAPI spec.
1232#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1233pub struct ImportTemplatePublicV2BodyDto {
1234    /// Import provider (URL-based providers only)
1235    /// Allowed values: `mailchimp`, `active_campaign`.
1236    /// Required by the API.
1237    #[serde(rename = "importProvider")]
1238    pub import_provider: String,
1239    /// Public import URL
1240    /// Required by the API.
1241    #[serde(rename = "importUrl")]
1242    pub import_url: String,
1243    /// Template name
1244    #[serde(default, skip_serializing_if = "Option::is_none")]
1245    pub name: Option<String>,
1246    /// Parent folder ID
1247    #[serde(
1248        rename = "parentFolderId",
1249        default,
1250        skip_serializing_if = "Option::is_none"
1251    )]
1252    pub parent_folder_id: Option<String>,
1253    /// ID of the user performing this action
1254    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
1255    pub user_id: Option<String>,
1256}
1257
1258/// `ImportTemplatePublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1259#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1260pub struct ImportTemplatePublicV2ResponseDto {
1261    /// Template ID
1262    /// Required by the API.
1263    pub id: String,
1264    /// Template name
1265    /// Required by the API.
1266    pub name: String,
1267    /// Editor type
1268    /// Allowed values: `html`, `text`.
1269    /// Required by the API.
1270    #[serde(rename = "editorType")]
1271    pub editor_type: String,
1272    /// Whether template is plain text
1273    /// Required by the API.
1274    #[serde(rename = "isPlainText")]
1275    pub is_plain_text: bool,
1276    /// Parent folder ID
1277    #[serde(
1278        rename = "parentFolderId",
1279        default,
1280        skip_serializing_if = "Option::is_none"
1281    )]
1282    pub parent_folder_id: Option<String>,
1283    /// Sender name
1284    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
1285    pub from_name: Option<String>,
1286    /// Sender email address
1287    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
1288    pub from_email: Option<String>,
1289    /// Email subject line
1290    #[serde(
1291        rename = "subjectLine",
1292        default,
1293        skip_serializing_if = "Option::is_none"
1294    )]
1295    pub subject_line: Option<String>,
1296    /// Preview text
1297    #[serde(
1298        rename = "previewText",
1299        default,
1300        skip_serializing_if = "Option::is_none"
1301    )]
1302    pub preview_text: Option<String>,
1303    /// Preview URL
1304    #[serde(
1305        rename = "previewUrl",
1306        default,
1307        skip_serializing_if = "Option::is_none"
1308    )]
1309    pub preview_url: Option<String>,
1310    /// Created timestamp
1311    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
1312    pub created_at: Option<String>,
1313    /// Updated timestamp
1314    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
1315    pub updated_at: Option<String>,
1316    /// Trace ID of request
1317    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1318    pub trace_id: Option<String>,
1319}
1320
1321/// `InvalidLocationDTO` from the GoHighLevel OpenAPI spec.
1322#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1323pub struct InvalidLocationDTO {
1324    /// HTTP status code for invalid location access
1325    #[serde(
1326        rename = "statusCode",
1327        default,
1328        skip_serializing_if = "Option::is_none"
1329    )]
1330    pub status_code: Option<f64>,
1331    /// Error message describing the location access failure
1332    #[serde(default, skip_serializing_if = "Option::is_none")]
1333    pub message: Option<String>,
1334}
1335
1336/// `ListBulkActionCampaignsPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1337#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1338pub struct ListBulkActionCampaignsPublicV2ResponseDto {
1339    /// List of bulk action campaigns
1340    /// Required by the API.
1341    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1342    pub campaigns: Vec<BulkActionCampaignPublicV2Dto>,
1343    /// Total count of bulk action campaigns
1344    /// Required by the API.
1345    pub total: f64,
1346    /// Trace ID of the request
1347    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1348    pub trace_id: Option<String>,
1349}
1350
1351/// `ListEmailCampaignsPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1352#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1353pub struct ListEmailCampaignsPublicV2ResponseDto {
1354    /// List of email campaigns
1355    /// Required by the API.
1356    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1357    pub campaigns: Vec<EmailCampaignPublicV2Dto>,
1358    /// Total count of email campaigns
1359    /// Required by the API.
1360    pub total: f64,
1361    /// Trace ID of the request
1362    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1363    pub trace_id: Option<String>,
1364}
1365
1366/// `ListTemplatesPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1367#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1368pub struct ListTemplatesPublicV2ResponseDto {
1369    /// List of template and folder resources
1370    /// Required by the API.
1371    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1372    pub items: Vec<TemplateListItemPublicV2Dto>,
1373    /// Total count of templates and folders
1374    /// Required by the API.
1375    pub total: f64,
1376    /// Trace ID of the request
1377    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1378    pub trace_id: Option<String>,
1379}
1380
1381/// `ListWorkflowCampaignsPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1382#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1383pub struct ListWorkflowCampaignsPublicV2ResponseDto {
1384    /// List of workflow campaigns
1385    /// Required by the API.
1386    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1387    pub campaigns: Vec<WorkflowCampaignPublicV2Dto>,
1388    /// Total count of campaigns
1389    /// Required by the API.
1390    pub total: f64,
1391    /// Trace ID of the request
1392    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1393    pub trace_id: Option<String>,
1394}
1395
1396/// `NotFoundDTO` from the GoHighLevel OpenAPI spec.
1397#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1398pub struct NotFoundDTO {
1399    /// HTTP status code for not found
1400    #[serde(
1401        rename = "statusCode",
1402        default,
1403        skip_serializing_if = "Option::is_none"
1404    )]
1405    pub status_code: Option<f64>,
1406    /// Error message describing the not found failure
1407    #[serde(default, skip_serializing_if = "Option::is_none")]
1408    pub message: Option<String>,
1409    /// Error type identifier
1410    #[serde(default, skip_serializing_if = "Option::is_none")]
1411    pub error: Option<String>,
1412}
1413
1414/// `SaveBuilderDataDto` from the GoHighLevel OpenAPI spec.
1415#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1416pub struct SaveBuilderDataDto {
1417    /// Required by the API.
1418    #[serde(rename = "locationId")]
1419    pub location_id: String,
1420    /// Required by the API.
1421    #[serde(rename = "templateId")]
1422    pub template_id: String,
1423    /// Required by the API.
1424    #[serde(rename = "updatedBy")]
1425    pub updated_by: String,
1426    /// Required by the API.
1427    pub dnd: IBuilderJsonMapper,
1428    /// Required by the API.
1429    pub html: String,
1430    /// Allowed values: `html`, `builder`.
1431    /// Required by the API.
1432    #[serde(rename = "editorType")]
1433    pub editor_type: String,
1434    #[serde(
1435        rename = "previewText",
1436        default,
1437        skip_serializing_if = "Option::is_none"
1438    )]
1439    pub preview_text: Option<String>,
1440    #[serde(
1441        rename = "isPlainText",
1442        default,
1443        skip_serializing_if = "Option::is_none"
1444    )]
1445    pub is_plain_text: Option<bool>,
1446    /// Whether Email AI was used
1447    #[serde(
1448        rename = "usedEmailAI",
1449        default,
1450        skip_serializing_if = "Option::is_none"
1451    )]
1452    pub used_email_ai: Option<bool>,
1453}
1454
1455/// `ScheduleCampaignABTestConfigPublicV2Dto` from the GoHighLevel OpenAPI spec.
1456#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1457pub struct ScheduleCampaignABTestConfigPublicV2Dto {
1458    /// What is being tested
1459    /// Allowed values: `emailContent`, `subjectLine`.
1460    /// Required by the API.
1461    #[serde(rename = "testType")]
1462    pub test_type: String,
1463    /// Seconds to run the test before picking a winner
1464    /// Required by the API.
1465    #[serde(rename = "testDuration")]
1466    pub test_duration: f64,
1467    /// Number of variations
1468    /// Required by the API.
1469    #[serde(rename = "variationCount")]
1470    pub variation_count: f64,
1471    /// Percentage of contacts in the test group (0-100)
1472    /// Required by the API.
1473    #[serde(rename = "testSize")]
1474    pub test_size: f64,
1475    /// How to pick the winner
1476    /// Allowed values: `openRate`, `clickRate`.
1477    /// Required by the API.
1478    #[serde(rename = "winningCriteria")]
1479    pub winning_criteria: String,
1480    /// A/B test variations
1481    /// Required by the API.
1482    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1483    pub variations: Vec<ScheduleCampaignABTestVariationPublicV2Dto>,
1484}
1485
1486/// `ScheduleCampaignABTestVariationPublicV2Dto` from the GoHighLevel OpenAPI spec.
1487#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1488pub struct ScheduleCampaignABTestVariationPublicV2Dto {
1489    /// Subject line for this variation
1490    #[serde(default, skip_serializing_if = "Option::is_none")]
1491    pub subject: Option<String>,
1492    /// Template/document ID for this variation
1493    #[serde(
1494        rename = "documentId",
1495        default,
1496        skip_serializing_if = "Option::is_none"
1497    )]
1498    pub document_id: Option<String>,
1499}
1500
1501/// `ScheduleCampaignBatchConfigPublicV2Dto` from the GoHighLevel OpenAPI spec.
1502#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1503pub struct ScheduleCampaignBatchConfigPublicV2Dto {
1504    /// Number of contacts to process per batch
1505    /// Required by the API.
1506    #[serde(rename = "batchSize")]
1507    pub batch_size: f64,
1508    /// Delay between batches
1509    /// Required by the API.
1510    pub interval: f64,
1511    /// Unit for the interval
1512    /// Allowed values: `minutes`, `hours`, `days`.
1513    /// Required by the API.
1514    #[serde(rename = "intervalUnit")]
1515    pub interval_unit: String,
1516    /// Days to skip sending
1517    /// Allowed values: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`.
1518    #[serde(rename = "skipDays", default, skip_serializing_if = "Vec::is_empty")]
1519    pub skip_days: Vec<String>,
1520    /// Earliest time to send batches
1521    #[serde(
1522        rename = "windowStart",
1523        default,
1524        skip_serializing_if = "Option::is_none"
1525    )]
1526    pub window_start: Option<String>,
1527    /// Latest time to send batches
1528    #[serde(rename = "windowEnd", default, skip_serializing_if = "Option::is_none")]
1529    pub window_end: Option<String>,
1530}
1531
1532/// `ScheduleCampaignEmailMetaPublicV2Dto` from the GoHighLevel OpenAPI spec.
1533#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1534pub struct ScheduleCampaignEmailMetaPublicV2Dto {
1535    /// Email subject line
1536    /// Required by the API.
1537    pub subject: String,
1538    /// Sender display name
1539    /// Required by the API.
1540    #[serde(rename = "fromName")]
1541    pub from_name: String,
1542    /// Sender email address
1543    /// Required by the API.
1544    #[serde(rename = "fromEmail")]
1545    pub from_email: String,
1546    /// Reply-to email address
1547    #[serde(
1548        rename = "replyToAddress",
1549        default,
1550        skip_serializing_if = "Option::is_none"
1551    )]
1552    pub reply_to_address: Option<String>,
1553    /// Preview text shown in inbox after subject
1554    #[serde(
1555        rename = "previewText",
1556        default,
1557        skip_serializing_if = "Option::is_none"
1558    )]
1559    pub preview_text: Option<String>,
1560    /// Attachment download URLs
1561    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1562    pub attachments: Vec<String>,
1563}
1564
1565/// `ScheduleCampaignPublicV2BodyDto` from the GoHighLevel OpenAPI spec.
1566#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1567pub struct ScheduleCampaignPublicV2BodyDto {
1568    /// How to schedule the campaign
1569    /// Allowed values: `immediate`, `scheduled`, `batch`, `rss`, `smart_send`.
1570    /// Required by the API.
1571    #[serde(rename = "scheduleType")]
1572    pub schedule_type: String,
1573    /// IANA timezone
1574    /// Required by the API.
1575    #[serde(rename = "timeZone")]
1576    pub time_zone: String,
1577    /// ID of the user performing this action
1578    /// Required by the API.
1579    #[serde(rename = "userId")]
1580    pub user_id: String,
1581    /// Name of the user performing this action
1582    #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")]
1583    pub user_name: Option<String>,
1584    /// Email subject, sender, and content metadata
1585    /// Required by the API.
1586    #[serde(rename = "emailMeta")]
1587    pub email_meta: ScheduleCampaignEmailMetaPublicV2Dto,
1588    /// Who receives the email. Must provide either contactIds or filter.
1589    /// Required by the API.
1590    pub recipients: ScheduleCampaignRecipientsPublicV2Dto,
1591    /// Days of the week to allow sending. Used for batch and RSS scheduleTypes.
1592    /// Allowed values: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`.
1593    #[serde(rename = "sendDays", default, skip_serializing_if = "Vec::is_empty")]
1594    pub send_days: Vec<String>,
1595    /// Schedule configuration for immediate, scheduled, batch, and smart_send types. Required
1596    /// when scheduleType is not rss.
1597    #[serde(
1598        rename = "scheduleConfig",
1599        default,
1600        skip_serializing_if = "Option::is_none"
1601    )]
1602    pub schedule_config: Option<ScheduleCampaignScheduleConfigPublicV2Dto>,
1603    /// RSS feed configuration. Required when scheduleType is rss.
1604    #[serde(rename = "rssConfig", default, skip_serializing_if = "Option::is_none")]
1605    pub rss_config: Option<ScheduleCampaignRssConfigPublicV2Dto>,
1606    /// A/B test configuration. Can be combined with any scheduleType except rss.
1607    #[serde(
1608        rename = "abTestConfig",
1609        default,
1610        skip_serializing_if = "Option::is_none"
1611    )]
1612    pub ab_test_config: Option<ScheduleCampaignABTestConfigPublicV2Dto>,
1613}
1614
1615/// `ScheduleCampaignPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1616#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1617pub struct ScheduleCampaignPublicV2ResponseDto {
1618    /// Campaign ID
1619    /// Required by the API.
1620    #[serde(rename = "campaignId")]
1621    pub campaign_id: String,
1622    /// Source ID for fetching campaign statistics
1623    /// Required by the API.
1624    #[serde(rename = "sourceId")]
1625    pub source_id: String,
1626    /// Trace ID of the request
1627    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
1628    pub trace_id: Option<String>,
1629}
1630
1631/// `ScheduleCampaignRecipientsPublicV2Dto` from the GoHighLevel OpenAPI spec.
1632#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1633pub struct ScheduleCampaignRecipientsPublicV2Dto {
1634    /// Recipient selection type
1635    /// Allowed values: `contact`, `tag`, `segment`.
1636    /// Required by the API.
1637    #[serde(rename = "type")]
1638    pub type_: String,
1639    /// Contact IDs to send to. Required when type is contact.
1640    #[serde(rename = "contactIds", default, skip_serializing_if = "Vec::is_empty")]
1641    pub contact_ids: Vec<String>,
1642    /// Tag IDs to filter recipients by. Required when type is tag.
1643    #[serde(rename = "tagIds", default, skip_serializing_if = "Vec::is_empty")]
1644    pub tag_ids: Vec<String>,
1645    /// Segment type for pre-built segments. Required when type is segment.
1646    /// Allowed values: `engaged_last_7_days`, `engaged_last_30_days`, `engaged_last_60_days`,
1647    /// `engaged_last_5_campaigns`, `unengaged_last_5_campaigns`.
1648    #[serde(default, skip_serializing_if = "Option::is_none")]
1649    pub segment: Option<String>,
1650    /// Freeze the contact list at schedule time — new matching contacts will not be added later
1651    #[serde(
1652        rename = "freezeList",
1653        default,
1654        skip_serializing_if = "Option::is_none"
1655    )]
1656    pub freeze_list: Option<bool>,
1657}
1658
1659/// `ScheduleCampaignResendPublicV2Dto` from the GoHighLevel OpenAPI spec.
1660#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1661pub struct ScheduleCampaignResendPublicV2Dto {
1662    /// Enable resend to contacts who did not open
1663    #[serde(default, skip_serializing_if = "Option::is_none")]
1664    pub enabled: Option<bool>,
1665    /// Hours to wait before resending. Required when enabled is true.
1666    #[serde(rename = "waitHours", default, skip_serializing_if = "Option::is_none")]
1667    pub wait_hours: Option<f64>,
1668    /// Override subject line for the resend email
1669    #[serde(default, skip_serializing_if = "Option::is_none")]
1670    pub subject: Option<String>,
1671}
1672
1673/// `ScheduleCampaignRssConfigPublicV2Dto` from the GoHighLevel OpenAPI spec.
1674#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1675pub struct ScheduleCampaignRssConfigPublicV2Dto {
1676    /// RSS schedule name
1677    /// Required by the API.
1678    pub name: String,
1679    /// RSS feed URL
1680    /// Required by the API.
1681    #[serde(rename = "rssFeedURL")]
1682    pub rss_feed_url: String,
1683    /// How often to check the feed
1684    /// Allowed values: `every_day`, `every_week`, `every_month`.
1685    /// Required by the API.
1686    #[serde(rename = "repeatAfter")]
1687    pub repeat_after: String,
1688    /// Time of day to execute
1689    /// Required by the API.
1690    #[serde(rename = "repeatAfterTime")]
1691    pub repeat_after_time: String,
1692    /// Max number of RSS items per email
1693    #[serde(
1694        rename = "rssFeedLimit",
1695        default,
1696        skip_serializing_if = "Option::is_none"
1697    )]
1698    pub rss_feed_limit: Option<f64>,
1699    /// Day of week for weekly RSS
1700    /// Allowed values: `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday`,
1701    /// `Sunday`.
1702    #[serde(
1703        rename = "startAtDay",
1704        default,
1705        skip_serializing_if = "Option::is_none"
1706    )]
1707    pub start_at_day: Option<String>,
1708    /// Day of month for monthly RSS
1709    #[serde(
1710        rename = "startAtMonthDay",
1711        default,
1712        skip_serializing_if = "Option::is_none"
1713    )]
1714    pub start_at_month_day: Option<String>,
1715    /// Override first execution date/time
1716    #[serde(
1717        rename = "firstExecutionDate",
1718        default,
1719        skip_serializing_if = "Option::is_none"
1720    )]
1721    pub first_execution_date: Option<String>,
1722}
1723
1724/// `ScheduleCampaignScheduleConfigPublicV2Dto` from the GoHighLevel OpenAPI spec.
1725#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1726pub struct ScheduleCampaignScheduleConfigPublicV2Dto {
1727    /// Date/time to send. Required for scheduled, batch, and smart_send. Ignored for immediate.
1728    #[serde(rename = "sendAt", default, skip_serializing_if = "Option::is_none")]
1729    pub send_at: Option<String>,
1730    /// Batch/drip configuration. Required when scheduleType is batch. Ignored otherwise.
1731    #[serde(default, skip_serializing_if = "Option::is_none")]
1732    pub batch: Option<ScheduleCampaignBatchConfigPublicV2Dto>,
1733    /// Click and UTM tracking options
1734    #[serde(default, skip_serializing_if = "Option::is_none")]
1735    pub tracking: Option<ScheduleCampaignTrackingPublicV2Dto>,
1736    /// Auto-resend to contacts who did not open
1737    #[serde(default, skip_serializing_if = "Option::is_none")]
1738    pub resend: Option<ScheduleCampaignResendPublicV2Dto>,
1739    /// Email preference type ID for categorizing this campaign
1740    #[serde(
1741        rename = "emailPreferenceId",
1742        default,
1743        skip_serializing_if = "Option::is_none"
1744    )]
1745    pub email_preference_id: Option<String>,
1746}
1747
1748/// `ScheduleCampaignTrackingPublicV2Dto` from the GoHighLevel OpenAPI spec.
1749#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1750pub struct ScheduleCampaignTrackingPublicV2Dto {
1751    /// Enable click tracking on links
1752    #[serde(
1753        rename = "clickTracking",
1754        default,
1755        skip_serializing_if = "Option::is_none"
1756    )]
1757    pub click_tracking: Option<bool>,
1758    /// Enable UTM parameters on links
1759    #[serde(
1760        rename = "utmTracking",
1761        default,
1762        skip_serializing_if = "Option::is_none"
1763    )]
1764    pub utm_tracking: Option<bool>,
1765}
1766
1767/// `ScheduleDto` from the GoHighLevel OpenAPI spec.
1768#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1769pub struct ScheduleDto {
1770    /// Required by the API.
1771    pub name: String,
1772    /// Required by the API.
1773    #[serde(rename = "repeatAfter")]
1774    pub repeat_after: String,
1775    /// Required by the API.
1776    pub id: String,
1777    /// Required by the API.
1778    #[serde(rename = "parentId")]
1779    pub parent_id: String,
1780    /// Required by the API.
1781    #[serde(rename = "childCount")]
1782    pub child_count: f64,
1783    /// Required by the API.
1784    #[serde(rename = "campaignType")]
1785    pub campaign_type: String,
1786    /// Required by the API.
1787    #[serde(rename = "bulkActionVersion")]
1788    pub bulk_action_version: String,
1789    /// Required by the API.
1790    #[serde(rename = "_id")]
1791    pub id_alt: String,
1792    /// Required by the API.
1793    pub status: String,
1794    /// Required by the API.
1795    #[serde(rename = "sendDays", default, skip_serializing_if = "Vec::is_empty")]
1796    pub send_days: Vec<String>,
1797    /// Required by the API.
1798    pub deleted: bool,
1799    /// Required by the API.
1800    pub migrated: bool,
1801    /// Required by the API.
1802    pub archived: bool,
1803    /// Required by the API.
1804    #[serde(rename = "hasTracking")]
1805    pub has_tracking: bool,
1806    /// Required by the API.
1807    #[serde(rename = "isPlainText")]
1808    pub is_plain_text: bool,
1809    /// Required by the API.
1810    #[serde(rename = "hasUtmTracking")]
1811    pub has_utm_tracking: bool,
1812    /// Required by the API.
1813    #[serde(rename = "enableResendToUnopened")]
1814    pub enable_resend_to_unopened: bool,
1815    /// Required by the API.
1816    #[serde(rename = "locationId")]
1817    pub location_id: String,
1818    /// Required by the API.
1819    #[serde(rename = "templateId")]
1820    pub template_id: String,
1821    /// Required by the API.
1822    #[serde(rename = "templateType")]
1823    pub template_type: String,
1824    /// Required by the API.
1825    #[serde(rename = "createdAt")]
1826    pub created_at: String,
1827    /// Required by the API.
1828    #[serde(rename = "updatedAt")]
1829    pub updated_at: String,
1830    /// Required by the API.
1831    #[serde(rename = "__v")]
1832    pub v: f64,
1833    /// Required by the API.
1834    #[serde(rename = "documentId")]
1835    pub document_id: String,
1836    /// Required by the API.
1837    #[serde(rename = "downloadUrl")]
1838    pub download_url: String,
1839    /// Required by the API.
1840    #[serde(rename = "templateDataDownloadUrl")]
1841    pub template_data_download_url: String,
1842    /// Required by the API.
1843    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1844    pub child: Vec<String>,
1845}
1846
1847/// `ScheduleFetchSuccessfulDTO` from the GoHighLevel OpenAPI spec.
1848#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1849pub struct ScheduleFetchSuccessfulDTO {
1850    /// The list of campaigns
1851    /// Required by the API.
1852    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1853    pub schedules: Vec<ScheduleDto>,
1854    /// The total number of campaigns
1855    /// Required by the API.
1856    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1857    pub total: Vec<String>,
1858    /// Trace Id
1859    /// Required by the API.
1860    #[serde(rename = "traceId")]
1861    pub trace_id: String,
1862}
1863
1864/// `TemplateListItemPublicV2Dto` from the GoHighLevel OpenAPI spec.
1865#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1866pub struct TemplateListItemPublicV2Dto {
1867    /// Resource ID
1868    /// Required by the API.
1869    pub id: String,
1870    /// Resource name
1871    /// Required by the API.
1872    pub name: String,
1873    /// Resource type
1874    /// Allowed values: `template`, `folder`.
1875    /// Required by the API.
1876    #[serde(rename = "type")]
1877    pub type_: String,
1878    /// Whether template is plain text
1879    #[serde(
1880        rename = "isPlainText",
1881        default,
1882        skip_serializing_if = "Option::is_none"
1883    )]
1884    pub is_plain_text: Option<bool>,
1885    /// Last updated timestamp
1886    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
1887    pub updated_at: Option<String>,
1888    /// Created timestamp
1889    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
1890    pub created_at: Option<String>,
1891    /// Preview URL
1892    #[serde(
1893        rename = "previewUrl",
1894        default,
1895        skip_serializing_if = "Option::is_none"
1896    )]
1897    pub preview_url: Option<String>,
1898    /// Editor type for template resources
1899    /// Allowed values: `html`, `builder`, `text`.
1900    #[serde(
1901        rename = "editorType",
1902        default,
1903        skip_serializing_if = "Option::is_none"
1904    )]
1905    pub editor_type: Option<String>,
1906    /// Children count for folder resources
1907    #[serde(
1908        rename = "childCount",
1909        default,
1910        skip_serializing_if = "Option::is_none"
1911    )]
1912    pub child_count: Option<f64>,
1913    /// Whether folder has child resources
1914    #[serde(
1915        rename = "hasChildren",
1916        default,
1917        skip_serializing_if = "Option::is_none"
1918    )]
1919    pub has_children: Option<bool>,
1920    /// Parent folder ID
1921    #[serde(
1922        rename = "parentFolderId",
1923        default,
1924        skip_serializing_if = "Option::is_none"
1925    )]
1926    pub parent_folder_id: Option<String>,
1927}
1928
1929/// `TemplateSettings` from the GoHighLevel OpenAPI spec.
1930#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1931pub struct TemplateSettings {
1932    /// The spec defines no fields for this schema.
1933    #[serde(flatten)]
1934    pub extra: serde_json::Map<String, serde_json::Value>,
1935}
1936
1937/// `UpdateEmailCampaignPublicV2BodyDto` from the GoHighLevel OpenAPI spec.
1938#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1939pub struct UpdateEmailCampaignPublicV2BodyDto {
1940    /// Campaign name
1941    #[serde(default, skip_serializing_if = "Option::is_none")]
1942    pub name: Option<String>,
1943    /// Editor content to update. Required only when updating campaign content, and must be
1944    /// provided together with editorType. Provide HTML or plain-text string content.
1945    #[serde(
1946        rename = "editorContent",
1947        default,
1948        skip_serializing_if = "Option::is_none"
1949    )]
1950    pub editor_content: Option<String>,
1951    /// Editor type for campaign content. Required only when updating campaign content, and must
1952    /// be provided together with editorContent.
1953    /// Allowed values: `html`, `text`.
1954    #[serde(
1955        rename = "editorType",
1956        default,
1957        skip_serializing_if = "Option::is_none"
1958    )]
1959    pub editor_type: Option<String>,
1960    /// ID of the user performing this action
1961    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
1962    pub user_id: Option<String>,
1963}
1964
1965/// `UpdateEmailCampaignPublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
1966#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1967pub struct UpdateEmailCampaignPublicV2ResponseDto {
1968    /// Campaign ID
1969    /// Required by the API.
1970    pub id: String,
1971    /// Source of the campaign
1972    #[serde(default, skip_serializing_if = "Option::is_none")]
1973    pub source: Option<String>,
1974    /// Source ID of the campaign
1975    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
1976    pub source_id: Option<String>,
1977    /// Campaign name
1978    #[serde(default, skip_serializing_if = "Option::is_none")]
1979    pub name: Option<String>,
1980    /// Campaign status
1981    /// Allowed values: `all`, `sent`, `failed`, `archived`, `draft`, `processing`, `scheduled`,
1982    /// `cancelled`, `paused`.
1983    #[serde(default, skip_serializing_if = "Option::is_none")]
1984    pub status: Option<String>,
1985    /// Campaign type
1986    #[serde(
1987        rename = "campaignType",
1988        default,
1989        skip_serializing_if = "Option::is_none"
1990    )]
1991    pub campaign_type: Option<String>,
1992    /// Campaign category
1993    #[serde(
1994        rename = "campaignCategory",
1995        default,
1996        skip_serializing_if = "Option::is_none"
1997    )]
1998    pub campaign_category: Option<String>,
1999    /// AB test variation identifiers (available only for AB test campaigns)
2000    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2001    pub variations: Vec<EmailCampaignVariationPublicV2Dto>,
2002    /// Whether the campaign is deleted
2003    /// Required by the API.
2004    pub deleted: bool,
2005    /// Created at timestamp
2006    /// Required by the API.
2007    #[serde(rename = "createdAt")]
2008    pub created_at: String,
2009    /// Last updated timestamp
2010    /// Required by the API.
2011    #[serde(rename = "updatedAt")]
2012    pub updated_at: String,
2013    /// Trace ID of request
2014    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
2015    pub trace_id: Option<String>,
2016}
2017
2018/// `UpdateEmailTemplateDto` from the GoHighLevel OpenAPI spec.
2019#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2020pub struct UpdateEmailTemplateDto {
2021    /// Location ID where the template belongs
2022    /// Required by the API.
2023    #[serde(rename = "locationId")]
2024    pub location_id: String,
2025    /// User ID who is updating the template
2026    #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
2027    pub updated_by: Option<String>,
2028    /// Editor content - can be HTML string, plain text string, or DND builder object depending
2029    /// on editorType. When editorType is "html" or "text", this should be a string. When
2030    /// editorType is "builder", this should be a DND object with elements, attrs, and
2031    /// templateSettings. Must be provided together with editorType.
2032    /// Multiple possible shapes in the spec; raw JSON.
2033    #[serde(
2034        rename = "editorContent",
2035        default,
2036        skip_serializing_if = "Option::is_none"
2037    )]
2038    pub editor_content: Option<serde_json::Value>,
2039    /// Type of editor content: "html" for HTML content, "text" for plain text content,
2040    /// "builder" for drag-and-drop builder content. Must be provided together with
2041    /// editorContent.
2042    /// Allowed values: `html`, `builder`, `text`.
2043    #[serde(
2044        rename = "editorType",
2045        default,
2046        skip_serializing_if = "Option::is_none"
2047    )]
2048    pub editor_type: Option<String>,
2049    /// Preview text shown in email clients before opening
2050    #[serde(
2051        rename = "previewText",
2052        default,
2053        skip_serializing_if = "Option::is_none"
2054    )]
2055    pub preview_text: Option<String>,
2056    /// Email subject line
2057    #[serde(
2058        rename = "subjectLine",
2059        default,
2060        skip_serializing_if = "Option::is_none"
2061    )]
2062    pub subject_line: Option<String>,
2063    /// Sender name displayed in email
2064    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
2065    pub from_name: Option<String>,
2066    /// Sender email address
2067    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
2068    pub from_email: Option<String>,
2069    /// Template name
2070    #[serde(default, skip_serializing_if = "Option::is_none")]
2071    pub name: Option<String>,
2072    /// Whether the template is archived
2073    #[serde(default, skip_serializing_if = "Option::is_none")]
2074    pub archived: Option<bool>,
2075    /// Field-level default values for custom variables in template fields (fromName,
2076    /// subjectLine, previewText)
2077    #[serde(
2078        rename = "fieldDefaults",
2079        default,
2080        skip_serializing_if = "Option::is_none"
2081    )]
2082    pub field_defaults: Option<serde_json::Value>,
2083}
2084
2085/// `UpdateEmailTemplateResponseDto` from the GoHighLevel OpenAPI spec.
2086#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2087pub struct UpdateEmailTemplateResponseDto {
2088    /// Indicates if the update was successful
2089    /// Required by the API.
2090    pub ok: bool,
2091    /// Unique template identifier
2092    /// Required by the API.
2093    pub id: String,
2094    /// Template name
2095    /// Required by the API.
2096    pub name: String,
2097    /// Whether the template is archived
2098    /// Required by the API.
2099    pub archived: bool,
2100    /// Builder version used for the template
2101    /// Required by the API.
2102    #[serde(rename = "builderVersion")]
2103    pub builder_version: String,
2104    /// Sender name displayed in email
2105    /// Required by the API.
2106    #[serde(rename = "fromName")]
2107    pub from_name: String,
2108    /// Sender email address
2109    /// Required by the API.
2110    #[serde(rename = "fromEmail")]
2111    pub from_email: String,
2112    /// Email subject line
2113    /// Required by the API.
2114    #[serde(rename = "subjectLine")]
2115    pub subject_line: String,
2116    /// Preview text shown in email clients
2117    /// Required by the API.
2118    #[serde(rename = "previewText")]
2119    pub preview_text: String,
2120    /// URL to preview the rendered template
2121    /// Required by the API.
2122    #[serde(rename = "previewUrl")]
2123    pub preview_url: String,
2124    /// Type of template editor used
2125    /// Allowed values: `html`, `builder`.
2126    /// Required by the API.
2127    #[serde(rename = "type")]
2128    pub type_: String,
2129    /// Timestamp of last update
2130    /// Required by the API.
2131    #[serde(rename = "lastUpdated")]
2132    pub last_updated: String,
2133    /// Timestamp when template was created
2134    /// Required by the API.
2135    #[serde(rename = "createdAt")]
2136    pub created_at: String,
2137    /// Whether the template contains plain text content (true) or HTML content (false)
2138    /// Required by the API.
2139    #[serde(rename = "isPlainText")]
2140    pub is_plain_text: bool,
2141    /// Field-level default values for custom variables in template fields
2142    #[serde(
2143        rename = "fieldDefaults",
2144        default,
2145        skip_serializing_if = "Option::is_none"
2146    )]
2147    pub field_defaults: Option<serde_json::Value>,
2148}
2149
2150/// `UpdateTemplatePublicV2BodyDto` from the GoHighLevel OpenAPI spec.
2151#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2152pub struct UpdateTemplatePublicV2BodyDto {
2153    /// Template name
2154    #[serde(default, skip_serializing_if = "Option::is_none")]
2155    pub name: Option<String>,
2156    /// Editor content to update. Required only when updating template content, and must be
2157    /// provided together with editorType. Provide HTML or plain-text string content.
2158    #[serde(
2159        rename = "editorContent",
2160        default,
2161        skip_serializing_if = "Option::is_none"
2162    )]
2163    pub editor_content: Option<String>,
2164    /// Type of editor content. Required only when updating template content, and must be
2165    /// provided together with editorContent.
2166    /// Allowed values: `html`, `text`.
2167    #[serde(
2168        rename = "editorType",
2169        default,
2170        skip_serializing_if = "Option::is_none"
2171    )]
2172    pub editor_type: Option<String>,
2173    /// Preview text
2174    #[serde(
2175        rename = "previewText",
2176        default,
2177        skip_serializing_if = "Option::is_none"
2178    )]
2179    pub preview_text: Option<String>,
2180    /// Email subject line
2181    #[serde(
2182        rename = "subjectLine",
2183        default,
2184        skip_serializing_if = "Option::is_none"
2185    )]
2186    pub subject_line: Option<String>,
2187    /// Sender name
2188    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
2189    pub from_name: Option<String>,
2190    /// Sender email address
2191    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
2192    pub from_email: Option<String>,
2193    /// Whether template is archived
2194    #[serde(default, skip_serializing_if = "Option::is_none")]
2195    pub archived: Option<bool>,
2196    /// Parent folder ID. Pass `null` to move template to the root level.
2197    #[serde(
2198        rename = "parentFolderId",
2199        default,
2200        skip_serializing_if = "Option::is_none"
2201    )]
2202    pub parent_folder_id: Option<String>,
2203    /// ID of the user performing this action
2204    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
2205    pub user_id: Option<String>,
2206}
2207
2208/// `UpdateTemplatePublicV2ResponseDto` from the GoHighLevel OpenAPI spec.
2209#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2210pub struct UpdateTemplatePublicV2ResponseDto {
2211    /// Template ID
2212    /// Required by the API.
2213    pub id: String,
2214    /// Template name
2215    /// Required by the API.
2216    pub name: String,
2217    /// Whether template is archived
2218    /// Required by the API.
2219    pub archived: bool,
2220    /// Sender name
2221    /// Required by the API.
2222    #[serde(rename = "fromName")]
2223    pub from_name: String,
2224    /// Sender email address
2225    /// Required by the API.
2226    #[serde(rename = "fromEmail")]
2227    pub from_email: String,
2228    /// Email subject line
2229    /// Required by the API.
2230    #[serde(rename = "subjectLine")]
2231    pub subject_line: String,
2232    /// Preview text
2233    /// Required by the API.
2234    #[serde(rename = "previewText")]
2235    pub preview_text: String,
2236    /// Preview URL
2237    /// Required by the API.
2238    #[serde(rename = "previewUrl")]
2239    pub preview_url: String,
2240    /// Template type
2241    /// Allowed values: `html`, `text`.
2242    #[serde(
2243        rename = "editorType",
2244        default,
2245        skip_serializing_if = "Option::is_none"
2246    )]
2247    pub editor_type: Option<String>,
2248    /// Whether template is plain text
2249    #[serde(
2250        rename = "isPlainText",
2251        default,
2252        skip_serializing_if = "Option::is_none"
2253    )]
2254    pub is_plain_text: Option<bool>,
2255    /// Parent folder ID
2256    #[serde(
2257        rename = "parentFolderId",
2258        default,
2259        skip_serializing_if = "Option::is_none"
2260    )]
2261    pub parent_folder_id: Option<String>,
2262    /// Last updated timestamp
2263    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
2264    pub updated_at: Option<String>,
2265    /// Created timestamp
2266    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
2267    pub created_at: Option<String>,
2268    /// Trace ID of request
2269    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
2270    pub trace_id: Option<String>,
2271}
2272
2273/// `WorkflowCampaignPublicDto` from the GoHighLevel OpenAPI spec.
2274#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2275pub struct WorkflowCampaignPublicDto {
2276    /// Campaign ID
2277    /// Required by the API.
2278    pub id: String,
2279    /// Campaign name
2280    /// Required by the API.
2281    pub name: String,
2282    /// Campaign status
2283    /// Allowed values: `published`, `draft`.
2284    /// Required by the API.
2285    pub status: String,
2286    /// Source ID
2287    /// Required by the API.
2288    #[serde(rename = "sourceId")]
2289    pub source_id: String,
2290    /// Whether the campaign is deleted
2291    /// Required by the API.
2292    pub deleted: bool,
2293    /// Created at timestamp
2294    /// Required by the API.
2295    #[serde(rename = "createdAt")]
2296    pub created_at: String,
2297    /// Updated at timestamp
2298    /// Required by the API.
2299    #[serde(rename = "updatedAt")]
2300    pub updated_at: String,
2301}
2302
2303/// `WorkflowCampaignPublicV2Dto` from the GoHighLevel OpenAPI spec.
2304#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2305pub struct WorkflowCampaignPublicV2Dto {
2306    /// Campaign ID
2307    /// Required by the API.
2308    pub id: String,
2309    /// Campaign name
2310    #[serde(default, skip_serializing_if = "Option::is_none")]
2311    pub name: Option<String>,
2312    /// Campaign status
2313    /// Allowed values: `published`, `draft`.
2314    #[serde(default, skip_serializing_if = "Option::is_none")]
2315    pub status: Option<String>,
2316    /// Source of the campaign
2317    #[serde(default, skip_serializing_if = "Option::is_none")]
2318    pub source: Option<String>,
2319    /// Source ID of the campaign
2320    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
2321    pub source_id: Option<String>,
2322    /// Whether the campaign is deleted
2323    #[serde(default, skip_serializing_if = "Option::is_none")]
2324    pub deleted: Option<bool>,
2325    /// Created at timestamp
2326    /// Required by the API.
2327    #[serde(rename = "createdAt")]
2328    pub created_at: String,
2329    /// Updated at timestamp
2330    /// Required by the API.
2331    #[serde(rename = "updatedAt")]
2332    pub updated_at: String,
2333}
2334
2335/// `WorkflowCampaignSubSourcePublicV2Dto` from the GoHighLevel OpenAPI spec.
2336#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2337pub struct WorkflowCampaignSubSourcePublicV2Dto {
2338    /// Sub-source identifier (workflow step). Pass this value as the `subSourceId` query
2339    /// parameter on the campaign stats endpoint to retrieve stats scoped to this step.
2340    /// Required by the API.
2341    pub id: String,
2342    /// Workflow step name
2343    #[serde(default, skip_serializing_if = "Option::is_none")]
2344    pub name: Option<String>,
2345    /// Email subject line
2346    #[serde(default, skip_serializing_if = "Option::is_none")]
2347    pub subject: Option<String>,
2348    /// Sender name
2349    #[serde(rename = "fromName", default, skip_serializing_if = "Option::is_none")]
2350    pub from_name: Option<String>,
2351    /// Sender email address
2352    #[serde(rename = "fromEmail", default, skip_serializing_if = "Option::is_none")]
2353    pub from_email: Option<String>,
2354    /// Preview text
2355    #[serde(
2356        rename = "previewText",
2357        default,
2358        skip_serializing_if = "Option::is_none"
2359    )]
2360    pub preview_text: Option<String>,
2361    /// Editor type for this step
2362    /// Allowed values: `html`, `builder`, `text`.
2363    #[serde(
2364        rename = "editorType",
2365        default,
2366        skip_serializing_if = "Option::is_none"
2367    )]
2368    pub editor_type: Option<String>,
2369    /// Whether this step uses plain text
2370    #[serde(
2371        rename = "isPlainText",
2372        default,
2373        skip_serializing_if = "Option::is_none"
2374    )]
2375    pub is_plain_text: Option<bool>,
2376    /// URL to fetch the rendered step content as HTML. Issue a GET against this URL to retrieve
2377    /// the body.
2378    #[serde(
2379        rename = "editorContentUrl",
2380        default,
2381        skip_serializing_if = "Option::is_none"
2382    )]
2383    pub editor_content_url: Option<String>,
2384    /// Timestamp when this step was added to the workflow
2385    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
2386    pub created_at: Option<String>,
2387    /// Timestamp when this step was last updated
2388    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
2389    pub updated_at: Option<String>,
2390}