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