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
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
(* 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.acm_pca
let apiVersion = "2017-08-22"
let endpointPrefix = "acm-pca"
let serviceFullName = "AWS Certificate Manager Private Certificate Authority"
let signatureVersion = "v4"
let protocol = "json"
let globalEndpoint = endpointPrefix ^ ".amazonaws.com"
let serviceAbbreviation = "ACM-PCA"
let targetPrefix = "ACMPrivateCA"
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 CustomObjectIdentifier =
  struct
    type nonrec t = string
    let context_ = "CustomObjectIdentifier"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:0) >>=
             (fun () ->
                (check_string_max i ~max:64) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"([0-2])\\.([0-9]|([0-3][0-9]))((\\.([0-9]+)){0,126})")));
        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:"CustomObjectIdentifier" j
    let to_json = simple_to_json to_value
  end
module String1To256 =
  struct
    type nonrec t = string
    let context_ = "String1To256"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:256) >>=
             (fun () -> check_string_min i ~min:1));
        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:"String1To256" j
    let to_json = simple_to_json to_value
  end
module CustomAttribute =
  struct
    type nonrec t =
      {
      objectIdentifier: CustomObjectIdentifier.t
        [@ocaml.doc
          "Specifies the object identifier (OID) of the attribute type of the relative distinguished name (RDN)."];
      value: String1To256.t
        [@ocaml.doc
          "Specifies the attribute value of relative distinguished name (RDN)."]}
    let context_ = "CustomAttribute"
    let make ~objectIdentifier =
      fun ~value -> fun () -> { objectIdentifier; value }
    let to_value x =
      structure_to_value
        [("ObjectIdentifier",
           (Some (CustomObjectIdentifier.to_value x.objectIdentifier)));
        ("Value", (Some (String1To256.to_value x.value)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let value =
        String1To256.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Value") in
      let objectIdentifier =
        CustomObjectIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "ObjectIdentifier") in
      make ~value ~objectIdentifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let value = field_map_exn json__ "Value" String1To256.of_json in
      let objectIdentifier =
        field_map_exn json__ "ObjectIdentifier"
          CustomObjectIdentifier.of_json in
      make ~value ~objectIdentifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Defines the X.500 relative distinguished name (RDN)."]
module ASN1PrintableString64 =
  struct
    type nonrec t = string
    let context_ = "ASN1PrintableString64"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:0) >>=
             (fun () ->
                (check_string_max i ~max:64) >>=
                  (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:"ASN1PrintableString64" j
    let to_json = simple_to_json to_value
  end
module CountryCodeString =
  struct
    type nonrec t = string
    let context_ = "CountryCodeString"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:2) >>=
             (fun () ->
                (check_string_max i ~max:2) >>=
                  (fun () -> check_pattern i ~pattern:"[A-Za-z]{2}")));
        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:"CountryCodeString" j
    let to_json = simple_to_json to_value
  end
module CustomAttributeList =
  struct
    type nonrec t = CustomAttribute.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:150) >>=
             (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:CustomAttribute.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:CustomAttribute.of_xml)
    let of_json j =
      list_of_json ~kind:"CustomAttributeList"
        ~of_json:CustomAttribute.of_json j
    let to_json v = composed_to_json to_value v
  end
module String128 =
  struct
    type nonrec t = string
    let context_ = "String128"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:128) >>=
             (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:"String128" j
    let to_json = simple_to_json to_value
  end
module String16 =
  struct
    type nonrec t = string
    let context_ = "String16"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:16) >>=
             (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:"String16" j
    let to_json = simple_to_json to_value
  end
module String3 =
  struct
    type nonrec t = string
    let context_ = "String3"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:3) >>=
             (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:"String3" j
    let to_json = simple_to_json to_value
  end
module String40 =
  struct
    type nonrec t = string
    let context_ = "String40"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:40) >>=
             (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:"String40" j
    let to_json = simple_to_json to_value
  end
module String5 =
  struct
    type nonrec t = string
    let context_ = "String5"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:5) >>=
             (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:"String5" j
    let to_json = simple_to_json to_value
  end
module String64 =
  struct
    type nonrec t = string
    let context_ = "String64"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:64) >>=
             (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:"String64" j
    let to_json = simple_to_json to_value
  end
module String256 =
  struct
    type nonrec t = string
    let context_ = "String256"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:256) >>=
             (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:"String256" j
    let to_json = simple_to_json to_value
  end
module AccessMethodType =
  struct
    type nonrec t =
      | CA_REPOSITORY 
      | RESOURCE_PKI_MANIFEST 
      | RESOURCE_PKI_NOTIFY 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | CA_REPOSITORY -> "CA_REPOSITORY"
      | RESOURCE_PKI_MANIFEST -> "RESOURCE_PKI_MANIFEST"
      | RESOURCE_PKI_NOTIFY -> "RESOURCE_PKI_NOTIFY"
      | Non_static_id s -> s
    let of_string =
      function
      | "CA_REPOSITORY" -> CA_REPOSITORY
      | "RESOURCE_PKI_MANIFEST" -> RESOURCE_PKI_MANIFEST
      | "RESOURCE_PKI_NOTIFY" -> RESOURCE_PKI_NOTIFY
      | 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 AccessMethodType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"AccessMethodType" j)
    let to_json = simple_to_json to_value
  end
module ASN1Subject =
  struct
    type nonrec t =
      {
      country: CountryCodeString.t option
        [@ocaml.doc
          "Two-digit code that specifies the country in which the certificate subject located."];
      organization: String64.t option
        [@ocaml.doc
          "Legal name of the organization with which the certificate subject is affiliated."];
      organizationalUnit: String64.t option
        [@ocaml.doc
          "A subdivision or unit of the organization (such as sales or finance) with which the certificate subject is affiliated."];
      distinguishedNameQualifier: ASN1PrintableString64.t option
        [@ocaml.doc
          "Disambiguating information for the certificate subject."];
      state: String128.t option
        [@ocaml.doc
          "State in which the subject of the certificate is located."];
      commonName: String64.t option
        [@ocaml.doc
          "For CA and end-entity certificates in a private PKI, the common name (CN) can be any string within the length limit. Note: In publicly trusted certificates, the common name must be a fully qualified domain name (FQDN) associated with the certificate subject."];
      serialNumber: ASN1PrintableString64.t option
        [@ocaml.doc "The certificate serial number."];
      locality: String128.t option
        [@ocaml.doc
          "The locality (such as a city or town) in which the certificate subject is located."];
      title: String64.t option
        [@ocaml.doc
          "A title such as Mr. or Ms., which is pre-pended to the name to refer formally to the certificate subject."];
      surname: String40.t option
        [@ocaml.doc
          "Family name. In the US and the UK, for example, the surname of an individual is ordered last. In Asian cultures the surname is typically ordered first."];
      givenName: String16.t option [@ocaml.doc "First name."];
      initials: String5.t option
        [@ocaml.doc
          "Concatenation that typically contains the first letter of the GivenName, the first letter of the middle name if one exists, and the first letter of the Surname."];
      pseudonym: String128.t option
        [@ocaml.doc
          "Typically a shortened version of a longer GivenName. For example, Jonathan is often shortened to John. Elizabeth is often shortened to Beth, Liz, or Eliza."];
      generationQualifier: String3.t option
        [@ocaml.doc
          "Typically a qualifier appended to the name of an individual. Examples include Jr. for junior, Sr. for senior, and III for third."];
      customAttributes: CustomAttributeList.t option
        [@ocaml.doc
          "Contains a sequence of one or more X.500 relative distinguished names (RDNs), each of which consists of an object identifier (OID) and a value. For more information, see NIST\226\128\153s definition of Object Identifier (OID). Custom attributes cannot be used in combination with standard attributes."]}
    let make ?country =
      fun ?organization ->
        fun ?organizationalUnit ->
          fun ?distinguishedNameQualifier ->
            fun ?state ->
              fun ?commonName ->
                fun ?serialNumber ->
                  fun ?locality ->
                    fun ?title ->
                      fun ?surname ->
                        fun ?givenName ->
                          fun ?initials ->
                            fun ?pseudonym ->
                              fun ?generationQualifier ->
                                fun ?customAttributes ->
                                  fun () ->
                                    {
                                      country;
                                      organization;
                                      organizationalUnit;
                                      distinguishedNameQualifier;
                                      state;
                                      commonName;
                                      serialNumber;
                                      locality;
                                      title;
                                      surname;
                                      givenName;
                                      initials;
                                      pseudonym;
                                      generationQualifier;
                                      customAttributes
                                    }
    let to_value x =
      structure_to_value
        [("Country", (Option.map x.country ~f:CountryCodeString.to_value));
        ("Organization", (Option.map x.organization ~f:String64.to_value));
        ("OrganizationalUnit",
          (Option.map x.organizationalUnit ~f:String64.to_value));
        ("DistinguishedNameQualifier",
          (Option.map x.distinguishedNameQualifier
             ~f:ASN1PrintableString64.to_value));
        ("State", (Option.map x.state ~f:String128.to_value));
        ("CommonName", (Option.map x.commonName ~f:String64.to_value));
        ("SerialNumber",
          (Option.map x.serialNumber ~f:ASN1PrintableString64.to_value));
        ("Locality", (Option.map x.locality ~f:String128.to_value));
        ("Title", (Option.map x.title ~f:String64.to_value));
        ("Surname", (Option.map x.surname ~f:String40.to_value));
        ("GivenName", (Option.map x.givenName ~f:String16.to_value));
        ("Initials", (Option.map x.initials ~f:String5.to_value));
        ("Pseudonym", (Option.map x.pseudonym ~f:String128.to_value));
        ("GenerationQualifier",
          (Option.map x.generationQualifier ~f:String3.to_value));
        ("CustomAttributes",
          (Option.map x.customAttributes ~f:CustomAttributeList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let customAttributes =
        (Option.map ~f:CustomAttributeList.of_xml)
          (Xml.child xml_arg0 "CustomAttributes") in
      let generationQualifier =
        (Option.map ~f:String3.of_xml)
          (Xml.child xml_arg0 "GenerationQualifier") in
      let pseudonym =
        (Option.map ~f:String128.of_xml) (Xml.child xml_arg0 "Pseudonym") in
      let initials =
        (Option.map ~f:String5.of_xml) (Xml.child xml_arg0 "Initials") in
      let givenName =
        (Option.map ~f:String16.of_xml) (Xml.child xml_arg0 "GivenName") in
      let surname =
        (Option.map ~f:String40.of_xml) (Xml.child xml_arg0 "Surname") in
      let title =
        (Option.map ~f:String64.of_xml) (Xml.child xml_arg0 "Title") in
      let locality =
        (Option.map ~f:String128.of_xml) (Xml.child xml_arg0 "Locality") in
      let serialNumber =
        (Option.map ~f:ASN1PrintableString64.of_xml)
          (Xml.child xml_arg0 "SerialNumber") in
      let commonName =
        (Option.map ~f:String64.of_xml) (Xml.child xml_arg0 "CommonName") in
      let state =
        (Option.map ~f:String128.of_xml) (Xml.child xml_arg0 "State") in
      let distinguishedNameQualifier =
        (Option.map ~f:ASN1PrintableString64.of_xml)
          (Xml.child xml_arg0 "DistinguishedNameQualifier") in
      let organizationalUnit =
        (Option.map ~f:String64.of_xml)
          (Xml.child xml_arg0 "OrganizationalUnit") in
      let organization =
        (Option.map ~f:String64.of_xml) (Xml.child xml_arg0 "Organization") in
      let country =
        (Option.map ~f:CountryCodeString.of_xml)
          (Xml.child xml_arg0 "Country") in
      make ?customAttributes ?generationQualifier ?pseudonym ?initials
        ?givenName ?surname ?title ?locality ?serialNumber ?commonName ?state
        ?distinguishedNameQualifier ?organizationalUnit ?organization
        ?country ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let customAttributes =
        field_map json__ "CustomAttributes" CustomAttributeList.of_json in
      let generationQualifier =
        field_map json__ "GenerationQualifier" String3.of_json in
      let pseudonym = field_map json__ "Pseudonym" String128.of_json in
      let initials = field_map json__ "Initials" String5.of_json in
      let givenName = field_map json__ "GivenName" String16.of_json in
      let surname = field_map json__ "Surname" String40.of_json in
      let title = field_map json__ "Title" String64.of_json in
      let locality = field_map json__ "Locality" String128.of_json in
      let serialNumber =
        field_map json__ "SerialNumber" ASN1PrintableString64.of_json in
      let commonName = field_map json__ "CommonName" String64.of_json in
      let state = field_map json__ "State" String128.of_json in
      let distinguishedNameQualifier =
        field_map json__ "DistinguishedNameQualifier"
          ASN1PrintableString64.of_json in
      let organizationalUnit =
        field_map json__ "OrganizationalUnit" String64.of_json in
      let organization = field_map json__ "Organization" String64.of_json in
      let country = field_map json__ "Country" CountryCodeString.of_json in
      make ?customAttributes ?generationQualifier ?pseudonym ?initials
        ?givenName ?surname ?title ?locality ?serialNumber ?commonName ?state
        ?distinguishedNameQualifier ?organizationalUnit ?organization
        ?country ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains information about the certificate subject. The Subject field in the certificate identifies the entity that owns or controls the public key in the certificate. The entity can be a user, computer, device, or service. The Subject must contain an X.500 distinguished name (DN). A DN is a sequence of relative distinguished names (RDNs). The RDNs are separated by commas in the certificate."]
module EdiPartyName =
  struct
    type nonrec t =
      {
      partyName: String256.t [@ocaml.doc "Specifies the party name."];
      nameAssigner: String256.t option
        [@ocaml.doc "Specifies the name assigner."]}
    let context_ = "EdiPartyName"
    let make ?nameAssigner =
      fun ~partyName -> fun () -> { nameAssigner; partyName }
    let to_value x =
      structure_to_value
        [("PartyName", (Some (String256.to_value x.partyName)));
        ("NameAssigner", (Option.map x.nameAssigner ~f:String256.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let nameAssigner =
        (Option.map ~f:String256.of_xml) (Xml.child xml_arg0 "NameAssigner") in
      let partyName =
        String256.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "PartyName") in
      make ?nameAssigner ~partyName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let nameAssigner = field_map json__ "NameAssigner" String256.of_json in
      let partyName = field_map_exn json__ "PartyName" String256.of_json in
      make ?nameAssigner ~partyName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Describes an Electronic Data Interchange (EDI) entity as described in as defined in Subject Alternative Name in RFC 5280."]
module OtherName =
  struct
    type nonrec t =
      {
      typeId: CustomObjectIdentifier.t [@ocaml.doc "Specifies an OID."];
      value: String256.t [@ocaml.doc "Specifies an OID value."]}
    let context_ = "OtherName"
    let make ~typeId = fun ~value -> fun () -> { typeId; value }
    let to_value x =
      structure_to_value
        [("TypeId", (Some (CustomObjectIdentifier.to_value x.typeId)));
        ("Value", (Some (String256.to_value x.value)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let value =
        String256.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Value") in
      let typeId =
        CustomObjectIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "TypeId") in
      make ~value ~typeId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let value = field_map_exn json__ "Value" String256.of_json in
      let typeId =
        field_map_exn json__ "TypeId" CustomObjectIdentifier.of_json in
      make ~value ~typeId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Defines a custom ASN.1 X.400 GeneralName using an object identifier (OID) and value. The OID must satisfy the regular expression shown below. For more information, see NIST's definition of Object Identifier (OID)."]
module String253 =
  struct
    type nonrec t = string
    let context_ = "String253"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:253) >>=
             (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:"String253" j
    let to_json = simple_to_json to_value
  end
module String39 =
  struct
    type nonrec t = string
    let context_ = "String39"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:39) >>=
             (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:"String39" j
    let to_json = simple_to_json to_value
  end
module AccessMethod =
  struct
    type nonrec t =
      {
      customObjectIdentifier: CustomObjectIdentifier.t option
        [@ocaml.doc
          "An object identifier (OID) specifying the AccessMethod. The OID must satisfy the regular expression shown below. For more information, see NIST's definition of Object Identifier (OID)."];
      accessMethodType: AccessMethodType.t option
        [@ocaml.doc "Specifies the AccessMethod."]}
    let make ?customObjectIdentifier =
      fun ?accessMethodType ->
        fun () -> { customObjectIdentifier; accessMethodType }
    let to_value x =
      structure_to_value
        [("CustomObjectIdentifier",
           (Option.map x.customObjectIdentifier
              ~f:CustomObjectIdentifier.to_value));
        ("AccessMethodType",
          (Option.map x.accessMethodType ~f:AccessMethodType.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accessMethodType =
        (Option.map ~f:AccessMethodType.of_xml)
          (Xml.child xml_arg0 "AccessMethodType") in
      let customObjectIdentifier =
        (Option.map ~f:CustomObjectIdentifier.of_xml)
          (Xml.child xml_arg0 "CustomObjectIdentifier") in
      make ?accessMethodType ?customObjectIdentifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accessMethodType =
        field_map json__ "AccessMethodType" AccessMethodType.of_json in
      let customObjectIdentifier =
        field_map json__ "CustomObjectIdentifier"
          CustomObjectIdentifier.of_json in
      make ?accessMethodType ?customObjectIdentifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Describes the type and format of extension access. Only one of CustomObjectIdentifier or AccessMethodType may be provided. Providing both results in InvalidArgsException."]
module GeneralName =
  struct
    type nonrec t =
      {
      otherName: OtherName.t option
        [@ocaml.doc "Represents GeneralName using an OtherName object."];
      rfc822Name: String256.t option
        [@ocaml.doc "Represents GeneralName as an RFC 822 email address."];
      dnsName: String253.t option
        [@ocaml.doc "Represents GeneralName as a DNS name."];
      directoryName: ASN1Subject.t option ;
      ediPartyName: EdiPartyName.t option
        [@ocaml.doc "Represents GeneralName as an EdiPartyName object."];
      uniformResourceIdentifier: String253.t option
        [@ocaml.doc "Represents GeneralName as a URI."];
      ipAddress: String39.t option
        [@ocaml.doc "Represents GeneralName as an IPv4 or IPv6 address."];
      registeredId: CustomObjectIdentifier.t option
        [@ocaml.doc "Represents GeneralName as an object identifier (OID)."]}
    let make ?otherName =
      fun ?rfc822Name ->
        fun ?dnsName ->
          fun ?directoryName ->
            fun ?ediPartyName ->
              fun ?uniformResourceIdentifier ->
                fun ?ipAddress ->
                  fun ?registeredId ->
                    fun () ->
                      {
                        otherName;
                        rfc822Name;
                        dnsName;
                        directoryName;
                        ediPartyName;
                        uniformResourceIdentifier;
                        ipAddress;
                        registeredId
                      }
    let to_value x =
      structure_to_value
        [("OtherName", (Option.map x.otherName ~f:OtherName.to_value));
        ("Rfc822Name", (Option.map x.rfc822Name ~f:String256.to_value));
        ("DnsName", (Option.map x.dnsName ~f:String253.to_value));
        ("DirectoryName",
          (Option.map x.directoryName ~f:ASN1Subject.to_value));
        ("EdiPartyName",
          (Option.map x.ediPartyName ~f:EdiPartyName.to_value));
        ("UniformResourceIdentifier",
          (Option.map x.uniformResourceIdentifier ~f:String253.to_value));
        ("IpAddress", (Option.map x.ipAddress ~f:String39.to_value));
        ("RegisteredId",
          (Option.map x.registeredId ~f:CustomObjectIdentifier.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let registeredId =
        (Option.map ~f:CustomObjectIdentifier.of_xml)
          (Xml.child xml_arg0 "RegisteredId") in
      let ipAddress =
        (Option.map ~f:String39.of_xml) (Xml.child xml_arg0 "IpAddress") in
      let uniformResourceIdentifier =
        (Option.map ~f:String253.of_xml)
          (Xml.child xml_arg0 "UniformResourceIdentifier") in
      let ediPartyName =
        (Option.map ~f:EdiPartyName.of_xml)
          (Xml.child xml_arg0 "EdiPartyName") in
      let directoryName =
        (Option.map ~f:ASN1Subject.of_xml)
          (Xml.child xml_arg0 "DirectoryName") in
      let dnsName =
        (Option.map ~f:String253.of_xml) (Xml.child xml_arg0 "DnsName") in
      let rfc822Name =
        (Option.map ~f:String256.of_xml) (Xml.child xml_arg0 "Rfc822Name") in
      let otherName =
        (Option.map ~f:OtherName.of_xml) (Xml.child xml_arg0 "OtherName") in
      make ?registeredId ?ipAddress ?uniformResourceIdentifier ?ediPartyName
        ?directoryName ?dnsName ?rfc822Name ?otherName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let registeredId =
        field_map json__ "RegisteredId" CustomObjectIdentifier.of_json in
      let ipAddress = field_map json__ "IpAddress" String39.of_json in
      let uniformResourceIdentifier =
        field_map json__ "UniformResourceIdentifier" String253.of_json in
      let ediPartyName = field_map json__ "EdiPartyName" EdiPartyName.of_json in
      let directoryName =
        field_map json__ "DirectoryName" ASN1Subject.of_json in
      let dnsName = field_map json__ "DnsName" String253.of_json in
      let rfc822Name = field_map json__ "Rfc822Name" String256.of_json in
      let otherName = field_map json__ "OtherName" OtherName.of_json in
      make ?registeredId ?ipAddress ?uniformResourceIdentifier ?ediPartyName
        ?directoryName ?dnsName ?rfc822Name ?otherName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Describes an ASN.1 X.400 GeneralName as defined in RFC 5280. Only one of the following naming options should be provided. Providing more than one option results in an InvalidArgsException error."]
module PolicyQualifierId =
  struct
    type nonrec t =
      | CPS 
      | Non_static_id of string 
    let make i = i
    let to_string = function | CPS -> "CPS" | Non_static_id s -> s
    let of_string = function | "CPS" -> CPS | 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 PolicyQualifierId" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"PolicyQualifierId" j)
    let to_json = simple_to_json to_value
  end
module Qualifier =
  struct
    type nonrec t =
      {
      cpsUri: String256.t
        [@ocaml.doc
          "Contains a pointer to a certification practice statement (CPS) published by the CA."]}
    let context_ = "Qualifier"
    let make ~cpsUri = fun () -> { cpsUri }
    let to_value x =
      structure_to_value [("CpsUri", (Some (String256.to_value x.cpsUri)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let cpsUri =
        String256.of_xml (Xml.child_exn ~context:context_ xml_arg0 "CpsUri") in
      make ~cpsUri ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let cpsUri = field_map_exn json__ "CpsUri" String256.of_json in
      make ~cpsUri ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Defines a PolicyInformation qualifier. Amazon Web Services Private CA supports the certification practice statement (CPS) qualifier defined in RFC 5280."]
module AccessDescription =
  struct
    type nonrec t =
      {
      accessMethod: AccessMethod.t
        [@ocaml.doc "The type and format of AccessDescription information."];
      accessLocation: GeneralName.t
        [@ocaml.doc "The location of AccessDescription information."]}
    let context_ = "AccessDescription"
    let make ~accessMethod =
      fun ~accessLocation -> fun () -> { accessMethod; accessLocation }
    let to_value x =
      structure_to_value
        [("AccessMethod", (Some (AccessMethod.to_value x.accessMethod)));
        ("AccessLocation", (Some (GeneralName.to_value x.accessLocation)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accessLocation =
        GeneralName.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AccessLocation") in
      let accessMethod =
        AccessMethod.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AccessMethod") in
      make ~accessLocation ~accessMethod ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accessLocation =
        field_map_exn json__ "AccessLocation" GeneralName.of_json in
      let accessMethod =
        field_map_exn json__ "AccessMethod" AccessMethod.of_json in
      make ~accessLocation ~accessMethod ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Provides access information used by the authorityInfoAccess and subjectInfoAccess extensions described in RFC 5280."]
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 PolicyQualifierInfo =
  struct
    type nonrec t =
      {
      policyQualifierId: PolicyQualifierId.t
        [@ocaml.doc "Identifies the qualifier modifying a CertPolicyId."];
      qualifier: Qualifier.t
        [@ocaml.doc
          "Defines the qualifier type. Amazon Web Services Private CA supports the use of a URI for a CPS qualifier in this field."]}
    let context_ = "PolicyQualifierInfo"
    let make ~policyQualifierId =
      fun ~qualifier -> fun () -> { policyQualifierId; qualifier }
    let to_value x =
      structure_to_value
        [("PolicyQualifierId",
           (Some (PolicyQualifierId.to_value x.policyQualifierId)));
        ("Qualifier", (Some (Qualifier.to_value x.qualifier)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let qualifier =
        Qualifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Qualifier") in
      let policyQualifierId =
        PolicyQualifierId.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "PolicyQualifierId") in
      make ~qualifier ~policyQualifierId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let qualifier = field_map_exn json__ "Qualifier" Qualifier.of_json in
      let policyQualifierId =
        field_map_exn json__ "PolicyQualifierId" PolicyQualifierId.of_json in
      make ~qualifier ~policyQualifierId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Modifies the CertPolicyId of a PolicyInformation object with a qualifier. Amazon Web Services Private CA supports the certification practice statement (CPS) qualifier."]
module AccessDescriptionList =
  struct
    type nonrec t = AccessDescription.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:AccessDescription.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:AccessDescription.of_xml)
    let of_json j =
      list_of_json ~kind:"AccessDescriptionList"
        ~of_json:AccessDescription.of_json j
    let to_json v = composed_to_json to_value v
  end
module KeyUsage =
  struct
    type nonrec t =
      {
      digitalSignature: Boolean.t option
        [@ocaml.doc "Key can be used for digital signing."];
      nonRepudiation: Boolean.t option
        [@ocaml.doc "Key can be used for non-repudiation."];
      keyEncipherment: Boolean.t option
        [@ocaml.doc "Key can be used to encipher data."];
      dataEncipherment: Boolean.t option
        [@ocaml.doc "Key can be used to decipher data."];
      keyAgreement: Boolean.t option
        [@ocaml.doc "Key can be used in a key-agreement protocol."];
      keyCertSign: Boolean.t option
        [@ocaml.doc "Key can be used to sign certificates."];
      cRLSign: Boolean.t option [@ocaml.doc "Key can be used to sign CRLs."];
      encipherOnly: Boolean.t option
        [@ocaml.doc "Key can be used only to encipher data."];
      decipherOnly: Boolean.t option
        [@ocaml.doc "Key can be used only to decipher data."]}
    let make ?digitalSignature =
      fun ?nonRepudiation ->
        fun ?keyEncipherment ->
          fun ?dataEncipherment ->
            fun ?keyAgreement ->
              fun ?keyCertSign ->
                fun ?cRLSign ->
                  fun ?encipherOnly ->
                    fun ?decipherOnly ->
                      fun () ->
                        {
                          digitalSignature;
                          nonRepudiation;
                          keyEncipherment;
                          dataEncipherment;
                          keyAgreement;
                          keyCertSign;
                          cRLSign;
                          encipherOnly;
                          decipherOnly
                        }
    let to_value x =
      structure_to_value
        [("DigitalSignature",
           (Option.map x.digitalSignature ~f:Boolean.to_value));
        ("NonRepudiation", (Option.map x.nonRepudiation ~f:Boolean.to_value));
        ("KeyEncipherment",
          (Option.map x.keyEncipherment ~f:Boolean.to_value));
        ("DataEncipherment",
          (Option.map x.dataEncipherment ~f:Boolean.to_value));
        ("KeyAgreement", (Option.map x.keyAgreement ~f:Boolean.to_value));
        ("KeyCertSign", (Option.map x.keyCertSign ~f:Boolean.to_value));
        ("CRLSign", (Option.map x.cRLSign ~f:Boolean.to_value));
        ("EncipherOnly", (Option.map x.encipherOnly ~f:Boolean.to_value));
        ("DecipherOnly", (Option.map x.decipherOnly ~f:Boolean.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let decipherOnly =
        (Option.map ~f:Boolean.of_xml) (Xml.child xml_arg0 "DecipherOnly") in
      let encipherOnly =
        (Option.map ~f:Boolean.of_xml) (Xml.child xml_arg0 "EncipherOnly") in
      let cRLSign =
        (Option.map ~f:Boolean.of_xml) (Xml.child xml_arg0 "CRLSign") in
      let keyCertSign =
        (Option.map ~f:Boolean.of_xml) (Xml.child xml_arg0 "KeyCertSign") in
      let keyAgreement =
        (Option.map ~f:Boolean.of_xml) (Xml.child xml_arg0 "KeyAgreement") in
      let dataEncipherment =
        (Option.map ~f:Boolean.of_xml)
          (Xml.child xml_arg0 "DataEncipherment") in
      let keyEncipherment =
        (Option.map ~f:Boolean.of_xml) (Xml.child xml_arg0 "KeyEncipherment") in
      let nonRepudiation =
        (Option.map ~f:Boolean.of_xml) (Xml.child xml_arg0 "NonRepudiation") in
      let digitalSignature =
        (Option.map ~f:Boolean.of_xml)
          (Xml.child xml_arg0 "DigitalSignature") in
      make ?decipherOnly ?encipherOnly ?cRLSign ?keyCertSign ?keyAgreement
        ?dataEncipherment ?keyEncipherment ?nonRepudiation ?digitalSignature
        ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let decipherOnly = field_map json__ "DecipherOnly" Boolean.of_json in
      let encipherOnly = field_map json__ "EncipherOnly" Boolean.of_json in
      let cRLSign = field_map json__ "CRLSign" Boolean.of_json in
      let keyCertSign = field_map json__ "KeyCertSign" Boolean.of_json in
      let keyAgreement = field_map json__ "KeyAgreement" Boolean.of_json in
      let dataEncipherment =
        field_map json__ "DataEncipherment" Boolean.of_json in
      let keyEncipherment =
        field_map json__ "KeyEncipherment" Boolean.of_json in
      let nonRepudiation = field_map json__ "NonRepudiation" Boolean.of_json in
      let digitalSignature =
        field_map json__ "DigitalSignature" Boolean.of_json in
      make ?decipherOnly ?encipherOnly ?cRLSign ?keyCertSign ?keyAgreement
        ?dataEncipherment ?keyEncipherment ?nonRepudiation ?digitalSignature
        ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Defines one or more purposes for which the key contained in the certificate can be used. Default value for each option is false."]
module CnameString =
  struct
    type nonrec t = string
    let context_ = "CnameString"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:0) >>=
             (fun () ->
                (check_string_max i ~max:253) >>=
                  (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:"CnameString" j
    let to_json = simple_to_json to_value
  end
module CrlDistributionPointExtensionConfiguration =
  struct
    type nonrec t =
      {
      omitExtension: Boolean.t
        [@ocaml.doc
          "Configures whether the CRL Distribution Point extension should be populated with the default URL to the CRL. If set to true, then the CDP extension will not be present in any certificates issued by that CA unless otherwise specified through CSR or API passthrough. Only set this if you have another way to distribute the CRL Distribution Points ffor certificates issued by your CA, such as the Matter Distributed Compliance Ledger This configuration cannot be enabled with a custom CNAME set."]}
    let context_ = "CrlDistributionPointExtensionConfiguration"
    let make ~omitExtension = fun () -> { omitExtension }
    let to_value x =
      structure_to_value
        [("OmitExtension", (Some (Boolean.to_value x.omitExtension)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let omitExtension =
        Boolean.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "OmitExtension") in
      make ~omitExtension ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let omitExtension =
        field_map_exn json__ "OmitExtension" Boolean.of_json in
      make ~omitExtension ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains configuration information for the default behavior of the CRL Distribution Point (CDP) extension in certificates issued by your CA. This extension contains a link to download the CRL, so you can check whether a certificate has been revoked. To choose whether you want this extension omitted or not in certificates issued by your CA, you can set the OmitExtension parameter."]
module CrlPathString =
  struct
    type nonrec t = string
    let context_ = "CrlPathString"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:0) >>=
             (fun () ->
                (check_string_max i ~max:253) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"[-a-zA-Z0-9;?:@&=+$,%_.!~*()']+(/[-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:"CrlPathString" j
    let to_json = simple_to_json to_value
  end
module CrlType =
  struct
    type nonrec t =
      | COMPLETE 
      | PARTITIONED 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | COMPLETE -> "COMPLETE"
      | PARTITIONED -> "PARTITIONED"
      | Non_static_id s -> s
    let of_string =
      function
      | "COMPLETE" -> COMPLETE
      | "PARTITIONED" -> PARTITIONED
      | 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 CrlType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"CrlType" j)
    let to_json = simple_to_json to_value
  end
module Integer1To5000 =
  struct
    type nonrec t = int
    let make i =
      let open Result in
        ok_or_failwith
          ((check_int_max i ~max:5000) >>= (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 Integer1To5000" 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 S3BucketName3To255 =
  struct
    type nonrec t = string
    let context_ = "S3BucketName3To255"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:3) >>=
             (fun () ->
                (check_string_max i ~max:255) >>=
                  (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:"S3BucketName3To255" j
    let to_json = simple_to_json to_value
  end
module S3ObjectAcl =
  struct
    type nonrec t =
      | PUBLIC_READ 
      | BUCKET_OWNER_FULL_CONTROL 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | PUBLIC_READ -> "PUBLIC_READ"
      | BUCKET_OWNER_FULL_CONTROL -> "BUCKET_OWNER_FULL_CONTROL"
      | Non_static_id s -> s
    let of_string =
      function
      | "PUBLIC_READ" -> PUBLIC_READ
      | "BUCKET_OWNER_FULL_CONTROL" -> BUCKET_OWNER_FULL_CONTROL
      | 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 S3ObjectAcl" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"S3ObjectAcl" j)
    let to_json = simple_to_json to_value
  end
module PolicyQualifierInfoList =
  struct
    type nonrec t = PolicyQualifierInfo.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:20) >>= (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:PolicyQualifierInfo.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:PolicyQualifierInfo.of_xml)
    let of_json j =
      list_of_json ~kind:"PolicyQualifierInfoList"
        ~of_json:PolicyQualifierInfo.of_json j
    let to_json v = composed_to_json to_value v
  end
module Base64String1To4096 =
  struct
    type nonrec t = string
    let context_ = "Base64String1To4096"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:4096) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?")));
        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:"Base64String1To4096" j
    let to_json = simple_to_json to_value
  end
module ExtendedKeyUsageType =
  struct
    type nonrec t =
      | SERVER_AUTH 
      | CLIENT_AUTH 
      | CODE_SIGNING 
      | EMAIL_PROTECTION 
      | TIME_STAMPING 
      | OCSP_SIGNING 
      | SMART_CARD_LOGIN 
      | DOCUMENT_SIGNING 
      | CERTIFICATE_TRANSPARENCY 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | SERVER_AUTH -> "SERVER_AUTH"
      | CLIENT_AUTH -> "CLIENT_AUTH"
      | CODE_SIGNING -> "CODE_SIGNING"
      | EMAIL_PROTECTION -> "EMAIL_PROTECTION"
      | TIME_STAMPING -> "TIME_STAMPING"
      | OCSP_SIGNING -> "OCSP_SIGNING"
      | SMART_CARD_LOGIN -> "SMART_CARD_LOGIN"
      | DOCUMENT_SIGNING -> "DOCUMENT_SIGNING"
      | CERTIFICATE_TRANSPARENCY -> "CERTIFICATE_TRANSPARENCY"
      | Non_static_id s -> s
    let of_string =
      function
      | "SERVER_AUTH" -> SERVER_AUTH
      | "CLIENT_AUTH" -> CLIENT_AUTH
      | "CODE_SIGNING" -> CODE_SIGNING
      | "EMAIL_PROTECTION" -> EMAIL_PROTECTION
      | "TIME_STAMPING" -> TIME_STAMPING
      | "OCSP_SIGNING" -> OCSP_SIGNING
      | "SMART_CARD_LOGIN" -> SMART_CARD_LOGIN
      | "DOCUMENT_SIGNING" -> DOCUMENT_SIGNING
      | "CERTIFICATE_TRANSPARENCY" -> CERTIFICATE_TRANSPARENCY
      | 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 ExtendedKeyUsageType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"ExtendedKeyUsageType" j)
    let to_json = simple_to_json to_value
  end
module ActionType =
  struct
    type nonrec t =
      | IssueCertificate 
      | GetCertificate 
      | ListPermissions 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | IssueCertificate -> "IssueCertificate"
      | GetCertificate -> "GetCertificate"
      | ListPermissions -> "ListPermissions"
      | Non_static_id s -> s
    let of_string =
      function
      | "IssueCertificate" -> IssueCertificate
      | "GetCertificate" -> GetCertificate
      | "ListPermissions" -> ListPermissions
      | 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 ActionType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"ActionType" j)
    let to_json = simple_to_json to_value
  end
module CsrExtensions =
  struct
    type nonrec t =
      {
      keyUsage: KeyUsage.t option
        [@ocaml.doc
          "Indicates the purpose of the certificate and of the key contained in the certificate."];
      subjectInformationAccess: AccessDescriptionList.t option
        [@ocaml.doc
          "For CA certificates, provides a path to additional information pertaining to the CA, such as revocation and policy. For more information, see Subject Information Access in RFC 5280."]}
    let make ?keyUsage =
      fun ?subjectInformationAccess ->
        fun () -> { keyUsage; subjectInformationAccess }
    let to_value x =
      structure_to_value
        [("KeyUsage", (Option.map x.keyUsage ~f:KeyUsage.to_value));
        ("SubjectInformationAccess",
          (Option.map x.subjectInformationAccess
             ~f:AccessDescriptionList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let subjectInformationAccess =
        (Option.map ~f:AccessDescriptionList.of_xml)
          (Xml.child xml_arg0 "SubjectInformationAccess") in
      let keyUsage =
        (Option.map ~f:KeyUsage.of_xml) (Xml.child xml_arg0 "KeyUsage") in
      make ?subjectInformationAccess ?keyUsage ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let subjectInformationAccess =
        field_map json__ "SubjectInformationAccess"
          AccessDescriptionList.of_json in
      let keyUsage = field_map json__ "KeyUsage" KeyUsage.of_json in
      make ?subjectInformationAccess ?keyUsage ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Describes the certificate extensions to be added to the certificate signing request (CSR)."]
module KeyAlgorithm =
  struct
    type nonrec t =
      | RSA_2048 
      | RSA_3072 
      | RSA_4096 
      | EC_prime256v1 
      | EC_secp384r1 
      | EC_secp521r1 
      | ML_DSA_44 
      | ML_DSA_65 
      | ML_DSA_87 
      | SM2 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | RSA_2048 -> "RSA_2048"
      | RSA_3072 -> "RSA_3072"
      | RSA_4096 -> "RSA_4096"
      | EC_prime256v1 -> "EC_prime256v1"
      | EC_secp384r1 -> "EC_secp384r1"
      | EC_secp521r1 -> "EC_secp521r1"
      | ML_DSA_44 -> "ML_DSA_44"
      | ML_DSA_65 -> "ML_DSA_65"
      | ML_DSA_87 -> "ML_DSA_87"
      | SM2 -> "SM2"
      | Non_static_id s -> s
    let of_string =
      function
      | "RSA_2048" -> RSA_2048
      | "RSA_3072" -> RSA_3072
      | "RSA_4096" -> RSA_4096
      | "EC_prime256v1" -> EC_prime256v1
      | "EC_secp384r1" -> EC_secp384r1
      | "EC_secp521r1" -> EC_secp521r1
      | "ML_DSA_44" -> ML_DSA_44
      | "ML_DSA_65" -> ML_DSA_65
      | "ML_DSA_87" -> ML_DSA_87
      | "SM2" -> SM2
      | 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 KeyAlgorithm" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"KeyAlgorithm" j)
    let to_json = simple_to_json to_value
  end
module SigningAlgorithm =
  struct
    type nonrec t =
      | SHA256WITHECDSA 
      | SHA384WITHECDSA 
      | SHA512WITHECDSA 
      | SHA256WITHRSA 
      | SHA384WITHRSA 
      | SHA512WITHRSA 
      | SM3WITHSM2 
      | ML_DSA_44 
      | ML_DSA_65 
      | ML_DSA_87 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | SHA256WITHECDSA -> "SHA256WITHECDSA"
      | SHA384WITHECDSA -> "SHA384WITHECDSA"
      | SHA512WITHECDSA -> "SHA512WITHECDSA"
      | SHA256WITHRSA -> "SHA256WITHRSA"
      | SHA384WITHRSA -> "SHA384WITHRSA"
      | SHA512WITHRSA -> "SHA512WITHRSA"
      | SM3WITHSM2 -> "SM3WITHSM2"
      | ML_DSA_44 -> "ML_DSA_44"
      | ML_DSA_65 -> "ML_DSA_65"
      | ML_DSA_87 -> "ML_DSA_87"
      | Non_static_id s -> s
    let of_string =
      function
      | "SHA256WITHECDSA" -> SHA256WITHECDSA
      | "SHA384WITHECDSA" -> SHA384WITHECDSA
      | "SHA512WITHECDSA" -> SHA512WITHECDSA
      | "SHA256WITHRSA" -> SHA256WITHRSA
      | "SHA384WITHRSA" -> SHA384WITHRSA
      | "SHA512WITHRSA" -> SHA512WITHRSA
      | "SM3WITHSM2" -> SM3WITHSM2
      | "ML_DSA_44" -> ML_DSA_44
      | "ML_DSA_65" -> ML_DSA_65
      | "ML_DSA_87" -> ML_DSA_87
      | 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 SigningAlgorithm" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"SigningAlgorithm" j)
    let to_json = simple_to_json to_value
  end
module CrlConfiguration =
  struct
    type nonrec t =
      {
      enabled: Boolean.t
        [@ocaml.doc
          "Boolean value that specifies whether certificate revocation lists (CRLs) are enabled. You can use this value to enable certificate revocation for a new CA when you call the CreateCertificateAuthority action or for an existing CA when you call the UpdateCertificateAuthority action."];
      expirationInDays: Integer1To5000.t option
        [@ocaml.doc "Validity period of the CRL in days."];
      customCname: CnameString.t option
        [@ocaml.doc
          "Name inserted into the certificate CRL Distribution Points extension that enables the use of an alias for the CRL distribution point. Use this value if you don't want the name of your S3 bucket to be public. The content of a Canonical Name (CNAME) record must conform to RFC2396 restrictions on the use of special characters in URIs. Additionally, the value of the CNAME must not include a protocol prefix such as \"http://\" or \"https://\"."];
      s3BucketName: S3BucketName3To255.t option
        [@ocaml.doc
          "Name of the S3 bucket that contains the CRL. If you do not provide a value for the CustomCname argument, the name of your S3 bucket is placed into the CRL Distribution Points extension of the issued certificate. You can change the name of your bucket by calling the UpdateCertificateAuthority operation. You must specify a bucket policy that allows Amazon Web Services Private CA to write the CRL to your bucket. The S3BucketName parameter must conform to the S3 bucket naming rules."];
      s3ObjectAcl: S3ObjectAcl.t option
        [@ocaml.doc
          "Determines whether the CRL will be publicly readable or privately held in the CRL Amazon S3 bucket. If you choose PUBLIC_READ, the CRL will be accessible over the public internet. If you choose BUCKET_OWNER_FULL_CONTROL, only the owner of the CRL S3 bucket can access the CRL, and your PKI clients may need an alternative method of access. If no value is specified, the default is PUBLIC_READ. Note: This default can cause CA creation to fail in some circumstances. If you have have enabled the Block Public Access (BPA) feature in your S3 account, then you must specify the value of this parameter as BUCKET_OWNER_FULL_CONTROL, and not doing so results in an error. If you have disabled BPA in S3, then you can specify either BUCKET_OWNER_FULL_CONTROL or PUBLIC_READ as the value. For more information, see Blocking public access to the S3 bucket."];
      crlDistributionPointExtensionConfiguration:
        CrlDistributionPointExtensionConfiguration.t option
        [@ocaml.doc
          "Configures the behavior of the CRL Distribution Point extension for certificates issued by your certificate authority. If this field is not provided, then the CRl Distribution Point Extension will be present and contain the default CRL URL."];
      crlType: CrlType.t option
        [@ocaml.doc
          "Specifies whether to create a complete or partitioned CRL. This setting determines the maximum number of certificates that the certificate authority can issue and revoke. For more information, see Amazon Web Services Private CA quotas. COMPLETE - The default setting. Amazon Web Services Private CA maintains a single CRL \239\172\129le for all unexpired certi\239\172\129cates issued by a CA that have been revoked for any reason. Each certi\239\172\129cate that Amazon Web Services Private CA issues is bound to a speci\239\172\129c CRL through its CRL distribution point (CDP) extension, de\239\172\129ned in RFC 5280. PARTITIONED - Compared to complete CRLs, partitioned CRLs dramatically increase the number of certi\239\172\129cates your private CA can issue. When using partitioned CRLs, you must validate that the CRL's associated issuing distribution point (IDP) URI matches the certi\239\172\129cate's CDP URI to ensure the right CRL has been fetched. Amazon Web Services Private CA marks the IDP extension as critical, which your client must be able to process."];
      customPath: CrlPathString.t option
        [@ocaml.doc
          "Designates a custom \239\172\129le path in S3 for CRL(s). For example, http://<CustomName>/ <CustomPath>/<CrlPartition_GUID>.crl."]}
    let context_ = "CrlConfiguration"
    let make ?expirationInDays =
      fun ?customCname ->
        fun ?s3BucketName ->
          fun ?s3ObjectAcl ->
            fun ?crlDistributionPointExtensionConfiguration ->
              fun ?crlType ->
                fun ?customPath ->
                  fun ~enabled ->
                    fun () ->
                      {
                        expirationInDays;
                        customCname;
                        s3BucketName;
                        s3ObjectAcl;
                        crlDistributionPointExtensionConfiguration;
                        crlType;
                        customPath;
                        enabled
                      }
    let to_value x =
      structure_to_value
        [("Enabled", (Some (Boolean.to_value x.enabled)));
        ("ExpirationInDays",
          (Option.map x.expirationInDays ~f:Integer1To5000.to_value));
        ("CustomCname", (Option.map x.customCname ~f:CnameString.to_value));
        ("S3BucketName",
          (Option.map x.s3BucketName ~f:S3BucketName3To255.to_value));
        ("S3ObjectAcl", (Option.map x.s3ObjectAcl ~f:S3ObjectAcl.to_value));
        ("CrlDistributionPointExtensionConfiguration",
          (Option.map x.crlDistributionPointExtensionConfiguration
             ~f:CrlDistributionPointExtensionConfiguration.to_value));
        ("CrlType", (Option.map x.crlType ~f:CrlType.to_value));
        ("CustomPath", (Option.map x.customPath ~f:CrlPathString.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let customPath =
        (Option.map ~f:CrlPathString.of_xml)
          (Xml.child xml_arg0 "CustomPath") in
      let crlType =
        (Option.map ~f:CrlType.of_xml) (Xml.child xml_arg0 "CrlType") in
      let crlDistributionPointExtensionConfiguration =
        (Option.map ~f:CrlDistributionPointExtensionConfiguration.of_xml)
          (Xml.child xml_arg0 "CrlDistributionPointExtensionConfiguration") in
      let s3ObjectAcl =
        (Option.map ~f:S3ObjectAcl.of_xml) (Xml.child xml_arg0 "S3ObjectAcl") in
      let s3BucketName =
        (Option.map ~f:S3BucketName3To255.of_xml)
          (Xml.child xml_arg0 "S3BucketName") in
      let customCname =
        (Option.map ~f:CnameString.of_xml) (Xml.child xml_arg0 "CustomCname") in
      let expirationInDays =
        (Option.map ~f:Integer1To5000.of_xml)
          (Xml.child xml_arg0 "ExpirationInDays") in
      let enabled =
        Boolean.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Enabled") in
      make ?customPath ?crlType ?crlDistributionPointExtensionConfiguration
        ?s3ObjectAcl ?s3BucketName ?customCname ?expirationInDays ~enabled ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let customPath = field_map json__ "CustomPath" CrlPathString.of_json in
      let crlType = field_map json__ "CrlType" CrlType.of_json in
      let crlDistributionPointExtensionConfiguration =
        field_map json__ "CrlDistributionPointExtensionConfiguration"
          CrlDistributionPointExtensionConfiguration.of_json in
      let s3ObjectAcl = field_map json__ "S3ObjectAcl" S3ObjectAcl.of_json in
      let s3BucketName =
        field_map json__ "S3BucketName" S3BucketName3To255.of_json in
      let customCname = field_map json__ "CustomCname" CnameString.of_json in
      let expirationInDays =
        field_map json__ "ExpirationInDays" Integer1To5000.of_json in
      let enabled = field_map_exn json__ "Enabled" Boolean.of_json in
      make ?customPath ?crlType ?crlDistributionPointExtensionConfiguration
        ?s3ObjectAcl ?s3BucketName ?customCname ?expirationInDays ~enabled ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains configuration information for a certificate revocation list (CRL). Your private certificate authority (CA) creates base CRLs. Delta CRLs are not supported. You can enable CRLs for your new or an existing private CA by setting the Enabled parameter to true. Your private CA writes CRLs to an S3 bucket that you specify in the S3BucketName parameter. You can hide the name of your bucket by specifying a value for the CustomCname parameter. Your private CA by default copies the CNAME or the S3 bucket name to the CRL Distribution Points extension of each certificate it issues. If you want to configure this default behavior to be something different, you can set the CrlDistributionPointExtensionConfiguration parameter. Your S3 bucket policy must give write permission to Amazon Web Services Private CA. Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see Encrypting Your CRLs. Your private CA uses the value in the ExpirationInDays parameter to calculate the nextUpdate field in the CRL. The CRL is refreshed prior to a certificate's expiration date or when a certificate is revoked. When a certificate is revoked, it appears in the CRL until the certificate expires, and then in one additional CRL after expiration, and it always appears in the audit report. A CRL is typically updated approximately 30 minutes after a certificate is revoked. If for any reason a CRL update fails, Amazon Web Services Private CA makes further attempts every 15 minutes. CRLs contain the following fields: Version: The current version number defined in RFC 5280 is V2. The integer value is 0x1. Signature Algorithm: The name of the algorithm used to sign the CRL. Issuer: The X.500 distinguished name of your private CA that issued the CRL. Last Update: The issue date and time of this CRL. Next Update: The day and time by which the next CRL will be issued. Revoked Certificates: List of revoked certificates. Each list item contains the following information. Serial Number: The serial number, in hexadecimal format, of the revoked certificate. Revocation Date: Date and time the certificate was revoked. CRL Entry Extensions: Optional extensions for the CRL entry. X509v3 CRL Reason Code: Reason the certificate was revoked. CRL Extensions: Optional extensions for the CRL. X509v3 Authority Key Identifier: Identifies the public key associated with the private key used to sign the certificate. X509v3 CRL Number:: Decimal sequence number for the CRL. Signature Algorithm: Algorithm used by your private CA to sign the CRL. Signature Value: Signature computed over the CRL. Certificate revocation lists created by Amazon Web Services Private CA are DER-encoded. You can use the following OpenSSL command to list a CRL. openssl crl -inform DER -text -in crl_path -noout For more information, see Planning a certificate revocation list (CRL) in the Amazon Web Services Private Certificate Authority User Guide"]
module OcspConfiguration =
  struct
    type nonrec t =
      {
      enabled: Boolean.t
        [@ocaml.doc
          "Flag enabling use of the Online Certificate Status Protocol (OCSP) for validating certificate revocation status."];
      ocspCustomCname: CnameString.t option
        [@ocaml.doc
          "By default, Amazon Web Services Private CA injects an Amazon Web Services domain into certificates being validated by the Online Certificate Status Protocol (OCSP). A customer can alternatively use this object to define a CNAME specifying a customized OCSP domain. The content of a Canonical Name (CNAME) record must conform to RFC2396 restrictions on the use of special characters in URIs. Additionally, the value of the CNAME must not include a protocol prefix such as \"http://\" or \"https://\". For more information, see Customizing Online Certificate Status Protocol (OCSP) in the Amazon Web Services Private Certificate Authority User Guide."]}
    let context_ = "OcspConfiguration"
    let make ?ocspCustomCname =
      fun ~enabled -> fun () -> { ocspCustomCname; enabled }
    let to_value x =
      structure_to_value
        [("Enabled", (Some (Boolean.to_value x.enabled)));
        ("OcspCustomCname",
          (Option.map x.ocspCustomCname ~f:CnameString.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let ocspCustomCname =
        (Option.map ~f:CnameString.of_xml)
          (Xml.child xml_arg0 "OcspCustomCname") in
      let enabled =
        Boolean.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Enabled") in
      make ?ocspCustomCname ~enabled ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let ocspCustomCname =
        field_map json__ "OcspCustomCname" CnameString.of_json in
      let enabled = field_map_exn json__ "Enabled" Boolean.of_json in
      make ?ocspCustomCname ~enabled ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains information to enable and configure Online Certificate Status Protocol (OCSP) for validating certificate revocation status. When you revoke a certificate, OCSP responses may take up to 60 minutes to reflect the new status."]
module PolicyInformation =
  struct
    type nonrec t =
      {
      certPolicyId: CustomObjectIdentifier.t
        [@ocaml.doc
          "Specifies the object identifier (OID) of the certificate policy under which the certificate was issued. For more information, see NIST's definition of Object Identifier (OID)."];
      policyQualifiers: PolicyQualifierInfoList.t option
        [@ocaml.doc
          "Modifies the given CertPolicyId with a qualifier. Amazon Web Services Private CA supports the certification practice statement (CPS) qualifier."]}
    let context_ = "PolicyInformation"
    let make ?policyQualifiers =
      fun ~certPolicyId -> fun () -> { policyQualifiers; certPolicyId }
    let to_value x =
      structure_to_value
        [("CertPolicyId",
           (Some (CustomObjectIdentifier.to_value x.certPolicyId)));
        ("PolicyQualifiers",
          (Option.map x.policyQualifiers ~f:PolicyQualifierInfoList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let policyQualifiers =
        (Option.map ~f:PolicyQualifierInfoList.of_xml)
          (Xml.child xml_arg0 "PolicyQualifiers") in
      let certPolicyId =
        CustomObjectIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertPolicyId") in
      make ?policyQualifiers ~certPolicyId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let policyQualifiers =
        field_map json__ "PolicyQualifiers" PolicyQualifierInfoList.of_json in
      let certPolicyId =
        field_map_exn json__ "CertPolicyId" CustomObjectIdentifier.of_json in
      make ?policyQualifiers ~certPolicyId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Defines the X.509 CertificatePolicies extension."]
module CustomExtension =
  struct
    type nonrec t =
      {
      objectIdentifier: CustomObjectIdentifier.t
        [@ocaml.doc
          "Specifies the object identifier (OID) of the X.509 extension. For more information, see the Global OID reference database."];
      value: Base64String1To4096.t
        [@ocaml.doc
          "Specifies the base64-encoded value of the X.509 extension."];
      critical: Boolean.t option
        [@ocaml.doc "Specifies the critical flag of the X.509 extension."]}
    let context_ = "CustomExtension"
    let make ?critical =
      fun ~objectIdentifier ->
        fun ~value -> fun () -> { critical; objectIdentifier; value }
    let to_value x =
      structure_to_value
        [("ObjectIdentifier",
           (Some (CustomObjectIdentifier.to_value x.objectIdentifier)));
        ("Value", (Some (Base64String1To4096.to_value x.value)));
        ("Critical", (Option.map x.critical ~f:Boolean.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let critical =
        (Option.map ~f:Boolean.of_xml) (Xml.child xml_arg0 "Critical") in
      let value =
        Base64String1To4096.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Value") in
      let objectIdentifier =
        CustomObjectIdentifier.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "ObjectIdentifier") in
      make ?critical ~value ~objectIdentifier ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let critical = field_map json__ "Critical" Boolean.of_json in
      let value = field_map_exn json__ "Value" Base64String1To4096.of_json in
      let objectIdentifier =
        field_map_exn json__ "ObjectIdentifier"
          CustomObjectIdentifier.of_json in
      make ?critical ~value ~objectIdentifier ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Specifies the X.509 extension information for a certificate. Extensions present in CustomExtensions follow the ApiPassthrough template rules."]
module ExtendedKeyUsage =
  struct
    type nonrec t =
      {
      extendedKeyUsageType: ExtendedKeyUsageType.t option
        [@ocaml.doc
          "Specifies a standard ExtendedKeyUsage as defined as in RFC 5280."];
      extendedKeyUsageObjectIdentifier: CustomObjectIdentifier.t option
        [@ocaml.doc
          "Specifies a custom ExtendedKeyUsage with an object identifier (OID)."]}
    let make ?extendedKeyUsageType =
      fun ?extendedKeyUsageObjectIdentifier ->
        fun () -> { extendedKeyUsageType; extendedKeyUsageObjectIdentifier }
    let to_value x =
      structure_to_value
        [("ExtendedKeyUsageType",
           (Option.map x.extendedKeyUsageType
              ~f:ExtendedKeyUsageType.to_value));
        ("ExtendedKeyUsageObjectIdentifier",
          (Option.map x.extendedKeyUsageObjectIdentifier
             ~f:CustomObjectIdentifier.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let extendedKeyUsageObjectIdentifier =
        (Option.map ~f:CustomObjectIdentifier.of_xml)
          (Xml.child xml_arg0 "ExtendedKeyUsageObjectIdentifier") in
      let extendedKeyUsageType =
        (Option.map ~f:ExtendedKeyUsageType.of_xml)
          (Xml.child xml_arg0 "ExtendedKeyUsageType") in
      make ?extendedKeyUsageObjectIdentifier ?extendedKeyUsageType ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let extendedKeyUsageObjectIdentifier =
        field_map json__ "ExtendedKeyUsageObjectIdentifier"
          CustomObjectIdentifier.of_json in
      let extendedKeyUsageType =
        field_map json__ "ExtendedKeyUsageType" ExtendedKeyUsageType.of_json in
      make ?extendedKeyUsageObjectIdentifier ?extendedKeyUsageType ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the KeyUsage extension."]
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 TagValue =
  struct
    type nonrec t = string
    let context_ = "TagValue"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:0) >>=
             (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 AWSPolicy =
  struct
    type nonrec t = string
    let context_ = "AWSPolicy"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:81920) >>=
                  (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:"AWSPolicy" j
    let to_json = simple_to_json to_value
  end
module AccountId =
  struct
    type nonrec t = string
    let context_ = "AccountId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:12) >>=
             (fun () ->
                (check_string_max i ~max:12) >>=
                  (fun () -> check_pattern i ~pattern:"[0-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:"AccountId" j
    let to_json = simple_to_json to_value
  end
module ActionList =
  struct
    type nonrec t = ActionType.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:3) >>= (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:ActionType.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:ActionType.of_xml)
    let of_json j =
      list_of_json ~kind:"ActionList" ~of_json:ActionType.of_json j
    let to_json v = composed_to_json to_value v
  end
module Arn =
  struct
    type nonrec t = string
    let context_ = "Arn"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:5) >>=
             (fun () ->
                (check_string_max i ~max:200) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"arn:[\\w+=/,.@-]+:acm-pca:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*")));
        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:"Arn" j
    let to_json = simple_to_json to_value
  end
module Principal =
  struct
    type nonrec t = string
    let context_ = "Principal"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:0) >>=
             (fun () ->
                (check_string_max i ~max:128) >>=
                  (fun () -> check_pattern i ~pattern:"[^*]+")));
        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:"Principal" j
    let to_json = simple_to_json to_value
  end
module TStamp =
  struct
    type nonrec t = string
    let make i = i
    let of_string x = x
    let to_value x = `Timestamp x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = string_of_xml ~kind:"a timestamp"
    let of_json = timestamp_of_json
    let to_json = simple_to_json to_value
  end
module CertificateAuthorityConfiguration =
  struct
    type nonrec t =
      {
      keyAlgorithm: KeyAlgorithm.t
        [@ocaml.doc
          "Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA."];
      signingAlgorithm: SigningAlgorithm.t
        [@ocaml.doc
          "Name of the algorithm your private CA uses to sign certificate requests. This parameter should not be confused with the SigningAlgorithm parameter used to sign certificates when they are issued."];
      subject: ASN1Subject.t
        [@ocaml.doc
          "Structure that contains X.500 distinguished name information for your private CA."];
      csrExtensions: CsrExtensions.t option
        [@ocaml.doc
          "Specifies information to be added to the extension section of the certificate signing request (CSR)."]}
    let context_ = "CertificateAuthorityConfiguration"
    let make ?csrExtensions =
      fun ~keyAlgorithm ->
        fun ~signingAlgorithm ->
          fun ~subject ->
            fun () ->
              { csrExtensions; keyAlgorithm; signingAlgorithm; subject }
    let to_value x =
      structure_to_value
        [("KeyAlgorithm", (Some (KeyAlgorithm.to_value x.keyAlgorithm)));
        ("SigningAlgorithm",
          (Some (SigningAlgorithm.to_value x.signingAlgorithm)));
        ("Subject", (Some (ASN1Subject.to_value x.subject)));
        ("CsrExtensions",
          (Option.map x.csrExtensions ~f:CsrExtensions.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let csrExtensions =
        (Option.map ~f:CsrExtensions.of_xml)
          (Xml.child xml_arg0 "CsrExtensions") in
      let subject =
        ASN1Subject.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Subject") in
      let signingAlgorithm =
        SigningAlgorithm.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "SigningAlgorithm") in
      let keyAlgorithm =
        KeyAlgorithm.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "KeyAlgorithm") in
      make ?csrExtensions ~subject ~signingAlgorithm ~keyAlgorithm ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let csrExtensions =
        field_map json__ "CsrExtensions" CsrExtensions.of_json in
      let subject = field_map_exn json__ "Subject" ASN1Subject.of_json in
      let signingAlgorithm =
        field_map_exn json__ "SigningAlgorithm" SigningAlgorithm.of_json in
      let keyAlgorithm =
        field_map_exn json__ "KeyAlgorithm" KeyAlgorithm.of_json in
      make ?csrExtensions ~subject ~signingAlgorithm ~keyAlgorithm ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains configuration information for your private certificate authority (CA). This includes information about the class of public key algorithm and the key pair that your private CA creates when it issues a certificate. It also includes the signature algorithm that it uses when issuing certificates, and its X.500 distinguished name. You must specify this information when you call the CreateCertificateAuthority action."]
module CertificateAuthorityStatus =
  struct
    type nonrec t =
      | CREATING 
      | PENDING_CERTIFICATE 
      | ACTIVE 
      | DELETED 
      | DISABLED 
      | EXPIRED 
      | FAILED 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | CREATING -> "CREATING"
      | PENDING_CERTIFICATE -> "PENDING_CERTIFICATE"
      | ACTIVE -> "ACTIVE"
      | DELETED -> "DELETED"
      | DISABLED -> "DISABLED"
      | EXPIRED -> "EXPIRED"
      | FAILED -> "FAILED"
      | Non_static_id s -> s
    let of_string =
      function
      | "CREATING" -> CREATING
      | "PENDING_CERTIFICATE" -> PENDING_CERTIFICATE
      | "ACTIVE" -> ACTIVE
      | "DELETED" -> DELETED
      | "DISABLED" -> DISABLED
      | "EXPIRED" -> EXPIRED
      | "FAILED" -> FAILED
      | 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 CertificateAuthorityStatus"
           xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"CertificateAuthorityStatus" j)
    let to_json = simple_to_json to_value
  end
module CertificateAuthorityType =
  struct
    type nonrec t =
      | ROOT 
      | SUBORDINATE 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | ROOT -> "ROOT"
      | SUBORDINATE -> "SUBORDINATE"
      | Non_static_id s -> s
    let of_string =
      function
      | "ROOT" -> ROOT
      | "SUBORDINATE" -> SUBORDINATE
      | 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 CertificateAuthorityType" xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"CertificateAuthorityType" j)
    let to_json = simple_to_json to_value
  end
module CertificateAuthorityUsageMode =
  struct
    type nonrec t =
      | GENERAL_PURPOSE 
      | SHORT_LIVED_CERTIFICATE 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | GENERAL_PURPOSE -> "GENERAL_PURPOSE"
      | SHORT_LIVED_CERTIFICATE -> "SHORT_LIVED_CERTIFICATE"
      | Non_static_id s -> s
    let of_string =
      function
      | "GENERAL_PURPOSE" -> GENERAL_PURPOSE
      | "SHORT_LIVED_CERTIFICATE" -> SHORT_LIVED_CERTIFICATE
      | 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 CertificateAuthorityUsageMode"
           xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"CertificateAuthorityUsageMode" j)
    let to_json = simple_to_json to_value
  end
module FailureReason =
  struct
    type nonrec t =
      | REQUEST_TIMED_OUT 
      | UNSUPPORTED_ALGORITHM 
      | OTHER 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | REQUEST_TIMED_OUT -> "REQUEST_TIMED_OUT"
      | UNSUPPORTED_ALGORITHM -> "UNSUPPORTED_ALGORITHM"
      | OTHER -> "OTHER"
      | Non_static_id s -> s
    let of_string =
      function
      | "REQUEST_TIMED_OUT" -> REQUEST_TIMED_OUT
      | "UNSUPPORTED_ALGORITHM" -> UNSUPPORTED_ALGORITHM
      | "OTHER" -> OTHER
      | 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 FailureReason" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"FailureReason" j)
    let to_json = simple_to_json to_value
  end
module KeyStorageSecurityStandard =
  struct
    type nonrec t =
      | FIPS_140_2_LEVEL_2_OR_HIGHER 
      | FIPS_140_2_LEVEL_3_OR_HIGHER 
      | CCPC_LEVEL_1_OR_HIGHER 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | FIPS_140_2_LEVEL_2_OR_HIGHER -> "FIPS_140_2_LEVEL_2_OR_HIGHER"
      | FIPS_140_2_LEVEL_3_OR_HIGHER -> "FIPS_140_2_LEVEL_3_OR_HIGHER"
      | CCPC_LEVEL_1_OR_HIGHER -> "CCPC_LEVEL_1_OR_HIGHER"
      | Non_static_id s -> s
    let of_string =
      function
      | "FIPS_140_2_LEVEL_2_OR_HIGHER" -> FIPS_140_2_LEVEL_2_OR_HIGHER
      | "FIPS_140_2_LEVEL_3_OR_HIGHER" -> FIPS_140_2_LEVEL_3_OR_HIGHER
      | "CCPC_LEVEL_1_OR_HIGHER" -> CCPC_LEVEL_1_OR_HIGHER
      | 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 KeyStorageSecurityStandard"
           xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"KeyStorageSecurityStandard" j)
    let to_json = simple_to_json to_value
  end
module RevocationConfiguration =
  struct
    type nonrec t =
      {
      crlConfiguration: CrlConfiguration.t option
        [@ocaml.doc
          "Configuration of the certificate revocation list (CRL), if any, maintained by your private CA. A CRL is typically updated approximately 30 minutes after a certificate is revoked. If for any reason a CRL update fails, Amazon Web Services Private CA makes further attempts every 15 minutes."];
      ocspConfiguration: OcspConfiguration.t option
        [@ocaml.doc
          "Configuration of Online Certificate Status Protocol (OCSP) support, if any, maintained by your private CA. When you revoke a certificate, OCSP responses may take up to 60 minutes to reflect the new status."]}
    let make ?crlConfiguration =
      fun ?ocspConfiguration ->
        fun () -> { crlConfiguration; ocspConfiguration }
    let to_value x =
      structure_to_value
        [("CrlConfiguration",
           (Option.map x.crlConfiguration ~f:CrlConfiguration.to_value));
        ("OcspConfiguration",
          (Option.map x.ocspConfiguration ~f:OcspConfiguration.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let ocspConfiguration =
        (Option.map ~f:OcspConfiguration.of_xml)
          (Xml.child xml_arg0 "OcspConfiguration") in
      let crlConfiguration =
        (Option.map ~f:CrlConfiguration.of_xml)
          (Xml.child xml_arg0 "CrlConfiguration") in
      make ?ocspConfiguration ?crlConfiguration ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let ocspConfiguration =
        field_map json__ "OcspConfiguration" OcspConfiguration.of_json in
      let crlConfiguration =
        field_map json__ "CrlConfiguration" CrlConfiguration.of_json in
      make ?ocspConfiguration ?crlConfiguration ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Certificate revocation information used by the CreateCertificateAuthority and UpdateCertificateAuthority actions. Your private certificate authority (CA) can configure Online Certificate Status Protocol (OCSP) support and/or maintain a certificate revocation list (CRL). OCSP returns validation information about certificates as requested by clients, and a CRL contains an updated list of certificates revoked by your CA. For more information, see RevokeCertificate and Setting up a certificate revocation method in the Amazon Web Services Private Certificate Authority User Guide."]
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 CertificatePolicyList =
  struct
    type nonrec t = PolicyInformation.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:20) >>= (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:PolicyInformation.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:PolicyInformation.of_xml)
    let of_json j =
      list_of_json ~kind:"CertificatePolicyList"
        ~of_json:PolicyInformation.of_json j
    let to_json v = composed_to_json to_value v
  end
module CustomExtensionList =
  struct
    type nonrec t = CustomExtension.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:150) >>=
             (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:CustomExtension.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:CustomExtension.of_xml)
    let of_json j =
      list_of_json ~kind:"CustomExtensionList"
        ~of_json:CustomExtension.of_json j
    let to_json v = composed_to_json to_value v
  end
module ExtendedKeyUsageList =
  struct
    type nonrec t = ExtendedKeyUsage.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:20) >>= (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:ExtendedKeyUsage.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:ExtendedKeyUsage.of_xml)
    let of_json j =
      list_of_json ~kind:"ExtendedKeyUsageList"
        ~of_json:ExtendedKeyUsage.of_json j
    let to_json v = composed_to_json to_value v
  end
module GeneralNameList =
  struct
    type nonrec t = GeneralName.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:150) >>=
             (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:GeneralName.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:GeneralName.of_xml)
    let of_json j =
      list_of_json ~kind:"GeneralNameList" ~of_json:GeneralName.of_json j
    let to_json v = composed_to_json to_value v
  end
module Tag =
  struct
    type nonrec t =
      {
      key: TagKey.t [@ocaml.doc "Key (name) of the tag."];
      value: TagValue.t option [@ocaml.doc "Value of the tag."]}
    let context_ = "Tag"
    let make ?value = fun ~key -> fun () -> { value; key }
    let to_value x =
      structure_to_value
        [("Key", (Some (TagKey.to_value x.key)));
        ("Value", (Option.map x.value ~f:TagValue.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let value =
        (Option.map ~f:TagValue.of_xml) (Xml.child xml_arg0 "Value") in
      let key =
        TagKey.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Key") in
      make ?value ~key ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let value = field_map json__ "Value" TagValue.of_json in
      let key = field_map_exn json__ "Key" TagKey.of_json in
      make ?value ~key ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Tags are labels that you can use to identify and organize your private CAs. Each tag consists of a key and an optional value. You can associate up to 50 tags with a private CA. To add one or more tags to a private CA, call the TagCertificateAuthority action. To remove a tag, call the UntagCertificateAuthority action."]
module Permission =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t option
        [@ocaml.doc
          "The Amazon Resource Number (ARN) of the private CA from which the permission was issued."];
      createdAt: TStamp.t option
        [@ocaml.doc "The time at which the permission was created."];
      principal: Principal.t option
        [@ocaml.doc
          "The Amazon Web Services service or entity that holds the permission. At this time, the only valid principal is acm.amazonaws.com."];
      sourceAccount: AccountId.t option
        [@ocaml.doc "The ID of the account that assigned the permission."];
      actions: ActionList.t option
        [@ocaml.doc
          "The private CA actions that can be performed by the designated Amazon Web Services service."];
      policy: AWSPolicy.t option
        [@ocaml.doc
          "The name of the policy that is associated with the permission."]}
    let make ?certificateAuthorityArn =
      fun ?createdAt ->
        fun ?principal ->
          fun ?sourceAccount ->
            fun ?actions ->
              fun ?policy ->
                fun () ->
                  {
                    certificateAuthorityArn;
                    createdAt;
                    principal;
                    sourceAccount;
                    actions;
                    policy
                  }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Option.map x.certificateAuthorityArn ~f:Arn.to_value));
        ("CreatedAt", (Option.map x.createdAt ~f:TStamp.to_value));
        ("Principal", (Option.map x.principal ~f:Principal.to_value));
        ("SourceAccount", (Option.map x.sourceAccount ~f:AccountId.to_value));
        ("Actions", (Option.map x.actions ~f:ActionList.to_value));
        ("Policy", (Option.map x.policy ~f:AWSPolicy.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let policy =
        (Option.map ~f:AWSPolicy.of_xml) (Xml.child xml_arg0 "Policy") in
      let actions =
        (Option.map ~f:ActionList.of_xml) (Xml.child xml_arg0 "Actions") in
      let sourceAccount =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "SourceAccount") in
      let principal =
        (Option.map ~f:Principal.of_xml) (Xml.child xml_arg0 "Principal") in
      let createdAt =
        (Option.map ~f:TStamp.of_xml) (Xml.child xml_arg0 "CreatedAt") in
      let certificateAuthorityArn =
        (Option.map ~f:Arn.of_xml)
          (Xml.child xml_arg0 "CertificateAuthorityArn") in
      make ?policy ?actions ?sourceAccount ?principal ?createdAt
        ?certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let policy = field_map json__ "Policy" AWSPolicy.of_json in
      let actions = field_map json__ "Actions" ActionList.of_json in
      let sourceAccount = field_map json__ "SourceAccount" AccountId.of_json in
      let principal = field_map json__ "Principal" Principal.of_json in
      let createdAt = field_map json__ "CreatedAt" TStamp.of_json in
      let certificateAuthorityArn =
        field_map json__ "CertificateAuthorityArn" Arn.of_json in
      make ?policy ?actions ?sourceAccount ?principal ?createdAt
        ?certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Permissions designate which private CA actions can be performed by an Amazon Web Services service or entity. In order for ACM to automatically renew private certificates, you must give the ACM service principal all available permissions (IssueCertificate, GetCertificate, and ListPermissions). Permissions can be assigned with the CreatePermission action, removed with the DeletePermission action, and listed with the ListPermissions action."]
module CertificateAuthority =
  struct
    type nonrec t =
      {
      arn: Arn.t option
        [@ocaml.doc
          "Amazon Resource Name (ARN) for your private certificate authority (CA). The format is 12345678-1234-1234-1234-123456789012 ."];
      ownerAccount: AccountId.t option
        [@ocaml.doc
          "The Amazon Web Services account ID that owns the certificate authority."];
      createdAt: TStamp.t option
        [@ocaml.doc "Date and time at which your private CA was created."];
      lastStateChangeAt: TStamp.t option
        [@ocaml.doc
          "Date and time at which your private CA was last updated."];
      type_: CertificateAuthorityType.t option
        [@ocaml.doc "Type of your private CA."];
      serial: String_.t option
        [@ocaml.doc "Serial number of your private CA."];
      status: CertificateAuthorityStatus.t option
        [@ocaml.doc "Status of your private CA."];
      notBefore: TStamp.t option
        [@ocaml.doc
          "Date and time before which your private CA certificate is not valid."];
      notAfter: TStamp.t option
        [@ocaml.doc
          "Date and time after which your private CA certificate is not valid."];
      failureReason: FailureReason.t option
        [@ocaml.doc "Reason the request to create your private CA failed."];
      certificateAuthorityConfiguration:
        CertificateAuthorityConfiguration.t option
        [@ocaml.doc "Your private CA configuration."];
      revocationConfiguration: RevocationConfiguration.t option
        [@ocaml.doc
          "Information about the Online Certificate Status Protocol (OCSP) configuration or certificate revocation list (CRL) created and maintained by your private CA."];
      restorableUntil: TStamp.t option
        [@ocaml.doc
          "The period during which a deleted CA can be restored. For more information, see the PermanentDeletionTimeInDays parameter of the DeleteCertificateAuthorityRequest action."];
      keyStorageSecurityStandard: KeyStorageSecurityStandard.t option
        [@ocaml.doc
          "Defines a cryptographic key management compliance standard for handling and protecting CA keys. Default: FIPS_140_2_LEVEL_3_OR_HIGHER Starting January 26, 2023, Amazon Web Services Private CA protects all CA private keys in non-China regions using hardware security modules (HSMs) that comply with FIPS PUB 140-2 Level 3. For information about security standard support in different Amazon Web Services Regions, see Storage and security compliance of Amazon Web Services Private CA private keys."];
      usageMode: CertificateAuthorityUsageMode.t option
        [@ocaml.doc
          "Specifies whether the CA issues general-purpose certificates that typically require a revocation mechanism, or short-lived certificates that may optionally omit revocation because they expire quickly. Short-lived certificate validity is limited to seven days. The default value is GENERAL_PURPOSE."]}
    let make ?arn =
      fun ?ownerAccount ->
        fun ?createdAt ->
          fun ?lastStateChangeAt ->
            fun ?type_ ->
              fun ?serial ->
                fun ?status ->
                  fun ?notBefore ->
                    fun ?notAfter ->
                      fun ?failureReason ->
                        fun ?certificateAuthorityConfiguration ->
                          fun ?revocationConfiguration ->
                            fun ?restorableUntil ->
                              fun ?keyStorageSecurityStandard ->
                                fun ?usageMode ->
                                  fun () ->
                                    {
                                      arn;
                                      ownerAccount;
                                      createdAt;
                                      lastStateChangeAt;
                                      type_;
                                      serial;
                                      status;
                                      notBefore;
                                      notAfter;
                                      failureReason;
                                      certificateAuthorityConfiguration;
                                      revocationConfiguration;
                                      restorableUntil;
                                      keyStorageSecurityStandard;
                                      usageMode
                                    }
    let to_value x =
      structure_to_value
        [("Arn", (Option.map x.arn ~f:Arn.to_value));
        ("OwnerAccount", (Option.map x.ownerAccount ~f:AccountId.to_value));
        ("CreatedAt", (Option.map x.createdAt ~f:TStamp.to_value));
        ("LastStateChangeAt",
          (Option.map x.lastStateChangeAt ~f:TStamp.to_value));
        ("Type", (Option.map x.type_ ~f:CertificateAuthorityType.to_value));
        ("Serial", (Option.map x.serial ~f:String_.to_value));
        ("Status",
          (Option.map x.status ~f:CertificateAuthorityStatus.to_value));
        ("NotBefore", (Option.map x.notBefore ~f:TStamp.to_value));
        ("NotAfter", (Option.map x.notAfter ~f:TStamp.to_value));
        ("FailureReason",
          (Option.map x.failureReason ~f:FailureReason.to_value));
        ("CertificateAuthorityConfiguration",
          (Option.map x.certificateAuthorityConfiguration
             ~f:CertificateAuthorityConfiguration.to_value));
        ("RevocationConfiguration",
          (Option.map x.revocationConfiguration
             ~f:RevocationConfiguration.to_value));
        ("RestorableUntil",
          (Option.map x.restorableUntil ~f:TStamp.to_value));
        ("KeyStorageSecurityStandard",
          (Option.map x.keyStorageSecurityStandard
             ~f:KeyStorageSecurityStandard.to_value));
        ("UsageMode",
          (Option.map x.usageMode ~f:CertificateAuthorityUsageMode.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let usageMode =
        (Option.map ~f:CertificateAuthorityUsageMode.of_xml)
          (Xml.child xml_arg0 "UsageMode") in
      let keyStorageSecurityStandard =
        (Option.map ~f:KeyStorageSecurityStandard.of_xml)
          (Xml.child xml_arg0 "KeyStorageSecurityStandard") in
      let restorableUntil =
        (Option.map ~f:TStamp.of_xml) (Xml.child xml_arg0 "RestorableUntil") in
      let revocationConfiguration =
        (Option.map ~f:RevocationConfiguration.of_xml)
          (Xml.child xml_arg0 "RevocationConfiguration") in
      let certificateAuthorityConfiguration =
        (Option.map ~f:CertificateAuthorityConfiguration.of_xml)
          (Xml.child xml_arg0 "CertificateAuthorityConfiguration") in
      let failureReason =
        (Option.map ~f:FailureReason.of_xml)
          (Xml.child xml_arg0 "FailureReason") in
      let notAfter =
        (Option.map ~f:TStamp.of_xml) (Xml.child xml_arg0 "NotAfter") in
      let notBefore =
        (Option.map ~f:TStamp.of_xml) (Xml.child xml_arg0 "NotBefore") in
      let status =
        (Option.map ~f:CertificateAuthorityStatus.of_xml)
          (Xml.child xml_arg0 "Status") in
      let serial =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "Serial") in
      let type_ =
        (Option.map ~f:CertificateAuthorityType.of_xml)
          (Xml.child xml_arg0 "Type") in
      let lastStateChangeAt =
        (Option.map ~f:TStamp.of_xml)
          (Xml.child xml_arg0 "LastStateChangeAt") in
      let createdAt =
        (Option.map ~f:TStamp.of_xml) (Xml.child xml_arg0 "CreatedAt") in
      let ownerAccount =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "OwnerAccount") in
      let arn = (Option.map ~f:Arn.of_xml) (Xml.child xml_arg0 "Arn") in
      make ?usageMode ?keyStorageSecurityStandard ?restorableUntil
        ?revocationConfiguration ?certificateAuthorityConfiguration
        ?failureReason ?notAfter ?notBefore ?status ?serial ?type_
        ?lastStateChangeAt ?createdAt ?ownerAccount ?arn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let usageMode =
        field_map json__ "UsageMode" CertificateAuthorityUsageMode.of_json in
      let keyStorageSecurityStandard =
        field_map json__ "KeyStorageSecurityStandard"
          KeyStorageSecurityStandard.of_json in
      let restorableUntil = field_map json__ "RestorableUntil" TStamp.of_json in
      let revocationConfiguration =
        field_map json__ "RevocationConfiguration"
          RevocationConfiguration.of_json in
      let certificateAuthorityConfiguration =
        field_map json__ "CertificateAuthorityConfiguration"
          CertificateAuthorityConfiguration.of_json in
      let failureReason =
        field_map json__ "FailureReason" FailureReason.of_json in
      let notAfter = field_map json__ "NotAfter" TStamp.of_json in
      let notBefore = field_map json__ "NotBefore" TStamp.of_json in
      let status =
        field_map json__ "Status" CertificateAuthorityStatus.of_json in
      let serial = field_map json__ "Serial" String_.of_json in
      let type_ = field_map json__ "Type" CertificateAuthorityType.of_json in
      let lastStateChangeAt =
        field_map json__ "LastStateChangeAt" TStamp.of_json in
      let createdAt = field_map json__ "CreatedAt" TStamp.of_json in
      let ownerAccount = field_map json__ "OwnerAccount" AccountId.of_json in
      let arn = field_map json__ "Arn" Arn.of_json in
      make ?usageMode ?keyStorageSecurityStandard ?restorableUntil
        ?revocationConfiguration ?certificateAuthorityConfiguration
        ?failureReason ?notAfter ?notBefore ?status ?serial ?type_
        ?lastStateChangeAt ?createdAt ?ownerAccount ?arn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains information about your private certificate authority (CA). Your private CA can issue and revoke X.509 digital certificates. Digital certificates verify that the entity named in the certificate Subject field owns or controls the public key contained in the Subject Public Key Info field. Call the CreateCertificateAuthority action to create your private CA. You must then call the GetCertificateAuthorityCertificate action to retrieve a private CA certificate signing request (CSR). Sign the CSR with your Amazon Web Services Private CA-hosted or on-premises root or subordinate CA certificate. Call the ImportCertificateAuthorityCertificate action to import the signed certificate into Certificate Manager (ACM)."]
module Extensions =
  struct
    type nonrec t =
      {
      certificatePolicies: CertificatePolicyList.t option
        [@ocaml.doc
          "Contains a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers. For more information, see NIST's definition of Object Identifier (OID). In an end-entity certificate, these terms indicate the policy under which the certificate was issued and the purposes for which it may be used. In a CA certificate, these terms limit the set of policies for certification paths that include this certificate."];
      extendedKeyUsage: ExtendedKeyUsageList.t option
        [@ocaml.doc
          "Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the KeyUsage extension."];
      keyUsage: KeyUsage.t option ;
      subjectAlternativeNames: GeneralNameList.t option
        [@ocaml.doc
          "The subject alternative name extension allows identities to be bound to the subject of the certificate. These identities may be included in addition to or in place of the identity in the subject field of the certificate."];
      customExtensions: CustomExtensionList.t option
        [@ocaml.doc
          "Contains a sequence of one or more X.509 extensions, each of which consists of an object identifier (OID), a base64-encoded value, and the critical flag. For more information, see the Global OID reference database."]}
    let make ?certificatePolicies =
      fun ?extendedKeyUsage ->
        fun ?keyUsage ->
          fun ?subjectAlternativeNames ->
            fun ?customExtensions ->
              fun () ->
                {
                  certificatePolicies;
                  extendedKeyUsage;
                  keyUsage;
                  subjectAlternativeNames;
                  customExtensions
                }
    let to_value x =
      structure_to_value
        [("CertificatePolicies",
           (Option.map x.certificatePolicies
              ~f:CertificatePolicyList.to_value));
        ("ExtendedKeyUsage",
          (Option.map x.extendedKeyUsage ~f:ExtendedKeyUsageList.to_value));
        ("KeyUsage", (Option.map x.keyUsage ~f:KeyUsage.to_value));
        ("SubjectAlternativeNames",
          (Option.map x.subjectAlternativeNames ~f:GeneralNameList.to_value));
        ("CustomExtensions",
          (Option.map x.customExtensions ~f:CustomExtensionList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let customExtensions =
        (Option.map ~f:CustomExtensionList.of_xml)
          (Xml.child xml_arg0 "CustomExtensions") in
      let subjectAlternativeNames =
        (Option.map ~f:GeneralNameList.of_xml)
          (Xml.child xml_arg0 "SubjectAlternativeNames") in
      let keyUsage =
        (Option.map ~f:KeyUsage.of_xml) (Xml.child xml_arg0 "KeyUsage") in
      let extendedKeyUsage =
        (Option.map ~f:ExtendedKeyUsageList.of_xml)
          (Xml.child xml_arg0 "ExtendedKeyUsage") in
      let certificatePolicies =
        (Option.map ~f:CertificatePolicyList.of_xml)
          (Xml.child xml_arg0 "CertificatePolicies") in
      make ?customExtensions ?subjectAlternativeNames ?keyUsage
        ?extendedKeyUsage ?certificatePolicies ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let customExtensions =
        field_map json__ "CustomExtensions" CustomExtensionList.of_json in
      let subjectAlternativeNames =
        field_map json__ "SubjectAlternativeNames" GeneralNameList.of_json in
      let keyUsage = field_map json__ "KeyUsage" KeyUsage.of_json in
      let extendedKeyUsage =
        field_map json__ "ExtendedKeyUsage" ExtendedKeyUsageList.of_json in
      let certificatePolicies =
        field_map json__ "CertificatePolicies" CertificatePolicyList.of_json in
      make ?customExtensions ?subjectAlternativeNames ?keyUsage
        ?extendedKeyUsage ?certificatePolicies ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Contains X.509 extension information for a certificate."]
module PositiveLong =
  struct
    type nonrec t = Int64.t
    let make i =
      let open Result in ok_or_failwith (check_int64_min i ~min:1L); 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 ValidityPeriodType =
  struct
    type nonrec t =
      | END_DATE 
      | ABSOLUTE 
      | DAYS 
      | MONTHS 
      | YEARS 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | END_DATE -> "END_DATE"
      | ABSOLUTE -> "ABSOLUTE"
      | DAYS -> "DAYS"
      | MONTHS -> "MONTHS"
      | YEARS -> "YEARS"
      | Non_static_id s -> s
    let of_string =
      function
      | "END_DATE" -> END_DATE
      | "ABSOLUTE" -> ABSOLUTE
      | "DAYS" -> DAYS
      | "MONTHS" -> MONTHS
      | "YEARS" -> YEARS
      | 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 ValidityPeriodType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"ValidityPeriodType" j)
    let to_json = simple_to_json to_value
  end
module TagList =
  struct
    type nonrec t = Tag.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:50) >>= (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:Tag.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:Tag.of_xml)
    let of_json j = list_of_json ~kind:"TagList" ~of_json:Tag.of_json j
    let to_json v = composed_to_json to_value v
  end
module RevocationReason =
  struct
    type nonrec t =
      | UNSPECIFIED 
      | KEY_COMPROMISE 
      | CERTIFICATE_AUTHORITY_COMPROMISE 
      | AFFILIATION_CHANGED 
      | SUPERSEDED 
      | CESSATION_OF_OPERATION 
      | PRIVILEGE_WITHDRAWN 
      | A_A_COMPROMISE 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | UNSPECIFIED -> "UNSPECIFIED"
      | KEY_COMPROMISE -> "KEY_COMPROMISE"
      | CERTIFICATE_AUTHORITY_COMPROMISE ->
          "CERTIFICATE_AUTHORITY_COMPROMISE"
      | AFFILIATION_CHANGED -> "AFFILIATION_CHANGED"
      | SUPERSEDED -> "SUPERSEDED"
      | CESSATION_OF_OPERATION -> "CESSATION_OF_OPERATION"
      | PRIVILEGE_WITHDRAWN -> "PRIVILEGE_WITHDRAWN"
      | A_A_COMPROMISE -> "A_A_COMPROMISE"
      | Non_static_id s -> s
    let of_string =
      function
      | "UNSPECIFIED" -> UNSPECIFIED
      | "KEY_COMPROMISE" -> KEY_COMPROMISE
      | "CERTIFICATE_AUTHORITY_COMPROMISE" ->
          CERTIFICATE_AUTHORITY_COMPROMISE
      | "AFFILIATION_CHANGED" -> AFFILIATION_CHANGED
      | "SUPERSEDED" -> SUPERSEDED
      | "CESSATION_OF_OPERATION" -> CESSATION_OF_OPERATION
      | "PRIVILEGE_WITHDRAWN" -> PRIVILEGE_WITHDRAWN
      | "A_A_COMPROMISE" -> A_A_COMPROMISE
      | 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 RevocationReason" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"RevocationReason" j)
    let to_json = simple_to_json to_value
  end
module InvalidArnException =
  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 requested Amazon Resource Name (ARN) does not refer to an existing resource."]
module InvalidStateException =
  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 state of the private CA does not allow this action to occur."]
module NextToken =
  struct
    type nonrec t = string
    let context_ = "NextToken"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:43739) >>=
             (fun () -> check_string_min i ~min:1));
        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:"NextToken" j
    let to_json = simple_to_json to_value
  end
module RequestFailedException =
  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 has failed for an unspecified reason."]
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
       "A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found."]
module MaxResults =
  struct
    type nonrec t = int
    let make i =
      let open Result in
        ok_or_failwith
          ((check_int_max i ~max:1000) >>= (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 MaxResults" 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 InvalidNextTokenException =
  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 token specified in the NextToken argument is not valid. Use the token returned from your previous call to ListCertificateAuthorities."]
module PermissionList =
  struct
    type nonrec t = Permission.t list
    let make i =
      let open Result in ok_or_failwith (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:Permission.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:Permission.of_xml)
    let of_json j =
      list_of_json ~kind:"PermissionList" ~of_json:Permission.of_json j
    let to_json v = composed_to_json to_value v
  end
module CertificateAuthorities =
  struct
    type nonrec t = CertificateAuthority.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:CertificateAuthority.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:CertificateAuthority.of_xml)
    let of_json j =
      list_of_json ~kind:"CertificateAuthorities"
        ~of_json:CertificateAuthority.of_json j
    let to_json v = composed_to_json to_value v
  end
module ResourceOwner =
  struct
    type nonrec t =
      | SELF 
      | OTHER_ACCOUNTS 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | SELF -> "SELF"
      | OTHER_ACCOUNTS -> "OTHER_ACCOUNTS"
      | Non_static_id s -> s
    let of_string =
      function
      | "SELF" -> SELF
      | "OTHER_ACCOUNTS" -> OTHER_ACCOUNTS
      | 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 ResourceOwner" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"ResourceOwner" j)
    let to_json = simple_to_json to_value
  end
module InvalidArgsException =
  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 "One or more of the specified arguments was not valid."]
module LimitExceededException =
  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 Amazon Web Services Private CA quota has been exceeded. See the exception message returned to determine the quota that was exceeded."]
module MalformedCSRException =
  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 certificate signing request is invalid."]
module ApiPassthrough =
  struct
    type nonrec t =
      {
      extensions: Extensions.t option
        [@ocaml.doc
          "Specifies X.509 extension information for a certificate."];
      subject: ASN1Subject.t option }
    let make ?extensions = fun ?subject -> fun () -> { extensions; subject }
    let to_value x =
      structure_to_value
        [("Extensions", (Option.map x.extensions ~f:Extensions.to_value));
        ("Subject", (Option.map x.subject ~f:ASN1Subject.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let subject =
        (Option.map ~f:ASN1Subject.of_xml) (Xml.child xml_arg0 "Subject") in
      let extensions =
        (Option.map ~f:Extensions.of_xml) (Xml.child xml_arg0 "Extensions") in
      make ?subject ?extensions ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let subject = field_map json__ "Subject" ASN1Subject.of_json in
      let extensions = field_map json__ "Extensions" Extensions.of_json in
      make ?subject ?extensions ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains X.509 certificate information to be placed in an issued certificate. An APIPassthrough or APICSRPassthrough template variant must be selected, or else this parameter is ignored. If conflicting or duplicate certificate information is supplied from other sources, Amazon Web Services Private CA applies order of operation rules to determine what information is used."]
module CsrBlob =
  struct
    type nonrec t = string
    let make i = i
    let of_string x = x
    let to_value x = `Blob x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml xml_arg0 = string_of_xml ~kind:"a blob" xml_arg0
    let of_json j = string_of_json ~kind:"a blob" j
    let to_json = simple_to_json to_value
  end
module IdempotencyToken =
  struct
    type nonrec t = string
    let context_ = "IdempotencyToken"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:36) >>=
                  (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:"IdempotencyToken" j
    let to_json = simple_to_json to_value
  end
module Validity =
  struct
    type nonrec t =
      {
      value: PositiveLong.t
        [@ocaml.doc
          "A long integer interpreted according to the value of Type, below."];
      type_: ValidityPeriodType.t
        [@ocaml.doc
          "Determines how Amazon Web Services Private CA interprets the Value parameter, an integer. Supported validity types include those listed below. Type definitions with values include a sample input value and the resulting output. END_DATE: The specific date and time when the certificate will expire, expressed using UTCTime (YYMMDDHHMMSS) or GeneralizedTime (YYYYMMDDHHMMSS) format. When UTCTime is used, if the year field (YY) is greater than or equal to 50, the year is interpreted as 19YY. If the year field is less than 50, the year is interpreted as 20YY. Sample input value: 491231235959 (UTCTime format) Output expiration date/time: 12/31/2049 23:59:59 ABSOLUTE: The specific date and time when the validity of a certificate will start or expire, expressed in seconds since the Unix Epoch. Sample input value: 2524608000 Output expiration date/time: 01/01/2050 00:00:00 DAYS, MONTHS, YEARS: The relative time from the moment of issuance until the certificate will expire, expressed in days, months, or years. Example if DAYS, issued on 10/12/2020 at 12:34:54 UTC: Sample input value: 90 Output expiration date: 01/10/2020 12:34:54 UTC The minimum validity duration for a certificate using relative time (DAYS) is one day. The minimum validity for a certificate using absolute time (ABSOLUTE or END_DATE) is one second."]}
    let context_ = "Validity"
    let make ~value = fun ~type_ -> fun () -> { value; type_ }
    let to_value x =
      structure_to_value
        [("Value", (Some (PositiveLong.to_value x.value)));
        ("Type", (Some (ValidityPeriodType.to_value x.type_)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let type_ =
        ValidityPeriodType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Type") in
      let value =
        PositiveLong.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Value") in
      make ~type_ ~value ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let type_ = field_map_exn json__ "Type" ValidityPeriodType.of_json in
      let value = field_map_exn json__ "Value" PositiveLong.of_json in
      make ~type_ ~value ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Validity specifies the period of time during which a certificate is valid. Validity can be expressed as an explicit date and time when the validity of a certificate starts or expires, or as a span of time after issuance, stated in days, months, or years. For more information, see Validity in RFC 5280. Amazon Web Services Private CA API consumes the Validity data type differently in two distinct parameters of the IssueCertificate action. The required parameter IssueCertificate:Validity specifies the end of a certificate's validity period. The optional parameter IssueCertificate:ValidityNotBefore specifies a customized starting time for the validity period."]
module CertificateBodyBlob =
  struct
    type nonrec t = string
    let make i = i
    let of_string x = x
    let to_value x = `Blob x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml xml_arg0 = string_of_xml ~kind:"a blob" xml_arg0
    let of_json j = string_of_json ~kind:"a blob" j
    let to_json = simple_to_json to_value
  end
module CertificateChainBlob =
  struct
    type nonrec t = string
    let make i = i
    let of_string x = x
    let to_value x = `Blob x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml xml_arg0 = string_of_xml ~kind:"a blob" xml_arg0
    let of_json j = string_of_json ~kind:"a blob" j
    let to_json = simple_to_json to_value
  end
module CertificateBody =
  struct
    type nonrec t = string
    let context_ = "CertificateBody"
    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:"CertificateBody" j
    let to_json = simple_to_json to_value
  end
module CertificateChain =
  struct
    type nonrec t = string
    let context_ = "CertificateChain"
    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:"CertificateChain" j
    let to_json = simple_to_json to_value
  end
module RequestInProgressException =
  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 "Your request is already in progress."]
module CsrBody =
  struct
    type nonrec t = string
    let context_ = "CsrBody"
    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:"CsrBody" j
    let to_json = simple_to_json to_value
  end
module AuditReportStatus =
  struct
    type nonrec t =
      | CREATING 
      | SUCCESS 
      | FAILED 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | CREATING -> "CREATING"
      | SUCCESS -> "SUCCESS"
      | FAILED -> "FAILED"
      | Non_static_id s -> s
    let of_string =
      function
      | "CREATING" -> CREATING
      | "SUCCESS" -> SUCCESS
      | "FAILED" -> FAILED
      | 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 AuditReportStatus" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"AuditReportStatus" j)
    let to_json = simple_to_json to_value
  end
module S3BucketName =
  struct
    type nonrec t = string
    let context_ = "S3BucketName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:63) >>=
             (fun () -> check_string_min i ~min:3));
        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:"S3BucketName" j
    let to_json = simple_to_json to_value
  end
module S3Key =
  struct
    type nonrec t = string
    let context_ = "S3Key"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:1024) >>=
             (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:"S3Key" j
    let to_json = simple_to_json to_value
  end
module AuditReportId =
  struct
    type nonrec t = string
    let context_ = "AuditReportId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:36) >>=
             (fun () ->
                (check_string_max i ~max:36) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}")));
        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:"AuditReportId" j
    let to_json = simple_to_json to_value
  end
module PermanentDeletionTimeInDays =
  struct
    type nonrec t = int
    let make i =
      let open Result in
        ok_or_failwith
          ((check_int_max i ~max:30) >>= (fun () -> check_int_min i ~min:7));
        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 PermanentDeletionTimeInDays"
           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 InvalidPolicyException =
  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 resource policy is invalid or is missing a required statement. For general information about IAM policy and statement structure, see Overview of JSON Policies."]
module InvalidTagException =
  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 tag associated with the CA is not valid. The invalid argument is contained in the message field."]
module AuditReportResponseFormat =
  struct
    type nonrec t =
      | JSON 
      | CSV 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function | JSON -> "JSON" | CSV -> "CSV" | Non_static_id s -> s
    let of_string =
      function | "JSON" -> JSON | "CSV" -> CSV | 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 AuditReportResponseFormat" xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"AuditReportResponseFormat" j)
    let to_json = simple_to_json to_value
  end
module UpdateCertificateAuthorityRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"];
      revocationConfiguration: RevocationConfiguration.t option
        [@ocaml.doc
          "Contains information to enable support for Online Certificate Status Protocol (OCSP), certificate revocation list (CRL), both protocols, or neither. If you don't supply this parameter, existing capibilites remain unchanged. For more information, see the OcspConfiguration and CrlConfiguration types. The following requirements apply to revocation configurations. A configuration disabling CRLs or OCSP must contain only the Enabled=False parameter, and will fail if other parameters such as CustomCname or ExpirationInDays are included. In a CRL configuration, the S3BucketName parameter must conform to Amazon S3 bucket naming rules. A configuration containing a custom Canonical Name (CNAME) parameter for CRLs or OCSP must conform to RFC2396 restrictions on the use of special characters in a CNAME. In a CRL or OCSP configuration, the value of a CNAME parameter must not include a protocol prefix such as \"http://\" or \"https://\". If you update the S3BucketName of CrlConfiguration, you can break revocation for existing certificates. In other words, if you call UpdateCertificateAuthority to update the CRL configuration's S3 bucket name, Amazon Web Services Private CA only writes CRLs to the new S3 bucket. Certificates issued prior to this point will have the old S3 bucket name in your CRL Distribution Point (CDP) extension, essentially breaking revocation. If you must update the S3 bucket, you'll need to reissue old certificates to keep the revocation working. Alternatively, you can use a CustomCname in your CRL configuration if you might need to change the S3 bucket name in the future."];
      status: CertificateAuthorityStatus.t option
        [@ocaml.doc "Status of your private CA."]}
    let context_ = "UpdateCertificateAuthorityRequest"
    let make ?revocationConfiguration =
      fun ?status ->
        fun ~certificateAuthorityArn ->
          fun () ->
            { revocationConfiguration; status; certificateAuthorityArn }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("RevocationConfiguration",
          (Option.map x.revocationConfiguration
             ~f:RevocationConfiguration.to_value));
        ("Status",
          (Option.map x.status ~f:CertificateAuthorityStatus.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let status =
        (Option.map ~f:CertificateAuthorityStatus.of_xml)
          (Xml.child xml_arg0 "Status") in
      let revocationConfiguration =
        (Option.map ~f:RevocationConfiguration.of_xml)
          (Xml.child xml_arg0 "RevocationConfiguration") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ?status ?revocationConfiguration ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let status =
        field_map json__ "Status" CertificateAuthorityStatus.of_json in
      let revocationConfiguration =
        field_map json__ "RevocationConfiguration"
          RevocationConfiguration.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ?status ?revocationConfiguration ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Updates the status or configuration of a private certificate authority (CA). Your private CA must be in the ACTIVE or DISABLED state before you can update it. You can disable a private CA that is in the ACTIVE state or make a CA that is in the DISABLED state active again. Both Amazon Web Services Private CA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see Access policies for CRLs in Amazon S3."]
module UntagCertificateAuthorityRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"];
      tags: TagList.t [@ocaml.doc "List of tags to be removed from the CA."]}
    let context_ = "UntagCertificateAuthorityRequest"
    let make ~certificateAuthorityArn =
      fun ~tags -> fun () -> { certificateAuthorityArn; tags }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("Tags", (Some (TagList.to_value x.tags)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags =
        TagList.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Tags") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~tags ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map_exn json__ "Tags" TagList.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~tags ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Remove one or more tags from your private CA. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this action, the tag will be removed regardless of value. If you specify a value, the tag is removed only if it is associated with the specified value. To add tags to a private CA, use the TagCertificateAuthority. Call the ListTags action to see what tags are associated with your CA."]
module TooManyTagsException =
  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 can associate up to 50 tags with a private CA. Exception information is contained in the exception message field."]
module TagCertificateAuthorityRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"];
      tags: TagList.t
        [@ocaml.doc "List of tags to be associated with the CA."]}
    let context_ = "TagCertificateAuthorityRequest"
    let make ~certificateAuthorityArn =
      fun ~tags -> fun () -> { certificateAuthorityArn; tags }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("Tags", (Some (TagList.to_value x.tags)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags =
        TagList.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Tags") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~tags ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map_exn json__ "Tags" TagList.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~tags ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Adds one or more tags to your private CA. Tags are labels that you can use to identify and organize your Amazon Web Services resources. Each tag consists of a key and an optional value. You specify the private CA on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair. You can apply a tag to just one private CA if you want to identify a specific characteristic of that CA, or you can apply the same tag to multiple private CAs if you want to filter for a common relationship among those CAs. To remove one or more tags, use the UntagCertificateAuthority action. Call the ListTags action to see what tags are associated with your CA. To attach tags to a private CA during the creation procedure, a CA administrator must first associate an inline IAM policy with the CreateCertificateAuthority action and explicitly allow tagging. For more information, see Attaching tags to a CA at the time of creation."]
module RevokeCertificateRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"];
      certificateSerial: String128.t
        [@ocaml.doc
          "Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the serial number by calling GetCertificate with the Amazon Resource Name (ARN) of the certificate you want and the ARN of your private CA. The GetCertificate action retrieves the certificate in the PEM format. You can use the following OpenSSL command to list the certificate in text format and copy the hexadecimal serial number. openssl x509 -in file_path -text -noout You can also copy the serial number from the console or use the DescribeCertificate action in the Certificate Manager API Reference."];
      revocationReason: RevocationReason.t
        [@ocaml.doc "Specifies why you revoked the certificate."]}
    let context_ = "RevokeCertificateRequest"
    let make ~certificateAuthorityArn =
      fun ~certificateSerial ->
        fun ~revocationReason ->
          fun () ->
            { certificateAuthorityArn; certificateSerial; revocationReason }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("CertificateSerial",
          (Some (String128.to_value x.certificateSerial)));
        ("RevocationReason",
          (Some (RevocationReason.to_value x.revocationReason)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let revocationReason =
        RevocationReason.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "RevocationReason") in
      let certificateSerial =
        String128.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateSerial") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~revocationReason ~certificateSerial ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let revocationReason =
        field_map_exn json__ "RevocationReason" RevocationReason.of_json in
      let certificateSerial =
        field_map_exn json__ "CertificateSerial" String128.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~revocationReason ~certificateSerial ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Revokes a certificate that was issued inside Amazon Web Services Private CA. If you enable a certificate revocation list (CRL) when you create or update your private CA, information about the revoked certificates will be included in the CRL. Amazon Web Services Private CA writes the CRL to an S3 bucket that you specify. A CRL is typically updated approximately 30 minutes after a certificate is revoked. If for any reason the CRL update fails, Amazon Web Services Private CA attempts makes further attempts every 15 minutes. With Amazon CloudWatch, you can create alarms for the metrics CRLGenerated and MisconfiguredCRLBucket. For more information, see Supported CloudWatch Metrics. Both Amazon Web Services Private CA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see Access policies for CRLs in Amazon S3. Amazon Web Services Private CA also writes revocation information to the audit report. For more information, see CreateCertificateAuthorityAuditReport. You cannot revoke a root CA self-signed certificate."]
module RestoreCertificateAuthorityRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called the CreateCertificateAuthority action. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"]}
    let context_ = "RestoreCertificateAuthorityRequest"
    let make ~certificateAuthorityArn = fun () -> { certificateAuthorityArn }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Restores a certificate authority (CA) that is in the DELETED state. You can restore a CA during the period that you defined in the PermanentDeletionTimeInDays parameter of the DeleteCertificateAuthority action. Currently, you can specify 7 to 30 days. If you did not specify a PermanentDeletionTimeInDays value, by default you can restore the CA at any time in a 30 day period. You can check the time remaining in the restoration period of a private CA in the DELETED state by calling the DescribeCertificateAuthority or ListCertificateAuthorities actions. The status of a restored CA is set to its pre-deletion status when the RestoreCertificateAuthority action returns. To change its status to ACTIVE, call the UpdateCertificateAuthority action. If the private CA was in the PENDING_CERTIFICATE state at deletion, you must use the ImportCertificateAuthorityCertificate action to import a certificate authority into the private CA before it can be activated. You cannot restore a CA after the restoration period has ended."]
module RequestAlreadyProcessedException =
  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 "Your request has already been completed."]
module PutPolicyRequest =
  struct
    type nonrec t =
      {
      resourceArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Number (ARN) of the private CA to associate with the policy. The ARN of the CA can be found by calling the ListCertificateAuthorities action."];
      policy: AWSPolicy.t
        [@ocaml.doc
          "The path and file name of a JSON-formatted IAM policy to attach to the specified private CA resource. If this policy does not contain all required statements or if it includes any statement that is not allowed, the PutPolicy action returns an InvalidPolicyException. For information about IAM policy and statement structure, see Overview of JSON Policies."]}
    let context_ = "PutPolicyRequest"
    let make ~resourceArn = fun ~policy -> fun () -> { resourceArn; policy }
    let to_value x =
      structure_to_value
        [("ResourceArn", (Some (Arn.to_value x.resourceArn)));
        ("Policy", (Some (AWSPolicy.to_value x.policy)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let policy =
        AWSPolicy.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Policy") in
      let resourceArn =
        Arn.of_xml (Xml.child_exn ~context:context_ xml_arg0 "ResourceArn") in
      make ~policy ~resourceArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let policy = field_map_exn json__ "Policy" AWSPolicy.of_json in
      let resourceArn = field_map_exn json__ "ResourceArn" Arn.of_json in
      make ~policy ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Attaches a resource-based policy to a private CA. A policy can also be applied by sharing a private CA through Amazon Web Services Resource Access Manager (RAM). For more information, see Attach a Policy for Cross-Account Access. The policy can be displayed with GetPolicy and removed with DeletePolicy. About Policies A policy grants access on a private CA to an Amazon Web Services customer account, to Amazon Web Services Organizations, or to an Amazon Web Services Organizations unit. Policies are under the control of a CA administrator. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA. A policy permits a user of Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account. For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the Amazon Web Services Private CA policy. For more information, see Using a Service Linked Role with ACM. Updates made in Amazon Web Services Resource Manager (RAM) are reflected in policies. For more information, see Attach a Policy for Cross-Account Access."]
module PermissionAlreadyExistsException =
  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 designated permission has already been given to the user."]
module MalformedCertificateException =
  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 "One or more fields in the certificate are invalid."]
module LockoutPreventedException =
  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 current action was prevented because it would lock the caller out from performing subsequent actions. Verify that the specified parameters would not result in the caller being denied access to the resource."]
module ListTagsResponse =
  struct
    type nonrec t =
      {
      nextToken: NextToken.t option
        [@ocaml.doc
          "When the list is truncated, this value is present and should be used for the NextToken parameter in a subsequent pagination request."];
      tags: TagList.t option
        [@ocaml.doc "The tags associated with your private CA."]}
    type nonrec error =
      [ `InvalidArnException of InvalidArnException.t 
      | `InvalidStateException of InvalidStateException.t 
      | `RequestFailedException of RequestFailedException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?nextToken = fun ?tags -> fun () -> { nextToken; tags }
    let error_of_json name json =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_json json)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_xml xml)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `InvalidStateException e ->
          `Assoc
            [("error", (`String "InvalidStateException"));
            ("details", (InvalidStateException.to_json e))]
      | `RequestFailedException e ->
          `Assoc
            [("error", (`String "RequestFailedException"));
            ("details", (RequestFailedException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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:NextToken.to_value));
        ("Tags", (Option.map x.tags ~f:TagList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags = (Option.map ~f:TagList.of_xml) (Xml.child xml_arg0 "Tags") in
      let nextToken =
        (Option.map ~f:NextToken.of_xml) (Xml.child xml_arg0 "NextToken") in
      make ?tags ?nextToken ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map json__ "Tags" TagList.of_json in
      let nextToken = field_map json__ "NextToken" NextToken.of_json in
      make ?tags ?nextToken ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists the tags, if any, that are associated with your private CA or one that has been shared with you. Tags are labels that you can use to identify and organize your CAs. Each tag consists of a key and an optional value. Call the TagCertificateAuthority action to add one or more tags to your CA. Call the UntagCertificateAuthority action to remove tags."]
module ListTagsRequest =
  struct
    type nonrec t =
      {
      maxResults: MaxResults.t option
        [@ocaml.doc
          "Use this parameter when paginating results to specify the maximum number of items to return in the response. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items."];
      nextToken: NextToken.t option
        [@ocaml.doc
          "Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the response you just received."];
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called the CreateCertificateAuthority action. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"]}
    let context_ = "ListTagsRequest"
    let make ?maxResults =
      fun ?nextToken ->
        fun ~certificateAuthorityArn ->
          fun () -> { maxResults; nextToken; certificateAuthorityArn }
    let to_value x =
      structure_to_value
        [("MaxResults", (Option.map x.maxResults ~f:MaxResults.to_value));
        ("NextToken", (Option.map x.nextToken ~f:NextToken.to_value));
        ("CertificateAuthorityArn",
          (Some (Arn.to_value x.certificateAuthorityArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      let nextToken =
        (Option.map ~f:NextToken.of_xml) (Xml.child xml_arg0 "NextToken") in
      let maxResults =
        (Option.map ~f:MaxResults.of_xml) (Xml.child xml_arg0 "MaxResults") in
      make ~certificateAuthorityArn ?nextToken ?maxResults ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      let nextToken = field_map json__ "NextToken" NextToken.of_json in
      let maxResults = field_map json__ "MaxResults" MaxResults.of_json in
      make ~certificateAuthorityArn ?nextToken ?maxResults ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists the tags, if any, that are associated with your private CA or one that has been shared with you. Tags are labels that you can use to identify and organize your CAs. Each tag consists of a key and an optional value. Call the TagCertificateAuthority action to add one or more tags to your CA. Call the UntagCertificateAuthority action to remove tags."]
module ListPermissionsResponse =
  struct
    type nonrec t =
      {
      nextToken: NextToken.t option
        [@ocaml.doc
          "When the list is truncated, this value is present and should be used for the NextToken parameter in a subsequent pagination request."];
      permissions: PermissionList.t option
        [@ocaml.doc
          "Summary information about each permission assigned by the specified private CA, including the action enabled, the policy provided, and the time of creation."]}
    type nonrec error =
      [ `InvalidArnException of InvalidArnException.t 
      | `InvalidNextTokenException of InvalidNextTokenException.t 
      | `InvalidStateException of InvalidStateException.t 
      | `RequestFailedException of RequestFailedException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?nextToken =
      fun ?permissions -> fun () -> { nextToken; permissions }
    let error_of_json name json =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "InvalidNextTokenException" ->
          `InvalidNextTokenException (InvalidNextTokenException.of_json json)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_json json)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "InvalidNextTokenException" ->
          `InvalidNextTokenException (InvalidNextTokenException.of_xml xml)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_xml xml)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `InvalidNextTokenException e ->
          `Assoc
            [("error", (`String "InvalidNextTokenException"));
            ("details", (InvalidNextTokenException.to_json e))]
      | `InvalidStateException e ->
          `Assoc
            [("error", (`String "InvalidStateException"));
            ("details", (InvalidStateException.to_json e))]
      | `RequestFailedException e ->
          `Assoc
            [("error", (`String "RequestFailedException"));
            ("details", (RequestFailedException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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:NextToken.to_value));
        ("Permissions",
          (Option.map x.permissions ~f:PermissionList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let permissions =
        (Option.map ~f:PermissionList.of_xml)
          (Xml.child xml_arg0 "Permissions") in
      let nextToken =
        (Option.map ~f:NextToken.of_xml) (Xml.child xml_arg0 "NextToken") in
      make ?permissions ?nextToken ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let permissions = field_map json__ "Permissions" PermissionList.of_json in
      let nextToken = field_map json__ "NextToken" NextToken.of_json in
      make ?permissions ?nextToken ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "List all permissions on a private CA, if any, granted to the Certificate Manager (ACM) service principal (acm.amazonaws.com). These permissions allow ACM to issue and renew ACM certificates that reside in the same Amazon Web Services account as the CA. Permissions can be granted with the CreatePermission action and revoked with the DeletePermission action. About Permissions If the private CA and the certificates it issues reside in the same account, you can use CreatePermission to grant permissions for ACM to carry out automatic certificate renewals. For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates. If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA."]
module ListPermissionsRequest =
  struct
    type nonrec t =
      {
      maxResults: MaxResults.t option
        [@ocaml.doc
          "When paginating results, use this parameter to specify the maximum number of items to return in the response. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items."];
      nextToken: NextToken.t option
        [@ocaml.doc
          "When paginating results, use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the response you just received."];
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Number (ARN) of the private CA to inspect. You can find the ARN by calling the ListCertificateAuthorities action. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 You can get a private CA's ARN by running the ListCertificateAuthorities action."]}
    let context_ = "ListPermissionsRequest"
    let make ?maxResults =
      fun ?nextToken ->
        fun ~certificateAuthorityArn ->
          fun () -> { maxResults; nextToken; certificateAuthorityArn }
    let to_value x =
      structure_to_value
        [("MaxResults", (Option.map x.maxResults ~f:MaxResults.to_value));
        ("NextToken", (Option.map x.nextToken ~f:NextToken.to_value));
        ("CertificateAuthorityArn",
          (Some (Arn.to_value x.certificateAuthorityArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      let nextToken =
        (Option.map ~f:NextToken.of_xml) (Xml.child xml_arg0 "NextToken") in
      let maxResults =
        (Option.map ~f:MaxResults.of_xml) (Xml.child xml_arg0 "MaxResults") in
      make ~certificateAuthorityArn ?nextToken ?maxResults ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      let nextToken = field_map json__ "NextToken" NextToken.of_json in
      let maxResults = field_map json__ "MaxResults" MaxResults.of_json in
      make ~certificateAuthorityArn ?nextToken ?maxResults ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "List all permissions on a private CA, if any, granted to the Certificate Manager (ACM) service principal (acm.amazonaws.com). These permissions allow ACM to issue and renew ACM certificates that reside in the same Amazon Web Services account as the CA. Permissions can be granted with the CreatePermission action and revoked with the DeletePermission action. About Permissions If the private CA and the certificates it issues reside in the same account, you can use CreatePermission to grant permissions for ACM to carry out automatic certificate renewals. For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates. If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA."]
module ListCertificateAuthoritiesResponse =
  struct
    type nonrec t =
      {
      nextToken: NextToken.t option
        [@ocaml.doc
          "When the list is truncated, this value is present and should be used for the NextToken parameter in a subsequent pagination request."];
      certificateAuthorities: CertificateAuthorities.t option
        [@ocaml.doc
          "Summary information about each certificate authority you have created."]}
    type nonrec error =
      [ `InvalidNextTokenException of InvalidNextTokenException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?nextToken =
      fun ?certificateAuthorities ->
        fun () -> { nextToken; certificateAuthorities }
    let error_of_json name json =
      match name with
      | "InvalidNextTokenException" ->
          `InvalidNextTokenException (InvalidNextTokenException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidNextTokenException" ->
          `InvalidNextTokenException (InvalidNextTokenException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidNextTokenException e ->
          `Assoc
            [("error", (`String "InvalidNextTokenException"));
            ("details", (InvalidNextTokenException.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:NextToken.to_value));
        ("CertificateAuthorities",
          (Option.map x.certificateAuthorities
             ~f:CertificateAuthorities.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthorities =
        (Option.map ~f:CertificateAuthorities.of_xml)
          (Xml.child xml_arg0 "CertificateAuthorities") in
      let nextToken =
        (Option.map ~f:NextToken.of_xml) (Xml.child xml_arg0 "NextToken") in
      make ?certificateAuthorities ?nextToken ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthorities =
        field_map json__ "CertificateAuthorities"
          CertificateAuthorities.of_json in
      let nextToken = field_map json__ "NextToken" NextToken.of_json in
      make ?certificateAuthorities ?nextToken ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists the private certificate authorities that you created by using the CreateCertificateAuthority action."]
module ListCertificateAuthoritiesRequest =
  struct
    type nonrec t =
      {
      maxResults: MaxResults.t option
        [@ocaml.doc
          "Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items. Although the maximum value is 1000, the action only returns a maximum of 100 items."];
      nextToken: NextToken.t option
        [@ocaml.doc
          "Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the NextToken parameter from the response you just received."];
      resourceOwner: ResourceOwner.t option
        [@ocaml.doc
          "Use this parameter to filter the returned set of certificate authorities based on their owner. The default is SELF."]}
    let make ?maxResults =
      fun ?nextToken ->
        fun ?resourceOwner ->
          fun () -> { maxResults; nextToken; resourceOwner }
    let to_value x =
      structure_to_value
        [("MaxResults", (Option.map x.maxResults ~f:MaxResults.to_value));
        ("NextToken", (Option.map x.nextToken ~f:NextToken.to_value));
        ("ResourceOwner",
          (Option.map x.resourceOwner ~f:ResourceOwner.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let resourceOwner =
        (Option.map ~f:ResourceOwner.of_xml)
          (Xml.child xml_arg0 "ResourceOwner") in
      let nextToken =
        (Option.map ~f:NextToken.of_xml) (Xml.child xml_arg0 "NextToken") in
      let maxResults =
        (Option.map ~f:MaxResults.of_xml) (Xml.child xml_arg0 "MaxResults") in
      make ?resourceOwner ?nextToken ?maxResults ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let resourceOwner =
        field_map json__ "ResourceOwner" ResourceOwner.of_json in
      let nextToken = field_map json__ "NextToken" NextToken.of_json in
      let maxResults = field_map json__ "MaxResults" MaxResults.of_json in
      make ?resourceOwner ?nextToken ?maxResults ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists the private certificate authorities that you created by using the CreateCertificateAuthority action."]
module IssueCertificateResponse =
  struct
    type nonrec t =
      {
      certificateArn: Arn.t option
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the issued certificate and the certificate serial number. This is of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012/certificate/286535153982981100925020015808220737245"]}
    type nonrec error =
      [ `InvalidArgsException of InvalidArgsException.t 
      | `InvalidArnException of InvalidArnException.t 
      | `InvalidStateException of InvalidStateException.t 
      | `LimitExceededException of LimitExceededException.t 
      | `MalformedCSRException of MalformedCSRException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?certificateArn = fun () -> { certificateArn }
    let error_of_json name json =
      match name with
      | "InvalidArgsException" ->
          `InvalidArgsException (InvalidArgsException.of_json json)
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_json json)
      | "LimitExceededException" ->
          `LimitExceededException (LimitExceededException.of_json json)
      | "MalformedCSRException" ->
          `MalformedCSRException (MalformedCSRException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArgsException" ->
          `InvalidArgsException (InvalidArgsException.of_xml xml)
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_xml xml)
      | "LimitExceededException" ->
          `LimitExceededException (LimitExceededException.of_xml xml)
      | "MalformedCSRException" ->
          `MalformedCSRException (MalformedCSRException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArgsException e ->
          `Assoc
            [("error", (`String "InvalidArgsException"));
            ("details", (InvalidArgsException.to_json e))]
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `InvalidStateException e ->
          `Assoc
            [("error", (`String "InvalidStateException"));
            ("details", (InvalidStateException.to_json e))]
      | `LimitExceededException e ->
          `Assoc
            [("error", (`String "LimitExceededException"));
            ("details", (LimitExceededException.to_json e))]
      | `MalformedCSRException e ->
          `Assoc
            [("error", (`String "MalformedCSRException"));
            ("details", (MalformedCSRException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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
        [("CertificateArn", (Option.map x.certificateArn ~f:Arn.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateArn =
        (Option.map ~f:Arn.of_xml) (Xml.child xml_arg0 "CertificateArn") in
      make ?certificateArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateArn = field_map json__ "CertificateArn" Arn.of_json in
      make ?certificateArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Uses your private certificate authority (CA), or one that has been shared with you, to issue a client certificate. This action returns the Amazon Resource Name (ARN) of the certificate. You can retrieve the certificate by calling the GetCertificate action and specifying the ARN. You cannot use the ACM ListCertificateAuthorities action to retrieve the ARNs of the certificates that you issue by using Amazon Web Services Private CA."]
module IssueCertificateRequest =
  struct
    type nonrec t =
      {
      apiPassthrough: ApiPassthrough.t option
        [@ocaml.doc
          "Specifies X.509 certificate information to be included in the issued certificate. An APIPassthrough or APICSRPassthrough template variant must be selected, or else this parameter is ignored. For more information about using these templates, see Understanding Certificate Templates. If conflicting or duplicate certificate information is supplied during certificate issuance, Amazon Web Services Private CA applies order of operation rules to determine what information is used."];
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"];
      csr: CsrBlob.t
        [@ocaml.doc
          "The certificate signing request (CSR) for the certificate you want to issue. As an example, you can use the following OpenSSL command to create the CSR and a 2048 bit RSA private key. openssl req -new -newkey rsa:2048 -days 365 -keyout private/test_cert_priv_key.pem -out csr/test_cert_.csr If you have a configuration file, you can then use the following OpenSSL command. The usr_cert block in the configuration file contains your X509 version 3 extensions. openssl req -new -config openssl_rsa.cnf -extensions usr_cert -newkey rsa:2048 -days 365 -keyout private/test_cert_priv_key.pem -out csr/test_cert_.csr Note: A CSR must provide either a subject name or a subject alternative name or the request will be rejected."];
      signingAlgorithm: SigningAlgorithm.t
        [@ocaml.doc
          "The name of the algorithm that will be used to sign the certificate to be issued. This parameter should not be confused with the SigningAlgorithm parameter used to sign a CSR in the CreateCertificateAuthority action. The specified signing algorithm family (RSA or ECDSA) must match the algorithm family of the CA's secret key."];
      templateArn: Arn.t option
        [@ocaml.doc
          "Specifies a custom configuration template to use when issuing a certificate. If this parameter is not provided, Amazon Web Services Private CA defaults to the EndEntityCertificate/V1 template. For CA certificates, you should choose the shortest path length that meets your needs. The path length is indicated by the PathLenN portion of the ARN, where N is the CA depth. Note: The CA depth configured on a subordinate CA certificate must not exceed the limit set by its parents in the CA hierarchy. For a list of TemplateArn values supported by Amazon Web Services Private CA, see Understanding Certificate Templates."];
      validity: Validity.t
        [@ocaml.doc
          "Information describing the end of the validity period of the certificate. This parameter sets the \226\128\156Not After\226\128\157 date for the certificate. Certificate validity is the period of time during which a certificate is valid. Validity can be expressed as an explicit date and time when the certificate expires, or as a span of time after issuance, stated in days, months, or years. For more information, see Validity in RFC 5280. This value is unaffected when ValidityNotBefore is also specified. For example, if Validity is set to 20 days in the future, the certificate will expire 20 days from issuance time regardless of the ValidityNotBefore value. The end of the validity period configured on a certificate must not exceed the limit set on its parents in the CA hierarchy."];
      validityNotBefore: Validity.t option
        [@ocaml.doc
          "Information describing the start of the validity period of the certificate. This parameter sets the \226\128\156Not Before\" date for the certificate. By default, when issuing a certificate, Amazon Web Services Private CA sets the \"Not Before\" date to the issuance time minus 60 minutes. This compensates for clock inconsistencies across computer systems. The ValidityNotBefore parameter can be used to customize the \226\128\156Not Before\226\128\157 value. Unlike the Validity parameter, the ValidityNotBefore parameter is optional. The ValidityNotBefore value is expressed as an explicit date and time, using the Validity type value ABSOLUTE. For more information, see Validity in this API reference and Validity in RFC 5280."];
      idempotencyToken: IdempotencyToken.t option
        [@ocaml.doc
          "Alphanumeric string that can be used to distinguish between calls to the IssueCertificate action. Idempotency tokens for IssueCertificate time out after five minutes. Therefore, if you call IssueCertificate multiple times with the same idempotency token within five minutes, Amazon Web Services Private CA recognizes that you are requesting only one certificate and will issue only one. If you change the idempotency token for each call, Amazon Web Services Private CA recognizes that you are requesting multiple certificates."]}
    let context_ = "IssueCertificateRequest"
    let make ?apiPassthrough =
      fun ?templateArn ->
        fun ?validityNotBefore ->
          fun ?idempotencyToken ->
            fun ~certificateAuthorityArn ->
              fun ~csr ->
                fun ~signingAlgorithm ->
                  fun ~validity ->
                    fun () ->
                      {
                        apiPassthrough;
                        templateArn;
                        validityNotBefore;
                        idempotencyToken;
                        certificateAuthorityArn;
                        csr;
                        signingAlgorithm;
                        validity
                      }
    let to_value x =
      structure_to_value
        [("ApiPassthrough",
           (Option.map x.apiPassthrough ~f:ApiPassthrough.to_value));
        ("CertificateAuthorityArn",
          (Some (Arn.to_value x.certificateAuthorityArn)));
        ("Csr", (Some (CsrBlob.to_value x.csr)));
        ("SigningAlgorithm",
          (Some (SigningAlgorithm.to_value x.signingAlgorithm)));
        ("TemplateArn", (Option.map x.templateArn ~f:Arn.to_value));
        ("Validity", (Some (Validity.to_value x.validity)));
        ("ValidityNotBefore",
          (Option.map x.validityNotBefore ~f:Validity.to_value));
        ("IdempotencyToken",
          (Option.map x.idempotencyToken ~f:IdempotencyToken.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let idempotencyToken =
        (Option.map ~f:IdempotencyToken.of_xml)
          (Xml.child xml_arg0 "IdempotencyToken") in
      let validityNotBefore =
        (Option.map ~f:Validity.of_xml)
          (Xml.child xml_arg0 "ValidityNotBefore") in
      let validity =
        Validity.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Validity") in
      let templateArn =
        (Option.map ~f:Arn.of_xml) (Xml.child xml_arg0 "TemplateArn") in
      let signingAlgorithm =
        SigningAlgorithm.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "SigningAlgorithm") in
      let csr =
        CsrBlob.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Csr") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      let apiPassthrough =
        (Option.map ~f:ApiPassthrough.of_xml)
          (Xml.child xml_arg0 "ApiPassthrough") in
      make ?idempotencyToken ?validityNotBefore ~validity ?templateArn
        ~signingAlgorithm ~csr ~certificateAuthorityArn ?apiPassthrough ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let idempotencyToken =
        field_map json__ "IdempotencyToken" IdempotencyToken.of_json in
      let validityNotBefore =
        field_map json__ "ValidityNotBefore" Validity.of_json in
      let validity = field_map_exn json__ "Validity" Validity.of_json in
      let templateArn = field_map json__ "TemplateArn" Arn.of_json in
      let signingAlgorithm =
        field_map_exn json__ "SigningAlgorithm" SigningAlgorithm.of_json in
      let csr = field_map_exn json__ "Csr" CsrBlob.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      let apiPassthrough =
        field_map json__ "ApiPassthrough" ApiPassthrough.of_json in
      make ?idempotencyToken ?validityNotBefore ~validity ?templateArn
        ~signingAlgorithm ~csr ~certificateAuthorityArn ?apiPassthrough ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Uses your private certificate authority (CA), or one that has been shared with you, to issue a client certificate. This action returns the Amazon Resource Name (ARN) of the certificate. You can retrieve the certificate by calling the GetCertificate action and specifying the ARN. You cannot use the ACM ListCertificateAuthorities action to retrieve the ARNs of the certificates that you issue by using Amazon Web Services Private CA."]
module InvalidRequestException =
  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 action cannot be performed or is prohibited."]
module ImportCertificateAuthorityCertificateRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"];
      certificate: CertificateBodyBlob.t
        [@ocaml.doc
          "The PEM-encoded certificate for a private CA. This may be a self-signed certificate in the case of a root CA, or it may be signed by another CA that you control."];
      certificateChain: CertificateChainBlob.t option
        [@ocaml.doc
          "A PEM-encoded file that contains all of your certificates, other than the certificate you're importing, chaining up to your root CA. Your Amazon Web Services Private CA-hosted or on-premises root certificate is the last in the chain, and each certificate in the chain signs the one preceding. This parameter must be supplied when you import a subordinate CA. When you import a root CA, there is no chain."]}
    let context_ = "ImportCertificateAuthorityCertificateRequest"
    let make ?certificateChain =
      fun ~certificateAuthorityArn ->
        fun ~certificate ->
          fun () ->
            { certificateChain; certificateAuthorityArn; certificate }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("Certificate", (Some (CertificateBodyBlob.to_value x.certificate)));
        ("CertificateChain",
          (Option.map x.certificateChain ~f:CertificateChainBlob.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateChain =
        (Option.map ~f:CertificateChainBlob.of_xml)
          (Xml.child xml_arg0 "CertificateChain") in
      let certificate =
        CertificateBodyBlob.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Certificate") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ?certificateChain ~certificate ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateChain =
        field_map json__ "CertificateChain" CertificateChainBlob.of_json in
      let certificate =
        field_map_exn json__ "Certificate" CertificateBodyBlob.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ?certificateChain ~certificate ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Imports a signed private CA certificate into Amazon Web Services Private CA. This action is used when you are using a chain of trust whose root is located outside Amazon Web Services Private CA. Before you can call this action, the following preparations must in place: In Amazon Web Services Private CA, call the CreateCertificateAuthority action to create the private CA that you plan to back with the imported certificate. Call the GetCertificateAuthorityCsr action to generate a certificate signing request (CSR). Sign the CSR using a root or intermediate CA hosted by either an on-premises PKI hierarchy or by a commercial CA. Create a certificate chain and copy the signed certificate and the certificate chain to your working directory. Amazon Web Services Private CA supports three scenarios for installing a CA certificate: Installing a certificate for a root CA hosted by Amazon Web Services Private CA. Installing a subordinate CA certificate whose parent authority is hosted by Amazon Web Services Private CA. Installing a subordinate CA certificate whose parent authority is externally hosted. The following additional requirements apply when you import a CA certificate. Only a self-signed certificate can be imported as a root CA. A self-signed certificate cannot be imported as a subordinate CA. Your certificate chain must not include the private CA certificate that you are importing. Your root CA must be the last certificate in your chain. The subordinate certificate, if any, that your root CA signed must be next to last. The subordinate certificate signed by the preceding subordinate CA must come next, and so on until your chain is built. The chain must be PEM-encoded. The maximum allowed size of a certificate is 32 KB. The maximum allowed size of a certificate chain is 2 MB. Enforcement of Critical Constraints Amazon Web Services Private CA allows the following extensions to be marked critical in the imported CA certificate or chain. Authority key identifier Basic constraints (must be marked critical) Certificate policies Extended key usage Inhibit anyPolicy Issuer alternative name Key usage Name constraints Policy mappings Subject alternative name Subject directory attributes Subject key identifier Subject information access Amazon Web Services Private CA rejects the following extensions when they are marked critical in an imported CA certificate or chain. Authority information access CRL distribution points Freshest CRL Policy constraints Amazon Web Services Private Certificate Authority will also reject any other extension marked as critical not contained on the preceding list of allowed extensions."]
module GetPolicyResponse =
  struct
    type nonrec t =
      {
      policy: AWSPolicy.t option
        [@ocaml.doc
          "The policy attached to the private CA as a JSON document."]}
    type nonrec error =
      [ `InvalidArnException of InvalidArnException.t 
      | `InvalidStateException of InvalidStateException.t 
      | `RequestFailedException of RequestFailedException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?policy = fun () -> { policy }
    let error_of_json name json =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_json json)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_xml xml)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `InvalidStateException e ->
          `Assoc
            [("error", (`String "InvalidStateException"));
            ("details", (InvalidStateException.to_json e))]
      | `RequestFailedException e ->
          `Assoc
            [("error", (`String "RequestFailedException"));
            ("details", (RequestFailedException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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
        [("Policy", (Option.map x.policy ~f:AWSPolicy.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let policy =
        (Option.map ~f:AWSPolicy.of_xml) (Xml.child xml_arg0 "Policy") in
      make ?policy ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let policy = field_map json__ "Policy" AWSPolicy.of_json in
      make ?policy ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the resource-based policy attached to a private CA. If either the private CA resource or the policy cannot be found, this action returns a ResourceNotFoundException. The policy can be attached or updated with PutPolicy and removed with DeletePolicy. About Policies A policy grants access on a private CA to an Amazon Web Services customer account, to Amazon Web Services Organizations, or to an Amazon Web Services Organizations unit. Policies are under the control of a CA administrator. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA. A policy permits a user of Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account. For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the Amazon Web Services Private CA policy. For more information, see Using a Service Linked Role with ACM. Updates made in Amazon Web Services Resource Manager (RAM) are reflected in policies. For more information, see Attach a Policy for Cross-Account Access."]
module GetPolicyRequest =
  struct
    type nonrec t =
      {
      resourceArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Number (ARN) of the private CA that will have its policy retrieved. You can find the CA's ARN by calling the ListCertificateAuthorities action."]}
    let context_ = "GetPolicyRequest"
    let make ~resourceArn = fun () -> { resourceArn }
    let to_value x =
      structure_to_value
        [("ResourceArn", (Some (Arn.to_value x.resourceArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let resourceArn =
        Arn.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" Arn.of_json in
      make ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the resource-based policy attached to a private CA. If either the private CA resource or the policy cannot be found, this action returns a ResourceNotFoundException. The policy can be attached or updated with PutPolicy and removed with DeletePolicy. About Policies A policy grants access on a private CA to an Amazon Web Services customer account, to Amazon Web Services Organizations, or to an Amazon Web Services Organizations unit. Policies are under the control of a CA administrator. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA. A policy permits a user of Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account. For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the Amazon Web Services Private CA policy. For more information, see Using a Service Linked Role with ACM. Updates made in Amazon Web Services Resource Manager (RAM) are reflected in policies. For more information, see Attach a Policy for Cross-Account Access."]
module GetCertificateResponse =
  struct
    type nonrec t =
      {
      certificate: CertificateBody.t option
        [@ocaml.doc
          "The base64 PEM-encoded certificate specified by the CertificateArn parameter."];
      certificateChain: CertificateChain.t option
        [@ocaml.doc
          "The base64 PEM-encoded certificate chain that chains up to the root CA certificate that you used to sign your private CA certificate."]}
    type nonrec error =
      [ `InvalidArnException of InvalidArnException.t 
      | `InvalidStateException of InvalidStateException.t 
      | `RequestFailedException of RequestFailedException.t 
      | `RequestInProgressException of RequestInProgressException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?certificate =
      fun ?certificateChain -> fun () -> { certificate; certificateChain }
    let error_of_json name json =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_json json)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_json json)
      | "RequestInProgressException" ->
          `RequestInProgressException
            (RequestInProgressException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_xml xml)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_xml xml)
      | "RequestInProgressException" ->
          `RequestInProgressException (RequestInProgressException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `InvalidStateException e ->
          `Assoc
            [("error", (`String "InvalidStateException"));
            ("details", (InvalidStateException.to_json e))]
      | `RequestFailedException e ->
          `Assoc
            [("error", (`String "RequestFailedException"));
            ("details", (RequestFailedException.to_json e))]
      | `RequestInProgressException e ->
          `Assoc
            [("error", (`String "RequestInProgressException"));
            ("details", (RequestInProgressException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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
        [("Certificate",
           (Option.map x.certificate ~f:CertificateBody.to_value));
        ("CertificateChain",
          (Option.map x.certificateChain ~f:CertificateChain.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateChain =
        (Option.map ~f:CertificateChain.of_xml)
          (Xml.child xml_arg0 "CertificateChain") in
      let certificate =
        (Option.map ~f:CertificateBody.of_xml)
          (Xml.child xml_arg0 "Certificate") in
      make ?certificateChain ?certificate ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateChain =
        field_map json__ "CertificateChain" CertificateChain.of_json in
      let certificate =
        field_map json__ "Certificate" CertificateBody.of_json in
      make ?certificateChain ?certificate ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves a certificate from your private CA or one that has been shared with you. The ARN of the certificate is returned when you call the IssueCertificate action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the GetCertificate action. You can retrieve the certificate if it is in the ISSUED, EXPIRED, or REVOKED state. You can call the CreateCertificateAuthorityAuditReport action to create a report that contains information about all of the certificates issued and revoked by your private CA."]
module GetCertificateRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."];
      certificateArn: Arn.t
        [@ocaml.doc
          "The ARN of the issued certificate. The ARN contains the certificate serial number and must be in the following form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012/certificate/286535153982981100925020015808220737245"]}
    let context_ = "GetCertificateRequest"
    let make ~certificateAuthorityArn =
      fun ~certificateArn ->
        fun () -> { certificateAuthorityArn; certificateArn }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("CertificateArn", (Some (Arn.to_value x.certificateArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateArn") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~certificateArn ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateArn = field_map_exn json__ "CertificateArn" Arn.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~certificateArn ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves a certificate from your private CA or one that has been shared with you. The ARN of the certificate is returned when you call the IssueCertificate action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the GetCertificate action. You can retrieve the certificate if it is in the ISSUED, EXPIRED, or REVOKED state. You can call the CreateCertificateAuthorityAuditReport action to create a report that contains information about all of the certificates issued and revoked by your private CA."]
module GetCertificateAuthorityCsrResponse =
  struct
    type nonrec t =
      {
      csr: CsrBody.t option
        [@ocaml.doc
          "The base64 PEM-encoded certificate signing request (CSR) for your private CA certificate."]}
    type nonrec error =
      [ `InvalidArnException of InvalidArnException.t 
      | `InvalidStateException of InvalidStateException.t 
      | `RequestFailedException of RequestFailedException.t 
      | `RequestInProgressException of RequestInProgressException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?csr = fun () -> { csr }
    let error_of_json name json =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_json json)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_json json)
      | "RequestInProgressException" ->
          `RequestInProgressException
            (RequestInProgressException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_xml xml)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_xml xml)
      | "RequestInProgressException" ->
          `RequestInProgressException (RequestInProgressException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `InvalidStateException e ->
          `Assoc
            [("error", (`String "InvalidStateException"));
            ("details", (InvalidStateException.to_json e))]
      | `RequestFailedException e ->
          `Assoc
            [("error", (`String "RequestFailedException"));
            ("details", (RequestFailedException.to_json e))]
      | `RequestInProgressException e ->
          `Assoc
            [("error", (`String "RequestInProgressException"));
            ("details", (RequestInProgressException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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 [("Csr", (Option.map x.csr ~f:CsrBody.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let csr = (Option.map ~f:CsrBody.of_xml) (Xml.child xml_arg0 "Csr") in
      make ?csr ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let csr = field_map json__ "Csr" CsrBody.of_json in make ?csr ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the certificate signing request (CSR) for your private certificate authority (CA). The CSR is created when you call the CreateCertificateAuthority action. Sign the CSR with your Amazon Web Services Private CA-hosted or on-premises root or subordinate CA. Then import the signed certificate back into Amazon Web Services Private CA by calling the ImportCertificateAuthorityCertificate action. The CSR is returned as a base64 PEM-encoded string."]
module GetCertificateAuthorityCsrRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called the CreateCertificateAuthority action. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"]}
    let context_ = "GetCertificateAuthorityCsrRequest"
    let make ~certificateAuthorityArn = fun () -> { certificateAuthorityArn }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the certificate signing request (CSR) for your private certificate authority (CA). The CSR is created when you call the CreateCertificateAuthority action. Sign the CSR with your Amazon Web Services Private CA-hosted or on-premises root or subordinate CA. Then import the signed certificate back into Amazon Web Services Private CA by calling the ImportCertificateAuthorityCertificate action. The CSR is returned as a base64 PEM-encoded string."]
module GetCertificateAuthorityCertificateResponse =
  struct
    type nonrec t =
      {
      certificate: CertificateBody.t option
        [@ocaml.doc "Base64-encoded certificate authority (CA) certificate."];
      certificateChain: CertificateChain.t option
        [@ocaml.doc
          "Base64-encoded certificate chain that includes any intermediate certificates and chains up to root certificate that you used to sign your private CA certificate. The chain does not include your private CA certificate. If this is a root CA, the value will be null."]}
    type nonrec error =
      [ `InvalidArnException of InvalidArnException.t 
      | `InvalidStateException of InvalidStateException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?certificate =
      fun ?certificateChain -> fun () -> { certificate; certificateChain }
    let error_of_json name json =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `InvalidStateException e ->
          `Assoc
            [("error", (`String "InvalidStateException"));
            ("details", (InvalidStateException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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
        [("Certificate",
           (Option.map x.certificate ~f:CertificateBody.to_value));
        ("CertificateChain",
          (Option.map x.certificateChain ~f:CertificateChain.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateChain =
        (Option.map ~f:CertificateChain.of_xml)
          (Xml.child xml_arg0 "CertificateChain") in
      let certificate =
        (Option.map ~f:CertificateBody.of_xml)
          (Xml.child xml_arg0 "Certificate") in
      make ?certificateChain ?certificate ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateChain =
        field_map json__ "CertificateChain" CertificateChain.of_json in
      let certificate =
        field_map json__ "Certificate" CertificateBody.of_json in
      make ?certificateChain ?certificate ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the certificate and certificate chain for your private certificate authority (CA) or one that has been shared with you. Both the certificate and the chain are base64 PEM-encoded. The chain does not include the CA certificate. Each certificate in the chain signs the one before it."]
module GetCertificateAuthorityCertificateRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of your private CA. This is of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."]}
    let context_ = "GetCertificateAuthorityCertificateRequest"
    let make ~certificateAuthorityArn = fun () -> { certificateAuthorityArn }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the certificate and certificate chain for your private certificate authority (CA) or one that has been shared with you. Both the certificate and the chain are base64 PEM-encoded. The chain does not include the CA certificate. Each certificate in the chain signs the one before it."]
module DescribeCertificateAuthorityResponse =
  struct
    type nonrec t =
      {
      certificateAuthority: CertificateAuthority.t option
        [@ocaml.doc
          "A CertificateAuthority structure that contains information about your private CA."]}
    type nonrec error =
      [ `InvalidArnException of InvalidArnException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?certificateAuthority = fun () -> { certificateAuthority }
    let error_of_json name json =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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
        [("CertificateAuthority",
           (Option.map x.certificateAuthority
              ~f:CertificateAuthority.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthority =
        (Option.map ~f:CertificateAuthority.of_xml)
          (Xml.child xml_arg0 "CertificateAuthority") in
      make ?certificateAuthority ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthority =
        field_map json__ "CertificateAuthority" CertificateAuthority.of_json in
      make ?certificateAuthority ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists information about your private certificate authority (CA) or one that has been shared with you. You specify the private CA on input by its ARN (Amazon Resource Name). The output contains the status of your CA. This can be any of the following: CREATING - Amazon Web Services Private CA is creating your private certificate authority. PENDING_CERTIFICATE - The certificate is pending. You must use your Amazon Web Services Private CA-hosted or on-premises root or subordinate CA to sign your private CA CSR and then import it into Amazon Web Services Private CA. ACTIVE - Your private CA is active. DISABLED - Your private CA has been disabled. EXPIRED - Your private CA certificate has expired. FAILED - Your private CA has failed. Your CA can fail because of problems such a network outage or back-end Amazon Web Services failure or other errors. A failed CA can never return to the pending state. You must create a new CA. DELETED - Your private CA is within the restoration period, after which it is permanently deleted. The length of time remaining in the CA's restoration period is also included in this action's output."]
module DescribeCertificateAuthorityRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."]}
    let context_ = "DescribeCertificateAuthorityRequest"
    let make ~certificateAuthorityArn = fun () -> { certificateAuthorityArn }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists information about your private certificate authority (CA) or one that has been shared with you. You specify the private CA on input by its ARN (Amazon Resource Name). The output contains the status of your CA. This can be any of the following: CREATING - Amazon Web Services Private CA is creating your private certificate authority. PENDING_CERTIFICATE - The certificate is pending. You must use your Amazon Web Services Private CA-hosted or on-premises root or subordinate CA to sign your private CA CSR and then import it into Amazon Web Services Private CA. ACTIVE - Your private CA is active. DISABLED - Your private CA has been disabled. EXPIRED - Your private CA certificate has expired. FAILED - Your private CA has failed. Your CA can fail because of problems such a network outage or back-end Amazon Web Services failure or other errors. A failed CA can never return to the pending state. You must create a new CA. DELETED - Your private CA is within the restoration period, after which it is permanently deleted. The length of time remaining in the CA's restoration period is also included in this action's output."]
module DescribeCertificateAuthorityAuditReportResponse =
  struct
    type nonrec t =
      {
      auditReportStatus: AuditReportStatus.t option
        [@ocaml.doc
          "Specifies whether report creation is in progress, has succeeded, or has failed."];
      s3BucketName: S3BucketName.t option
        [@ocaml.doc "Name of the S3 bucket that contains the report."];
      s3Key: S3Key.t option
        [@ocaml.doc
          "S3 key that uniquely identifies the report file in your S3 bucket."];
      createdAt: TStamp.t option
        [@ocaml.doc "The date and time at which the report was created."]}
    type nonrec error =
      [ `InvalidArgsException of InvalidArgsException.t 
      | `InvalidArnException of InvalidArnException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?auditReportStatus =
      fun ?s3BucketName ->
        fun ?s3Key ->
          fun ?createdAt ->
            fun () -> { auditReportStatus; s3BucketName; s3Key; createdAt }
    let error_of_json name json =
      match name with
      | "InvalidArgsException" ->
          `InvalidArgsException (InvalidArgsException.of_json json)
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArgsException" ->
          `InvalidArgsException (InvalidArgsException.of_xml xml)
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArgsException e ->
          `Assoc
            [("error", (`String "InvalidArgsException"));
            ("details", (InvalidArgsException.to_json e))]
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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
        [("AuditReportStatus",
           (Option.map x.auditReportStatus ~f:AuditReportStatus.to_value));
        ("S3BucketName",
          (Option.map x.s3BucketName ~f:S3BucketName.to_value));
        ("S3Key", (Option.map x.s3Key ~f:S3Key.to_value));
        ("CreatedAt", (Option.map x.createdAt ~f:TStamp.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let createdAt =
        (Option.map ~f:TStamp.of_xml) (Xml.child xml_arg0 "CreatedAt") in
      let s3Key = (Option.map ~f:S3Key.of_xml) (Xml.child xml_arg0 "S3Key") in
      let s3BucketName =
        (Option.map ~f:S3BucketName.of_xml)
          (Xml.child xml_arg0 "S3BucketName") in
      let auditReportStatus =
        (Option.map ~f:AuditReportStatus.of_xml)
          (Xml.child xml_arg0 "AuditReportStatus") in
      make ?createdAt ?s3Key ?s3BucketName ?auditReportStatus ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let createdAt = field_map json__ "CreatedAt" TStamp.of_json in
      let s3Key = field_map json__ "S3Key" S3Key.of_json in
      let s3BucketName = field_map json__ "S3BucketName" S3BucketName.of_json in
      let auditReportStatus =
        field_map json__ "AuditReportStatus" AuditReportStatus.of_json in
      make ?createdAt ?s3Key ?s3BucketName ?auditReportStatus ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists information about a specific audit report created by calling the CreateCertificateAuthorityAuditReport action. Audit information is created every time the certificate authority (CA) private key is used. The private key is used when you call the IssueCertificate action or the RevokeCertificate action."]
module DescribeCertificateAuthorityAuditReportRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the private CA. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."];
      auditReportId: AuditReportId.t
        [@ocaml.doc
          "The report ID returned by calling the CreateCertificateAuthorityAuditReport action."]}
    let context_ = "DescribeCertificateAuthorityAuditReportRequest"
    let make ~certificateAuthorityArn =
      fun ~auditReportId ->
        fun () -> { certificateAuthorityArn; auditReportId }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("AuditReportId", (Some (AuditReportId.to_value x.auditReportId)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let auditReportId =
        AuditReportId.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AuditReportId") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~auditReportId ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let auditReportId =
        field_map_exn json__ "AuditReportId" AuditReportId.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~auditReportId ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists information about a specific audit report created by calling the CreateCertificateAuthorityAuditReport action. Audit information is created every time the certificate authority (CA) private key is used. The private key is used when you call the IssueCertificate action or the RevokeCertificate action."]
module DeletePolicyRequest =
  struct
    type nonrec t =
      {
      resourceArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Number (ARN) of the private CA that will have its policy deleted. You can find the CA's ARN by calling the ListCertificateAuthorities action. The ARN value must have the form arn:aws:acm-pca:region:account:certificate-authority/01234567-89ab-cdef-0123-0123456789ab."]}
    let context_ = "DeletePolicyRequest"
    let make ~resourceArn = fun () -> { resourceArn }
    let to_value x =
      structure_to_value
        [("ResourceArn", (Some (Arn.to_value x.resourceArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let resourceArn =
        Arn.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" Arn.of_json in
      make ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Deletes the resource-based policy attached to a private CA. Deletion will remove any access that the policy has granted. If there is no policy attached to the private CA, this action will return successful. If you delete a policy that was applied through Amazon Web Services Resource Access Manager (RAM), the CA will be removed from all shares in which it was included. The Certificate Manager Service Linked Role that the policy supports is not affected when you delete the policy. The current policy can be shown with GetPolicy and updated with PutPolicy. About Policies A policy grants access on a private CA to an Amazon Web Services customer account, to Amazon Web Services Organizations, or to an Amazon Web Services Organizations unit. Policies are under the control of a CA administrator. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA. A policy permits a user of Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account. For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the Amazon Web Services Private CA policy. For more information, see Using a Service Linked Role with ACM. Updates made in Amazon Web Services Resource Manager (RAM) are reflected in policies. For more information, see Attach a Policy for Cross-Account Access."]
module DeletePermissionRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Number (ARN) of the private CA that issued the permissions. You can find the CA's ARN by calling the ListCertificateAuthorities action. This must have the following form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."];
      principal: Principal.t
        [@ocaml.doc
          "The Amazon Web Services service or identity that will have its CA permissions revoked. At this time, the only valid service principal is acm.amazonaws.com"];
      sourceAccount: AccountId.t option
        [@ocaml.doc
          "The Amazon Web Services account that calls this action."]}
    let context_ = "DeletePermissionRequest"
    let make ?sourceAccount =
      fun ~certificateAuthorityArn ->
        fun ~principal ->
          fun () -> { sourceAccount; certificateAuthorityArn; principal }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("Principal", (Some (Principal.to_value x.principal)));
        ("SourceAccount", (Option.map x.sourceAccount ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let sourceAccount =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "SourceAccount") in
      let principal =
        Principal.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Principal") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ?sourceAccount ~principal ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let sourceAccount = field_map json__ "SourceAccount" AccountId.of_json in
      let principal = field_map_exn json__ "Principal" Principal.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ?sourceAccount ~principal ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Revokes permissions on a private CA granted to the Certificate Manager (ACM) service principal (acm.amazonaws.com). These permissions allow ACM to issue and renew ACM certificates that reside in the same Amazon Web Services account as the CA. If you revoke these permissions, ACM will no longer renew the affected certificates automatically. Permissions can be granted with the CreatePermission action and listed with the ListPermissions action. About Permissions If the private CA and the certificates it issues reside in the same account, you can use CreatePermission to grant permissions for ACM to carry out automatic certificate renewals. For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates. If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA."]
module DeleteCertificateAuthorityRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority. This must have the following form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."];
      permanentDeletionTimeInDays: PermanentDeletionTimeInDays.t option
        [@ocaml.doc
          "The number of days to make a CA restorable after it has been deleted. This can be anywhere from 7 to 30 days, with 30 being the default."]}
    let context_ = "DeleteCertificateAuthorityRequest"
    let make ?permanentDeletionTimeInDays =
      fun ~certificateAuthorityArn ->
        fun () -> { permanentDeletionTimeInDays; certificateAuthorityArn }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("PermanentDeletionTimeInDays",
          (Option.map x.permanentDeletionTimeInDays
             ~f:PermanentDeletionTimeInDays.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let permanentDeletionTimeInDays =
        (Option.map ~f:PermanentDeletionTimeInDays.of_xml)
          (Xml.child xml_arg0 "PermanentDeletionTimeInDays") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ?permanentDeletionTimeInDays ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let permanentDeletionTimeInDays =
        field_map json__ "PermanentDeletionTimeInDays"
          PermanentDeletionTimeInDays.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ?permanentDeletionTimeInDays ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Deletes a private certificate authority (CA). You must provide the Amazon Resource Name (ARN) of the private CA that you want to delete. You can find the ARN by calling the ListCertificateAuthorities action. Deleting a CA will invalidate other CAs and certificates below it in your CA hierarchy. Before you can delete a CA that you have created and activated, you must disable it. To do this, call the UpdateCertificateAuthority action and set the CertificateAuthorityStatus parameter to DISABLED. Additionally, you can delete a CA if you are waiting for it to be created (that is, the status of the CA is CREATING). You can also delete it if the CA has been created but you haven't yet imported the signed certificate into Amazon Web Services Private CA (that is, the status of the CA is PENDING_CERTIFICATE). When you successfully call DeleteCertificateAuthority, the CA's status changes to DELETED. However, the CA won't be permanently deleted until the restoration period has passed. By default, if you do not set the PermanentDeletionTimeInDays parameter, the CA remains restorable for 30 days. You can set the parameter from 7 to 30 days. The DescribeCertificateAuthority action returns the time remaining in the restoration window of a private CA in the DELETED state. To restore an eligible CA, call the RestoreCertificateAuthority action. A private CA can be deleted if it is in the PENDING_CERTIFICATE, CREATING, EXPIRED, DISABLED, or FAILED state. To delete a CA in the ACTIVE state, you must first disable it, or else the delete request results in an exception. If you are deleting a private CA in the PENDING_CERTIFICATE or DISABLED state, you can set the length of its restoration period to 7-30 days. The default is 30. During this time, the status is set to DELETED and the CA can be restored. A private CA deleted in the CREATING or FAILED state has no assigned restoration period and cannot be restored."]
module CreatePermissionRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the CA that grants the permissions. You can find the ARN by calling the ListCertificateAuthorities action. This must have the following form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."];
      principal: Principal.t
        [@ocaml.doc
          "The Amazon Web Services service or identity that receives the permission. At this time, the only valid principal is acm.amazonaws.com."];
      sourceAccount: AccountId.t option
        [@ocaml.doc "The ID of the calling account."];
      actions: ActionList.t
        [@ocaml.doc
          "The actions that the specified Amazon Web Services service principal can use. These include IssueCertificate, GetCertificate, and ListPermissions."]}
    let context_ = "CreatePermissionRequest"
    let make ?sourceAccount =
      fun ~certificateAuthorityArn ->
        fun ~principal ->
          fun ~actions ->
            fun () ->
              { sourceAccount; certificateAuthorityArn; principal; actions }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("Principal", (Some (Principal.to_value x.principal)));
        ("SourceAccount", (Option.map x.sourceAccount ~f:AccountId.to_value));
        ("Actions", (Some (ActionList.to_value x.actions)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let actions =
        ActionList.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Actions") in
      let sourceAccount =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "SourceAccount") in
      let principal =
        Principal.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Principal") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~actions ?sourceAccount ~principal ~certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let actions = field_map_exn json__ "Actions" ActionList.of_json in
      let sourceAccount = field_map json__ "SourceAccount" AccountId.of_json in
      let principal = field_map_exn json__ "Principal" Principal.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~actions ?sourceAccount ~principal ~certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Grants one or more permissions on a private CA to the Certificate Manager (ACM) service principal (acm.amazonaws.com). These permissions allow ACM to issue and renew ACM certificates that reside in the same Amazon Web Services account as the CA. You can list current permissions with the ListPermissions action and revoke them with the DeletePermission action. About Permissions If the private CA and the certificates it issues reside in the same account, you can use CreatePermission to grant permissions for ACM to carry out automatic certificate renewals. For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates. If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA."]
module CreateCertificateAuthorityResponse =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t option
        [@ocaml.doc
          "If successful, the Amazon Resource Name (ARN) of the certificate authority (CA). This is of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."]}
    type nonrec error =
      [ `InvalidArgsException of InvalidArgsException.t 
      | `InvalidPolicyException of InvalidPolicyException.t 
      | `InvalidTagException of InvalidTagException.t 
      | `LimitExceededException of LimitExceededException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?certificateAuthorityArn = fun () -> { certificateAuthorityArn }
    let error_of_json name json =
      match name with
      | "InvalidArgsException" ->
          `InvalidArgsException (InvalidArgsException.of_json json)
      | "InvalidPolicyException" ->
          `InvalidPolicyException (InvalidPolicyException.of_json json)
      | "InvalidTagException" ->
          `InvalidTagException (InvalidTagException.of_json json)
      | "LimitExceededException" ->
          `LimitExceededException (LimitExceededException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArgsException" ->
          `InvalidArgsException (InvalidArgsException.of_xml xml)
      | "InvalidPolicyException" ->
          `InvalidPolicyException (InvalidPolicyException.of_xml xml)
      | "InvalidTagException" ->
          `InvalidTagException (InvalidTagException.of_xml xml)
      | "LimitExceededException" ->
          `LimitExceededException (LimitExceededException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArgsException e ->
          `Assoc
            [("error", (`String "InvalidArgsException"));
            ("details", (InvalidArgsException.to_json e))]
      | `InvalidPolicyException e ->
          `Assoc
            [("error", (`String "InvalidPolicyException"));
            ("details", (InvalidPolicyException.to_json e))]
      | `InvalidTagException e ->
          `Assoc
            [("error", (`String "InvalidTagException"));
            ("details", (InvalidTagException.to_json e))]
      | `LimitExceededException e ->
          `Assoc
            [("error", (`String "LimitExceededException"));
            ("details", (LimitExceededException.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
        [("CertificateAuthorityArn",
           (Option.map x.certificateAuthorityArn ~f:Arn.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let certificateAuthorityArn =
        (Option.map ~f:Arn.of_xml)
          (Xml.child xml_arg0 "CertificateAuthorityArn") in
      make ?certificateAuthorityArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let certificateAuthorityArn =
        field_map json__ "CertificateAuthorityArn" Arn.of_json in
      make ?certificateAuthorityArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates a root or subordinate private certificate authority (CA). You must specify the CA configuration, an optional configuration for Online Certificate Status Protocol (OCSP) and/or a certificate revocation list (CRL), the CA type, and an optional idempotency token to avoid accidental creation of multiple CAs. The CA configuration specifies the name of the algorithm and key size to be used to create the CA private key, the type of signing algorithm that the CA uses, and X.500 subject information. The OCSP configuration can optionally specify a custom URL for the OCSP responder. The CRL configuration specifies the CRL expiration period in days (the validity period of the CRL), the Amazon S3 bucket that will contain the CRL, and a CNAME alias for the S3 bucket that is included in certificates issued by the CA. If successful, this action returns the Amazon Resource Name (ARN) of the CA. Both Amazon Web Services Private CA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see Access policies for CRLs in Amazon S3. Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see Encrypting Your CRLs."]
module CreateCertificateAuthorityRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityConfiguration: CertificateAuthorityConfiguration.t
        [@ocaml.doc
          "Name and bit size of the private key algorithm, the name of the signing algorithm, and X.500 certificate subject information."];
      revocationConfiguration: RevocationConfiguration.t option
        [@ocaml.doc
          "Contains information to enable support for Online Certificate Status Protocol (OCSP), certificate revocation list (CRL), both protocols, or neither. By default, both certificate validation mechanisms are disabled. The following requirements apply to revocation configurations. A configuration disabling CRLs or OCSP must contain only the Enabled=False parameter, and will fail if other parameters such as CustomCname or ExpirationInDays are included. In a CRL configuration, the S3BucketName parameter must conform to Amazon S3 bucket naming rules. A configuration containing a custom Canonical Name (CNAME) parameter for CRLs or OCSP must conform to RFC2396 restrictions on the use of special characters in a CNAME. In a CRL or OCSP configuration, the value of a CNAME parameter must not include a protocol prefix such as \"http://\" or \"https://\". For more information, see the OcspConfiguration and CrlConfiguration types."];
      certificateAuthorityType: CertificateAuthorityType.t
        [@ocaml.doc "The type of the certificate authority."];
      idempotencyToken: IdempotencyToken.t option
        [@ocaml.doc
          "Custom string that can be used to distinguish between calls to the CreateCertificateAuthority action. Idempotency tokens for CreateCertificateAuthority time out after five minutes. Therefore, if you call CreateCertificateAuthority multiple times with the same idempotency token within five minutes, Amazon Web Services Private CA recognizes that you are requesting only certificate authority and will issue only one. If you change the idempotency token for each call, Amazon Web Services Private CA recognizes that you are requesting multiple certificate authorities."];
      keyStorageSecurityStandard: KeyStorageSecurityStandard.t option
        [@ocaml.doc
          "Specifies a cryptographic key management compliance standard for handling and protecting CA keys. Default: FIPS_140_2_LEVEL_3_OR_HIGHER Some Amazon Web Services Regions don't support the default value. When you create a CA in these Regions, you must use CCPC_LEVEL_1_OR_HIGHER for the KeyStorageSecurityStandard parameter. If you don't, the operation returns an InvalidArgsException with this message: \"A certificate authority cannot be created in this region with the specified security standard.\" For information about security standard support in different Amazon Web Services Regions, see Storage and security compliance of Amazon Web Services Private CA private keys."];
      tags: TagList.t option
        [@ocaml.doc
          "Key-value pairs that will be attached to the new private CA. You can associate up to 50 tags with a private CA. For information using tags with IAM to manage permissions, see Controlling Access Using IAM Tags."];
      usageMode: CertificateAuthorityUsageMode.t option
        [@ocaml.doc
          "Specifies whether the CA issues general-purpose certificates that typically require a revocation mechanism, or short-lived certificates that may optionally omit revocation because they expire quickly. Short-lived certificate validity is limited to seven days. The default value is GENERAL_PURPOSE."]}
    let context_ = "CreateCertificateAuthorityRequest"
    let make ?revocationConfiguration =
      fun ?idempotencyToken ->
        fun ?keyStorageSecurityStandard ->
          fun ?tags ->
            fun ?usageMode ->
              fun ~certificateAuthorityConfiguration ->
                fun ~certificateAuthorityType ->
                  fun () ->
                    {
                      revocationConfiguration;
                      idempotencyToken;
                      keyStorageSecurityStandard;
                      tags;
                      usageMode;
                      certificateAuthorityConfiguration;
                      certificateAuthorityType
                    }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityConfiguration",
           (Some
              (CertificateAuthorityConfiguration.to_value
                 x.certificateAuthorityConfiguration)));
        ("RevocationConfiguration",
          (Option.map x.revocationConfiguration
             ~f:RevocationConfiguration.to_value));
        ("CertificateAuthorityType",
          (Some
             (CertificateAuthorityType.to_value x.certificateAuthorityType)));
        ("IdempotencyToken",
          (Option.map x.idempotencyToken ~f:IdempotencyToken.to_value));
        ("KeyStorageSecurityStandard",
          (Option.map x.keyStorageSecurityStandard
             ~f:KeyStorageSecurityStandard.to_value));
        ("Tags", (Option.map x.tags ~f:TagList.to_value));
        ("UsageMode",
          (Option.map x.usageMode ~f:CertificateAuthorityUsageMode.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let usageMode =
        (Option.map ~f:CertificateAuthorityUsageMode.of_xml)
          (Xml.child xml_arg0 "UsageMode") in
      let tags = (Option.map ~f:TagList.of_xml) (Xml.child xml_arg0 "Tags") in
      let keyStorageSecurityStandard =
        (Option.map ~f:KeyStorageSecurityStandard.of_xml)
          (Xml.child xml_arg0 "KeyStorageSecurityStandard") in
      let idempotencyToken =
        (Option.map ~f:IdempotencyToken.of_xml)
          (Xml.child xml_arg0 "IdempotencyToken") in
      let certificateAuthorityType =
        CertificateAuthorityType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0
             "CertificateAuthorityType") in
      let revocationConfiguration =
        (Option.map ~f:RevocationConfiguration.of_xml)
          (Xml.child xml_arg0 "RevocationConfiguration") in
      let certificateAuthorityConfiguration =
        CertificateAuthorityConfiguration.of_xml
          (Xml.child_exn ~context:context_ xml_arg0
             "CertificateAuthorityConfiguration") in
      make ?usageMode ?tags ?keyStorageSecurityStandard ?idempotencyToken
        ~certificateAuthorityType ?revocationConfiguration
        ~certificateAuthorityConfiguration ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let usageMode =
        field_map json__ "UsageMode" CertificateAuthorityUsageMode.of_json in
      let tags = field_map json__ "Tags" TagList.of_json in
      let keyStorageSecurityStandard =
        field_map json__ "KeyStorageSecurityStandard"
          KeyStorageSecurityStandard.of_json in
      let idempotencyToken =
        field_map json__ "IdempotencyToken" IdempotencyToken.of_json in
      let certificateAuthorityType =
        field_map_exn json__ "CertificateAuthorityType"
          CertificateAuthorityType.of_json in
      let revocationConfiguration =
        field_map json__ "RevocationConfiguration"
          RevocationConfiguration.of_json in
      let certificateAuthorityConfiguration =
        field_map_exn json__ "CertificateAuthorityConfiguration"
          CertificateAuthorityConfiguration.of_json in
      make ?usageMode ?tags ?keyStorageSecurityStandard ?idempotencyToken
        ~certificateAuthorityType ?revocationConfiguration
        ~certificateAuthorityConfiguration ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates a root or subordinate private certificate authority (CA). You must specify the CA configuration, an optional configuration for Online Certificate Status Protocol (OCSP) and/or a certificate revocation list (CRL), the CA type, and an optional idempotency token to avoid accidental creation of multiple CAs. The CA configuration specifies the name of the algorithm and key size to be used to create the CA private key, the type of signing algorithm that the CA uses, and X.500 subject information. The OCSP configuration can optionally specify a custom URL for the OCSP responder. The CRL configuration specifies the CRL expiration period in days (the validity period of the CRL), the Amazon S3 bucket that will contain the CRL, and a CNAME alias for the S3 bucket that is included in certificates issued by the CA. If successful, this action returns the Amazon Resource Name (ARN) of the CA. Both Amazon Web Services Private CA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see Access policies for CRLs in Amazon S3. Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see Encrypting Your CRLs."]
module CreateCertificateAuthorityAuditReportResponse =
  struct
    type nonrec t =
      {
      auditReportId: AuditReportId.t option
        [@ocaml.doc
          "An alphanumeric string that contains a report identifier."];
      s3Key: S3Key.t option
        [@ocaml.doc
          "The key that uniquely identifies the report file in your S3 bucket."]}
    type nonrec error =
      [ `InvalidArgsException of InvalidArgsException.t 
      | `InvalidArnException of InvalidArnException.t 
      | `InvalidStateException of InvalidStateException.t 
      | `RequestFailedException of RequestFailedException.t 
      | `RequestInProgressException of RequestInProgressException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?auditReportId =
      fun ?s3Key -> fun () -> { auditReportId; s3Key }
    let error_of_json name json =
      match name with
      | "InvalidArgsException" ->
          `InvalidArgsException (InvalidArgsException.of_json json)
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_json json)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_json json)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_json json)
      | "RequestInProgressException" ->
          `RequestInProgressException
            (RequestInProgressException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InvalidArgsException" ->
          `InvalidArgsException (InvalidArgsException.of_xml xml)
      | "InvalidArnException" ->
          `InvalidArnException (InvalidArnException.of_xml xml)
      | "InvalidStateException" ->
          `InvalidStateException (InvalidStateException.of_xml xml)
      | "RequestFailedException" ->
          `RequestFailedException (RequestFailedException.of_xml xml)
      | "RequestInProgressException" ->
          `RequestInProgressException (RequestInProgressException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InvalidArgsException e ->
          `Assoc
            [("error", (`String "InvalidArgsException"));
            ("details", (InvalidArgsException.to_json e))]
      | `InvalidArnException e ->
          `Assoc
            [("error", (`String "InvalidArnException"));
            ("details", (InvalidArnException.to_json e))]
      | `InvalidStateException e ->
          `Assoc
            [("error", (`String "InvalidStateException"));
            ("details", (InvalidStateException.to_json e))]
      | `RequestFailedException e ->
          `Assoc
            [("error", (`String "RequestFailedException"));
            ("details", (RequestFailedException.to_json e))]
      | `RequestInProgressException e ->
          `Assoc
            [("error", (`String "RequestInProgressException"));
            ("details", (RequestInProgressException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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
        [("AuditReportId",
           (Option.map x.auditReportId ~f:AuditReportId.to_value));
        ("S3Key", (Option.map x.s3Key ~f:S3Key.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let s3Key = (Option.map ~f:S3Key.of_xml) (Xml.child xml_arg0 "S3Key") in
      let auditReportId =
        (Option.map ~f:AuditReportId.of_xml)
          (Xml.child xml_arg0 "AuditReportId") in
      make ?s3Key ?auditReportId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let s3Key = field_map json__ "S3Key" S3Key.of_json in
      let auditReportId =
        field_map json__ "AuditReportId" AuditReportId.of_json in
      make ?s3Key ?auditReportId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates an audit report that lists every time that your CA private key is used to issue a certificate. The IssueCertificate and RevokeCertificate actions use the private key. To save the audit report to your designated Amazon S3 bucket, you must create a bucket policy that grants Amazon Web Services Private CA permission to access and write to it. For an example policy, see Prepare an Amazon S3 bucket for audit reports. Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see Encrypting Your Audit Reports. You can generate a maximum of one report every 30 minutes."]
module CreateCertificateAuthorityAuditReportRequest =
  struct
    type nonrec t =
      {
      certificateAuthorityArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the CA to be audited. This is of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ."];
      s3BucketName: S3BucketName.t
        [@ocaml.doc
          "The name of the S3 bucket that will contain the audit report."];
      auditReportResponseFormat: AuditReportResponseFormat.t
        [@ocaml.doc
          "The format in which to create the report. This can be either JSON or CSV."]}
    let context_ = "CreateCertificateAuthorityAuditReportRequest"
    let make ~certificateAuthorityArn =
      fun ~s3BucketName ->
        fun ~auditReportResponseFormat ->
          fun () ->
            {
              certificateAuthorityArn;
              s3BucketName;
              auditReportResponseFormat
            }
    let to_value x =
      structure_to_value
        [("CertificateAuthorityArn",
           (Some (Arn.to_value x.certificateAuthorityArn)));
        ("S3BucketName", (Some (S3BucketName.to_value x.s3BucketName)));
        ("AuditReportResponseFormat",
          (Some
             (AuditReportResponseFormat.to_value x.auditReportResponseFormat)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let auditReportResponseFormat =
        AuditReportResponseFormat.of_xml
          (Xml.child_exn ~context:context_ xml_arg0
             "AuditReportResponseFormat") in
      let s3BucketName =
        S3BucketName.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "S3BucketName") in
      let certificateAuthorityArn =
        Arn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CertificateAuthorityArn") in
      make ~auditReportResponseFormat ~s3BucketName ~certificateAuthorityArn
        ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let auditReportResponseFormat =
        field_map_exn json__ "AuditReportResponseFormat"
          AuditReportResponseFormat.of_json in
      let s3BucketName =
        field_map_exn json__ "S3BucketName" S3BucketName.of_json in
      let certificateAuthorityArn =
        field_map_exn json__ "CertificateAuthorityArn" Arn.of_json in
      make ~auditReportResponseFormat ~s3BucketName ~certificateAuthorityArn
        ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates an audit report that lists every time that your CA private key is used to issue a certificate. The IssueCertificate and RevokeCertificate actions use the private key. To save the audit report to your designated Amazon S3 bucket, you must create a bucket policy that grants Amazon Web Services Private CA permission to access and write to it. For an example policy, see Prepare an Amazon S3 bucket for audit reports. Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see Encrypting Your Audit Reports. You can generate a maximum of one report every 30 minutes."]
module ConcurrentModificationException =
  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 "A previous update to your private CA is still ongoing."]
module CertificateMismatchException =
  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 certificate authority certificate you are importing does not comply with conditions specified in the certificate that signed it."]