slack-web-api 0.2.1

Typed async Slack Web API client for Rust: all 330 methods incl. admin, Block Kit, pagination, file upload, rate-limit retry (reqwest + rustls, no OpenSSL)
Documentation
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
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
// このファイルは codegen/generate.py が生成する。手で編集しない

#![allow(unused_imports)]

use crate::objects::*;
use crate::{
    CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
};
use serde::{Deserialize, Serialize};

/// Arguments for the Slack Web API method [`chat.appendStream`](https://docs.slack.dev/reference/methods/chat.appendStream): Append text to an existing streaming conversation
///
/// Send it with [`SlackClient::chat_append_stream`].
#[doc(alias = "chat.appendStream")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatAppendStreamRequest {
    /// An encoded ID that represents a channel, private group, or DM
    pub channel: String,
    /// The timestamp of the streaming message.
    pub ts: String,
    /// Array of streaming chunks.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub chunks: Option<Vec<serde_json::Value>>,
    /// Accepts message text formatted in markdown. Limit this field to 12,000 characters. This text is what will be appended to the message received so far.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub markdown_text: Option<String>,
}

impl ChatAppendStreamRequest {
    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            ts: ts.into(),
            chunks: None,
            markdown_text: None,
        }
    }

    pub fn chunks(mut self, chunks: Vec<serde_json::Value>) -> Self {
        self.chunks = Some(chunks);
        self
    }

    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
        self.markdown_text = Some(markdown_text.into());
        self
    }
}

impl SlackApiMethod for ChatAppendStreamRequest {
    const METHOD: &'static str = "chat.appendStream";
    type Response = ChatAppendStreamResponse;
}

/// Successful response of the Slack Web API method [`chat.appendStream`](https://docs.slack.dev/reference/methods/chat.appendStream).
#[doc(alias = "chat.appendStream")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatAppendStreamResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub ts: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.delete`](https://docs.slack.dev/reference/methods/chat.delete): Deletes a message.
///
/// Send it with [`SlackClient::chat_delete`].
#[doc(alias = "chat.delete")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatDeleteRequest {
    /// Channel containing the message to be deleted.
    pub channel: String,
    /// Timestamp of the message to be deleted.
    pub ts: String,
    /// (Legacy) Pass true to delete the message as the authed user with `chat:write:user` scope. Bot users in this context are considered authed users. See [legacy `as_user` parameter](#legacy_as_user) below.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub as_user: Option<bool>,
}

impl ChatDeleteRequest {
    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            ts: ts.into(),
            as_user: None,
        }
    }

    pub fn as_user(mut self, as_user: bool) -> Self {
        self.as_user = Some(as_user);
        self
    }
}

impl SlackApiMethod for ChatDeleteRequest {
    const METHOD: &'static str = "chat.delete";
    type Response = ChatDeleteResponse;
}

/// Successful response of the Slack Web API method [`chat.delete`](https://docs.slack.dev/reference/methods/chat.delete).
#[doc(alias = "chat.delete")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatDeleteResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub ts: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.deleteScheduledMessage`](https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage): Deletes a pending scheduled message from the queue.
///
/// Send it with [`SlackClient::chat_delete_scheduled_message`].
#[doc(alias = "chat.deleteScheduledMessage")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatDeleteScheduledMessageRequest {
    /// The channel the scheduled\_message is posting to
    pub channel: String,
    /// `scheduled_message_id` returned from call to chat.scheduleMessage
    pub scheduled_message_id: String,
    /// Pass true to delete the message as the authed user with `chat:write:user` scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with `chat:write:bot` scope.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub as_user: Option<bool>,
}

impl ChatDeleteScheduledMessageRequest {
    pub fn new(channel: impl Into<String>, scheduled_message_id: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            scheduled_message_id: scheduled_message_id.into(),
            as_user: None,
        }
    }

    pub fn as_user(mut self, as_user: bool) -> Self {
        self.as_user = Some(as_user);
        self
    }
}

impl SlackApiMethod for ChatDeleteScheduledMessageRequest {
    const METHOD: &'static str = "chat.deleteScheduledMessage";
    type Response = ChatDeleteScheduledMessageResponse;
}

/// Successful response of the Slack Web API method [`chat.deleteScheduledMessage`](https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage).
#[doc(alias = "chat.deleteScheduledMessage")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatDeleteScheduledMessageResponse {
    /// Fields returned by Slack. This method has no documented response example.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.getPermalink`](https://docs.slack.dev/reference/methods/chat.getPermalink): Retrieve a permalink URL for a specific extant message
///
/// Send it with [`SlackClient::chat_get_permalink`].
#[doc(alias = "chat.getPermalink")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatGetPermalinkRequest {
    /// The ID of the conversation or channel containing the message
    pub channel: String,
    /// A message's `ts` value, uniquely identifying it within a channel
    pub message_ts: String,
}

impl ChatGetPermalinkRequest {
    pub fn new(channel: impl Into<String>, message_ts: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            message_ts: message_ts.into(),
        }
    }
}

impl SlackApiMethod for ChatGetPermalinkRequest {
    const METHOD: &'static str = "chat.getPermalink";
    type Response = ChatGetPermalinkResponse;
}

/// Successful response of the Slack Web API method [`chat.getPermalink`](https://docs.slack.dev/reference/methods/chat.getPermalink).
#[doc(alias = "chat.getPermalink")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatGetPermalinkResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub permalink: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.meMessage`](https://docs.slack.dev/reference/methods/chat.meMessage): Share a me message into a channel.
///
/// Send it with [`SlackClient::chat_me_message`].
#[doc(alias = "chat.meMessage")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatMeMessageRequest {
    /// Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
    pub channel: String,
    /// Text of the message to send.
    pub text: String,
}

impl ChatMeMessageRequest {
    pub fn new(channel: impl Into<String>, text: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            text: text.into(),
        }
    }
}

impl SlackApiMethod for ChatMeMessageRequest {
    const METHOD: &'static str = "chat.meMessage";
    type Response = ChatMeMessageResponse;
}

/// Successful response of the Slack Web API method [`chat.meMessage`](https://docs.slack.dev/reference/methods/chat.meMessage).
#[doc(alias = "chat.meMessage")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatMeMessageResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub ts: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.postEphemeral`](https://docs.slack.dev/reference/methods/chat.postEphemeral): Sends an ephemeral message to a user in a channel.
///
/// Send it with [`SlackClient::chat_post_ephemeral`].
#[doc(alias = "chat.postEphemeral")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatPostEphemeralRequest {
    /// Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
    pub channel: String,
    /// `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument.
    pub user: String,
    /// (Legacy) Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub as_user: Option<bool>,
    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub attachments: Option<Vec<crate::blocks::Attachment>>,
    /// A JSON-based array of structured blocks, presented as a URL-encoded string.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub blocks: Option<Vec<crate::blocks::Block>>,
    /// Emoji to use as the icon for this message. Overrides `icon_url`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon_emoji: Option<String>,
    /// URL to an image to use as the icon for this message.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon_url: Option<String>,
    /// Find and link channel names and usernames.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub link_names: Option<bool>,
    /// Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub markdown_text: Option<String>,
    /// JSON object with an `entities` array of work object entity metadata, presented as a URL-encoded string. Only entity metadata is supported: ephemeral messages are not persisted and never dispatch `message_metadata_*` events, so `event_type`/`event_payload` message metadata is ignored here. Each entity requires `entity_type`, `entity_payload`, `external_ref`, and `url`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<crate::blocks::MessageMetadata>,
    /// Change how messages are treated. Defaults to `none`. See [below](#formatting).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub parse: Option<String>,
    /// How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// Provide another message's `ts` value to post this message in a thread. Avoid using a reply's `ts` value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_ts: Option<String>,
    /// Set your bot's user name.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
}

impl ChatPostEphemeralRequest {
    pub fn new(channel: impl Into<String>, user: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            user: user.into(),
            as_user: None,
            attachments: None,
            blocks: None,
            icon_emoji: None,
            icon_url: None,
            link_names: None,
            markdown_text: None,
            metadata: None,
            parse: None,
            text: None,
            thread_ts: None,
            username: None,
        }
    }

    pub fn as_user(mut self, as_user: bool) -> Self {
        self.as_user = Some(as_user);
        self
    }

    pub fn attachments(mut self, attachments: Vec<crate::blocks::Attachment>) -> Self {
        self.attachments = Some(attachments);
        self
    }

    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
        self.blocks = Some(blocks);
        self
    }

    pub fn icon_emoji(mut self, icon_emoji: impl Into<String>) -> Self {
        self.icon_emoji = Some(icon_emoji.into());
        self
    }

    pub fn icon_url(mut self, icon_url: impl Into<String>) -> Self {
        self.icon_url = Some(icon_url.into());
        self
    }

    pub fn link_names(mut self, link_names: bool) -> Self {
        self.link_names = Some(link_names);
        self
    }

    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
        self.markdown_text = Some(markdown_text.into());
        self
    }

    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
        self.metadata = Some(metadata);
        self
    }

    pub fn parse(mut self, parse: impl Into<String>) -> Self {
        self.parse = Some(parse.into());
        self
    }

    pub fn text(mut self, text: impl Into<String>) -> Self {
        self.text = Some(text.into());
        self
    }

    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
        self.thread_ts = Some(thread_ts.into());
        self
    }

    pub fn username(mut self, username: impl Into<String>) -> Self {
        self.username = Some(username.into());
        self
    }
}

impl SlackApiMethod for ChatPostEphemeralRequest {
    const METHOD: &'static str = "chat.postEphemeral";
    type Response = ChatPostEphemeralResponse;
}

/// Successful response of the Slack Web API method [`chat.postEphemeral`](https://docs.slack.dev/reference/methods/chat.postEphemeral).
#[doc(alias = "chat.postEphemeral")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatPostEphemeralResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub message_ts: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.postMessage`](https://docs.slack.dev/reference/methods/chat.postMessage): Sends a message to a channel.
///
/// Send it with [`SlackClient::chat_post_message`].
#[doc(alias = "chat.postMessage")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatPostMessageRequest {
    /// An encoded ID or channel name that represents a channel, private group, or IM channel to send the message to. See [below](#channels) for more details.
    pub channel: String,
    /// (Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic apps. See [legacy `as_user` parameter](#legacy_as_user) below.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub as_user: Option<bool>,
    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub attachments: Option<Vec<crate::blocks::Attachment>>,
    /// A JSON-based array of structured blocks, presented as a URL-encoded string.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub blocks: Option<Vec<crate::blocks::Block>>,
    /// This field represents the timestamp of the draft's last update at the time this API is called. If the current message is a draft, this field can be provided to ensure synchronization with the server.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub current_draft_last_updated_ts: Option<String>,
    /// Emoji to use as the icon for this message. Overrides `icon_url`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon_emoji: Option<String>,
    /// URL to an image to use as the icon for this message.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon_url: Option<String>,
    /// Find and link user groups. No longer supports linking individual users; use syntax shown in [Mentioning Users](https://docs.slack.dev/messaging/formatting-message-text.md#mentioning-users) instead.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub link_names: Option<bool>,
    /// Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub markdown_text: Option<String>,
    /// JSON object with event\_type and event\_payload fields, presented as a URL-encoded string. You can also provide Work Object entity metadata using this parameter. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<crate::blocks::MessageMetadata>,
    /// Disable Slack markup parsing by setting to `false`. Enabled by default.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mrkdwn: Option<bool>,
    /// Change how messages are treated. See [below](#formatting).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub parse: Option<String>,
    /// Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply_broadcast: Option<bool>,
    /// How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_ts: Option<String>,
    /// Pass true to enable unfurling of primarily text-based content.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unfurl_links: Option<bool>,
    /// Pass false to disable unfurling of media content.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unfurl_media: Option<bool>,
    /// Set your bot's user name.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
    /// Pass true to unfurl links from installed apps, or false to prevent app links from unfurling. When omitted, app links follow the `unfurl_links` setting.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unfurl_app_links: Option<bool>,
}

impl ChatPostMessageRequest {
    pub fn new(channel: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            as_user: None,
            attachments: None,
            blocks: None,
            current_draft_last_updated_ts: None,
            icon_emoji: None,
            icon_url: None,
            link_names: None,
            markdown_text: None,
            metadata: None,
            mrkdwn: None,
            parse: None,
            reply_broadcast: None,
            text: None,
            thread_ts: None,
            unfurl_links: None,
            unfurl_media: None,
            username: None,
            unfurl_app_links: None,
        }
    }

    pub fn as_user(mut self, as_user: bool) -> Self {
        self.as_user = Some(as_user);
        self
    }

    pub fn attachments(mut self, attachments: Vec<crate::blocks::Attachment>) -> Self {
        self.attachments = Some(attachments);
        self
    }

    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
        self.blocks = Some(blocks);
        self
    }

    pub fn current_draft_last_updated_ts(
        mut self,
        current_draft_last_updated_ts: impl Into<String>,
    ) -> Self {
        self.current_draft_last_updated_ts = Some(current_draft_last_updated_ts.into());
        self
    }

    pub fn icon_emoji(mut self, icon_emoji: impl Into<String>) -> Self {
        self.icon_emoji = Some(icon_emoji.into());
        self
    }

    pub fn icon_url(mut self, icon_url: impl Into<String>) -> Self {
        self.icon_url = Some(icon_url.into());
        self
    }

    pub fn link_names(mut self, link_names: bool) -> Self {
        self.link_names = Some(link_names);
        self
    }

    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
        self.markdown_text = Some(markdown_text.into());
        self
    }

    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
        self.metadata = Some(metadata);
        self
    }

    pub fn mrkdwn(mut self, mrkdwn: bool) -> Self {
        self.mrkdwn = Some(mrkdwn);
        self
    }

    pub fn parse(mut self, parse: impl Into<String>) -> Self {
        self.parse = Some(parse.into());
        self
    }

    pub fn reply_broadcast(mut self, reply_broadcast: bool) -> Self {
        self.reply_broadcast = Some(reply_broadcast);
        self
    }

    pub fn text(mut self, text: impl Into<String>) -> Self {
        self.text = Some(text.into());
        self
    }

    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
        self.thread_ts = Some(thread_ts.into());
        self
    }

    pub fn unfurl_links(mut self, unfurl_links: bool) -> Self {
        self.unfurl_links = Some(unfurl_links);
        self
    }

    pub fn unfurl_media(mut self, unfurl_media: bool) -> Self {
        self.unfurl_media = Some(unfurl_media);
        self
    }

    pub fn username(mut self, username: impl Into<String>) -> Self {
        self.username = Some(username.into());
        self
    }

    pub fn unfurl_app_links(mut self, unfurl_app_links: bool) -> Self {
        self.unfurl_app_links = Some(unfurl_app_links);
        self
    }
}

impl SlackApiMethod for ChatPostMessageRequest {
    const METHOD: &'static str = "chat.postMessage";
    type Response = ChatPostMessageResponse;
}

/// Successful response of the Slack Web API method [`chat.postMessage`](https://docs.slack.dev/reference/methods/chat.postMessage).
#[doc(alias = "chat.postMessage")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatPostMessageResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub ts: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub message: Option<Message>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.scheduleMessage`](https://docs.slack.dev/reference/methods/chat.scheduleMessage): Schedules a message to be sent to a channel.
///
/// Send it with [`SlackClient::chat_schedule_message`].
#[doc(alias = "chat.scheduleMessage")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatScheduleMessageRequest {
    /// Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details.
    pub channel: String,
    /// Unix timestamp representing the future time the message should post to Slack.
    pub post_at: i64,
    /// Set to `true` to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by [new Slack apps](https://docs.slack.dev/quickstart.md). See [chat.postMessage](chat.postMessage#authorship).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub as_user: Option<bool>,
    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub attachments: Option<Vec<crate::blocks::Attachment>>,
    /// A JSON-based array of structured blocks, presented as a URL-encoded string.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub blocks: Option<Vec<crate::blocks::Block>>,
    /// Find and link user groups. No longer supports linking individual users; use syntax shown in [Mentioning Users](https://docs.slack.dev/messaging/formatting-message-text.md#mentioning-users) instead.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub link_names: Option<bool>,
    /// Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub markdown_text: Option<String>,
    /// Change how messages are treated. See [chat.postMessage](chat.postMessage#formatting).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub parse: Option<String>,
    /// Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply_broadcast: Option<bool>,
    /// How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_ts: Option<String>,
    /// Pass true to enable unfurling of primarily text-based content.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unfurl_links: Option<bool>,
    /// Pass false to disable unfurling of media content.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unfurl_media: Option<bool>,
    /// JSON object with event\_type and event\_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<crate::blocks::MessageMetadata>,
}

impl ChatScheduleMessageRequest {
    pub fn new(channel: impl Into<String>, post_at: i64) -> Self {
        Self {
            channel: channel.into(),
            post_at,
            as_user: None,
            attachments: None,
            blocks: None,
            link_names: None,
            markdown_text: None,
            parse: None,
            reply_broadcast: None,
            text: None,
            thread_ts: None,
            unfurl_links: None,
            unfurl_media: None,
            metadata: None,
        }
    }

    pub fn as_user(mut self, as_user: bool) -> Self {
        self.as_user = Some(as_user);
        self
    }

    pub fn attachments(mut self, attachments: Vec<crate::blocks::Attachment>) -> Self {
        self.attachments = Some(attachments);
        self
    }

    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
        self.blocks = Some(blocks);
        self
    }

    pub fn link_names(mut self, link_names: bool) -> Self {
        self.link_names = Some(link_names);
        self
    }

    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
        self.markdown_text = Some(markdown_text.into());
        self
    }

    pub fn parse(mut self, parse: impl Into<String>) -> Self {
        self.parse = Some(parse.into());
        self
    }

    pub fn reply_broadcast(mut self, reply_broadcast: bool) -> Self {
        self.reply_broadcast = Some(reply_broadcast);
        self
    }

    pub fn text(mut self, text: impl Into<String>) -> Self {
        self.text = Some(text.into());
        self
    }

    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
        self.thread_ts = Some(thread_ts.into());
        self
    }

    pub fn unfurl_links(mut self, unfurl_links: bool) -> Self {
        self.unfurl_links = Some(unfurl_links);
        self
    }

    pub fn unfurl_media(mut self, unfurl_media: bool) -> Self {
        self.unfurl_media = Some(unfurl_media);
        self
    }

    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
        self.metadata = Some(metadata);
        self
    }
}

impl SlackApiMethod for ChatScheduleMessageRequest {
    const METHOD: &'static str = "chat.scheduleMessage";
    type Response = ChatScheduleMessageResponse;
}

/// Successful response of the Slack Web API method [`chat.scheduleMessage`](https://docs.slack.dev/reference/methods/chat.scheduleMessage).
#[doc(alias = "chat.scheduleMessage")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatScheduleMessageResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub scheduled_message_id: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub post_at: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub message: Option<ChatScheduleMessageResponseMessage>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatScheduleMessageResponseMessage {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub text: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub username: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub bot_id: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::vec",
        skip_serializing_if = "Vec::is_empty"
    )]
    pub attachments: Vec<MessageAttachment>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub r#type: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub subtype: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.scheduledMessages.list`](https://docs.slack.dev/reference/methods/chat.scheduledMessages.list): Returns a list of scheduled messages.
///
/// Send it with [`SlackClient::chat_scheduled_messages_list`].
#[doc(alias = "chat.scheduledMessages.list")]
#[derive(Debug, Clone, PartialEq, Serialize, Default)]
#[non_exhaustive]
pub struct ChatScheduledMessagesListRequest {
    /// The channel of the scheduled messages
    #[serde(skip_serializing_if = "Option::is_none")]
    pub channel: Option<String>,
    /// For pagination purposes, this is the `cursor` value returned from a previous call to `chat.scheduledmessages.list` indicating where you want to start this call from.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cursor: Option<String>,
    /// A Unix timestamp of the latest value in the time range
    #[serde(skip_serializing_if = "Option::is_none")]
    pub latest: Option<String>,
    /// Maximum number of original entries to return.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limit: Option<i64>,
    /// A Unix timestamp of the oldest value in the time range
    #[serde(skip_serializing_if = "Option::is_none")]
    pub oldest: Option<String>,
    /// encoded team id to list channels in, required if org token is used
    #[serde(skip_serializing_if = "Option::is_none")]
    pub team_id: Option<String>,
}

impl ChatScheduledMessagesListRequest {
    pub fn new() -> Self {
        Self {
            channel: None,
            cursor: None,
            latest: None,
            limit: None,
            oldest: None,
            team_id: None,
        }
    }

    pub fn channel(mut self, channel: impl Into<String>) -> Self {
        self.channel = Some(channel.into());
        self
    }

    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
        self.cursor = Some(cursor.into());
        self
    }

    pub fn latest(mut self, latest: impl Into<String>) -> Self {
        self.latest = Some(latest.into());
        self
    }

    pub fn limit(mut self, limit: i64) -> Self {
        self.limit = Some(limit);
        self
    }

    pub fn oldest(mut self, oldest: impl Into<String>) -> Self {
        self.oldest = Some(oldest.into());
        self
    }

    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
        self.team_id = Some(team_id.into());
        self
    }
}

impl SlackApiMethod for ChatScheduledMessagesListRequest {
    const METHOD: &'static str = "chat.scheduledMessages.list";
    type Response = ChatScheduledMessagesListResponse;
}

impl CursorPaginated for ChatScheduledMessagesListRequest {
    fn set_cursor(&mut self, cursor: String) {
        self.cursor = Some(cursor);
    }
}

impl NextCursor for ChatScheduledMessagesListResponse {
    fn next_cursor(&self) -> Option<&str> {
        self.response_metadata.as_ref()?.next_cursor.as_deref()
    }
}

/// Successful response of the Slack Web API method [`chat.scheduledMessages.list`](https://docs.slack.dev/reference/methods/chat.scheduledMessages.list).
#[doc(alias = "chat.scheduledMessages.list")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatScheduledMessagesListResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::vec",
        skip_serializing_if = "Vec::is_empty"
    )]
    pub scheduled_messages: Vec<ChatScheduledMessagesListResponseScheduledMessages>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatScheduledMessagesListResponseScheduledMessages {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_i64",
        skip_serializing_if = "Option::is_none"
    )]
    pub id: Option<i64>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel_id: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_i64",
        skip_serializing_if = "Option::is_none"
    )]
    pub post_at: Option<i64>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_i64",
        skip_serializing_if = "Option::is_none"
    )]
    pub date_created: Option<i64>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub text: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.startStream`](https://docs.slack.dev/reference/methods/chat.startStream): Start a new streaming conversation
///
/// Send it with [`SlackClient::chat_start_stream`].
#[doc(alias = "chat.startStream")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatStartStreamRequest {
    /// An encoded ID that represents a channel, thread, or DM.
    pub channel: String,
    /// Array of streaming chunks. Can include [markdown text chunk](#markdown_text-chunks) objects, [task update chunk](#task_update-chunks) objects, [plan update chunks](#plan_update-chunks), or [blocks chunks](#blocks-chunks).
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub chunks: Option<Vec<serde_json::Value>>,
    /// Accepts message text formatted in markdown. Limit this field to 12,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub markdown_text: Option<String>,
    /// Provide another message's `ts` value to reply to. Omit it to stream a top-level message instead of a thread reply; this is only supported in channels where the whole channel is one session, such as Slack Code, and returns `invalid_thread_ts` elsewhere. Passing `"0"` is equivalent to omitting it.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_ts: Option<String>,
    /// The encoded ID of the user to receive the streaming text. Required when streaming to channels.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recipient_user_id: Option<String>,
    /// The encoded ID of the team the user receiving the streaming text belongs to. Required when streaming to channels.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recipient_team_id: Option<String>,
    /// Specifies how tasks are displayed in the message. `timeline` task updates render as individual task cards interleaved with streamed text. `plan` task updates render together in a plan block.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub task_display_mode: Option<String>,
    /// Emoji to use as the icon for this message. Overrides `icon_url`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon_emoji: Option<String>,
    /// Image URL to use as the icon for this message.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub icon_url: Option<String>,
    /// The bot's username to display.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
}

impl ChatStartStreamRequest {
    pub fn new(channel: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            chunks: None,
            markdown_text: None,
            thread_ts: None,
            recipient_user_id: None,
            recipient_team_id: None,
            task_display_mode: None,
            icon_emoji: None,
            icon_url: None,
            username: None,
        }
    }

    pub fn chunks(mut self, chunks: Vec<serde_json::Value>) -> Self {
        self.chunks = Some(chunks);
        self
    }

    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
        self.markdown_text = Some(markdown_text.into());
        self
    }

    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
        self.thread_ts = Some(thread_ts.into());
        self
    }

    pub fn recipient_user_id(mut self, recipient_user_id: impl Into<String>) -> Self {
        self.recipient_user_id = Some(recipient_user_id.into());
        self
    }

    pub fn recipient_team_id(mut self, recipient_team_id: impl Into<String>) -> Self {
        self.recipient_team_id = Some(recipient_team_id.into());
        self
    }

    pub fn task_display_mode(mut self, task_display_mode: impl Into<String>) -> Self {
        self.task_display_mode = Some(task_display_mode.into());
        self
    }

    pub fn icon_emoji(mut self, icon_emoji: impl Into<String>) -> Self {
        self.icon_emoji = Some(icon_emoji.into());
        self
    }

    pub fn icon_url(mut self, icon_url: impl Into<String>) -> Self {
        self.icon_url = Some(icon_url.into());
        self
    }

    pub fn username(mut self, username: impl Into<String>) -> Self {
        self.username = Some(username.into());
        self
    }
}

impl SlackApiMethod for ChatStartStreamRequest {
    const METHOD: &'static str = "chat.startStream";
    type Response = ChatStartStreamResponse;
}

/// Successful response of the Slack Web API method [`chat.startStream`](https://docs.slack.dev/reference/methods/chat.startStream).
#[doc(alias = "chat.startStream")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatStartStreamResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub ts: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.stopStream`](https://docs.slack.dev/reference/methods/chat.stopStream): Stop a streaming conversation
///
/// Send it with [`SlackClient::chat_stop_stream`].
#[doc(alias = "chat.stopStream")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatStopStreamRequest {
    /// An encoded ID that represents a channel, private group, or DM
    pub channel: String,
    /// The timestamp of the streaming message.
    pub ts: String,
    /// Array of streaming chunks. Can include [markdown text chunk](#markdown_text-chunks) objects, [task update chunk](#task_update-chunks) objects, [plan update chunks](#plan_update-chunks), or [blocks chunks](#blocks-chunks).
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub chunks: Option<Vec<serde_json::Value>>,
    /// Accepts message text formatted in markdown. Limit this field to 12,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub markdown_text: Option<String>,
    /// A list of blocks that will be rendered at the bottom of the finalized message.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub blocks: Option<Vec<crate::blocks::Block>>,
    /// JSON object with event\_type and event\_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<crate::blocks::MessageMetadata>,
    /// The session status to set after stopping the stream.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub session_status: Option<String>,
}

impl ChatStopStreamRequest {
    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            ts: ts.into(),
            chunks: None,
            markdown_text: None,
            blocks: None,
            metadata: None,
            session_status: None,
        }
    }

    pub fn chunks(mut self, chunks: Vec<serde_json::Value>) -> Self {
        self.chunks = Some(chunks);
        self
    }

    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
        self.markdown_text = Some(markdown_text.into());
        self
    }

    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
        self.blocks = Some(blocks);
        self
    }

    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
        self.metadata = Some(metadata);
        self
    }

    pub fn session_status(mut self, session_status: impl Into<String>) -> Self {
        self.session_status = Some(session_status.into());
        self
    }
}

impl SlackApiMethod for ChatStopStreamRequest {
    const METHOD: &'static str = "chat.stopStream";
    type Response = ChatStopStreamResponse;
}

/// Successful response of the Slack Web API method [`chat.stopStream`](https://docs.slack.dev/reference/methods/chat.stopStream).
#[doc(alias = "chat.stopStream")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatStopStreamResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub ts: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub message: Option<Message>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.unfurl`](https://docs.slack.dev/reference/methods/chat.unfurl): Provide custom unfurl behavior for user-posted URLs
///
/// Send it with [`SlackClient::chat_unfurl`].
#[doc(alias = "chat.unfurl")]
#[derive(Debug, Clone, PartialEq, Serialize, Default)]
#[non_exhaustive]
pub struct ChatUnfurlRequest {
    /// Channel ID of the message. Both `channel` and `ts` must be provided together, _or_ `unfurl_id` and `source` must be provided together. Required for public channels.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub channel: Option<String>,
    /// Timestamp of the message to add unfurl behavior to. Required for public channels.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ts: Option<String>,
    /// URL-encoded JSON map with keys set to URLs featured in the message, pointing to their unfurl blocks or message attachments. Required for public channels.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unfurls: Option<String>,
    /// Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, `Not now` or `Never ask me again`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user_auth_message: Option<String>,
    /// Set to `true` or `1` to indicate the user must install your Slack app to trigger unfurls for this domain
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user_auth_required: Option<bool>,
    /// Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub user_auth_url: Option<String>,
    /// Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub user_auth_blocks: Option<Vec<crate::blocks::Block>>,
    /// The ID of the link to unfurl. Both `unfurl_id` and `source` must be provided together, _or_ `channel` and `ts` must be provided together.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unfurl_id: Option<String>,
    /// The source of the link to unfurl. The source may either be `composer`, when the link is inside the message composer, or `conversations_history`, when the link has been posted to a conversation.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
}

impl ChatUnfurlRequest {
    pub fn new() -> Self {
        Self {
            channel: None,
            ts: None,
            unfurls: None,
            user_auth_message: None,
            user_auth_required: None,
            user_auth_url: None,
            user_auth_blocks: None,
            unfurl_id: None,
            source: None,
        }
    }

    pub fn channel(mut self, channel: impl Into<String>) -> Self {
        self.channel = Some(channel.into());
        self
    }

    pub fn ts(mut self, ts: impl Into<String>) -> Self {
        self.ts = Some(ts.into());
        self
    }

    pub fn unfurls(mut self, unfurls: impl Into<String>) -> Self {
        self.unfurls = Some(unfurls.into());
        self
    }

    pub fn user_auth_message(mut self, user_auth_message: impl Into<String>) -> Self {
        self.user_auth_message = Some(user_auth_message.into());
        self
    }

    pub fn user_auth_required(mut self, user_auth_required: bool) -> Self {
        self.user_auth_required = Some(user_auth_required);
        self
    }

    pub fn user_auth_url(mut self, user_auth_url: impl Into<String>) -> Self {
        self.user_auth_url = Some(user_auth_url.into());
        self
    }

    pub fn user_auth_blocks(mut self, user_auth_blocks: Vec<crate::blocks::Block>) -> Self {
        self.user_auth_blocks = Some(user_auth_blocks);
        self
    }

    pub fn unfurl_id(mut self, unfurl_id: impl Into<String>) -> Self {
        self.unfurl_id = Some(unfurl_id.into());
        self
    }

    pub fn source(mut self, source: impl Into<String>) -> Self {
        self.source = Some(source.into());
        self
    }
}

impl SlackApiMethod for ChatUnfurlRequest {
    const METHOD: &'static str = "chat.unfurl";
    type Response = ChatUnfurlResponse;
}

/// Successful response of the Slack Web API method [`chat.unfurl`](https://docs.slack.dev/reference/methods/chat.unfurl).
#[doc(alias = "chat.unfurl")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatUnfurlResponse {
    /// Fields returned by Slack. This method has no documented response example.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

/// Arguments for the Slack Web API method [`chat.update`](https://docs.slack.dev/reference/methods/chat.update): Updates a message.
///
/// Send it with [`SlackClient::chat_update`].
#[doc(alias = "chat.update")]
#[derive(Debug, Clone, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChatUpdateRequest {
    /// Channel containing the message to be updated. For direct messages, ensure that this value is a DM ID (starts with `D`) instead of a User ID (starts with either `U` or `W`).
    pub channel: String,
    /// Timestamp of the message to be updated.
    pub ts: String,
    /// Pass true to update the message as the authed user. Bot users in this context are considered authed users.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub as_user: Option<bool>,
    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub attachments: Option<Vec<crate::blocks::Attachment>>,
    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unfurled_attachments: Option<String>,
    /// A JSON-based array of structured blocks, presented as a URL-encoded string.
    #[serde(
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::form::as_json"
    )]
    pub blocks: Option<Vec<crate::blocks::Block>>,
    /// Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub markdown_text: Option<String>,
    /// JSON object with event\_type and event\_payload fields, presented as a URL-encoded string. If you don't include this field, the message's previous `metadata` will be retained. To remove previous `metadata`, include an empty object for this field. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<crate::blocks::MessageMetadata>,
    /// Find and link channel names and usernames. Defaults to `none`. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, `none`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub link_names: Option<bool>,
    /// Change how messages are treated. Defaults to `client`, unlike `chat.postMessage`. Accepts either `none` or `full`. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, `client`.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub parse: Option<String>,
    /// How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply_broadcast: Option<bool>,
    /// Array of new file ids that will be sent with this message.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub file_ids: Option<Vec<String>>,
}

impl ChatUpdateRequest {
    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
        Self {
            channel: channel.into(),
            ts: ts.into(),
            as_user: None,
            attachments: None,
            unfurled_attachments: None,
            blocks: None,
            markdown_text: None,
            metadata: None,
            link_names: None,
            parse: None,
            text: None,
            reply_broadcast: None,
            file_ids: None,
        }
    }

    pub fn as_user(mut self, as_user: bool) -> Self {
        self.as_user = Some(as_user);
        self
    }

    pub fn attachments(mut self, attachments: Vec<crate::blocks::Attachment>) -> Self {
        self.attachments = Some(attachments);
        self
    }

    pub fn unfurled_attachments(mut self, unfurled_attachments: impl Into<String>) -> Self {
        self.unfurled_attachments = Some(unfurled_attachments.into());
        self
    }

    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
        self.blocks = Some(blocks);
        self
    }

    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
        self.markdown_text = Some(markdown_text.into());
        self
    }

    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
        self.metadata = Some(metadata);
        self
    }

    pub fn link_names(mut self, link_names: bool) -> Self {
        self.link_names = Some(link_names);
        self
    }

    pub fn parse(mut self, parse: impl Into<String>) -> Self {
        self.parse = Some(parse.into());
        self
    }

    pub fn text(mut self, text: impl Into<String>) -> Self {
        self.text = Some(text.into());
        self
    }

    pub fn reply_broadcast(mut self, reply_broadcast: bool) -> Self {
        self.reply_broadcast = Some(reply_broadcast);
        self
    }

    pub fn file_ids(mut self, file_ids: Vec<String>) -> Self {
        self.file_ids = Some(file_ids);
        self
    }
}

impl SlackApiMethod for ChatUpdateRequest {
    const METHOD: &'static str = "chat.update";
    type Response = ChatUpdateResponse;
}

/// Successful response of the Slack Web API method [`chat.update`](https://docs.slack.dev/reference/methods/chat.update).
#[doc(alias = "chat.update")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatUpdateResponse {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub ts: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub text: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub message: Option<ChatUpdateResponseMessage>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_object",
        skip_serializing_if = "Option::is_none"
    )]
    pub response_metadata: Option<ResponseMetadata>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub warning: Option<String>,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ChatUpdateResponseMessage {
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub text: Option<String>,
    #[serde(
        default,
        deserialize_with = "crate::de::opt_string",
        skip_serializing_if = "Option::is_none"
    )]
    pub user: Option<String>,
}

impl SlackClient {
    /// Calls the Slack Web API method [`chat.appendStream`](https://docs.slack.dev/reference/methods/chat.appendStream): Append text to an existing streaming conversation
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    ///
    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.appendStream")]
    pub async fn chat_append_stream(
        &self,
        request: &ChatAppendStreamRequest,
    ) -> Result<ChatAppendStreamResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.delete`](https://docs.slack.dev/reference/methods/chat.delete): Deletes a message.
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    /// - user token: `chat:write`
    ///
    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.delete")]
    pub async fn chat_delete(
        &self,
        request: &ChatDeleteRequest,
    ) -> Result<ChatDeleteResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.deleteScheduledMessage`](https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage): Deletes a pending scheduled message from the queue.
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    /// - user token: `chat:write`
    ///
    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.deleteScheduledMessage")]
    pub async fn chat_delete_scheduled_message(
        &self,
        request: &ChatDeleteScheduledMessageRequest,
    ) -> Result<ChatDeleteScheduledMessageResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.getPermalink`](https://docs.slack.dev/reference/methods/chat.getPermalink): Retrieve a permalink URL for a specific extant message
    ///
    /// Rate limit: Tier 5 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.getPermalink")]
    pub async fn chat_get_permalink(
        &self,
        request: &ChatGetPermalinkRequest,
    ) -> Result<ChatGetPermalinkResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.meMessage`](https://docs.slack.dev/reference/methods/chat.meMessage): Share a me message into a channel.
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    /// - user token: `chat:write`
    ///
    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.meMessage")]
    pub async fn chat_me_message(
        &self,
        request: &ChatMeMessageRequest,
    ) -> Result<ChatMeMessageResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.postEphemeral`](https://docs.slack.dev/reference/methods/chat.postEphemeral): Sends an ephemeral message to a user in a channel.
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    /// - user token: `chat:write`
    ///
    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.postEphemeral")]
    pub async fn chat_post_ephemeral(
        &self,
        request: &ChatPostEphemeralRequest,
    ) -> Result<ChatPostEphemeralResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.postMessage`](https://docs.slack.dev/reference/methods/chat.postMessage): Sends a message to a channel.
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    /// - user token: `chat:write`
    ///
    /// Rate limit: Tier 5 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.postMessage")]
    pub async fn chat_post_message(
        &self,
        request: &ChatPostMessageRequest,
    ) -> Result<ChatPostMessageResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.scheduleMessage`](https://docs.slack.dev/reference/methods/chat.scheduleMessage): Schedules a message to be sent to a channel.
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    /// - user token: `chat:write`
    ///
    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.scheduleMessage")]
    pub async fn chat_schedule_message(
        &self,
        request: &ChatScheduleMessageRequest,
    ) -> Result<ChatScheduleMessageResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.scheduledMessages.list`](https://docs.slack.dev/reference/methods/chat.scheduledMessages.list): Returns a list of scheduled messages.
    ///
    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.scheduledMessages.list")]
    pub async fn chat_scheduled_messages_list(
        &self,
        request: &ChatScheduledMessagesListRequest,
    ) -> Result<ChatScheduledMessagesListResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.startStream`](https://docs.slack.dev/reference/methods/chat.startStream): Start a new streaming conversation
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    ///
    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.startStream")]
    pub async fn chat_start_stream(
        &self,
        request: &ChatStartStreamRequest,
    ) -> Result<ChatStartStreamResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.stopStream`](https://docs.slack.dev/reference/methods/chat.stopStream): Stop a streaming conversation
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    ///
    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.stopStream")]
    pub async fn chat_stop_stream(
        &self,
        request: &ChatStopStreamRequest,
    ) -> Result<ChatStopStreamResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.unfurl`](https://docs.slack.dev/reference/methods/chat.unfurl): Provide custom unfurl behavior for user-posted URLs
    ///
    /// Required scopes:
    ///
    /// - bot token: `links:write`
    /// - user token: `links:write`
    ///
    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.unfurl")]
    pub async fn chat_unfurl(
        &self,
        request: &ChatUnfurlRequest,
    ) -> Result<ChatUnfurlResponse, SlackError> {
        self.call(request).await
    }

    /// Calls the Slack Web API method [`chat.update`](https://docs.slack.dev/reference/methods/chat.update): Updates a message.
    ///
    /// Required scopes:
    ///
    /// - bot token: `chat:write`
    /// - user token: `chat:write`
    ///
    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
    ///
    /// # Errors
    ///
    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
    #[doc(alias = "chat.update")]
    pub async fn chat_update(
        &self,
        request: &ChatUpdateRequest,
    ) -> Result<ChatUpdateResponse, SlackError> {
        self.call(request).await
    }
}