Skip to main content

ghl_models/v2/
conversations.rs

1//! `conversations` data models for GoHighLevel API V2 (44 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Conversations** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`conversations` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/conversations.md).
7//!
8//! Enable with `features = ["conversations"]`.
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/// `AddMessageAttachmentsDto` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct AddMessageAttachmentsDto {
24    /// Array of attachment URLs to set on the message (replaces existing). Maximum 5 URLs.
25    /// Required by the API.
26    #[serde(default, skip_serializing_if = "Vec::is_empty")]
27    pub attachments: Vec<String>,
28}
29
30/// `CallDataDTO` from the GoHighLevel OpenAPI spec.
31#[derive(Debug, Clone, Default, Serialize, Deserialize)]
32pub struct CallDataDTO {
33    /// Phone number of the receiver
34    #[serde(default, skip_serializing_if = "Option::is_none")]
35    pub to: Option<String>,
36    /// Phone number of the dialer
37    #[serde(rename = "from", default, skip_serializing_if = "Option::is_none")]
38    pub from_: Option<String>,
39    /// Call status
40    /// Allowed values: `pending`, `completed`, `answered`, `busy`, `no-answer`, `failed`,
41    /// `canceled`, `voicemail`.
42    #[serde(default, skip_serializing_if = "Option::is_none")]
43    pub status: Option<String>,
44}
45
46/// `CancelScheduledResponseDto` from the GoHighLevel OpenAPI spec.
47#[derive(Debug, Clone, Default, Serialize, Deserialize)]
48pub struct CancelScheduledResponseDto {
49    /// HTTP Status code of the request
50    /// Required by the API.
51    /// (Optional here so responses that omit it still parse.)
52    #[serde(default, skip_serializing_if = "Option::is_none")]
53    pub status: Option<f64>,
54    /// Error message of the request
55    /// Required by the API.
56    /// (Optional here so responses that omit it still parse.)
57    #[serde(default, skip_serializing_if = "Option::is_none")]
58    pub message: Option<String>,
59}
60
61/// `CompleteFileUploadDto` from the GoHighLevel OpenAPI spec.
62#[derive(Debug, Clone, Default, Serialize, Deserialize)]
63pub struct CompleteFileUploadDto {
64    /// Upload ID from request response
65    /// Required by the API.
66    #[serde(rename = "uploadId")]
67    pub upload_id: String,
68    /// File path from request response
69    /// Required by the API.
70    #[serde(rename = "filePath")]
71    pub file_path: String,
72    /// Location ID
73    /// Required by the API.
74    #[serde(rename = "locationId")]
75    pub location_id: String,
76    /// Conversation ID
77    /// Required by the API.
78    #[serde(rename = "conversationId")]
79    pub conversation_id: String,
80    /// Original filename (for response mapping)
81    /// Required by the API.
82    pub filename: String,
83}
84
85/// `CompleteFileUploadResponseDto` from the GoHighLevel OpenAPI spec.
86#[derive(Debug, Clone, Default, Serialize, Deserialize)]
87pub struct CompleteFileUploadResponseDto {
88    /// Map of filename to public URL
89    /// Required by the API.
90    /// (Optional here so responses that omit it still parse.)
91    #[serde(
92        rename = "uploadedFiles",
93        default,
94        skip_serializing_if = "Option::is_none"
95    )]
96    pub uploaded_files: Option<serde_json::Value>,
97    /// File metadata
98    /// Required by the API.
99    /// (Optional here so responses that omit it still parse.)
100    #[serde(default, skip_serializing_if = "Option::is_none")]
101    pub metadata: Option<serde_json::Value>,
102}
103
104/// `ConversationCreateResponseDto` from the GoHighLevel OpenAPI spec.
105#[derive(Debug, Clone, Default, Serialize, Deserialize)]
106pub struct ConversationCreateResponseDto {
107    /// Unique identifier for the conversation
108    /// Required by the API.
109    /// (Optional here so responses that omit it still parse.)
110    #[serde(default, skip_serializing_if = "Option::is_none")]
111    pub id: Option<String>,
112    /// Date when the conversation was last updated
113    /// Required by the API.
114    /// (Optional here so responses that omit it still parse.)
115    #[serde(
116        rename = "dateUpdated",
117        default,
118        skip_serializing_if = "Option::is_none"
119    )]
120    pub date_updated: Option<String>,
121    /// Date when the conversation was created
122    /// Required by the API.
123    /// (Optional here so responses that omit it still parse.)
124    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
125    pub date_added: Option<String>,
126    /// Flag indicating if this conversation has been deleted
127    /// Required by the API.
128    /// (Optional here so responses that omit it still parse.)
129    #[serde(default, skip_serializing_if = "Option::is_none")]
130    pub deleted: Option<bool>,
131    /// Unique identifier of the contact associated with this conversation
132    /// Required by the API.
133    /// (Optional here so responses that omit it still parse.)
134    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
135    pub contact_id: Option<String>,
136    /// Unique identifier of the business location where this conversation takes place
137    /// Required by the API.
138    /// (Optional here so responses that omit it still parse.)
139    #[serde(
140        rename = "locationId",
141        default,
142        skip_serializing_if = "Option::is_none"
143    )]
144    pub location_id: Option<String>,
145    /// Date of the last message in the conversation
146    /// Required by the API.
147    /// (Optional here so responses that omit it still parse.)
148    #[serde(
149        rename = "lastMessageDate",
150        default,
151        skip_serializing_if = "Option::is_none"
152    )]
153    pub last_message_date: Option<String>,
154    /// Unique identifier of the team member assigned to this conversation
155    #[serde(
156        rename = "assignedTo",
157        default,
158        skip_serializing_if = "Option::is_none"
159    )]
160    pub assigned_to: Option<String>,
161}
162
163/// `ConversationDto` from the GoHighLevel OpenAPI spec.
164#[derive(Debug, Clone, Default, Serialize, Deserialize)]
165pub struct ConversationDto {
166    /// Contact ID as string
167    #[serde(default, skip_serializing_if = "Option::is_none")]
168    pub id: Option<String>,
169    /// Location ID as string
170    /// Required by the API.
171    /// (Optional here so responses that omit it still parse.)
172    #[serde(
173        rename = "locationId",
174        default,
175        skip_serializing_if = "Option::is_none"
176    )]
177    pub location_id: Option<String>,
178    /// Contact ID as string
179    /// Required by the API.
180    /// (Optional here so responses that omit it still parse.)
181    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
182    pub contact_id: Option<String>,
183    /// Assigned User ID as string
184    #[serde(
185        rename = "assignedTo",
186        default,
187        skip_serializing_if = "Option::is_none"
188    )]
189    pub assigned_to: Option<String>,
190    /// User ID as string
191    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
192    pub user_id: Option<String>,
193    /// Last message body as string
194    #[serde(
195        rename = "lastMessageBody",
196        default,
197        skip_serializing_if = "Option::is_none"
198    )]
199    pub last_message_body: Option<String>,
200    /// Last message date as UTC
201    #[serde(
202        rename = "lastMessageDate",
203        default,
204        skip_serializing_if = "Option::is_none"
205    )]
206    pub last_message_date: Option<String>,
207    /// Type of the last message sent/received in the conversation.
208    /// Allowed values: `TYPE_CALL`, `TYPE_SMS`, `TYPE_RCS`, `TYPE_EMAIL`,
209    /// `TYPE_SMS_REVIEW_REQUEST`, `TYPE_WEBCHAT`, `TYPE_SMS_NO_SHOW_REQUEST`,
210    /// `TYPE_CAMPAIGN_SMS`, `TYPE_CAMPAIGN_CALL`, `TYPE_CAMPAIGN_EMAIL`,
211    /// `TYPE_CAMPAIGN_VOICEMAIL`, `TYPE_FACEBOOK`.
212    #[serde(
213        rename = "lastMessageType",
214        default,
215        skip_serializing_if = "Option::is_none"
216    )]
217    pub last_message_type: Option<String>,
218    /// Count of unread messages in the conversation
219    #[serde(
220        rename = "unreadCount",
221        default,
222        skip_serializing_if = "Option::is_none"
223    )]
224    pub unread_count: Option<f64>,
225    /// Inbox status of the conversation.
226    #[serde(default, skip_serializing_if = "Option::is_none")]
227    pub inbox: Option<bool>,
228    /// Starred status of the conversation.
229    #[serde(default, skip_serializing_if = "Option::is_none")]
230    pub starred: Option<bool>,
231    /// Deleted status of the conversation.
232    /// Required by the API.
233    /// (Optional here so responses that omit it still parse.)
234    #[serde(default, skip_serializing_if = "Option::is_none")]
235    pub deleted: Option<bool>,
236}
237
238/// `ConversationSchema` from the GoHighLevel OpenAPI spec.
239#[derive(Debug, Clone, Default, Serialize, Deserialize)]
240pub struct ConversationSchema {
241    /// Conversation Id
242    /// Required by the API.
243    /// (Optional here so responses that omit it still parse.)
244    #[serde(default, skip_serializing_if = "Option::is_none")]
245    pub id: Option<String>,
246    /// Contact Id
247    /// Required by the API.
248    /// (Optional here so responses that omit it still parse.)
249    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
250    pub contact_id: Option<String>,
251    /// Location Id
252    /// Required by the API.
253    /// (Optional here so responses that omit it still parse.)
254    #[serde(
255        rename = "locationId",
256        default,
257        skip_serializing_if = "Option::is_none"
258    )]
259    pub location_id: Option<String>,
260    /// Content of the most recent message in the conversation
261    /// Required by the API.
262    /// (Optional here so responses that omit it still parse.)
263    #[serde(
264        rename = "lastMessageBody",
265        default,
266        skip_serializing_if = "Option::is_none"
267    )]
268    pub last_message_body: Option<String>,
269    /// Channel/type of the most recent message (SMS, Email, Call, etc)
270    /// Allowed values: `TYPE_CALL`, `TYPE_SMS`, `TYPE_RCS`, `TYPE_EMAIL`,
271    /// `TYPE_SMS_REVIEW_REQUEST`, `TYPE_WEBCHAT`, `TYPE_SMS_NO_SHOW_REQUEST`,
272    /// `TYPE_CAMPAIGN_SMS`, `TYPE_CAMPAIGN_CALL`, `TYPE_CAMPAIGN_EMAIL`,
273    /// `TYPE_CAMPAIGN_VOICEMAIL`, `TYPE_FACEBOOK`.
274    /// Required by the API.
275    /// (Optional here so responses that omit it still parse.)
276    #[serde(
277        rename = "lastMessageType",
278        default,
279        skip_serializing_if = "Option::is_none"
280    )]
281    pub last_message_type: Option<String>,
282    /// Primary channel/type of the conversation (Phone, Email, etc)
283    /// Allowed values: `TYPE_PHONE`, `TYPE_EMAIL`, `TYPE_FB_MESSENGER`, `TYPE_REVIEW`,
284    /// `TYPE_GROUP_SMS`.
285    /// Required by the API.
286    /// (Optional here so responses that omit it still parse.)
287    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
288    pub type_: Option<String>,
289    /// Number of unread messages in this conversation
290    /// Required by the API.
291    /// (Optional here so responses that omit it still parse.)
292    #[serde(
293        rename = "unreadCount",
294        default,
295        skip_serializing_if = "Option::is_none"
296    )]
297    pub unread_count: Option<f64>,
298    /// Complete name of the contact (first and last name)
299    /// Required by the API.
300    /// (Optional here so responses that omit it still parse.)
301    #[serde(rename = "fullName", default, skip_serializing_if = "Option::is_none")]
302    pub full_name: Option<String>,
303    /// Alternative display name for the contact - used when full name is not available
304    /// Required by the API.
305    /// (Optional here so responses that omit it still parse.)
306    #[serde(
307        rename = "contactName",
308        default,
309        skip_serializing_if = "Option::is_none"
310    )]
311    pub contact_name: Option<String>,
312    /// Primary email address of the contact
313    /// Required by the API.
314    /// (Optional here so responses that omit it still parse.)
315    #[serde(default, skip_serializing_if = "Option::is_none")]
316    pub email: Option<String>,
317    /// Primary phone number of the contact
318    /// Required by the API.
319    /// (Optional here so responses that omit it still parse.)
320    #[serde(default, skip_serializing_if = "Option::is_none")]
321    pub phone: Option<String>,
322}
323
324/// `CreateConversationDto` from the GoHighLevel OpenAPI spec.
325#[derive(Debug, Clone, Default, Serialize, Deserialize)]
326pub struct CreateConversationDto {
327    /// Location ID as string
328    /// Required by the API.
329    #[serde(rename = "locationId")]
330    pub location_id: String,
331    /// Contact ID as string
332    /// Required by the API.
333    #[serde(rename = "contactId")]
334    pub contact_id: String,
335}
336
337/// `CreateConversationSuccessResponse` from the GoHighLevel OpenAPI spec.
338#[derive(Debug, Clone, Default, Serialize, Deserialize)]
339pub struct CreateConversationSuccessResponse {
340    /// Indicates whether the API request was successful.
341    /// Required by the API.
342    /// (Optional here so responses that omit it still parse.)
343    #[serde(default, skip_serializing_if = "Option::is_none")]
344    pub success: Option<bool>,
345    /// Conversation data of the provided conversation ID.
346    /// Required by the API.
347    /// (Optional here so responses that omit it still parse.)
348    #[serde(default, skip_serializing_if = "Option::is_none")]
349    pub conversation: Option<ConversationCreateResponseDto>,
350}
351
352/// `CreateCustomSubtypeDto` from the GoHighLevel OpenAPI spec.
353#[derive(Debug, Clone, Default, Serialize, Deserialize)]
354pub struct CreateCustomSubtypeDto {
355    /// Name of the custom subtype (max 100 characters)
356    /// Required by the API.
357    pub name: String,
358    /// Description of the custom subtype (max 100 characters)
359    #[serde(default, skip_serializing_if = "Option::is_none")]
360    pub description: Option<String>,
361    /// Communication channel
362    /// Allowed values: `email`, `sms`.
363    /// Required by the API.
364    pub channel: String,
365    /// Language code
366    /// Required by the API.
367    pub language: String,
368}
369
370/// `CreateLiveChatMessageFeedbackResponse` from the GoHighLevel OpenAPI spec.
371#[derive(Debug, Clone, Default, Serialize, Deserialize)]
372pub struct CreateLiveChatMessageFeedbackResponse {
373    /// Required by the API.
374    /// (Optional here so responses that omit it still parse.)
375    #[serde(default, skip_serializing_if = "Option::is_none")]
376    pub success: Option<bool>,
377}
378
379/// `DeleteConversationSuccessfulResponse` from the GoHighLevel OpenAPI spec.
380#[derive(Debug, Clone, Default, Serialize, Deserialize)]
381pub struct DeleteConversationSuccessfulResponse {
382    /// Boolean value as the API response.
383    /// Required by the API.
384    /// (Optional here so responses that omit it still parse.)
385    #[serde(default, skip_serializing_if = "Option::is_none")]
386    pub success: Option<bool>,
387}
388
389/// `ErrorDto` from the GoHighLevel OpenAPI spec.
390#[derive(Debug, Clone, Default, Serialize, Deserialize)]
391pub struct ErrorDto {
392    /// Error Code
393    /// Required by the API.
394    pub code: String,
395    /// Error Type
396    /// Required by the API.
397    #[serde(rename = "type")]
398    pub type_: String,
399    /// Error Message
400    /// Required by the API.
401    pub message: String,
402}
403
404/// `ExportMessagesResponseDto` from the GoHighLevel OpenAPI spec.
405#[derive(Debug, Clone, Default, Serialize, Deserialize)]
406pub struct ExportMessagesResponseDto {
407    /// Array of messages
408    /// Required by the API.
409    /// (Optional here so responses that omit it still parse.)
410    #[serde(default, skip_serializing_if = "Vec::is_empty")]
411    pub messages: Vec<GetMessageResponseDto>,
412    /// Cursor for fetching next page. Null if no more results.
413    #[serde(
414        rename = "nextCursor",
415        default,
416        skip_serializing_if = "Option::is_none"
417    )]
418    pub next_cursor: Option<String>,
419    /// Total number of messages matching the query
420    /// Required by the API.
421    /// (Optional here so responses that omit it still parse.)
422    #[serde(default, skip_serializing_if = "Option::is_none")]
423    pub total: Option<f64>,
424}
425
426/// `ForwardConfigDto` from the GoHighLevel OpenAPI spec.
427#[derive(Debug, Clone, Default, Serialize, Deserialize)]
428pub struct ForwardConfigDto {
429    /// Specify if this is a forwarded email
430    /// Required by the API.
431    #[serde(rename = "isForwarded")]
432    pub is_forwarded: bool,
433    /// Specify if forwarding the whole thread or just a single email
434    #[serde(
435        rename = "forwardWholeThread",
436        default,
437        skip_serializing_if = "Option::is_none"
438    )]
439    pub forward_whole_thread: Option<bool>,
440    /// Message ID of the email thread being forwarded (source) - REQUIRED for forwarding
441    #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")]
442    pub message_id: Option<String>,
443    /// Email Message ID of the specific email being forwarded (source) - Required for single
444    /// email forward, ignored for thread forward
445    #[serde(
446        rename = "emailMessageId",
447        default,
448        skip_serializing_if = "Option::is_none"
449    )]
450    pub email_message_id: Option<String>,
451    /// Contact ID where the forwarded email originated from (source) - Auto-populated if not
452    /// provided
453    #[serde(
454        rename = "sourceContactId",
455        default,
456        skip_serializing_if = "Option::is_none"
457    )]
458    pub source_contact_id: Option<String>,
459    /// Conversation ID where the forwarded email originated from (source) - Auto-populated if
460    /// not provided
461    #[serde(
462        rename = "sourceConversationId",
463        default,
464        skip_serializing_if = "Option::is_none"
465    )]
466    pub source_conversation_id: Option<String>,
467    /// Email address to forward to (destination)
468    #[serde(rename = "toEmail", default, skip_serializing_if = "Option::is_none")]
469    pub to_email: Option<String>,
470    /// Contact ID of recipient when forwarding (destination)
471    #[serde(
472        rename = "recipientContactId",
473        default,
474        skip_serializing_if = "Option::is_none"
475    )]
476    pub recipient_contact_id: Option<String>,
477    /// Conversation ID of recipient when forwarding (destination)
478    #[serde(
479        rename = "recipientConversationId",
480        default,
481        skip_serializing_if = "Option::is_none"
482    )]
483    pub recipient_conversation_id: Option<String>,
484}
485
486/// `ForwardResponseDto` from the GoHighLevel OpenAPI spec.
487#[derive(Debug, Clone, Default, Serialize, Deserialize)]
488pub struct ForwardResponseDto {
489    /// Whether the entire thread was forwarded
490    #[serde(
491        rename = "forwardWholeThread",
492        default,
493        skip_serializing_if = "Option::is_none"
494    )]
495    pub forward_whole_thread: Option<bool>,
496    /// Message ID of the forwarded message (source)
497    #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")]
498    pub message_id: Option<String>,
499    /// Email Message ID of the forwarded email (source)
500    #[serde(
501        rename = "emailMessageId",
502        default,
503        skip_serializing_if = "Option::is_none"
504    )]
505    pub email_message_id: Option<String>,
506    /// Contact ID where the forwarded email originated from (source)
507    #[serde(
508        rename = "sourceContactId",
509        default,
510        skip_serializing_if = "Option::is_none"
511    )]
512    pub source_contact_id: Option<String>,
513    /// Conversation ID where the forwarded email originated from (source)
514    #[serde(
515        rename = "sourceConversationId",
516        default,
517        skip_serializing_if = "Option::is_none"
518    )]
519    pub source_conversation_id: Option<String>,
520    /// Email address the message was forwarded to (destination)
521    #[serde(
522        rename = "forwardToEmail",
523        default,
524        skip_serializing_if = "Option::is_none"
525    )]
526    pub forward_to_email: Option<String>,
527    /// Contact ID of the recipient of the forwarded email (destination)
528    #[serde(
529        rename = "recipientContactId",
530        default,
531        skip_serializing_if = "Option::is_none"
532    )]
533    pub recipient_contact_id: Option<String>,
534    /// Conversation ID of the recipient of the forwarded email (destination)
535    #[serde(
536        rename = "recipientConversationId",
537        default,
538        skip_serializing_if = "Option::is_none"
539    )]
540    pub recipient_conversation_id: Option<String>,
541}
542
543/// `GetConversationByIdResponse` from the GoHighLevel OpenAPI spec.
544#[derive(Debug, Clone, Default, Serialize, Deserialize)]
545pub struct GetConversationByIdResponse {
546    /// Unique identifier of the contact associated with this conversation
547    /// Required by the API.
548    /// (Optional here so responses that omit it still parse.)
549    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
550    pub contact_id: Option<String>,
551    /// Unique identifier of the business location where this conversation takes place
552    /// Required by the API.
553    /// (Optional here so responses that omit it still parse.)
554    #[serde(
555        rename = "locationId",
556        default,
557        skip_serializing_if = "Option::is_none"
558    )]
559    pub location_id: Option<String>,
560    /// Flag indicating if this conversation has been moved to trash/deleted
561    /// Required by the API.
562    /// (Optional here so responses that omit it still parse.)
563    #[serde(default, skip_serializing_if = "Option::is_none")]
564    pub deleted: Option<bool>,
565    /// Flag indicating if this conversation is currently in the main inbox view
566    /// Required by the API.
567    /// (Optional here so responses that omit it still parse.)
568    #[serde(default, skip_serializing_if = "Option::is_none")]
569    pub inbox: Option<bool>,
570    /// Communication channel type for this conversation: 1 (Phone), 2 (Email), 3 (Facebook
571    /// Messenger), 4 (Review), 5 (Group SMS), 6 (Internal Chat - coming soon)
572    /// Required by the API.
573    /// (Optional here so responses that omit it still parse.)
574    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
575    pub type_: Option<f64>,
576    /// Number of messages in this conversation that have not been read by the user
577    /// Required by the API.
578    /// (Optional here so responses that omit it still parse.)
579    #[serde(
580        rename = "unreadCount",
581        default,
582        skip_serializing_if = "Option::is_none"
583    )]
584    pub unread_count: Option<f64>,
585    /// Unique identifier of the team member currently responsible for handling this
586    /// conversation
587    #[serde(
588        rename = "assignedTo",
589        default,
590        skip_serializing_if = "Option::is_none"
591    )]
592    pub assigned_to: Option<String>,
593    /// Unique identifier for this specific conversation thread
594    /// Required by the API.
595    /// (Optional here so responses that omit it still parse.)
596    #[serde(default, skip_serializing_if = "Option::is_none")]
597    pub id: Option<String>,
598    /// Flag indicating if this conversation has been marked as important/starred by the user
599    #[serde(default, skip_serializing_if = "Option::is_none")]
600    pub starred: Option<bool>,
601}
602
603/// `GetConversationSuccessfulResponse` from the GoHighLevel OpenAPI spec.
604#[derive(Debug, Clone, Default, Serialize, Deserialize)]
605pub struct GetConversationSuccessfulResponse {
606    /// Boolean value as the API response.
607    /// Required by the API.
608    /// (Optional here so responses that omit it still parse.)
609    #[serde(default, skip_serializing_if = "Option::is_none")]
610    pub success: Option<bool>,
611    /// Conversation data of the provided conversation ID.
612    /// Required by the API.
613    /// (Optional here so responses that omit it still parse.)
614    #[serde(default, skip_serializing_if = "Option::is_none")]
615    pub conversation: Option<ConversationDto>,
616}
617
618/// `GetEmailMessageResponseDto` from the GoHighLevel OpenAPI spec.
619#[derive(Debug, Clone, Default, Serialize, Deserialize)]
620pub struct GetEmailMessageResponseDto {
621    /// Required by the API.
622    /// (Optional here so responses that omit it still parse.)
623    #[serde(default, skip_serializing_if = "Option::is_none")]
624    pub id: Option<String>,
625    /// External Id
626    #[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
627    pub alt_id: Option<String>,
628    /// Message Id or thread Id
629    /// Required by the API.
630    /// (Optional here so responses that omit it still parse.)
631    #[serde(rename = "threadId", default, skip_serializing_if = "Option::is_none")]
632    pub thread_id: Option<String>,
633    /// Required by the API.
634    /// (Optional here so responses that omit it still parse.)
635    #[serde(
636        rename = "locationId",
637        default,
638        skip_serializing_if = "Option::is_none"
639    )]
640    pub location_id: Option<String>,
641    /// Required by the API.
642    /// (Optional here so responses that omit it still parse.)
643    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
644    pub contact_id: Option<String>,
645    /// Required by the API.
646    /// (Optional here so responses that omit it still parse.)
647    #[serde(
648        rename = "conversationId",
649        default,
650        skip_serializing_if = "Option::is_none"
651    )]
652    pub conversation_id: Option<String>,
653    /// Required by the API.
654    /// (Optional here so responses that omit it still parse.)
655    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
656    pub date_added: Option<String>,
657    #[serde(default, skip_serializing_if = "Option::is_none")]
658    pub subject: Option<String>,
659    /// Required by the API.
660    /// (Optional here so responses that omit it still parse.)
661    #[serde(default, skip_serializing_if = "Option::is_none")]
662    pub body: Option<String>,
663    /// Allowed values: `inbound`, `outbound`.
664    /// Required by the API.
665    /// (Optional here so responses that omit it still parse.)
666    #[serde(default, skip_serializing_if = "Option::is_none")]
667    pub direction: Option<String>,
668    /// Allowed values: `pending`, `scheduled`, `sent`, `delivered`, `read`, `undelivered`,
669    /// `connected`, `failed`, `opened`.
670    #[serde(default, skip_serializing_if = "Option::is_none")]
671    pub status: Option<String>,
672    /// Required by the API.
673    /// (Optional here so responses that omit it still parse.)
674    #[serde(
675        rename = "contentType",
676        default,
677        skip_serializing_if = "Option::is_none"
678    )]
679    pub content_type: Option<String>,
680    /// An array of attachment URLs.
681    #[serde(default, skip_serializing_if = "Vec::is_empty")]
682    pub attachments: Vec<String>,
683    #[serde(default, skip_serializing_if = "Option::is_none")]
684    pub provider: Option<String>,
685    /// Name and Email Id of the sender
686    /// Required by the API.
687    /// (Optional here so responses that omit it still parse.)
688    #[serde(rename = "from", default, skip_serializing_if = "Option::is_none")]
689    pub from_: Option<String>,
690    /// List of email Ids of the receivers
691    /// Required by the API.
692    /// (Optional here so responses that omit it still parse.)
693    #[serde(default, skip_serializing_if = "Vec::is_empty")]
694    pub to: Vec<String>,
695    /// List of email Ids of the people in the cc field
696    #[serde(default, skip_serializing_if = "Vec::is_empty")]
697    pub cc: Vec<String>,
698    /// List of email Ids of the people in the bcc field
699    #[serde(default, skip_serializing_if = "Vec::is_empty")]
700    pub bcc: Vec<String>,
701    /// In case of reply, email message Id of the reply to email
702    #[serde(
703        rename = "replyToMessageId",
704        default,
705        skip_serializing_if = "Option::is_none"
706    )]
707    pub reply_to_message_id: Option<String>,
708    /// Email source
709    /// Allowed values: `workflow`, `bulk_actions`, `campaign`, `api`, `app`.
710    #[serde(default, skip_serializing_if = "Option::is_none")]
711    pub source: Option<String>,
712    /// Conversation provider ID
713    #[serde(
714        rename = "conversationProviderId",
715        default,
716        skip_serializing_if = "Option::is_none"
717    )]
718    pub conversation_provider_id: Option<String>,
719}
720
721/// `GetMessageResponseDto` from the GoHighLevel OpenAPI spec.
722#[derive(Debug, Clone, Default, Serialize, Deserialize)]
723pub struct GetMessageResponseDto {
724    /// Required by the API.
725    /// (Optional here so responses that omit it still parse.)
726    #[serde(default, skip_serializing_if = "Option::is_none")]
727    pub id: Option<String>,
728    /// Required by the API.
729    /// (Optional here so responses that omit it still parse.)
730    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
731    pub type_: Option<f64>,
732    /// Type of the message as a string
733    /// Allowed values: `TYPE_CALL`, `TYPE_SMS`, `TYPE_RCS`, `TYPE_EMAIL`,
734    /// `TYPE_SMS_REVIEW_REQUEST`, `TYPE_WEBCHAT`, `TYPE_SMS_NO_SHOW_REQUEST`,
735    /// `TYPE_CAMPAIGN_SMS`, `TYPE_CAMPAIGN_CALL`, `TYPE_CAMPAIGN_EMAIL`,
736    /// `TYPE_CAMPAIGN_VOICEMAIL`, `TYPE_FACEBOOK`.
737    /// Required by the API.
738    /// (Optional here so responses that omit it still parse.)
739    #[serde(
740        rename = "messageType",
741        default,
742        skip_serializing_if = "Option::is_none"
743    )]
744    pub message_type: Option<String>,
745    /// Required by the API.
746    /// (Optional here so responses that omit it still parse.)
747    #[serde(
748        rename = "locationId",
749        default,
750        skip_serializing_if = "Option::is_none"
751    )]
752    pub location_id: Option<String>,
753    /// Required by the API.
754    /// (Optional here so responses that omit it still parse.)
755    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
756    pub contact_id: Option<String>,
757    /// Required by the API.
758    /// (Optional here so responses that omit it still parse.)
759    #[serde(
760        rename = "conversationId",
761        default,
762        skip_serializing_if = "Option::is_none"
763    )]
764    pub conversation_id: Option<String>,
765    /// Required by the API.
766    /// (Optional here so responses that omit it still parse.)
767    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
768    pub date_added: Option<String>,
769    #[serde(default, skip_serializing_if = "Option::is_none")]
770    pub body: Option<String>,
771    /// Allowed values: `inbound`, `outbound`.
772    /// Required by the API.
773    /// (Optional here so responses that omit it still parse.)
774    #[serde(default, skip_serializing_if = "Option::is_none")]
775    pub direction: Option<String>,
776    /// Allowed values: `connected`, `delivered`, `failed`, `opened`, `pending`, `read`,
777    /// `scheduled`, `sent`, `undelivered`, `clicked`, `opt_out`, `queued`.
778    #[serde(default, skip_serializing_if = "Option::is_none")]
779    pub status: Option<String>,
780    /// Required by the API.
781    /// (Optional here so responses that omit it still parse.)
782    #[serde(
783        rename = "contentType",
784        default,
785        skip_serializing_if = "Option::is_none"
786    )]
787    pub content_type: Option<String>,
788    /// An array of attachment URLs. Attachments will be empty for Call and Voicemails, type 1
789    /// and 10. Please use get call recording API to fetch call recording and voicemails.
790    #[serde(default, skip_serializing_if = "Vec::is_empty")]
791    pub attachments: Vec<String>,
792    #[serde(default, skip_serializing_if = "Option::is_none")]
793    pub meta: Option<MessageMeta>,
794    /// Message source
795    /// Allowed values: `workflow`, `bulk_actions`, `campaign`, `api`, `app`.
796    #[serde(default, skip_serializing_if = "Option::is_none")]
797    pub source: Option<String>,
798    /// User Id
799    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
800    pub user_id: Option<String>,
801    /// Conversation Provider Id
802    #[serde(
803        rename = "conversationProviderId",
804        default,
805        skip_serializing_if = "Option::is_none"
806    )]
807    pub conversation_provider_id: Option<String>,
808    /// Chat Widget Id
809    #[serde(
810        rename = "chatWidgetId",
811        default,
812        skip_serializing_if = "Option::is_none"
813    )]
814    pub chat_widget_id: Option<String>,
815}
816
817/// `GetMessageTranscriptionResponseDto` from the GoHighLevel OpenAPI spec.
818#[derive(Debug, Clone, Default, Serialize, Deserialize)]
819pub struct GetMessageTranscriptionResponseDto {
820    /// Media channel describes the user interaction channel
821    /// Required by the API.
822    /// (Optional here so responses that omit it still parse.)
823    #[serde(
824        rename = "mediaChannel",
825        default,
826        skip_serializing_if = "Option::is_none"
827    )]
828    pub media_channel: Option<f64>,
829    /// Index of the sentence in the transcription
830    /// Required by the API.
831    /// (Optional here so responses that omit it still parse.)
832    #[serde(
833        rename = "sentenceIndex",
834        default,
835        skip_serializing_if = "Option::is_none"
836    )]
837    pub sentence_index: Option<f64>,
838    /// Start time of the sentence in milliseconds
839    /// Required by the API.
840    /// (Optional here so responses that omit it still parse.)
841    #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")]
842    pub start_time: Option<f64>,
843    /// End time of the sentence in milliseconds
844    /// Required by the API.
845    /// (Optional here so responses that omit it still parse.)
846    #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")]
847    pub end_time: Option<f64>,
848    /// Transcript of the sentence
849    /// Required by the API.
850    /// (Optional here so responses that omit it still parse.)
851    #[serde(default, skip_serializing_if = "Option::is_none")]
852    pub transcript: Option<String>,
853    /// Confidence of the transcription
854    /// Required by the API.
855    /// (Optional here so responses that omit it still parse.)
856    #[serde(default, skip_serializing_if = "Option::is_none")]
857    pub confidence: Option<f64>,
858}
859
860/// `GetMessagesByConversationResponseDto` from the GoHighLevel OpenAPI spec.
861#[derive(Debug, Clone, Default, Serialize, Deserialize)]
862pub struct GetMessagesByConversationResponseDto {
863    /// Id of the last message in the messages array
864    /// Required by the API.
865    /// (Optional here so responses that omit it still parse.)
866    #[serde(
867        rename = "lastMessageId",
868        default,
869        skip_serializing_if = "Option::is_none"
870    )]
871    pub last_message_id: Option<String>,
872    /// Next page value true indicates only 20 message is in the response. Rest of the messages
873    /// are in the next page. Please use the lastMessageId value in the query to get the next
874    /// page messages
875    /// Required by the API.
876    /// (Optional here so responses that omit it still parse.)
877    #[serde(rename = "nextPage", default, skip_serializing_if = "Option::is_none")]
878    pub next_page: Option<bool>,
879    /// Array of messages
880    /// Required by the API.
881    /// (Optional here so responses that omit it still parse.)
882    #[serde(default, skip_serializing_if = "Vec::is_empty")]
883    pub messages: Vec<GetMessageResponseDto>,
884}
885
886/// `InitiateFileUploadDto` from the GoHighLevel OpenAPI spec.
887#[derive(Debug, Clone, Default, Serialize, Deserialize)]
888pub struct InitiateFileUploadDto {
889    /// Location ID
890    /// Required by the API.
891    #[serde(rename = "locationId")]
892    pub location_id: String,
893    /// Conversation ID
894    /// Required by the API.
895    #[serde(rename = "conversationId")]
896    pub conversation_id: String,
897    /// Original filename with extension
898    /// Required by the API.
899    pub filename: String,
900    /// MIME type of the file
901    /// Required by the API.
902    #[serde(rename = "contentType")]
903    pub content_type: String,
904    /// File size in bytes (optional, for pre-validation)
905    #[serde(rename = "fileSize", default, skip_serializing_if = "Option::is_none")]
906    pub file_size: Option<f64>,
907    /// Channel type for size limits (WHATSAPP for 100MB limit, others for 5MB)
908    /// Required by the API.
909    pub channel: String,
910}
911
912/// `InitiateFileUploadResponseDto` from the GoHighLevel OpenAPI spec.
913#[derive(Debug, Clone, Default, Serialize, Deserialize)]
914pub struct InitiateFileUploadResponseDto {
915    /// Signed URL for direct upload to GCS. Use PUT request with file content.
916    /// Required by the API.
917    /// (Optional here so responses that omit it still parse.)
918    #[serde(rename = "uploadUrl", default, skip_serializing_if = "Option::is_none")]
919    pub upload_url: Option<String>,
920    /// Unique upload ID for tracking and completing the upload
921    /// Required by the API.
922    /// (Optional here so responses that omit it still parse.)
923    #[serde(rename = "uploadId", default, skip_serializing_if = "Option::is_none")]
924    pub upload_id: Option<String>,
925    /// File path in GCS bucket (needed for confirmation endpoint)
926    /// Required by the API.
927    /// (Optional here so responses that omit it still parse.)
928    #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")]
929    pub file_path: Option<String>,
930    /// URL expiration timestamp (Unix milliseconds)
931    /// Required by the API.
932    /// (Optional here so responses that omit it still parse.)
933    #[serde(rename = "expiresAt", default, skip_serializing_if = "Option::is_none")]
934    pub expires_at: Option<f64>,
935    /// Maximum allowed file size in bytes
936    /// Required by the API.
937    /// (Optional here so responses that omit it still parse.)
938    #[serde(
939        rename = "maxFileSize",
940        default,
941        skip_serializing_if = "Option::is_none"
942    )]
943    pub max_file_size: Option<f64>,
944}
945
946/// `MessageMeta` from the GoHighLevel OpenAPI spec.
947#[derive(Debug, Clone, Default, Serialize, Deserialize)]
948pub struct MessageMeta {
949    /// Call duration in seconds
950    #[serde(
951        rename = "callDuration",
952        default,
953        skip_serializing_if = "Option::is_none"
954    )]
955    pub call_duration: Option<String>,
956    /// Call status - can be pending, completed, answered, busy, no-answer, failed, canceled, or
957    /// voicemail
958    /// Allowed values: `pending`, `completed`, `answered`, `busy`, `no-answer`, `failed`,
959    /// `canceled`, `voicemail`.
960    #[serde(
961        rename = "callStatus",
962        default,
963        skip_serializing_if = "Option::is_none"
964    )]
965    pub call_status: Option<String>,
966    /// meta will contain email, for message type 3 (email). messageIds is list of all email
967    /// message ids under the message thread
968    #[serde(default, skip_serializing_if = "Option::is_none")]
969    pub email: Option<serde_json::Value>,
970}
971
972/// `ProcessMessageBodyDto` from the GoHighLevel OpenAPI spec.
973#[derive(Debug, Clone, Default, Serialize, Deserialize)]
974pub struct ProcessMessageBodyDto {
975    /// Message Type
976    /// Allowed values: `SMS`, `RCS`, `Email`, `WhatsApp`, `GMB`, `IG`, `FB`, `Custom`,
977    /// `WebChat`, `Live_Chat`, `Call`, `IVR_Call`.
978    /// Required by the API.
979    #[serde(rename = "type")]
980    pub type_: String,
981    /// Array of attachments
982    #[serde(default, skip_serializing_if = "Vec::is_empty")]
983    pub attachments: Vec<String>,
984    /// Message Body
985    #[serde(default, skip_serializing_if = "Option::is_none")]
986    pub message: Option<String>,
987    /// Conversation Id
988    /// Required by the API.
989    #[serde(rename = "conversationId")]
990    pub conversation_id: String,
991    /// Contact Id
992    /// Required by the API.
993    #[serde(rename = "contactId")]
994    pub contact_id: String,
995    /// Conversation Provider Id
996    /// Required by the API.
997    #[serde(rename = "conversationProviderId")]
998    pub conversation_provider_id: String,
999    /// HTML Body of Email
1000    #[serde(default, skip_serializing_if = "Option::is_none")]
1001    pub html: Option<String>,
1002    /// Subject of the Email
1003    #[serde(default, skip_serializing_if = "Option::is_none")]
1004    pub subject: Option<String>,
1005    /// Email address to send from. This field is associated with the contact record and cannot
1006    /// be dynamically changed.
1007    #[serde(rename = "emailFrom", default, skip_serializing_if = "Option::is_none")]
1008    pub email_from: Option<String>,
1009    /// Recipient email address. This field is associated with the contact record and cannot be
1010    /// dynamically changed.
1011    #[serde(rename = "emailTo", default, skip_serializing_if = "Option::is_none")]
1012    pub email_to: Option<String>,
1013    /// List of email address to CC
1014    #[serde(rename = "emailCc", default, skip_serializing_if = "Vec::is_empty")]
1015    pub email_cc: Vec<String>,
1016    /// List of email address to BCC
1017    #[serde(rename = "emailBcc", default, skip_serializing_if = "Vec::is_empty")]
1018    pub email_bcc: Vec<String>,
1019    /// Send the email message id for which this email should be threaded. This is for replying
1020    /// to a specific email
1021    #[serde(
1022        rename = "emailMessageId",
1023        default,
1024        skip_serializing_if = "Option::is_none"
1025    )]
1026    pub email_message_id: Option<String>,
1027    /// external mail provider's message id
1028    #[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
1029    pub alt_id: Option<String>,
1030    /// Message direction, if required can be set manually, default is outbound
1031    #[serde(default, skip_serializing_if = "Option::is_none")]
1032    pub direction: Option<serde_json::Value>,
1033    /// Date of the inbound message
1034    /// Format: date-time (ISO-8601 string).
1035    #[serde(default, skip_serializing_if = "Option::is_none")]
1036    pub date: Option<String>,
1037    /// Phone call dialer and receiver information
1038    #[serde(default, skip_serializing_if = "Option::is_none")]
1039    pub call: Option<CallDataDTO>,
1040}
1041
1042/// `ProcessMessageResponseDto` from the GoHighLevel OpenAPI spec.
1043#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1044pub struct ProcessMessageResponseDto {
1045    /// Required by the API.
1046    /// (Optional here so responses that omit it still parse.)
1047    #[serde(default, skip_serializing_if = "Option::is_none")]
1048    pub success: Option<bool>,
1049    /// Conversation ID.
1050    /// Required by the API.
1051    /// (Optional here so responses that omit it still parse.)
1052    #[serde(
1053        rename = "conversationId",
1054        default,
1055        skip_serializing_if = "Option::is_none"
1056    )]
1057    pub conversation_id: Option<String>,
1058    /// This is the main Message ID
1059    /// Required by the API.
1060    /// (Optional here so responses that omit it still parse.)
1061    #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")]
1062    pub message_id: Option<String>,
1063    /// Required by the API.
1064    /// (Optional here so responses that omit it still parse.)
1065    #[serde(default, skip_serializing_if = "Option::is_none")]
1066    pub message: Option<String>,
1067    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
1068    pub contact_id: Option<String>,
1069    /// Format: date-time (ISO-8601 string).
1070    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
1071    pub date_added: Option<String>,
1072    #[serde(
1073        rename = "emailMessageId",
1074        default,
1075        skip_serializing_if = "Option::is_none"
1076    )]
1077    pub email_message_id: Option<String>,
1078}
1079
1080/// `ProcessOutboundMessageBodyDto` from the GoHighLevel OpenAPI spec.
1081#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1082pub struct ProcessOutboundMessageBodyDto {
1083    /// Message Type
1084    /// Allowed values: `Call`.
1085    /// Required by the API.
1086    #[serde(rename = "type")]
1087    pub type_: String,
1088    /// Array of attachments
1089    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1090    pub attachments: Vec<String>,
1091    /// Conversation Id
1092    /// Required by the API.
1093    #[serde(rename = "conversationId")]
1094    pub conversation_id: String,
1095    /// Conversation Provider Id
1096    /// Required by the API.
1097    #[serde(rename = "conversationProviderId")]
1098    pub conversation_provider_id: String,
1099    /// external mail provider's message id
1100    #[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
1101    pub alt_id: Option<String>,
1102    /// Date of the outbound message
1103    /// Format: date-time (ISO-8601 string).
1104    #[serde(default, skip_serializing_if = "Option::is_none")]
1105    pub date: Option<String>,
1106    /// Phone call dialer and receiver information
1107    #[serde(default, skip_serializing_if = "Option::is_none")]
1108    pub call: Option<CallDataDTO>,
1109}
1110
1111/// `SendConversationResponseDto` from the GoHighLevel OpenAPI spec.
1112#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1113pub struct SendConversationResponseDto {
1114    /// The list of all conversations found for the given query
1115    /// Required by the API.
1116    /// (Optional here so responses that omit it still parse.)
1117    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1118    pub conversations: Vec<ConversationSchema>,
1119    /// Total Number of results found for the given query
1120    /// Required by the API.
1121    /// (Optional here so responses that omit it still parse.)
1122    #[serde(default, skip_serializing_if = "Option::is_none")]
1123    pub total: Option<f64>,
1124}
1125
1126/// `SendMessageBodyDto` from the GoHighLevel OpenAPI spec.
1127#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1128pub struct SendMessageBodyDto {
1129    /// Type of message being sent
1130    /// Allowed values: `SMS`, `RCS`, `Email`, `WhatsApp`, `IG`, `FB`, `Custom`, `Live_Chat`,
1131    /// `TIKTOK`.
1132    /// Required by the API.
1133    #[serde(rename = "type")]
1134    pub type_: String,
1135    /// Type of message being sent
1136    /// Required by the API.
1137    #[serde(rename = "subType")]
1138    pub sub_type: serde_json::Value,
1139    /// ID of the contact receiving the message
1140    /// Required by the API.
1141    #[serde(rename = "contactId")]
1142    pub contact_id: String,
1143    /// ID of the associated appointment
1144    #[serde(
1145        rename = "appointmentId",
1146        default,
1147        skip_serializing_if = "Option::is_none"
1148    )]
1149    pub appointment_id: Option<String>,
1150    /// Array of attachment URLs
1151    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1152    pub attachments: Vec<String>,
1153    /// Email address to send from
1154    #[serde(rename = "emailFrom", default, skip_serializing_if = "Option::is_none")]
1155    pub email_from: Option<String>,
1156    /// Array of CC email addresses
1157    #[serde(rename = "emailCc", default, skip_serializing_if = "Vec::is_empty")]
1158    pub email_cc: Vec<String>,
1159    /// Array of BCC email addresses
1160    #[serde(rename = "emailBcc", default, skip_serializing_if = "Vec::is_empty")]
1161    pub email_bcc: Vec<String>,
1162    /// HTML content of the message
1163    #[serde(default, skip_serializing_if = "Option::is_none")]
1164    pub html: Option<String>,
1165    /// Text content of the message
1166    #[serde(default, skip_serializing_if = "Option::is_none")]
1167    pub message: Option<String>,
1168    /// Subject line for email messages
1169    #[serde(default, skip_serializing_if = "Option::is_none")]
1170    pub subject: Option<String>,
1171    /// ID of message being replied to
1172    #[serde(
1173        rename = "replyMessageId",
1174        default,
1175        skip_serializing_if = "Option::is_none"
1176    )]
1177    pub reply_message_id: Option<String>,
1178    /// ID of message template
1179    #[serde(
1180        rename = "templateId",
1181        default,
1182        skip_serializing_if = "Option::is_none"
1183    )]
1184    pub template_id: Option<String>,
1185    /// ID of message thread. For email messages, this is the message ID that contains multiple
1186    /// email messages in the thread
1187    #[serde(rename = "threadId", default, skip_serializing_if = "Option::is_none")]
1188    pub thread_id: Option<String>,
1189    /// UTC Timestamp (in seconds) at which the message should be scheduled
1190    #[serde(
1191        rename = "scheduledTimestamp",
1192        default,
1193        skip_serializing_if = "Option::is_none"
1194    )]
1195    pub scheduled_timestamp: Option<f64>,
1196    /// ID of conversation provider
1197    #[serde(
1198        rename = "conversationProviderId",
1199        default,
1200        skip_serializing_if = "Option::is_none"
1201    )]
1202    pub conversation_provider_id: Option<String>,
1203    /// Email address to send to, if different from contact's primary email. This should be a
1204    /// valid email address associated with the contact.
1205    #[serde(rename = "emailTo", default, skip_serializing_if = "Option::is_none")]
1206    pub email_to: Option<String>,
1207    /// Custom subtype ID for email unsubscription preferences. Only applies to email messages.
1208    #[serde(
1209        rename = "customSubtypeId",
1210        default,
1211        skip_serializing_if = "Option::is_none"
1212    )]
1213    pub custom_subtype_id: Option<String>,
1214    /// Mode for email replies
1215    /// Allowed values: `reply`, `reply_all`.
1216    #[serde(
1217        rename = "emailReplyMode",
1218        default,
1219        skip_serializing_if = "Option::is_none"
1220    )]
1221    pub email_reply_mode: Option<String>,
1222    /// Phone number used as the sender number for outbound messages
1223    #[serde(
1224        rename = "fromNumber",
1225        default,
1226        skip_serializing_if = "Option::is_none"
1227    )]
1228    pub from_number: Option<String>,
1229    /// Recipient phone number for outbound messages
1230    #[serde(rename = "toNumber", default, skip_serializing_if = "Option::is_none")]
1231    pub to_number: Option<String>,
1232    /// Forwarding configuration for emails
1233    #[serde(default, skip_serializing_if = "Option::is_none")]
1234    pub forward: Option<ForwardConfigDto>,
1235    /// Message status
1236    /// Allowed values: `delivered`, `failed`, `pending`, `read`.
1237    /// Required by the API.
1238    pub status: String,
1239    /// Whether the scheduled email uses native AI for the email scheduling
1240    #[serde(
1241        rename = "usesNativeSchedulingAi",
1242        default,
1243        skip_serializing_if = "Option::is_none"
1244    )]
1245    pub uses_native_scheduling_ai: Option<bool>,
1246    /// Optimization period in hours (24h, 48h, or 72h)
1247    /// Allowed values: `24h`, `48h`, `72h`.
1248    #[serde(
1249        rename = "optimizationPeriod",
1250        default,
1251        skip_serializing_if = "Option::is_none"
1252    )]
1253    pub optimization_period: Option<String>,
1254}
1255
1256/// `SendMessageResponseDto` from the GoHighLevel OpenAPI spec.
1257#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1258pub struct SendMessageResponseDto {
1259    /// Conversation ID.
1260    /// Required by the API.
1261    /// (Optional here so responses that omit it still parse.)
1262    #[serde(
1263        rename = "conversationId",
1264        default,
1265        skip_serializing_if = "Option::is_none"
1266    )]
1267    pub conversation_id: Option<String>,
1268    /// This contains the email message id (only for Email type). Use this ID to send inbound
1269    /// replies to GHL to create a threaded email.
1270    #[serde(
1271        rename = "emailMessageId",
1272        default,
1273        skip_serializing_if = "Option::is_none"
1274    )]
1275    pub email_message_id: Option<String>,
1276    /// This is the main Message ID
1277    /// Required by the API.
1278    /// (Optional here so responses that omit it still parse.)
1279    #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")]
1280    pub message_id: Option<String>,
1281    /// When sending via the GMB channel, we will be returning list of `messageIds` instead of
1282    /// single `messageId`.
1283    #[serde(rename = "messageIds", default, skip_serializing_if = "Vec::is_empty")]
1284    pub message_ids: Vec<String>,
1285    /// Additional response message when sending a workflow message
1286    #[serde(default, skip_serializing_if = "Option::is_none")]
1287    pub msg: Option<String>,
1288    /// Optional metadata for forwarded email
1289    #[serde(
1290        rename = "forwardData",
1291        default,
1292        skip_serializing_if = "Option::is_none"
1293    )]
1294    pub forward_data: Option<ForwardResponseDto>,
1295    /// Message status
1296    /// Allowed values: `delivered`, `failed`, `pending`, `read`.
1297    /// Required by the API.
1298    /// (Optional here so responses that omit it still parse.)
1299    #[serde(default, skip_serializing_if = "Option::is_none")]
1300    pub status: Option<String>,
1301}
1302
1303/// `SendReviewReplyDto` from the GoHighLevel OpenAPI spec.
1304#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1305pub struct SendReviewReplyDto {
1306    /// Conversation ID (must have reviewId)
1307    /// Required by the API.
1308    #[serde(rename = "conversationId")]
1309    pub conversation_id: String,
1310    /// Location ID
1311    /// Required by the API.
1312    #[serde(rename = "locationId")]
1313    pub location_id: String,
1314    /// Review reply message text
1315    /// Required by the API.
1316    pub message: String,
1317}
1318
1319/// `StartAfterArrayNumberSchema` from the GoHighLevel OpenAPI spec.
1320#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1321pub struct StartAfterArrayNumberSchema {
1322    /// Search to begin after the specified date - should contain the sort value of the last
1323    /// document
1324    #[serde(
1325        rename = "startAfterDate",
1326        default,
1327        skip_serializing_if = "Vec::is_empty"
1328    )]
1329    pub start_after_date: Vec<String>,
1330}
1331
1332/// `StartAfterNumberSchema` from the GoHighLevel OpenAPI spec.
1333#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1334pub struct StartAfterNumberSchema {
1335    /// Search to begin after the specified date - should contain the sort value of the last
1336    /// document
1337    #[serde(
1338        rename = "startAfterDate",
1339        default,
1340        skip_serializing_if = "Option::is_none"
1341    )]
1342    pub start_after_date: Option<f64>,
1343}
1344
1345/// `SubscriptionActionDto` from the GoHighLevel OpenAPI spec.
1346#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1347pub struct SubscriptionActionDto {
1348    /// Type of subscription action
1349    /// Allowed values: `default`, `custom`, `resub_all`.
1350    /// Required by the API.
1351    #[serde(rename = "type")]
1352    pub type_: String,
1353    /// Subscription type name (required for default types: "One on One")
1354    /// Allowed values: `One on One`.
1355    #[serde(default, skip_serializing_if = "Option::is_none")]
1356    pub subtype_name: Option<String>,
1357    /// Custom subscription type ID (required for custom types)
1358    #[serde(default, skip_serializing_if = "Option::is_none")]
1359    pub subtype_id: Option<String>,
1360    /// Subscription status
1361    /// Allowed values: `subscribed`, `unsubscribed`.
1362    /// Required by the API.
1363    pub subtype_status: String,
1364}
1365
1366/// `UpdateConversationDto` from the GoHighLevel OpenAPI spec.
1367#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1368pub struct UpdateConversationDto {
1369    /// Location ID as string
1370    /// Required by the API.
1371    #[serde(rename = "locationId")]
1372    pub location_id: String,
1373    /// Count of unread messages in the conversation
1374    #[serde(
1375        rename = "unreadCount",
1376        default,
1377        skip_serializing_if = "Option::is_none"
1378    )]
1379    pub unread_count: Option<f64>,
1380    /// Starred status of the conversation.
1381    #[serde(default, skip_serializing_if = "Option::is_none")]
1382    pub starred: Option<bool>,
1383    #[serde(default, skip_serializing_if = "Option::is_none")]
1384    pub feedback: Option<serde_json::Value>,
1385}
1386
1387/// `UpdateCustomSubtypeDto` from the GoHighLevel OpenAPI spec.
1388#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1389pub struct UpdateCustomSubtypeDto {
1390    /// Name of the custom subtype (max 100 characters)
1391    #[serde(default, skip_serializing_if = "Option::is_none")]
1392    pub name: Option<String>,
1393    /// Description of the custom subtype (max 100 characters)
1394    #[serde(default, skip_serializing_if = "Option::is_none")]
1395    pub description: Option<String>,
1396    /// Whether the custom subtype is archived
1397    #[serde(default, skip_serializing_if = "Option::is_none")]
1398    pub archived: Option<bool>,
1399    /// Resubscription legal form ID (optional when archiving)
1400    #[serde(default, skip_serializing_if = "Option::is_none")]
1401    pub resubscription_legal_form_id: Option<String>,
1402}
1403
1404/// `UpdateMessageStatusDto` from the GoHighLevel OpenAPI spec.
1405#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1406pub struct UpdateMessageStatusDto {
1407    /// Message status
1408    /// Allowed values: `delivered`, `failed`, `pending`, `read`.
1409    /// Required by the API.
1410    pub status: String,
1411    /// Error object from the conversation provider
1412    #[serde(default, skip_serializing_if = "Option::is_none")]
1413    pub error: Option<ErrorDto>,
1414    /// Email message Id
1415    #[serde(
1416        rename = "emailMessageId",
1417        default,
1418        skip_serializing_if = "Option::is_none"
1419    )]
1420    pub email_message_id: Option<String>,
1421    /// Email delivery status for additional email recipients.
1422    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1423    pub recipients: Vec<String>,
1424}
1425
1426/// `UploadFilesDto` from the GoHighLevel OpenAPI spec.
1427#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1428pub struct UploadFilesDto {
1429    /// Conversation Id
1430    /// Required by the API.
1431    #[serde(rename = "conversationId")]
1432    pub conversation_id: String,
1433    /// Contact Id
1434    /// Required by the API.
1435    #[serde(rename = "contactId")]
1436    pub contact_id: String,
1437    /// Required by the API.
1438    #[serde(rename = "locationId")]
1439    pub location_id: String,
1440    /// Required by the API.
1441    #[serde(
1442        rename = "attachmentUrls",
1443        default,
1444        skip_serializing_if = "Vec::is_empty"
1445    )]
1446    pub attachment_urls: Vec<String>,
1447    /// Twilio chat service SID for group SMS uploads
1448    #[serde(
1449        rename = "chatServiceSid",
1450        default,
1451        skip_serializing_if = "Option::is_none"
1452    )]
1453    pub chat_service_sid: Option<String>,
1454    /// Flag to indicate group SMS upload flow. When true, only 1 file upload is allowed per
1455    /// request.
1456    #[serde(
1457        rename = "isGroupSms",
1458        default,
1459        skip_serializing_if = "Option::is_none"
1460    )]
1461    pub is_group_sms: Option<String>,
1462}
1463
1464/// `UploadFilesErrorResponseDto` from the GoHighLevel OpenAPI spec.
1465#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1466pub struct UploadFilesErrorResponseDto {
1467    /// HTTP Status code of the request
1468    /// Allowed values: `400`, `413`, `415`.
1469    /// Required by the API.
1470    /// (Optional here so responses that omit it still parse.)
1471    #[serde(default, skip_serializing_if = "Option::is_none")]
1472    pub status: Option<String>,
1473    /// Error message of the request
1474    /// Required by the API.
1475    /// (Optional here so responses that omit it still parse.)
1476    #[serde(default, skip_serializing_if = "Option::is_none")]
1477    pub message: Option<String>,
1478}
1479
1480/// `UploadFilesResponseDto` from the GoHighLevel OpenAPI spec.
1481#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1482pub struct UploadFilesResponseDto {
1483    /// Required by the API.
1484    /// (Optional here so responses that omit it still parse.)
1485    #[serde(
1486        rename = "uploadedFiles",
1487        default,
1488        skip_serializing_if = "Option::is_none"
1489    )]
1490    pub uploaded_files: Option<serde_json::Value>,
1491    /// Twilio media SIDs for group SMS (when isGroupSms=true)
1492    #[serde(
1493        rename = "twilioMediaSids",
1494        default,
1495        skip_serializing_if = "Vec::is_empty"
1496    )]
1497    pub twilio_media_sids: Vec<String>,
1498}
1499
1500/// `UserSubscriptionChangeDto` from the GoHighLevel OpenAPI spec.
1501#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1502pub struct UserSubscriptionChangeDto {
1503    /// Location Id
1504    /// Required by the API.
1505    #[serde(rename = "locationId")]
1506    pub location_id: String,
1507    /// Contact Id
1508    /// Required by the API.
1509    #[serde(rename = "contactId")]
1510    pub contact_id: String,
1511    /// Email address
1512    /// Required by the API.
1513    pub email: String,
1514    /// Subscription action details
1515    /// Required by the API.
1516    pub subscription_action: SubscriptionActionDto,
1517    /// Legal reason for the change (required only for resubscribe and resub_all actions)
1518    #[serde(default, skip_serializing_if = "Option::is_none")]
1519    pub legal_reason: Option<String>,
1520    /// Legal description/details
1521    #[serde(default, skip_serializing_if = "Option::is_none")]
1522    pub legal_description: Option<String>,
1523}
1524
1525/// `UserTypingBody` from the GoHighLevel OpenAPI spec.
1526#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1527pub struct UserTypingBody {
1528    /// Location Id
1529    /// Required by the API.
1530    #[serde(rename = "locationId")]
1531    pub location_id: String,
1532    /// Typing status
1533    /// Required by the API.
1534    #[serde(rename = "isTyping")]
1535    pub is_typing: String,
1536    /// visitorId is the Unique ID assigned to each Live chat visitor. visitorId will be added
1537    /// soon in GET Contact API
1538    /// Required by the API.
1539    #[serde(rename = "visitorId")]
1540    pub visitor_id: String,
1541    /// Conversation Id
1542    /// Required by the API.
1543    #[serde(rename = "conversationId")]
1544    pub conversation_id: String,
1545}