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