Source file values.ml

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
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
(* generated by: awso-codegen generate-all --botocore-data vendor/botocore/botocore/data -o aws --runtime-dir lib/runtime/awso --cli-dir awso-cli *)
open Awso
open! Import
[@@@warning "-32"]
let service = Service.aiops
let apiVersion = "2018-05-10"
let endpointPrefix = "aiops"
let serviceFullName = "AWS AI Ops"
let signatureVersion = "v4"
let protocol = "rest_json"
let globalEndpoint = endpointPrefix ^ ".amazonaws.com"
let simple_to_json to_value x =
  Botodata.Json.value_to_json_scalar (to_value x)
let composed_to_json to_value x = Botodata.Json.value_to_json (to_value x)
let to_query to_value x = Client.Query.of_value (to_value x)
let structure_to_value_aux st ~f =
  let filter = function | (k, Some v) -> Some (k, v) | _ -> None in
  let pair k v = (k, v) in
  let defer_value (k, dv) = pair k dv in
  ((List.filter_map st ~f:filter) |> (List.map ~f:defer_value)) |>
    (fun x -> `Structure (f x))
let structure_to_value = structure_to_value_aux ~f:Fn.id
let structure_to_wrapped_value ~wrapper ~response =
  structure_to_value_aux
    ~f:(fun x -> [(wrapper, (`Structure x)); (response, (`Structure []))])
module ChatConfigurationArn =
  struct
    type nonrec t = string
    let context_ = "ChatConfigurationArn"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:20) >>=
             (fun () ->
                (check_string_max i ~max:2048) >>=
                  (fun () -> check_pattern i ~pattern:"arn:.*")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"ChatConfigurationArn" j
    let to_json = simple_to_json to_value
  end
module RoleArn =
  struct
    type nonrec t = string
    let context_ = "RoleArn"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:20) >>=
             (fun () ->
                (check_string_max i ~max:2048) >>=
                  (fun () -> check_pattern i ~pattern:"arn:.*")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"RoleArn" j
    let to_json = simple_to_json to_value
  end
module InvestigationGroupArn =
  struct
    type nonrec t = string
    let context_ = "InvestigationGroupArn"
    let make i =
      let open Result in
        ok_or_failwith
          (check_pattern i
             ~pattern:"arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):aiops:[a-zA-Z0-9-]*:[0-9]{12}:investigation-group\\/[A-Za-z0-9]{16}");
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"InvestigationGroupArn" j
    let to_json = simple_to_json to_value
  end
module StringWithPatternAndLengthLimits =
  struct
    type nonrec t = string
    let context_ = "StringWithPatternAndLengthLimits"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:512) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"[\\-_A-Za-z0-9\\[\\]\\(\\)\\{\\}\\.: ]+")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"StringWithPatternAndLengthLimits" j
    let to_json = simple_to_json to_value
  end
module ChatConfigurationArns =
  struct
    type nonrec t = ChatConfigurationArn.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:5) >>= (fun () -> check_list_min i ~min:1));
        i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:ChatConfigurationArn.to_value)) |>
        (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:ChatConfigurationArn.of_xml)
    let of_json j =
      list_of_json ~kind:"ChatConfigurationArns"
        ~of_json:ChatConfigurationArn.of_json j
    let to_json v = composed_to_json to_value v
  end
module SNSTopicArn =
  struct
    type nonrec t = string
    let context_ = "SNSTopicArn"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:20) >>=
             (fun () ->
                (check_string_max i ~max:2048) >>=
                  (fun () -> check_pattern i ~pattern:"arn:.*")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"SNSTopicArn" j
    let to_json = simple_to_json to_value
  end
module CrossAccountConfiguration =
  struct
    type nonrec t =
      {
      sourceRoleArn: RoleArn.t option
        [@ocaml.doc
          "The ARN of an existing role which will be used to do investigations on your behalf."]}
    let make ?sourceRoleArn = fun () -> { sourceRoleArn }
    let to_value x =
      structure_to_value
        [("sourceRoleArn", (Option.map x.sourceRoleArn ~f:RoleArn.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let sourceRoleArn =
        (Option.map ~f:RoleArn.of_xml) (Xml.child xml_arg0 "sourceRoleArn") in
      make ?sourceRoleArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let sourceRoleArn = field_map json__ "sourceRoleArn" RoleArn.of_json in
      make ?sourceRoleArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "This structure contains information about the cross-account configuration in the account."]
module EncryptionConfigurationType =
  struct
    type nonrec t =
      | AWS_OWNED_KEY 
      | CUSTOMER_MANAGED_KMS_KEY 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | AWS_OWNED_KEY -> "AWS_OWNED_KEY"
      | CUSTOMER_MANAGED_KMS_KEY -> "CUSTOMER_MANAGED_KMS_KEY"
      | Non_static_id s -> s
    let of_string =
      function
      | "AWS_OWNED_KEY" -> AWS_OWNED_KEY
      | "CUSTOMER_MANAGED_KMS_KEY" -> CUSTOMER_MANAGED_KMS_KEY
      | x -> Non_static_id x
    let to_value x = `Enum (to_string x)
    let to_query v = to_query to_value v
    let to_header x = to_string x
    let of_xml xml_arg0 =
      of_string
        (string_of_xml ~kind:"enumeration EncryptionConfigurationType"
           xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"EncryptionConfigurationType" j)
    let to_json = simple_to_json to_value
  end
module KmsKeyId =
  struct
    type nonrec t = string
    let context_ = "KmsKeyId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:256) >>=
                  (fun () -> check_pattern i ~pattern:"arn:.*")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"KmsKeyId" j
    let to_json = simple_to_json to_value
  end
module TagKey =
  struct
    type nonrec t = string
    let context_ = "TagKey"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:128) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]+)")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"TagKey" j
    let to_json = simple_to_json to_value
  end
module String_ =
  struct
    type nonrec t = string
    let context_ = "String"
    let make i = i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"String" j
    let to_json = simple_to_json to_value
  end
module TagValue =
  struct
    type nonrec t = string
    let context_ = "TagValue"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:256) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"TagValue" j
    let to_json = simple_to_json to_value
  end
module ListInvestigationGroupsModel =
  struct
    type nonrec t =
      {
      arn: InvestigationGroupArn.t option
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the investigation group."];
      name: StringWithPatternAndLengthLimits.t option
        [@ocaml.doc "The name of the investigation group."]}
    let make ?arn = fun ?name -> fun () -> { arn; name }
    let to_value x =
      structure_to_value
        [("arn", (Option.map x.arn ~f:InvestigationGroupArn.to_value));
        ("name",
          (Option.map x.name ~f:StringWithPatternAndLengthLimits.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let name =
        (Option.map ~f:StringWithPatternAndLengthLimits.of_xml)
          (Xml.child xml_arg0 "name") in
      let arn =
        (Option.map ~f:InvestigationGroupArn.of_xml)
          (Xml.child xml_arg0 "arn") in
      make ?name ?arn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let name =
        field_map json__ "name" StringWithPatternAndLengthLimits.of_json in
      let arn = field_map json__ "arn" InvestigationGroupArn.of_json in
      make ?name ?arn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "This structure contains information about one investigation group in the account."]
module Boolean =
  struct
    type nonrec t = bool
    let make i = i
    let of_string = Bool.of_string
    let to_value x = `Boolean x
    let to_query v = to_query to_value v
    let to_header x = Bool.to_string x
    let of_xml xml_arg0 =
      Bool.of_string (string_of_xml ~kind:"a boolean" xml_arg0)
    let of_json = bool_of_json
    let to_json = simple_to_json to_value
  end
module ChatbotNotificationChannel =
  struct
    type nonrec t = (SNSTopicArn.t * ChatConfigurationArns.t) list
    let make i = i
    let of_header xs =
      make
        (List.filter_map xs
           ~f:(fun (k, v) ->
                 (Base.String.chop_prefix k ~prefix:"x-amz-meta-") |>
                   (Option.map
                      ~f:(fun chopped ->
                            let (_ : string) = v in
                            let (_ : string) = chopped in
                            failwith
                              "no of_header for complex types SNSTopicArn ChatConfigurationArns"))))
    let to_value xs =
      (xs |>
         (List.map
            ~f:(fun (x, y) ->
                  (SNSTopicArn.to_value x) |>
                    (fun x ->
                       (ChatConfigurationArns.to_value y) |>
                         (fun y -> (x, y))))))
        |> (fun x -> `Map x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for Map_shape objects" ()
    let of_xml _ =
      failwith "of_xml_converter_of_shape: Map_shape case not implemented"
    let of_json j =
      object_of_json ~key_of_string:SNSTopicArn.of_string
        ~of_json:ChatConfigurationArns.of_json j
    let to_json v = composed_to_json to_value v
  end
module CrossAccountConfigurations =
  struct
    type nonrec t = CrossAccountConfiguration.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:25) >>= (fun () -> check_list_min i ~min:0));
        i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:CrossAccountConfiguration.to_value)) |>
        (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:CrossAccountConfiguration.of_xml)
    let of_json j =
      list_of_json ~kind:"CrossAccountConfigurations"
        ~of_json:CrossAccountConfiguration.of_json j
    let to_json v = composed_to_json to_value v
  end
module EncryptionConfiguration =
  struct
    type nonrec t =
      {
      type_: EncryptionConfigurationType.t option
        [@ocaml.doc
          "Displays whether investigation data is encrypted by a customer managed key or an Amazon Web Services owned key."];
      kmsKeyId: KmsKeyId.t option
        [@ocaml.doc
          "If the investigation group uses a customer managed key for encryption, this field displays the ID of that key."]}
    let make ?type_ = fun ?kmsKeyId -> fun () -> { type_; kmsKeyId }
    let to_value x =
      structure_to_value
        [("type",
           (Option.map x.type_ ~f:EncryptionConfigurationType.to_value));
        ("kmsKeyId", (Option.map x.kmsKeyId ~f:KmsKeyId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let kmsKeyId =
        (Option.map ~f:KmsKeyId.of_xml) (Xml.child xml_arg0 "kmsKeyId") in
      let type_ =
        (Option.map ~f:EncryptionConfigurationType.of_xml)
          (Xml.child xml_arg0 "type") in
      make ?kmsKeyId ?type_ ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let kmsKeyId = field_map json__ "kmsKeyId" KmsKeyId.of_json in
      let type_ = field_map json__ "type" EncryptionConfigurationType.of_json in
      make ?kmsKeyId ?type_ ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Use this structure to specify a customer managed KMS key to use to encrypt investigation data."]
module InvestigationGroupIdentifier =
  struct
    type nonrec t = string
    let context_ = "InvestigationGroupIdentifier"
    let make i =
      let open Result in
        ok_or_failwith
          (check_pattern i
             ~pattern:"(?:[\\-_A-Za-z0-9]{1,512}|arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):aiops:[a-zA-Z0-9-]*:[0-9]{12}:investigation-group\\/[A-Za-z0-9]{16})");
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"InvestigationGroupIdentifier" j
    let to_json = simple_to_json to_value
  end
module TagKeyBoundaries =
  struct
    type nonrec t = TagKey.t list
    let make i = i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:TagKey.to_value)) |> (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:TagKey.of_xml)
    let of_json j =
      list_of_json ~kind:"TagKeyBoundaries" ~of_json:TagKey.of_json j
    let to_json v = composed_to_json to_value v
  end
module AccessDeniedException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "You don't have sufficient permissions to perform this action."]
module ConflictException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "This operation couldn't be completed because of a conflict in resource states."]
module ForbiddenException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Access id denied for this operation, or this operation is not valid for the specified resource."]
module InternalServerException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "An internal server error occurred. You can try again later."]
module ResourceNotFoundException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "The specified resource doesn't exist."]
module ThrottlingException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The request was throttled because of quota limits. You can try again later."]
module ValidationException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "This operation or its parameters aren't formatted correctly."]
module TagKeys =
  struct
    type nonrec t = TagKey.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:50) >>= (fun () -> check_list_min i ~min:0));
        i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:TagKey.to_value)) |> (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:TagKey.of_xml)
    let of_json j = list_of_json ~kind:"TagKeys" ~of_json:TagKey.of_json j
    let to_json v = composed_to_json to_value v
  end
module Tags =
  struct
    type nonrec t = (TagKey.t * TagValue.t) list
    let make i = i
    let of_header xs =
      make
        (List.filter_map xs
           ~f:(fun (k, v) ->
                 (Base.String.chop_prefix k ~prefix:"x-amz-meta-") |>
                   (Option.map
                      ~f:(fun chopped ->
                            ((TagKey.of_string chopped),
                              (TagValue.of_string v))))))
    let to_value xs =
      (xs |>
         (List.map
            ~f:(fun (x, y) ->
                  (TagKey.to_value x) |>
                    (fun x -> (TagValue.to_value y) |> (fun y -> (x, y))))))
        |> (fun x -> `Map x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for Map_shape objects" ()
    let of_xml _ =
      failwith "of_xml_converter_of_shape: Map_shape case not implemented"
    let of_json j =
      object_of_json ~key_of_string:TagKey.of_string
        ~of_json:TagValue.of_json j
    let to_json v = composed_to_json to_value v
  end
module InvestigationGroupPolicyDocument =
  struct
    type nonrec t = string
    let context_ = "InvestigationGroupPolicyDocument"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:32768) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"[\\u0009\\u000A\\u000D\\u0020-\\u00FF]+")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"InvestigationGroupPolicyDocument" j
    let to_json = simple_to_json to_value
  end
module InvestigationGroups =
  struct
    type nonrec t = ListInvestigationGroupsModel.t list
    let make i = i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:ListInvestigationGroupsModel.to_value)) |>
        (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:ListInvestigationGroupsModel.of_xml)
    let of_json j =
      list_of_json ~kind:"InvestigationGroups"
        ~of_json:ListInvestigationGroupsModel.of_json j
    let to_json v = composed_to_json to_value v
  end
module SensitiveStringWithLengthLimits =
  struct
    type nonrec t = string
    let context_ = "SensitiveStringWithLengthLimits"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:2048) >>=
             (fun () -> check_string_min i ~min:0));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"SensitiveStringWithLengthLimits" j
    let to_json = simple_to_json to_value
  end
module ListInvestigationGroupsInputMaxResultsInteger =
  struct
    type nonrec t = int
    let make i =
      let open Result in
        ok_or_failwith
          ((check_int_max i ~max:50) >>= (fun () -> check_int_min i ~min:1));
        i
    let of_string = Int.of_string
    let to_value x = `Integer x
    let to_query v = to_query to_value v
    let to_header x = Int.to_string x
    let of_xml xml_arg0 =
      Int.of_string
        (string_of_xml
           ~kind:"an integer for ListInvestigationGroupsInputMaxResultsInteger"
           xml_arg0)
    let of_json j = Int.of_float (float_of_json ~kind:"an integer" j)
    let to_json = simple_to_json to_value
  end
module IdentifierStringWithPatternAndLengthLimits =
  struct
    type nonrec t = string
    let context_ = "IdentifierStringWithPatternAndLengthLimits"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:512) >>=
                  (fun () ->
                     check_pattern i ~pattern:"[\\-_\\/A-Za-z0-9:\\.]+")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j =
      string_of_json ~kind:"IdentifierStringWithPatternAndLengthLimits" j
    let to_json = simple_to_json to_value
  end
module Long =
  struct
    type nonrec t = Int64.t
    let make i = i
    let of_string = Int64.of_string
    let to_value x = `Long x
    let to_query v = to_query to_value v
    let to_header x = Int64.to_string x
    let of_xml xml_arg0 =
      Int64.of_string (string_of_xml ~kind:"a long" xml_arg0)
    let of_json j = Int64.of_float (float_of_json ~kind:"a long" j)
    let to_json = simple_to_json to_value
  end
module Retention =
  struct
    type nonrec t = Int64.t
    let make i =
      let open Result in
        ok_or_failwith
          ((check_int64_max i ~max:90L) >>=
             (fun () -> check_int64_min i ~min:7L));
        i
    let of_string = Int64.of_string
    let to_value x = `Long x
    let to_query v = to_query to_value v
    let to_header x = Int64.to_string x
    let of_xml xml_arg0 =
      Int64.of_string (string_of_xml ~kind:"a long" xml_arg0)
    let of_json j = Int64.of_float (float_of_json ~kind:"a long" j)
    let to_json = simple_to_json to_value
  end
module ServiceQuotaExceededException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      resourceId: String_.t option
        [@ocaml.doc "The resource that caused the quota exception."];
      resourceType: String_.t option
        [@ocaml.doc "The type of resource that caused the quota exception."];
      serviceCode: String_.t option
        [@ocaml.doc "This name of the service associated with the error."];
      quotaCode: String_.t option
        [@ocaml.doc "This quota that was exceeded."]}
    let make ?message =
      fun ?resourceId ->
        fun ?resourceType ->
          fun ?serviceCode ->
            fun ?quotaCode ->
              fun () ->
                { message; resourceId; resourceType; serviceCode; quotaCode }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("resourceId", (Option.map x.resourceId ~f:String_.to_value));
        ("resourceType", (Option.map x.resourceType ~f:String_.to_value));
        ("serviceCode", (Option.map x.serviceCode ~f:String_.to_value));
        ("quotaCode", (Option.map x.quotaCode ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let quotaCode =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "quotaCode") in
      let serviceCode =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "serviceCode") in
      let resourceType =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "resourceType") in
      let resourceId =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "resourceId") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?quotaCode ?serviceCode ?resourceType ?resourceId ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let quotaCode = field_map json__ "quotaCode" String_.of_json in
      let serviceCode = field_map json__ "serviceCode" String_.of_json in
      let resourceType = field_map json__ "resourceType" String_.of_json in
      let resourceId = field_map json__ "resourceId" String_.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?quotaCode ?serviceCode ?resourceType ?resourceId ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "This request exceeds a service quota."]
module UpdateInvestigationGroupRequest =
  struct
    type nonrec t =
      {
      identifier: InvestigationGroupIdentifier.t
        [@ocaml.doc
          "Specify either the name or the ARN of the investigation group that you want to modify."];
      roleArn: RoleArn.t option
        [@ocaml.doc
          "Specify this field if you want to change the IAM role that CloudWatch investigations will use when it gathers investigation data. To do so, specify the ARN of the new role. The permissions in this role determine which of your resources that CloudWatch investigations will have access to during investigations. For more information, see How to control what data CloudWatch investigations has access to during investigations."];
      encryptionConfiguration: EncryptionConfiguration.t option
        [@ocaml.doc
          "Use this structure if you want to use a customer managed KMS key to encrypt your investigation data. If you omit this parameter, CloudWatch investigations will use an Amazon Web Services key to encrypt the data. For more information, see Encryption of investigation data."];
      tagKeyBoundaries: TagKeyBoundaries.t option
        [@ocaml.doc
          "Enter the existing custom tag keys for custom applications in your system. Resource tags help CloudWatch investigations narrow the search space when it is unable to discover definite relationships between resources. For example, to discover that an Amazon ECS service depends on an Amazon RDS database, CloudWatch investigations can discover this relationship using data sources such as X-Ray and CloudWatch Application Signals. However, if you haven't deployed these features, CloudWatch investigations will attempt to identify possible relationships. Tag boundaries can be used to narrow the resources that will be discovered by CloudWatch investigations in these cases. You don't need to enter tags created by myApplications or CloudFormation, because CloudWatch investigations can automatically detect those tags."];
      chatbotNotificationChannel: ChatbotNotificationChannel.t option
        [@ocaml.doc
          "Use this structure to integrate CloudWatch investigations with chat applications. This structure is a string array. For the first string, specify the ARN of an Amazon SNS topic. For the array of strings, specify the ARNs of one or more chat applications configurations that you want to associate with that topic. For more information about these configuration ARNs, see Getting started with Amazon Q in chat applications and Resource type defined by Amazon Web Services Chatbot."];
      isCloudTrailEventHistoryEnabled: Boolean.t option
        [@ocaml.doc
          "Specify true to enable CloudWatch investigations to have access to change events that are recorded by CloudTrail. The default is true."];
      crossAccountConfigurations: CrossAccountConfigurations.t option
        [@ocaml.doc
          "Used to configure cross-account access for an investigation group. It allows the investigation group to access resources in other accounts."]}
    let context_ = "UpdateInvestigationGroupRequest"
    let make ?roleArn =
      fun ?encryptionConfiguration ->
        fun ?tagKeyBoundaries ->
          fun ?chatbotNotificationChannel ->
            fun ?isCloudTrailEventHistoryEnabled ->
              fun ?crossAccountConfigurations ->
                fun ~identifier ->
                  fun () ->
                    {
                      roleArn;
                      encryptionConfiguration;
                      tagKeyBoundaries;
                      chatbotNotificationChannel;
                      isCloudTrailEventHistoryEnabled;
                      crossAccountConfigurations;
                      identifier
                    }
    let to_value x =
      structure_to_value
        [("identifier",
           (Some (InvestigationGroupIdentifier.to_value x.identifier)));
        ("roleArn", (Option.map x.roleArn ~f:RoleArn.to_value));
        ("encryptionConfiguration",
          (Option.map x.encryptionConfiguration
             ~f:EncryptionConfiguration.to_value));
        ("tagKeyBoundaries",
          (Option.map x.tagKeyBoundaries ~f:TagKeyBoundaries.to_value));
        ("chatbotNotificationChannel",
          (Option.map x.chatbotNotificationChannel
             ~f:ChatbotNotificationChannel.to_value));
        ("isCloudTrailEventHistoryEnabled",
          (Option.map x.isCloudTrailEventHistoryEnabled ~f:Boolean.to_value));
        ("crossAccountConfigurations",
          (Option.map x.crossAccountConfigurations
             ~f:CrossAccountConfigurations.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let crossAccountConfigurations =
        (Option.map ~f:CrossAccountConfigurations.of_xml)
          (Xml.child xml_arg0 "crossAccountConfigurations") in
      let isCloudTrailEventHistoryEnabled =
        (Option.map ~f:Boolean.of_xml)
          (Xml.child xml_arg0 "isCloudTrailEventHistoryEnabled") in
      let chatbotNotificationChannel =
        (Option.map ~f:ChatbotNotificationChannel.of_xml)
          (Xml.child xml_arg0 "chatbotNotificationChannel") in
      let tagKeyBoundaries =
        (Option.map ~f:TagKeyBoundaries.of_xml)
          (Xml.child xml_arg0 "tagKeyBoundaries") in
      let encryptionConfiguration =
        (Option.map ~f:EncryptionConfiguration.of_xml)
          (Xml.child xml_arg0 "encryptionConfiguration") in
      let roleArn =
        (Option.map ~f:RoleArn.of_xml) (Xml.child xml_arg0 "roleArn") in
      let identifier =
        InvestigationGroupIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "identifier") in
      make ?crossAccountConfigurations ?isCloudTrailEventHistoryEnabled
        ?chatbotNotificationChannel ?tagKeyBoundaries
        ?encryptionConfiguration ?roleArn ~identifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let crossAccountConfigurations =
        field_map json__ "crossAccountConfigurations"
          CrossAccountConfigurations.of_json in
      let isCloudTrailEventHistoryEnabled =
        field_map json__ "isCloudTrailEventHistoryEnabled" Boolean.of_json in
      let chatbotNotificationChannel =
        field_map json__ "chatbotNotificationChannel"
          ChatbotNotificationChannel.of_json in
      let tagKeyBoundaries =
        field_map json__ "tagKeyBoundaries" TagKeyBoundaries.of_json in
      let encryptionConfiguration =
        field_map json__ "encryptionConfiguration"
          EncryptionConfiguration.of_json in
      let roleArn = field_map json__ "roleArn" RoleArn.of_json in
      let identifier =
        field_map_exn json__ "identifier"
          InvestigationGroupIdentifier.of_json in
      make ?crossAccountConfigurations ?isCloudTrailEventHistoryEnabled
        ?chatbotNotificationChannel ?tagKeyBoundaries
        ?encryptionConfiguration ?roleArn ~identifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Updates the configuration of the specified investigation group."]
module UpdateInvestigationGroupOutput =
  struct
    type nonrec t = unit
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make () = ()
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let of_header_and_body = ((fun (xs, pipe) -> make ())[@warning "-27"])
    let to_value _ = `Structure []
    let to_query v = to_query to_value v
    let of_xml _ = make ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json _ = make ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Updates the configuration of the specified investigation group."]
module UntagResourceResponse =
  struct
    type nonrec t = unit
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make () = ()
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let of_header_and_body = ((fun (xs, pipe) -> make ())[@warning "-27"])
    let to_value _ = `Structure []
    let to_query v = to_query to_value v
    let of_xml _ = make ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json _ = make ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Removes one or more tags from the specified resource."]
module UntagResourceRequest =
  struct
    type nonrec t =
      {
      resourceArn: String_.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the resource that you want to remove the tags from. You can use theListInvestigationGroups operation to find the ARNs of investigation groups."];
      tagKeys: TagKeys.t
        [@ocaml.doc "The list of tag keys to remove from the resource."]}
    let context_ = "UntagResourceRequest"
    let make ~resourceArn =
      fun ~tagKeys -> fun () -> { resourceArn; tagKeys }
    let to_value x =
      structure_to_value
        [("resourceArn", (Some (String_.to_value x.resourceArn)));
        ("tagKeys", (Some (TagKeys.to_value x.tagKeys)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tagKeys =
        TagKeys.of_xml (Xml.child_exn ~context:context_ xml_arg0 "tagKeys") in
      let resourceArn =
        String_.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "resourceArn") in
      make ~tagKeys ~resourceArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tagKeys = field_map_exn json__ "tagKeys" TagKeys.of_json in
      let resourceArn = field_map_exn json__ "resourceArn" String_.of_json in
      make ~tagKeys ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Removes one or more tags from the specified resource."]
module TagResourceResponse =
  struct
    type nonrec t = unit
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make () = ()
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let of_header_and_body = ((fun (xs, pipe) -> make ())[@warning "-27"])
    let to_value _ = `Structure []
    let to_query v = to_query to_value v
    let of_xml _ = make ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json _ = make ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Assigns one or more tags (key-value pairs) to the specified resource. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters. You can associate as many as 50 tags with a resource."]
module TagResourceRequest =
  struct
    type nonrec t =
      {
      resourceArn: String_.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the resource that you want to apply the tags to. You can use the ListInvestigationGroups operation to find the ARNs of investigation groups."];
      tags: Tags.t
        [@ocaml.doc
          "The list of key-value pairs to associate with the resource."]}
    let context_ = "TagResourceRequest"
    let make ~resourceArn = fun ~tags -> fun () -> { resourceArn; tags }
    let to_value x =
      structure_to_value
        [("resourceArn", (Some (String_.to_value x.resourceArn)));
        ("tags", (Some (Tags.to_value x.tags)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags =
        Tags.of_xml (Xml.child_exn ~context:context_ xml_arg0 "tags") in
      let resourceArn =
        String_.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "resourceArn") in
      make ~tags ~resourceArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map_exn json__ "tags" Tags.of_json in
      let resourceArn = field_map_exn json__ "resourceArn" String_.of_json in
      make ~tags ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Assigns one or more tags (key-value pairs) to the specified resource. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters. You can associate as many as 50 tags with a resource."]
module PutInvestigationGroupPolicyResponse =
  struct
    type nonrec t =
      {
      investigationGroupArn: InvestigationGroupArn.t option
        [@ocaml.doc
          "The ARN of the investigation group that will use this policy."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?investigationGroupArn = fun () -> { investigationGroupArn }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("investigationGroupArn",
           (Option.map x.investigationGroupArn
              ~f:InvestigationGroupArn.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let investigationGroupArn =
        (Option.map ~f:InvestigationGroupArn.of_xml)
          (Xml.child xml_arg0 "investigationGroupArn") in
      make ?investigationGroupArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let investigationGroupArn =
        field_map json__ "investigationGroupArn"
          InvestigationGroupArn.of_json in
      make ?investigationGroupArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates an IAM resource policy and assigns it to the specified investigation group. If you create your investigation group with CreateInvestigationGroup and you want to enable CloudWatch alarms to create investigations and add events to investigations, you must use this operation to create a policy similar to this example. \\{ \"Version\": \"2008-10-17\", \"Statement\": \\[ \\{ \"Effect\": \"Allow\", \"Principal\": \\{ \"Service\": \"aiops.alarms.cloudwatch.amazonaws.com\" \\}, \"Action\": \\[ \"aiops:CreateInvestigation\", \"aiops:CreateInvestigationEvent\" \\], \"Resource\": \"*\", \"Condition\": \\{ \"StringEquals\": \\{ \"aws:SourceAccount\": \"account-id\" \\}, \"ArnLike\": \\{ \"aws:SourceArn\": \"arn:aws:cloudwatch:region:account-id:alarm:*\" \\} \\} \\} \\] \\}"]
module PutInvestigationGroupPolicyRequest =
  struct
    type nonrec t =
      {
      identifier: InvestigationGroupIdentifier.t
        [@ocaml.doc
          "Specify either the name or the ARN of the investigation group that you want to assign the policy to."];
      policy: InvestigationGroupPolicyDocument.t
        [@ocaml.doc "The policy, in JSON format."]}
    let context_ = "PutInvestigationGroupPolicyRequest"
    let make ~identifier = fun ~policy -> fun () -> { identifier; policy }
    let to_value x =
      structure_to_value
        [("identifier",
           (Some (InvestigationGroupIdentifier.to_value x.identifier)));
        ("policy",
          (Some (InvestigationGroupPolicyDocument.to_value x.policy)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let policy =
        InvestigationGroupPolicyDocument.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "policy") in
      let identifier =
        InvestigationGroupIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "identifier") in
      make ~policy ~identifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let policy =
        field_map_exn json__ "policy"
          InvestigationGroupPolicyDocument.of_json in
      let identifier =
        field_map_exn json__ "identifier"
          InvestigationGroupIdentifier.of_json in
      make ~policy ~identifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates an IAM resource policy and assigns it to the specified investigation group. If you create your investigation group with CreateInvestigationGroup and you want to enable CloudWatch alarms to create investigations and add events to investigations, you must use this operation to create a policy similar to this example. \\{ \"Version\": \"2008-10-17\", \"Statement\": \\[ \\{ \"Effect\": \"Allow\", \"Principal\": \\{ \"Service\": \"aiops.alarms.cloudwatch.amazonaws.com\" \\}, \"Action\": \\[ \"aiops:CreateInvestigation\", \"aiops:CreateInvestigationEvent\" \\], \"Resource\": \"*\", \"Condition\": \\{ \"StringEquals\": \\{ \"aws:SourceAccount\": \"account-id\" \\}, \"ArnLike\": \\{ \"aws:SourceArn\": \"arn:aws:cloudwatch:region:account-id:alarm:*\" \\} \\} \\} \\] \\}"]
module ListTagsForResourceRequest =
  struct
    type nonrec t =
      {
      resourceArn: String_.t
        [@ocaml.doc
          "The ARN of the CloudWatch investigations resource that you want to view tags for. You can use the ListInvestigationGroups operation to find the ARNs of investigation groups. The ARN format for an investigation group is arn:aws:aiops:Region:account-id:investigation-group:investigation-group-id ."]}
    let context_ = "ListTagsForResourceRequest"
    let make ~resourceArn = fun () -> { resourceArn }
    let to_value x =
      structure_to_value
        [("resourceArn", (Some (String_.to_value x.resourceArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let resourceArn =
        String_.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "resourceArn") in
      make ~resourceArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let resourceArn = field_map_exn json__ "resourceArn" String_.of_json in
      make ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Displays the tags associated with a CloudWatch investigations resource. Currently, investigation groups support tagging."]
module ListTagsForResourceOutput =
  struct
    type nonrec t =
      {
      tags: Tags.t option
        [@ocaml.doc
          "The list of tag keys and values associated with the resource you specified."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?tags = fun () -> { tags }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value [("tags", (Option.map x.tags ~f:Tags.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags = (Option.map ~f:Tags.of_xml) (Xml.child xml_arg0 "tags") in
      make ?tags ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map json__ "tags" Tags.of_json in make ?tags ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Displays the tags associated with a CloudWatch investigations resource. Currently, investigation groups support tagging."]
module ListInvestigationGroupsOutput =
  struct
    type nonrec t =
      {
      nextToken: SensitiveStringWithLengthLimits.t option
        [@ocaml.doc
          "Include this value in your next use of this operation to get the next set of service operations."];
      investigationGroups: InvestigationGroups.t option
        [@ocaml.doc
          "An array of structures, where each structure contains the information about one investigation group in the account."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?nextToken =
      fun ?investigationGroups ->
        fun () -> { nextToken; investigationGroups }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("nextToken",
           (Option.map x.nextToken
              ~f:SensitiveStringWithLengthLimits.to_value));
        ("investigationGroups",
          (Option.map x.investigationGroups ~f:InvestigationGroups.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let investigationGroups =
        (Option.map ~f:InvestigationGroups.of_xml)
          (Xml.child xml_arg0 "investigationGroups") in
      let nextToken =
        (Option.map ~f:SensitiveStringWithLengthLimits.of_xml)
          (Xml.child xml_arg0 "nextToken") in
      make ?investigationGroups ?nextToken ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let investigationGroups =
        field_map json__ "investigationGroups" InvestigationGroups.of_json in
      let nextToken =
        field_map json__ "nextToken" SensitiveStringWithLengthLimits.of_json in
      make ?investigationGroups ?nextToken ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Returns the ARN and name of each investigation group in the account."]
module ListInvestigationGroupsInput =
  struct
    type nonrec t =
      {
      nextToken: SensitiveStringWithLengthLimits.t option
        [@ocaml.doc
          "Include this value, if it was returned by the previous operation, to get the next set of service operations."];
      maxResults: ListInvestigationGroupsInputMaxResultsInteger.t option
        [@ocaml.doc
          "The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used."]}
    let make ?nextToken =
      fun ?maxResults -> fun () -> { nextToken; maxResults }
    let to_value x =
      structure_to_value
        [("nextToken",
           (Option.map x.nextToken
              ~f:SensitiveStringWithLengthLimits.to_value));
        ("maxResults",
          (Option.map x.maxResults
             ~f:ListInvestigationGroupsInputMaxResultsInteger.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let maxResults =
        (Option.map ~f:ListInvestigationGroupsInputMaxResultsInteger.of_xml)
          (Xml.child xml_arg0 "maxResults") in
      let nextToken =
        (Option.map ~f:SensitiveStringWithLengthLimits.of_xml)
          (Xml.child xml_arg0 "nextToken") in
      make ?maxResults ?nextToken ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let maxResults =
        field_map json__ "maxResults"
          ListInvestigationGroupsInputMaxResultsInteger.of_json in
      let nextToken =
        field_map json__ "nextToken" SensitiveStringWithLengthLimits.of_json in
      make ?maxResults ?nextToken ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Returns the ARN and name of each investigation group in the account."]
module GetInvestigationGroupResponse =
  struct
    type nonrec t =
      {
      createdBy: IdentifierStringWithPatternAndLengthLimits.t option
        [@ocaml.doc
          "The name of the user who created the investigation group."];
      createdAt: Long.t option
        [@ocaml.doc
          "The date and time that the investigation group was created."];
      lastModifiedBy: IdentifierStringWithPatternAndLengthLimits.t option
        [@ocaml.doc
          "The name of the user who created the investigation group."];
      lastModifiedAt: Long.t option
        [@ocaml.doc
          "The date and time that the investigation group was most recently modified."];
      name: StringWithPatternAndLengthLimits.t option
        [@ocaml.doc "The name of the investigation group."];
      arn: InvestigationGroupArn.t option
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the investigation group."];
      roleArn: RoleArn.t option
        [@ocaml.doc
          "The ARN of the IAM role that the investigation group uses for permissions to gather data."];
      encryptionConfiguration: EncryptionConfiguration.t option
        [@ocaml.doc
          "Specifies the customer managed KMS key that the investigation group uses to encrypt data, if there is one. If not, the investigation group uses an Amazon Web Services key to encrypt the data."];
      retentionInDays: Retention.t option
        [@ocaml.doc "Specifies how long that investigation data is kept."];
      chatbotNotificationChannel: ChatbotNotificationChannel.t option
        [@ocaml.doc
          "This structure is a string array. The first string is the ARN of a Amazon SNS topic. The array of strings display the ARNs of chat applications configurations that are associated with that topic. For more information about these configuration ARNs, see Getting started with Amazon Q in chat applications and Resource type defined by Amazon Web Services Chatbot."];
      tagKeyBoundaries: TagKeyBoundaries.t option
        [@ocaml.doc
          "Displays the custom tag keys for custom applications in your system that you have specified in the investigation group. Resource tags help CloudWatch investigations narrow the search space when it is unable to discover definite relationships between resources."];
      isCloudTrailEventHistoryEnabled: Boolean.t option
        [@ocaml.doc
          "Specifies whether CloudWatch investigationshas access to change events that are recorded by CloudTrail."];
      crossAccountConfigurations: CrossAccountConfigurations.t option
        [@ocaml.doc
          "Lists the AWSAccountId of the accounts configured for cross-account access and the results of the last scan performed on each account."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?createdBy =
      fun ?createdAt ->
        fun ?lastModifiedBy ->
          fun ?lastModifiedAt ->
            fun ?name ->
              fun ?arn ->
                fun ?roleArn ->
                  fun ?encryptionConfiguration ->
                    fun ?retentionInDays ->
                      fun ?chatbotNotificationChannel ->
                        fun ?tagKeyBoundaries ->
                          fun ?isCloudTrailEventHistoryEnabled ->
                            fun ?crossAccountConfigurations ->
                              fun () ->
                                {
                                  createdBy;
                                  createdAt;
                                  lastModifiedBy;
                                  lastModifiedAt;
                                  name;
                                  arn;
                                  roleArn;
                                  encryptionConfiguration;
                                  retentionInDays;
                                  chatbotNotificationChannel;
                                  tagKeyBoundaries;
                                  isCloudTrailEventHistoryEnabled;
                                  crossAccountConfigurations
                                }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("createdBy",
           (Option.map x.createdBy
              ~f:IdentifierStringWithPatternAndLengthLimits.to_value));
        ("createdAt", (Option.map x.createdAt ~f:Long.to_value));
        ("lastModifiedBy",
          (Option.map x.lastModifiedBy
             ~f:IdentifierStringWithPatternAndLengthLimits.to_value));
        ("lastModifiedAt", (Option.map x.lastModifiedAt ~f:Long.to_value));
        ("name",
          (Option.map x.name ~f:StringWithPatternAndLengthLimits.to_value));
        ("arn", (Option.map x.arn ~f:InvestigationGroupArn.to_value));
        ("roleArn", (Option.map x.roleArn ~f:RoleArn.to_value));
        ("encryptionConfiguration",
          (Option.map x.encryptionConfiguration
             ~f:EncryptionConfiguration.to_value));
        ("retentionInDays",
          (Option.map x.retentionInDays ~f:Retention.to_value));
        ("chatbotNotificationChannel",
          (Option.map x.chatbotNotificationChannel
             ~f:ChatbotNotificationChannel.to_value));
        ("tagKeyBoundaries",
          (Option.map x.tagKeyBoundaries ~f:TagKeyBoundaries.to_value));
        ("isCloudTrailEventHistoryEnabled",
          (Option.map x.isCloudTrailEventHistoryEnabled ~f:Boolean.to_value));
        ("crossAccountConfigurations",
          (Option.map x.crossAccountConfigurations
             ~f:CrossAccountConfigurations.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let crossAccountConfigurations =
        (Option.map ~f:CrossAccountConfigurations.of_xml)
          (Xml.child xml_arg0 "crossAccountConfigurations") in
      let isCloudTrailEventHistoryEnabled =
        (Option.map ~f:Boolean.of_xml)
          (Xml.child xml_arg0 "isCloudTrailEventHistoryEnabled") in
      let tagKeyBoundaries =
        (Option.map ~f:TagKeyBoundaries.of_xml)
          (Xml.child xml_arg0 "tagKeyBoundaries") in
      let chatbotNotificationChannel =
        (Option.map ~f:ChatbotNotificationChannel.of_xml)
          (Xml.child xml_arg0 "chatbotNotificationChannel") in
      let retentionInDays =
        (Option.map ~f:Retention.of_xml)
          (Xml.child xml_arg0 "retentionInDays") in
      let encryptionConfiguration =
        (Option.map ~f:EncryptionConfiguration.of_xml)
          (Xml.child xml_arg0 "encryptionConfiguration") in
      let roleArn =
        (Option.map ~f:RoleArn.of_xml) (Xml.child xml_arg0 "roleArn") in
      let arn =
        (Option.map ~f:InvestigationGroupArn.of_xml)
          (Xml.child xml_arg0 "arn") in
      let name =
        (Option.map ~f:StringWithPatternAndLengthLimits.of_xml)
          (Xml.child xml_arg0 "name") in
      let lastModifiedAt =
        (Option.map ~f:Long.of_xml) (Xml.child xml_arg0 "lastModifiedAt") in
      let lastModifiedBy =
        (Option.map ~f:IdentifierStringWithPatternAndLengthLimits.of_xml)
          (Xml.child xml_arg0 "lastModifiedBy") in
      let createdAt =
        (Option.map ~f:Long.of_xml) (Xml.child xml_arg0 "createdAt") in
      let createdBy =
        (Option.map ~f:IdentifierStringWithPatternAndLengthLimits.of_xml)
          (Xml.child xml_arg0 "createdBy") in
      make ?crossAccountConfigurations ?isCloudTrailEventHistoryEnabled
        ?tagKeyBoundaries ?chatbotNotificationChannel ?retentionInDays
        ?encryptionConfiguration ?roleArn ?arn ?name ?lastModifiedAt
        ?lastModifiedBy ?createdAt ?createdBy ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let crossAccountConfigurations =
        field_map json__ "crossAccountConfigurations"
          CrossAccountConfigurations.of_json in
      let isCloudTrailEventHistoryEnabled =
        field_map json__ "isCloudTrailEventHistoryEnabled" Boolean.of_json in
      let tagKeyBoundaries =
        field_map json__ "tagKeyBoundaries" TagKeyBoundaries.of_json in
      let chatbotNotificationChannel =
        field_map json__ "chatbotNotificationChannel"
          ChatbotNotificationChannel.of_json in
      let retentionInDays =
        field_map json__ "retentionInDays" Retention.of_json in
      let encryptionConfiguration =
        field_map json__ "encryptionConfiguration"
          EncryptionConfiguration.of_json in
      let roleArn = field_map json__ "roleArn" RoleArn.of_json in
      let arn = field_map json__ "arn" InvestigationGroupArn.of_json in
      let name =
        field_map json__ "name" StringWithPatternAndLengthLimits.of_json in
      let lastModifiedAt = field_map json__ "lastModifiedAt" Long.of_json in
      let lastModifiedBy =
        field_map json__ "lastModifiedBy"
          IdentifierStringWithPatternAndLengthLimits.of_json in
      let createdAt = field_map json__ "createdAt" Long.of_json in
      let createdBy =
        field_map json__ "createdBy"
          IdentifierStringWithPatternAndLengthLimits.of_json in
      make ?crossAccountConfigurations ?isCloudTrailEventHistoryEnabled
        ?tagKeyBoundaries ?chatbotNotificationChannel ?retentionInDays
        ?encryptionConfiguration ?roleArn ?arn ?name ?lastModifiedAt
        ?lastModifiedBy ?createdAt ?createdBy ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Returns the configuration information for the specified investigation group."]
module GetInvestigationGroupRequest =
  struct
    type nonrec t =
      {
      identifier: InvestigationGroupIdentifier.t
        [@ocaml.doc
          "Specify either the name or the ARN of the investigation group that you want to view. This is used to set the name of the investigation group."]}
    let context_ = "GetInvestigationGroupRequest"
    let make ~identifier = fun () -> { identifier }
    let to_value x =
      structure_to_value
        [("identifier",
           (Some (InvestigationGroupIdentifier.to_value x.identifier)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let identifier =
        InvestigationGroupIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "identifier") in
      make ~identifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let identifier =
        field_map_exn json__ "identifier"
          InvestigationGroupIdentifier.of_json in
      make ~identifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Returns the configuration information for the specified investigation group."]
module GetInvestigationGroupPolicyResponse =
  struct
    type nonrec t =
      {
      investigationGroupArn: InvestigationGroupArn.t option
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the investigation group that you want to view the policy of."];
      policy: InvestigationGroupPolicyDocument.t option
        [@ocaml.doc "The policy, in JSON format."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?investigationGroupArn =
      fun ?policy -> fun () -> { investigationGroupArn; policy }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("investigationGroupArn",
           (Option.map x.investigationGroupArn
              ~f:InvestigationGroupArn.to_value));
        ("policy",
          (Option.map x.policy ~f:InvestigationGroupPolicyDocument.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let policy =
        (Option.map ~f:InvestigationGroupPolicyDocument.of_xml)
          (Xml.child xml_arg0 "policy") in
      let investigationGroupArn =
        (Option.map ~f:InvestigationGroupArn.of_xml)
          (Xml.child xml_arg0 "investigationGroupArn") in
      make ?policy ?investigationGroupArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let policy =
        field_map json__ "policy" InvestigationGroupPolicyDocument.of_json in
      let investigationGroupArn =
        field_map json__ "investigationGroupArn"
          InvestigationGroupArn.of_json in
      make ?policy ?investigationGroupArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Returns the JSON of the IAM resource policy associated with the specified investigation group in a string. For example, \\{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":\\[\\{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":\\{\\\"Service\\\":\\\"aiops.alarms.cloudwatch.amazonaws.com\\\"\\},\\\"Action\\\":\\[\\\"aiops:CreateInvestigation\\\",\\\"aiops:CreateInvestigationEvent\\\"\\],\\\"Resource\\\":\\\"*\\\",\\\"Condition\\\":\\{\\\"StringEquals\\\":\\{\\\"aws:SourceAccount\\\":\\\"111122223333\\\"\\},\\\"ArnLike\\\":\\{\\\"aws:SourceArn\\\":\\\"arn:aws:cloudwatch:us-east-1:111122223333:alarm:*\\\"\\}\\}\\}\\]\\}."]
module GetInvestigationGroupPolicyRequest =
  struct
    type nonrec t =
      {
      identifier: InvestigationGroupIdentifier.t
        [@ocaml.doc
          "Specify either the name or the ARN of the investigation group that you want to view the policy of."]}
    let context_ = "GetInvestigationGroupPolicyRequest"
    let make ~identifier = fun () -> { identifier }
    let to_value x =
      structure_to_value
        [("identifier",
           (Some (InvestigationGroupIdentifier.to_value x.identifier)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let identifier =
        InvestigationGroupIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "identifier") in
      make ~identifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let identifier =
        field_map_exn json__ "identifier"
          InvestigationGroupIdentifier.of_json in
      make ~identifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Returns the JSON of the IAM resource policy associated with the specified investigation group in a string. For example, \\{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":\\[\\{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":\\{\\\"Service\\\":\\\"aiops.alarms.cloudwatch.amazonaws.com\\\"\\},\\\"Action\\\":\\[\\\"aiops:CreateInvestigation\\\",\\\"aiops:CreateInvestigationEvent\\\"\\],\\\"Resource\\\":\\\"*\\\",\\\"Condition\\\":\\{\\\"StringEquals\\\":\\{\\\"aws:SourceAccount\\\":\\\"111122223333\\\"\\},\\\"ArnLike\\\":\\{\\\"aws:SourceArn\\\":\\\"arn:aws:cloudwatch:us-east-1:111122223333:alarm:*\\\"\\}\\}\\}\\]\\}."]
module DeleteInvestigationGroupRequest =
  struct
    type nonrec t =
      {
      identifier: InvestigationGroupIdentifier.t
        [@ocaml.doc
          "Specify either the name or the ARN of the investigation group that you want to delete."]}
    let context_ = "DeleteInvestigationGroupRequest"
    let make ~identifier = fun () -> { identifier }
    let to_value x =
      structure_to_value
        [("identifier",
           (Some (InvestigationGroupIdentifier.to_value x.identifier)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let identifier =
        InvestigationGroupIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "identifier") in
      make ~identifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let identifier =
        field_map_exn json__ "identifier"
          InvestigationGroupIdentifier.of_json in
      make ~identifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Deletes the specified investigation group from your account. You can currently have one investigation group per Region in your account. After you delete an investigation group, you can later create a new investigation group in the same Region."]
module DeleteInvestigationGroupPolicyRequest =
  struct
    type nonrec t =
      {
      identifier: InvestigationGroupIdentifier.t
        [@ocaml.doc
          "Specify either the name or the ARN of the investigation group that you want to remove the policy from."]}
    let context_ = "DeleteInvestigationGroupPolicyRequest"
    let make ~identifier = fun () -> { identifier }
    let to_value x =
      structure_to_value
        [("identifier",
           (Some (InvestigationGroupIdentifier.to_value x.identifier)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let identifier =
        InvestigationGroupIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "identifier") in
      make ~identifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let identifier =
        field_map_exn json__ "identifier"
          InvestigationGroupIdentifier.of_json in
      make ~identifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Removes the IAM resource policy from being associated with the investigation group that you specify."]
module DeleteInvestigationGroupPolicyOutput =
  struct
    type nonrec t = unit
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make () = ()
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let of_header_and_body = ((fun (xs, pipe) -> make ())[@warning "-27"])
    let to_value _ = `Structure []
    let to_query v = to_query to_value v
    let of_xml _ = make ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json _ = make ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Removes the IAM resource policy from being associated with the investigation group that you specify."]
module CreateInvestigationGroupOutput =
  struct
    type nonrec t =
      {
      arn: InvestigationGroupArn.t option
        [@ocaml.doc
          "The ARN of the investigation group that you just created."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `ForbiddenException of ForbiddenException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ServiceQuotaExceededException of ServiceQuotaExceededException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?arn = fun () -> { arn }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ServiceQuotaExceededException" ->
          `ServiceQuotaExceededException
            (ServiceQuotaExceededException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "ForbiddenException" ->
          `ForbiddenException (ForbiddenException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ServiceQuotaExceededException" ->
          `ServiceQuotaExceededException
            (ServiceQuotaExceededException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `ForbiddenException e ->
          `Assoc
            [("error", (`String "ForbiddenException"));
            ("details", (ForbiddenException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ServiceQuotaExceededException e ->
          `Assoc
            [("error", (`String "ServiceQuotaExceededException"));
            ("details", (ServiceQuotaExceededException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("arn", (Option.map x.arn ~f:InvestigationGroupArn.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let arn =
        (Option.map ~f:InvestigationGroupArn.of_xml)
          (Xml.child xml_arg0 "arn") in
      make ?arn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let arn = field_map json__ "arn" InvestigationGroupArn.of_json in
      make ?arn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates an investigation group in your account. Creating an investigation group is a one-time setup task for each Region in your account. It is a necessary task to be able to perform investigations. Settings in the investigation group help you centrally manage the common properties of your investigations, such as the following: Who can access the investigations Whether investigation data is encrypted with a customer managed Key Management Service key. How long investigations and their data are retained by default. Currently, you can have one investigation group in each Region in your account. Each investigation in a Region is a part of the investigation group in that Region To create an investigation group and set up CloudWatch investigations, you must be signed in to an IAM principal that has either the AIOpsConsoleAdminPolicy or the AdministratorAccess IAM policy attached, or to an account that has similar permissions. You can configure CloudWatch alarms to start investigations and add events to investigations. If you create your investigation group with CreateInvestigationGroup and you want to enable alarms to do this, you must use PutInvestigationGroupPolicy to create a resource policy that grants this permission to CloudWatch alarms. For more information about configuring CloudWatch alarms, see Using Amazon CloudWatch alarms"]
module CreateInvestigationGroupInput =
  struct
    type nonrec t =
      {
      name: StringWithPatternAndLengthLimits.t
        [@ocaml.doc "Provides a name for the investigation group."];
      roleArn: RoleArn.t
        [@ocaml.doc
          "Specify the ARN of the IAM role that CloudWatch investigations will use when it gathers investigation data. The permissions in this role determine which of your resources that CloudWatch investigations will have access to during investigations. For more information, see How to control what data CloudWatch investigations has access to during investigations."];
      encryptionConfiguration: EncryptionConfiguration.t option
        [@ocaml.doc
          "Use this structure if you want to use a customer managed KMS key to encrypt your investigation data. If you omit this parameter, CloudWatch investigations will use an Amazon Web Services key to encrypt the data. For more information, see Encryption of investigation data."];
      retentionInDays: Retention.t option
        [@ocaml.doc
          "Specify how long that investigation data is kept. For more information, see Operational investigation data retention. If you omit this parameter, the default of 90 days is used."];
      tags: Tags.t option
        [@ocaml.doc
          "A list of key-value pairs to associate with the investigation group. You can associate as many as 50 tags with an investigation group. To be able to associate tags when you create the investigation group, you must have the cloudwatch:TagResource permission. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values."];
      tagKeyBoundaries: TagKeyBoundaries.t option
        [@ocaml.doc
          "Enter the existing custom tag keys for custom applications in your system. Resource tags help CloudWatch investigations narrow the search space when it is unable to discover definite relationships between resources. For example, to discover that an Amazon ECS service depends on an Amazon RDS database, CloudWatch investigations can discover this relationship using data sources such as X-Ray and CloudWatch Application Signals. However, if you haven't deployed these features, CloudWatch investigations will attempt to identify possible relationships. Tag boundaries can be used to narrow the resources that will be discovered by CloudWatch investigations in these cases. You don't need to enter tags created by myApplications or CloudFormation, because CloudWatch investigations can automatically detect those tags."];
      chatbotNotificationChannel: ChatbotNotificationChannel.t option
        [@ocaml.doc
          "Use this structure to integrate CloudWatch investigations with chat applications. This structure is a string array. For the first string, specify the ARN of an Amazon SNS topic. For the array of strings, specify the ARNs of one or more chat applications configurations that you want to associate with that topic. For more information about these configuration ARNs, see Getting started with Amazon Q in chat applications and Resource type defined by Amazon Web Services Chatbot."];
      isCloudTrailEventHistoryEnabled: Boolean.t option
        [@ocaml.doc
          "Specify true to enable CloudWatch investigations to have access to change events that are recorded by CloudTrail. The default is true."];
      crossAccountConfigurations: CrossAccountConfigurations.t option
        [@ocaml.doc
          "List of sourceRoleArn values that have been configured for cross-account access."]}
    let context_ = "CreateInvestigationGroupInput"
    let make ?encryptionConfiguration =
      fun ?retentionInDays ->
        fun ?tags ->
          fun ?tagKeyBoundaries ->
            fun ?chatbotNotificationChannel ->
              fun ?isCloudTrailEventHistoryEnabled ->
                fun ?crossAccountConfigurations ->
                  fun ~name ->
                    fun ~roleArn ->
                      fun () ->
                        {
                          encryptionConfiguration;
                          retentionInDays;
                          tags;
                          tagKeyBoundaries;
                          chatbotNotificationChannel;
                          isCloudTrailEventHistoryEnabled;
                          crossAccountConfigurations;
                          name;
                          roleArn
                        }
    let to_value x =
      structure_to_value
        [("name", (Some (StringWithPatternAndLengthLimits.to_value x.name)));
        ("roleArn", (Some (RoleArn.to_value x.roleArn)));
        ("encryptionConfiguration",
          (Option.map x.encryptionConfiguration
             ~f:EncryptionConfiguration.to_value));
        ("retentionInDays",
          (Option.map x.retentionInDays ~f:Retention.to_value));
        ("tags", (Option.map x.tags ~f:Tags.to_value));
        ("tagKeyBoundaries",
          (Option.map x.tagKeyBoundaries ~f:TagKeyBoundaries.to_value));
        ("chatbotNotificationChannel",
          (Option.map x.chatbotNotificationChannel
             ~f:ChatbotNotificationChannel.to_value));
        ("isCloudTrailEventHistoryEnabled",
          (Option.map x.isCloudTrailEventHistoryEnabled ~f:Boolean.to_value));
        ("crossAccountConfigurations",
          (Option.map x.crossAccountConfigurations
             ~f:CrossAccountConfigurations.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let crossAccountConfigurations =
        (Option.map ~f:CrossAccountConfigurations.of_xml)
          (Xml.child xml_arg0 "crossAccountConfigurations") in
      let isCloudTrailEventHistoryEnabled =
        (Option.map ~f:Boolean.of_xml)
          (Xml.child xml_arg0 "isCloudTrailEventHistoryEnabled") in
      let chatbotNotificationChannel =
        (Option.map ~f:ChatbotNotificationChannel.of_xml)
          (Xml.child xml_arg0 "chatbotNotificationChannel") in
      let tagKeyBoundaries =
        (Option.map ~f:TagKeyBoundaries.of_xml)
          (Xml.child xml_arg0 "tagKeyBoundaries") in
      let tags = (Option.map ~f:Tags.of_xml) (Xml.child xml_arg0 "tags") in
      let retentionInDays =
        (Option.map ~f:Retention.of_xml)
          (Xml.child xml_arg0 "retentionInDays") in
      let encryptionConfiguration =
        (Option.map ~f:EncryptionConfiguration.of_xml)
          (Xml.child xml_arg0 "encryptionConfiguration") in
      let roleArn =
        RoleArn.of_xml (Xml.child_exn ~context:context_ xml_arg0 "roleArn") in
      let name =
        StringWithPatternAndLengthLimits.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "name") in
      make ?crossAccountConfigurations ?isCloudTrailEventHistoryEnabled
        ?chatbotNotificationChannel ?tagKeyBoundaries ?tags ?retentionInDays
        ?encryptionConfiguration ~roleArn ~name ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let crossAccountConfigurations =
        field_map json__ "crossAccountConfigurations"
          CrossAccountConfigurations.of_json in
      let isCloudTrailEventHistoryEnabled =
        field_map json__ "isCloudTrailEventHistoryEnabled" Boolean.of_json in
      let chatbotNotificationChannel =
        field_map json__ "chatbotNotificationChannel"
          ChatbotNotificationChannel.of_json in
      let tagKeyBoundaries =
        field_map json__ "tagKeyBoundaries" TagKeyBoundaries.of_json in
      let tags = field_map json__ "tags" Tags.of_json in
      let retentionInDays =
        field_map json__ "retentionInDays" Retention.of_json in
      let encryptionConfiguration =
        field_map json__ "encryptionConfiguration"
          EncryptionConfiguration.of_json in
      let roleArn = field_map_exn json__ "roleArn" RoleArn.of_json in
      let name =
        field_map_exn json__ "name" StringWithPatternAndLengthLimits.of_json in
      make ?crossAccountConfigurations ?isCloudTrailEventHistoryEnabled
        ?chatbotNotificationChannel ?tagKeyBoundaries ?tags ?retentionInDays
        ?encryptionConfiguration ~roleArn ~name ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates an investigation group in your account. Creating an investigation group is a one-time setup task for each Region in your account. It is a necessary task to be able to perform investigations. Settings in the investigation group help you centrally manage the common properties of your investigations, such as the following: Who can access the investigations Whether investigation data is encrypted with a customer managed Key Management Service key. How long investigations and their data are retained by default. Currently, you can have one investigation group in each Region in your account. Each investigation in a Region is a part of the investigation group in that Region To create an investigation group and set up CloudWatch investigations, you must be signed in to an IAM principal that has either the AIOpsConsoleAdminPolicy or the AdministratorAccess IAM policy attached, or to an account that has similar permissions. You can configure CloudWatch alarms to start investigations and add events to investigations. If you create your investigation group with CreateInvestigationGroup and you want to enable alarms to do this, you must use PutInvestigationGroupPolicy to create a resource policy that grants this permission to CloudWatch alarms. For more information about configuring CloudWatch alarms, see Using Amazon CloudWatch alarms"]