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
(* 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.account
let apiVersion = "2021-02-01"
let endpointPrefix = "account"
let serviceFullName = "AWS Account"
let signatureVersion = "v4"
let protocol = "rest_json"
let globalEndpoint = endpointPrefix ^ ".amazonaws.com"
let simple_to_json to_value x =
  Botodata.Json.value_to_json_scalar (to_value x)
let composed_to_json to_value x = Botodata.Json.value_to_json (to_value x)
let to_query to_value x = Client.Query.of_value (to_value x)
let structure_to_value_aux st ~f =
  let filter = function | (k, Some v) -> Some (k, v) | _ -> None in
  let pair k v = (k, v) in
  let defer_value (k, dv) = pair k dv in
  ((List.filter_map st ~f:filter) |> (List.map ~f:defer_value)) |>
    (fun x -> `Structure (f x))
let structure_to_value = structure_to_value_aux ~f:Fn.id
let structure_to_wrapped_value ~wrapper ~response =
  structure_to_value_aux
    ~f:(fun x -> [(wrapper, (`Structure x)); (response, (`Structure []))])
module SensitiveString =
  struct
    type nonrec t = string
    let context_ = "SensitiveString"
    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:"SensitiveString" j
    let to_json = simple_to_json to_value
  end
module String_ =
  struct
    type nonrec t = string
    let context_ = "String"
    let make i = i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"String" j
    let to_json = simple_to_json to_value
  end
module ValidationExceptionField =
  struct
    type nonrec t =
      {
      name: String_.t option
        [@ocaml.doc "The field name where the invalid entry was detected."];
      message: SensitiveString.t option
        [@ocaml.doc "A message about the validation exception."]}
    let make ?name = fun ?message -> fun () -> { name; message }
    let to_value x =
      structure_to_value
        [("name", (Option.map x.name ~f:String_.to_value));
        ("message", (Option.map x.message ~f:SensitiveString.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:SensitiveString.of_xml) (Xml.child xml_arg0 "message") in
      let name = (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "name") in
      make ?message ?name ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" SensitiveString.of_json in
      let name = field_map json__ "name" String_.of_json in
      make ?message ?name ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The input failed to meet the constraints specified by the Amazon Web Services service in a specified field."]
module RegionName =
  struct
    type nonrec t = string
    let context_ = "RegionName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:50) >>=
             (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:"RegionName" j
    let to_json = simple_to_json to_value
  end
module RegionOptStatus =
  struct
    type nonrec t =
      | ENABLED 
      | ENABLING 
      | DISABLING 
      | DISABLED 
      | ENABLED_BY_DEFAULT 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | ENABLED -> "ENABLED"
      | ENABLING -> "ENABLING"
      | DISABLING -> "DISABLING"
      | DISABLED -> "DISABLED"
      | ENABLED_BY_DEFAULT -> "ENABLED_BY_DEFAULT"
      | Non_static_id s -> s
    let of_string =
      function
      | "ENABLED" -> ENABLED
      | "ENABLING" -> ENABLING
      | "DISABLING" -> DISABLING
      | "DISABLED" -> DISABLED
      | "ENABLED_BY_DEFAULT" -> ENABLED_BY_DEFAULT
      | 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 RegionOptStatus" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"RegionOptStatus" j)
    let to_json = simple_to_json to_value
  end
module ValidationExceptionFieldList =
  struct
    type nonrec t = ValidationExceptionField.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:ValidationExceptionField.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:ValidationExceptionField.of_xml)
    let of_json j =
      list_of_json ~kind:"ValidationExceptionFieldList"
        ~of_json:ValidationExceptionField.of_json j
    let to_json v = composed_to_json to_value v
  end
module ValidationExceptionReason =
  struct
    type nonrec t =
      | InvalidRegionOptTarget 
      | FieldValidationFailed 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | InvalidRegionOptTarget -> "invalidRegionOptTarget"
      | FieldValidationFailed -> "fieldValidationFailed"
      | Non_static_id s -> s
    let of_string =
      function
      | "invalidRegionOptTarget" -> InvalidRegionOptTarget
      | "fieldValidationFailed" -> FieldValidationFailed
      | 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 ValidationExceptionReason" xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"ValidationExceptionReason" j)
    let to_json = simple_to_json to_value
  end
module AddressLine =
  struct
    type nonrec t = string
    let context_ = "AddressLine"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:60) >>=
             (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:"AddressLine" j
    let to_json = simple_to_json to_value
  end
module City =
  struct
    type nonrec t = string
    let context_ = "City"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:50) >>=
             (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:"City" j
    let to_json = simple_to_json to_value
  end
module CompanyName =
  struct
    type nonrec t = string
    let context_ = "CompanyName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:50) >>=
             (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:"CompanyName" j
    let to_json = simple_to_json to_value
  end
module ContactInformationPhoneNumber =
  struct
    type nonrec t = string
    let context_ = "ContactInformationPhoneNumber"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:20) >>=
                  (fun () -> check_pattern i ~pattern:"[+][\\s0-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:"ContactInformationPhoneNumber" j
    let to_json = simple_to_json to_value
  end
module CountryCode =
  struct
    type nonrec t = string
    let context_ = "CountryCode"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:2) >>=
             (fun () -> check_string_min i ~min: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:"CountryCode" j
    let to_json = simple_to_json to_value
  end
module DistrictOrCounty =
  struct
    type nonrec t = string
    let context_ = "DistrictOrCounty"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:50) >>=
             (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:"DistrictOrCounty" j
    let to_json = simple_to_json to_value
  end
module FullName =
  struct
    type nonrec t = string
    let context_ = "FullName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:50) >>=
             (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:"FullName" j
    let to_json = simple_to_json to_value
  end
module PostalCode =
  struct
    type nonrec t = string
    let context_ = "PostalCode"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:20) >>=
             (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:"PostalCode" j
    let to_json = simple_to_json to_value
  end
module StateOrRegion =
  struct
    type nonrec t = string
    let context_ = "StateOrRegion"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:50) >>=
             (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:"StateOrRegion" j
    let to_json = simple_to_json to_value
  end
module WebsiteUrl =
  struct
    type nonrec t = string
    let context_ = "WebsiteUrl"
    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:"WebsiteUrl" j
    let to_json = simple_to_json to_value
  end
module Region =
  struct
    type nonrec t =
      {
      regionName: RegionName.t option
        [@ocaml.doc
          "The Region code of a given Region (for example, us-east-1)."];
      regionOptStatus: RegionOptStatus.t option
        [@ocaml.doc
          "One of potential statuses a Region can undergo (Enabled, Enabling, Disabled, Disabling, Enabled_By_Default)."]}
    let make ?regionName =
      fun ?regionOptStatus -> fun () -> { regionName; regionOptStatus }
    let to_value x =
      structure_to_value
        [("RegionName", (Option.map x.regionName ~f:RegionName.to_value));
        ("RegionOptStatus",
          (Option.map x.regionOptStatus ~f:RegionOptStatus.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let regionOptStatus =
        (Option.map ~f:RegionOptStatus.of_xml)
          (Xml.child xml_arg0 "RegionOptStatus") in
      let regionName =
        (Option.map ~f:RegionName.of_xml) (Xml.child xml_arg0 "RegionName") in
      make ?regionOptStatus ?regionName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let regionOptStatus =
        field_map json__ "RegionOptStatus" RegionOptStatus.of_json in
      let regionName = field_map json__ "RegionName" RegionName.of_json in
      make ?regionOptStatus ?regionName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "This is a structure that expresses the Region for a given account, consisting of a name and opt-in status."]
module AlternateContactType =
  struct
    type nonrec t =
      | BILLING 
      | OPERATIONS 
      | SECURITY 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | BILLING -> "BILLING"
      | OPERATIONS -> "OPERATIONS"
      | SECURITY -> "SECURITY"
      | Non_static_id s -> s
    let of_string =
      function
      | "BILLING" -> BILLING
      | "OPERATIONS" -> OPERATIONS
      | "SECURITY" -> SECURITY
      | 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 AlternateContactType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"AlternateContactType" j)
    let to_json = simple_to_json to_value
  end
module EmailAddress =
  struct
    type nonrec t = string
    let context_ = "EmailAddress"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:254) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"[\\s]*[\\w+=.#|!&-]+@[\\w.-]+\\.[\\w]+[\\s]*")));
        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:"EmailAddress" j
    let to_json = simple_to_json to_value
  end
module Name =
  struct
    type nonrec t = string
    let context_ = "Name"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:64) >>=
             (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:"Name" j
    let to_json = simple_to_json to_value
  end
module PhoneNumber =
  struct
    type nonrec t = string
    let context_ = "PhoneNumber"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:25) >>=
                  (fun () -> check_pattern i ~pattern:"[\\s0-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:"PhoneNumber" j
    let to_json = simple_to_json to_value
  end
module Title =
  struct
    type nonrec t = string
    let context_ = "Title"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:50) >>=
             (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:"Title" j
    let to_json = simple_to_json to_value
  end
module AccessDeniedException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      errorType: String_.t option
        [@ocaml.doc
          "The value populated to the x-amzn-ErrorType response header by API Gateway."]}
    let make ?message = fun ?errorType -> fun () -> { message; errorType }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("x-amzn-ErrorType", (Option.map x.errorType ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let errorType =
        (Option.map ~f:String_.of_xml)
          (Xml.child xml_arg0 "x-amzn-ErrorType") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?errorType ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let errorType = field_map json__ "errorType" String_.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?errorType ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The operation failed because the calling identity doesn't have the minimum required permissions."]
module ConflictException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      errorType: String_.t option
        [@ocaml.doc
          "The value populated to the x-amzn-ErrorType response header by API Gateway."]}
    let make ?message = fun ?errorType -> fun () -> { message; errorType }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("x-amzn-ErrorType", (Option.map x.errorType ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let errorType =
        (Option.map ~f:String_.of_xml)
          (Xml.child xml_arg0 "x-amzn-ErrorType") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?errorType ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let errorType = field_map json__ "errorType" String_.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?errorType ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The request could not be processed because of a conflict in the current status of the resource. For example, this happens if you try to enable a Region that is currently being disabled (in a status of DISABLING) or if you try to change an account\226\128\153s root user email to an email address which is already in use."]
module InternalServerException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      errorType: String_.t option
        [@ocaml.doc
          "The value populated to the x-amzn-ErrorType response header by API Gateway."]}
    let make ?message = fun ?errorType -> fun () -> { message; errorType }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("x-amzn-ErrorType", (Option.map x.errorType ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let errorType =
        (Option.map ~f:String_.of_xml)
          (Xml.child xml_arg0 "x-amzn-ErrorType") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?errorType ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let errorType = field_map json__ "errorType" String_.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?errorType ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The operation failed because of an error internal to Amazon Web Services. Try your operation again later."]
module PrimaryEmailUpdateStatus =
  struct
    type nonrec t =
      | PENDING 
      | ACCEPTED 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | PENDING -> "PENDING"
      | ACCEPTED -> "ACCEPTED"
      | Non_static_id s -> s
    let of_string =
      function
      | "PENDING" -> PENDING
      | "ACCEPTED" -> ACCEPTED
      | 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 PrimaryEmailUpdateStatus" xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"PrimaryEmailUpdateStatus" j)
    let to_json = simple_to_json to_value
  end
module ResourceNotFoundException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      errorType: String_.t option
        [@ocaml.doc
          "The value populated to the x-amzn-ErrorType response header by API Gateway."]}
    let make ?message = fun ?errorType -> fun () -> { message; errorType }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("x-amzn-ErrorType", (Option.map x.errorType ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let errorType =
        (Option.map ~f:String_.of_xml)
          (Xml.child xml_arg0 "x-amzn-ErrorType") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?errorType ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let errorType = field_map json__ "errorType" String_.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?errorType ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The operation failed because it specified a resource that can't be found."]
module TooManyRequestsException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      errorType: String_.t option
        [@ocaml.doc
          "The value populated to the x-amzn-ErrorType response header by API Gateway."]}
    let make ?message = fun ?errorType -> fun () -> { message; errorType }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("x-amzn-ErrorType", (Option.map x.errorType ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let errorType =
        (Option.map ~f:String_.of_xml)
          (Xml.child xml_arg0 "x-amzn-ErrorType") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?errorType ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let errorType = field_map json__ "errorType" String_.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?errorType ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The operation failed because it was called too frequently and exceeded a throttle limit."]
module ValidationException =
  struct
    type nonrec t =
      {
      message: SensitiveString.t option
        [@ocaml.doc
          "The message that informs you about what was invalid about the request."];
      reason: ValidationExceptionReason.t option
        [@ocaml.doc "The reason that validation failed."];
      fieldList: ValidationExceptionFieldList.t option
        [@ocaml.doc "The field where the invalid entry was detected."]}
    let make ?message =
      fun ?reason ->
        fun ?fieldList -> fun () -> { message; reason; fieldList }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:SensitiveString.to_value));
        ("reason",
          (Option.map x.reason ~f:ValidationExceptionReason.to_value));
        ("fieldList",
          (Option.map x.fieldList ~f:ValidationExceptionFieldList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let fieldList =
        (Option.map ~f:ValidationExceptionFieldList.of_xml)
          (Xml.child xml_arg0 "fieldList") in
      let reason =
        (Option.map ~f:ValidationExceptionReason.of_xml)
          (Xml.child xml_arg0 "reason") in
      let message =
        (Option.map ~f:SensitiveString.of_xml) (Xml.child xml_arg0 "message") in
      make ?fieldList ?reason ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let fieldList =
        field_map json__ "fieldList" ValidationExceptionFieldList.of_json in
      let reason =
        field_map json__ "reason" ValidationExceptionReason.of_json in
      let message = field_map json__ "message" SensitiveString.of_json in
      make ?fieldList ?reason ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The operation failed because one of the input parameters was invalid."]
module AccountId =
  struct
    type nonrec t = string
    let context_ = "AccountId"
    let make i =
      let open Result in
        ok_or_failwith (check_pattern i ~pattern:"\\d{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:"AccountId" j
    let to_json = simple_to_json to_value
  end
module PrimaryEmailAddress =
  struct
    type nonrec t = string
    let context_ = "PrimaryEmailAddress"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:64) >>=
             (fun () -> check_string_min i ~min:5));
        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:"PrimaryEmailAddress" j
    let to_json = simple_to_json to_value
  end
module ContactInformation =
  struct
    type nonrec t =
      {
      fullName: FullName.t
        [@ocaml.doc "The full name of the primary contact address."];
      addressLine1: AddressLine.t
        [@ocaml.doc "The first line of the primary contact address."];
      addressLine2: AddressLine.t option
        [@ocaml.doc
          "The second line of the primary contact address, if any."];
      addressLine3: AddressLine.t option
        [@ocaml.doc "The third line of the primary contact address, if any."];
      city: City.t [@ocaml.doc "The city of the primary contact address."];
      stateOrRegion: StateOrRegion.t option
        [@ocaml.doc
          "The state or region of the primary contact address. If the mailing address is within the United States (US), the value in this field can be either a two character state code (for example, NJ) or the full state name (for example, New Jersey). This field is required in the following countries: US, CA, GB, DE, JP, IN, and BR."];
      districtOrCounty: DistrictOrCounty.t option
        [@ocaml.doc
          "The district or county of the primary contact address, if any."];
      postalCode: PostalCode.t
        [@ocaml.doc "The postal code of the primary contact address."];
      countryCode: CountryCode.t
        [@ocaml.doc
          "The ISO-3166 two-letter country code for the primary contact address."];
      phoneNumber: ContactInformationPhoneNumber.t
        [@ocaml.doc
          "The phone number of the primary contact information. The number will be validated and, in some countries, checked for activation."];
      companyName: CompanyName.t option
        [@ocaml.doc
          "The name of the company associated with the primary contact information, if any."];
      websiteUrl: WebsiteUrl.t option
        [@ocaml.doc
          "The URL of the website associated with the primary contact information, if any."]}
    let context_ = "ContactInformation"
    let make ?addressLine2 =
      fun ?addressLine3 ->
        fun ?stateOrRegion ->
          fun ?districtOrCounty ->
            fun ?companyName ->
              fun ?websiteUrl ->
                fun ~fullName ->
                  fun ~addressLine1 ->
                    fun ~city ->
                      fun ~postalCode ->
                        fun ~countryCode ->
                          fun ~phoneNumber ->
                            fun () ->
                              {
                                addressLine2;
                                addressLine3;
                                stateOrRegion;
                                districtOrCounty;
                                companyName;
                                websiteUrl;
                                fullName;
                                addressLine1;
                                city;
                                postalCode;
                                countryCode;
                                phoneNumber
                              }
    let to_value x =
      structure_to_value
        [("FullName", (Some (FullName.to_value x.fullName)));
        ("AddressLine1", (Some (AddressLine.to_value x.addressLine1)));
        ("AddressLine2", (Option.map x.addressLine2 ~f:AddressLine.to_value));
        ("AddressLine3", (Option.map x.addressLine3 ~f:AddressLine.to_value));
        ("City", (Some (City.to_value x.city)));
        ("StateOrRegion",
          (Option.map x.stateOrRegion ~f:StateOrRegion.to_value));
        ("DistrictOrCounty",
          (Option.map x.districtOrCounty ~f:DistrictOrCounty.to_value));
        ("PostalCode", (Some (PostalCode.to_value x.postalCode)));
        ("CountryCode", (Some (CountryCode.to_value x.countryCode)));
        ("PhoneNumber",
          (Some (ContactInformationPhoneNumber.to_value x.phoneNumber)));
        ("CompanyName", (Option.map x.companyName ~f:CompanyName.to_value));
        ("WebsiteUrl", (Option.map x.websiteUrl ~f:WebsiteUrl.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let websiteUrl =
        (Option.map ~f:WebsiteUrl.of_xml) (Xml.child xml_arg0 "WebsiteUrl") in
      let companyName =
        (Option.map ~f:CompanyName.of_xml) (Xml.child xml_arg0 "CompanyName") in
      let phoneNumber =
        ContactInformationPhoneNumber.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "PhoneNumber") in
      let countryCode =
        CountryCode.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "CountryCode") in
      let postalCode =
        PostalCode.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "PostalCode") in
      let districtOrCounty =
        (Option.map ~f:DistrictOrCounty.of_xml)
          (Xml.child xml_arg0 "DistrictOrCounty") in
      let stateOrRegion =
        (Option.map ~f:StateOrRegion.of_xml)
          (Xml.child xml_arg0 "StateOrRegion") in
      let city =
        City.of_xml (Xml.child_exn ~context:context_ xml_arg0 "City") in
      let addressLine3 =
        (Option.map ~f:AddressLine.of_xml)
          (Xml.child xml_arg0 "AddressLine3") in
      let addressLine2 =
        (Option.map ~f:AddressLine.of_xml)
          (Xml.child xml_arg0 "AddressLine2") in
      let addressLine1 =
        AddressLine.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AddressLine1") in
      let fullName =
        FullName.of_xml (Xml.child_exn ~context:context_ xml_arg0 "FullName") in
      make ?websiteUrl ?companyName ~phoneNumber ~countryCode ~postalCode
        ?districtOrCounty ?stateOrRegion ~city ?addressLine3 ?addressLine2
        ~addressLine1 ~fullName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let websiteUrl = field_map json__ "WebsiteUrl" WebsiteUrl.of_json in
      let companyName = field_map json__ "CompanyName" CompanyName.of_json in
      let phoneNumber =
        field_map_exn json__ "PhoneNumber"
          ContactInformationPhoneNumber.of_json in
      let countryCode =
        field_map_exn json__ "CountryCode" CountryCode.of_json in
      let postalCode = field_map_exn json__ "PostalCode" PostalCode.of_json in
      let districtOrCounty =
        field_map json__ "DistrictOrCounty" DistrictOrCounty.of_json in
      let stateOrRegion =
        field_map json__ "StateOrRegion" StateOrRegion.of_json in
      let city = field_map_exn json__ "City" City.of_json in
      let addressLine3 = field_map json__ "AddressLine3" AddressLine.of_json in
      let addressLine2 = field_map json__ "AddressLine2" AddressLine.of_json in
      let addressLine1 =
        field_map_exn json__ "AddressLine1" AddressLine.of_json in
      let fullName = field_map_exn json__ "FullName" FullName.of_json in
      make ?websiteUrl ?companyName ~phoneNumber ~countryCode ~postalCode
        ?districtOrCounty ?stateOrRegion ~city ?addressLine3 ?addressLine2
        ~addressLine1 ~fullName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains the details of the primary contact information associated with an Amazon Web Services account."]
module AccountName =
  struct
    type nonrec t = string
    let context_ = "AccountName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:50) >>=
                  (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:"AccountName" j
    let to_json = simple_to_json to_value
  end
module RegionOptList =
  struct
    type nonrec t = Region.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:Region.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:Region.of_xml)
    let of_json j =
      list_of_json ~kind:"RegionOptList" ~of_json:Region.of_json j
    let to_json v = composed_to_json to_value v
  end
module ListRegionsRequestMaxResultsInteger =
  struct
    type nonrec t = int
    let make i =
      let open Result in
        ok_or_failwith
          ((check_int_max i ~max:50) >>= (fun () -> check_int_min i ~min:1));
        i
    let of_string = Int.of_string
    let to_value x = `Integer x
    let to_query v = to_query to_value v
    let to_header x = Int.to_string x
    let of_xml xml_arg0 =
      Int.of_string
        (string_of_xml
           ~kind:"an integer for ListRegionsRequestMaxResultsInteger"
           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 ListRegionsRequestNextTokenString =
  struct
    type nonrec t = string
    let context_ = "ListRegionsRequestNextTokenString"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:1000) >>=
             (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:"ListRegionsRequestNextTokenString" j
    let to_json = simple_to_json to_value
  end
module RegionOptStatusList =
  struct
    type nonrec t = RegionOptStatus.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:RegionOptStatus.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:RegionOptStatus.of_xml)
    let of_json j =
      list_of_json ~kind:"RegionOptStatusList"
        ~of_json:RegionOptStatus.of_json j
    let to_json v = composed_to_json to_value v
  end
module AwsAccountState =
  struct
    type nonrec t =
      | PENDING_ACTIVATION 
      | ACTIVE 
      | SUSPENDED 
      | CLOSED 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | PENDING_ACTIVATION -> "PENDING_ACTIVATION"
      | ACTIVE -> "ACTIVE"
      | SUSPENDED -> "SUSPENDED"
      | CLOSED -> "CLOSED"
      | Non_static_id s -> s
    let of_string =
      function
      | "PENDING_ACTIVATION" -> PENDING_ACTIVATION
      | "ACTIVE" -> ACTIVE
      | "SUSPENDED" -> SUSPENDED
      | "CLOSED" -> CLOSED
      | 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 AwsAccountState" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"AwsAccountState" j)
    let to_json = simple_to_json to_value
  end
module ResourceUnavailableException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      errorType: String_.t option
        [@ocaml.doc
          "The value populated to the x-amzn-ErrorType response header by API Gateway."]}
    let make ?message = fun ?errorType -> fun () -> { message; errorType }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("x-amzn-ErrorType", (Option.map x.errorType ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let errorType =
        (Option.map ~f:String_.of_xml)
          (Xml.child xml_arg0 "x-amzn-ErrorType") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?errorType ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let errorType = field_map json__ "errorType" String_.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?errorType ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The operation failed because it specified a resource that is not currently available."]
module AlternateContact =
  struct
    type nonrec t =
      {
      name: Name.t option
        [@ocaml.doc "The name associated with this alternate contact."];
      title: Title.t option
        [@ocaml.doc "The title associated with this alternate contact."];
      emailAddress: EmailAddress.t option
        [@ocaml.doc
          "The email address associated with this alternate contact."];
      phoneNumber: PhoneNumber.t option
        [@ocaml.doc
          "The phone number associated with this alternate contact."];
      alternateContactType: AlternateContactType.t option
        [@ocaml.doc "The type of alternate contact."]}
    let make ?name =
      fun ?title ->
        fun ?emailAddress ->
          fun ?phoneNumber ->
            fun ?alternateContactType ->
              fun () ->
                {
                  name;
                  title;
                  emailAddress;
                  phoneNumber;
                  alternateContactType
                }
    let to_value x =
      structure_to_value
        [("Name", (Option.map x.name ~f:Name.to_value));
        ("Title", (Option.map x.title ~f:Title.to_value));
        ("EmailAddress",
          (Option.map x.emailAddress ~f:EmailAddress.to_value));
        ("PhoneNumber", (Option.map x.phoneNumber ~f:PhoneNumber.to_value));
        ("AlternateContactType",
          (Option.map x.alternateContactType ~f:AlternateContactType.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let alternateContactType =
        (Option.map ~f:AlternateContactType.of_xml)
          (Xml.child xml_arg0 "AlternateContactType") in
      let phoneNumber =
        (Option.map ~f:PhoneNumber.of_xml) (Xml.child xml_arg0 "PhoneNumber") in
      let emailAddress =
        (Option.map ~f:EmailAddress.of_xml)
          (Xml.child xml_arg0 "EmailAddress") in
      let title = (Option.map ~f:Title.of_xml) (Xml.child xml_arg0 "Title") in
      let name = (Option.map ~f:Name.of_xml) (Xml.child xml_arg0 "Name") in
      make ?alternateContactType ?phoneNumber ?emailAddress ?title ?name ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let alternateContactType =
        field_map json__ "AlternateContactType" AlternateContactType.of_json in
      let phoneNumber = field_map json__ "PhoneNumber" PhoneNumber.of_json in
      let emailAddress = field_map json__ "EmailAddress" EmailAddress.of_json in
      let title = field_map json__ "Title" Title.of_json in
      let name = field_map json__ "Name" Name.of_json in
      make ?alternateContactType ?phoneNumber ?emailAddress ?title ?name ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "A structure that contains the details of an alternate contact associated with an Amazon Web Services account"]
module AccountCreatedDate =
  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 AccountState =
  struct
    type nonrec t =
      | PENDING_ACTIVATION 
      | ACTIVE 
      | SUSPENDED 
      | CLOSED 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | PENDING_ACTIVATION -> "PENDING_ACTIVATION"
      | ACTIVE -> "ACTIVE"
      | SUSPENDED -> "SUSPENDED"
      | CLOSED -> "CLOSED"
      | Non_static_id s -> s
    let of_string =
      function
      | "PENDING_ACTIVATION" -> PENDING_ACTIVATION
      | "ACTIVE" -> ACTIVE
      | "SUSPENDED" -> SUSPENDED
      | "CLOSED" -> CLOSED
      | 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 AccountState" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"AccountState" j)
    let to_json = simple_to_json to_value
  end
module Otp =
  struct
    type nonrec t = string
    let context_ = "Otp"
    let make i =
      let open Result in
        ok_or_failwith (check_pattern i ~pattern:"[a-zA-Z0-9]{6}"); 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:"Otp" j
    let to_json = simple_to_json to_value
  end
module StartPrimaryEmailUpdateResponse =
  struct
    type nonrec t =
      {
      status: PrimaryEmailUpdateStatus.t option
        [@ocaml.doc "The status of the primary email update request."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?status = fun () -> { status }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("Status",
           (Option.map x.status ~f:PrimaryEmailUpdateStatus.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let status =
        (Option.map ~f:PrimaryEmailUpdateStatus.of_xml)
          (Xml.child xml_arg0 "Status") in
      make ?status ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let status = field_map json__ "Status" PrimaryEmailUpdateStatus.of_json in
      make ?status ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Starts the process to update the primary email address for the specified account."]
module StartPrimaryEmailUpdateRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. This operation can only be called from the management account or the delegated administrator account of an organization for a member account. The management account can't specify its own AccountId."];
      primaryEmail: PrimaryEmailAddress.t
        [@ocaml.doc
          "The new primary email address (also known as the root user email address) to use in the specified account."]}
    let context_ = "StartPrimaryEmailUpdateRequest"
    let make ~accountId =
      fun ~primaryEmail -> fun () -> { accountId; primaryEmail }
    let to_value x =
      structure_to_value
        [("AccountId", (Some (AccountId.to_value x.accountId)));
        ("PrimaryEmail",
          (Some (PrimaryEmailAddress.to_value x.primaryEmail)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let primaryEmail =
        PrimaryEmailAddress.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "PrimaryEmail") in
      let accountId =
        AccountId.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AccountId") in
      make ~primaryEmail ~accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let primaryEmail =
        field_map_exn json__ "PrimaryEmail" PrimaryEmailAddress.of_json in
      let accountId = field_map_exn json__ "AccountId" AccountId.of_json in
      make ~primaryEmail ~accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Starts the process to update the primary email address for the specified account."]
module PutContactInformationRequest =
  struct
    type nonrec t =
      {
      contactInformation: ContactInformation.t
        [@ocaml.doc
          "Contains the details of the primary contact information associated with an Amazon Web Services account."];
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don't specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated administrator account assigned. The management account can't specify its own AccountId. It must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, don't specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."]}
    let context_ = "PutContactInformationRequest"
    let make ?accountId =
      fun ~contactInformation -> fun () -> { accountId; contactInformation }
    let to_value x =
      structure_to_value
        [("ContactInformation",
           (Some (ContactInformation.to_value x.contactInformation)));
        ("AccountId", (Option.map x.accountId ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      let contactInformation =
        ContactInformation.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "ContactInformation") in
      make ?accountId ~contactInformation ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      let contactInformation =
        field_map_exn json__ "ContactInformation" ContactInformation.of_json in
      make ?accountId ~contactInformation ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Updates the primary contact information of an Amazon Web Services account. For complete details about how to use the primary contact operations, see Update the primary contact for your Amazon Web Services account."]
module PutAlternateContactRequest =
  struct
    type nonrec t =
      {
      name: Name.t [@ocaml.doc "Specifies a name for the alternate contact."];
      title: Title.t
        [@ocaml.doc "Specifies a title for the alternate contact."];
      emailAddress: EmailAddress.t
        [@ocaml.doc "Specifies an email address for the alternate contact."];
      phoneNumber: PhoneNumber.t
        [@ocaml.doc "Specifies a phone number for the alternate contact."];
      alternateContactType: AlternateContactType.t
        [@ocaml.doc
          "Specifies which alternate contact you want to create or update."];
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated administrator account assigned. The management account can't specify its own AccountId; it must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, then don't specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."]}
    let context_ = "PutAlternateContactRequest"
    let make ?accountId =
      fun ~name ->
        fun ~title ->
          fun ~emailAddress ->
            fun ~phoneNumber ->
              fun ~alternateContactType ->
                fun () ->
                  {
                    accountId;
                    name;
                    title;
                    emailAddress;
                    phoneNumber;
                    alternateContactType
                  }
    let to_value x =
      structure_to_value
        [("Name", (Some (Name.to_value x.name)));
        ("Title", (Some (Title.to_value x.title)));
        ("EmailAddress", (Some (EmailAddress.to_value x.emailAddress)));
        ("PhoneNumber", (Some (PhoneNumber.to_value x.phoneNumber)));
        ("AlternateContactType",
          (Some (AlternateContactType.to_value x.alternateContactType)));
        ("AccountId", (Option.map x.accountId ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      let alternateContactType =
        AlternateContactType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AlternateContactType") in
      let phoneNumber =
        PhoneNumber.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "PhoneNumber") in
      let emailAddress =
        EmailAddress.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "EmailAddress") in
      let title =
        Title.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Title") in
      let name =
        Name.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Name") in
      make ?accountId ~alternateContactType ~phoneNumber ~emailAddress ~title
        ~name ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      let alternateContactType =
        field_map_exn json__ "AlternateContactType"
          AlternateContactType.of_json in
      let phoneNumber =
        field_map_exn json__ "PhoneNumber" PhoneNumber.of_json in
      let emailAddress =
        field_map_exn json__ "EmailAddress" EmailAddress.of_json in
      let title = field_map_exn json__ "Title" Title.of_json in
      let name = field_map_exn json__ "Name" Name.of_json in
      make ?accountId ~alternateContactType ~phoneNumber ~emailAddress ~title
        ~name ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Modifies the specified alternate contact attached to an Amazon Web Services account. For complete details about how to use the alternate contact operations, see Update the alternate contacts for your Amazon Web Services account. Before you can update the alternate contact information for an Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management and Organizations. For more information, see Enable trusted access for Amazon Web Services Account Management."]
module PutAccountNameRequest =
  struct
    type nonrec t =
      {
      accountName: AccountName.t [@ocaml.doc "The name of the account."];
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated administrator account assigned. The management account can't specify its own AccountId; it must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, then don't specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."]}
    let context_ = "PutAccountNameRequest"
    let make ?accountId =
      fun ~accountName -> fun () -> { accountId; accountName }
    let to_value x =
      structure_to_value
        [("AccountName", (Some (AccountName.to_value x.accountName)));
        ("AccountId", (Option.map x.accountId ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      let accountName =
        AccountName.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AccountName") in
      make ?accountId ~accountName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      let accountName =
        field_map_exn json__ "AccountName" AccountName.of_json in
      make ?accountId ~accountName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Updates the account name of the specified account. To use this API, IAM principals must have the account:PutAccountName IAM permission."]
module ListRegionsResponse =
  struct
    type nonrec t =
      {
      nextToken: String_.t option
        [@ocaml.doc
          "If there is more data to be returned, this will be populated. It should be passed into the next-token request parameter of list-regions."];
      regions: RegionOptList.t option
        [@ocaml.doc
          "This is a list of Regions for a given account, or if the filtered parameter was used, a list of Regions that match the filter criteria set in the filter parameter."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?nextToken = fun ?regions -> fun () -> { nextToken; regions }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("NextToken", (Option.map x.nextToken ~f:String_.to_value));
        ("Regions", (Option.map x.regions ~f:RegionOptList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let regions =
        (Option.map ~f:RegionOptList.of_xml) (Xml.child xml_arg0 "Regions") in
      let nextToken =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "NextToken") in
      make ?regions ?nextToken ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let regions = field_map json__ "Regions" RegionOptList.of_json in
      let nextToken = field_map json__ "NextToken" String_.of_json in
      make ?regions ?nextToken ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists all the Regions for a given account and their respective opt-in statuses. Optionally, this list can be filtered by the region-opt-status-contains parameter."]
module ListRegionsRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don't specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. The management account can't specify its own AccountId. It must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, don't specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."];
      maxResults: ListRegionsRequestMaxResultsInteger.t option
        [@ocaml.doc
          "The total number of items to return in the command\226\128\153s output. If the total number of items available is more than the value specified, a NextToken is provided in the command\226\128\153s output. To resume pagination, provide the NextToken value in the starting-token argument of a subsequent command. Do not use the NextToken response element directly outside of the Amazon Web Services CLI. For usage examples, see Pagination in the Amazon Web Services Command Line Interface User Guide."];
      nextToken: ListRegionsRequestNextTokenString.t option
        [@ocaml.doc
          "A token used to specify where to start paginating. This is the NextToken from a previously truncated response. For usage examples, see Pagination in the Amazon Web Services Command Line Interface User Guide."];
      regionOptStatusContains: RegionOptStatusList.t option
        [@ocaml.doc
          "A list of Region statuses (Enabling, Enabled, Disabling, Disabled, Enabled_by_default) to use to filter the list of Regions for a given account. For example, passing in a value of ENABLING will only return a list of Regions with a Region status of ENABLING."]}
    let make ?accountId =
      fun ?maxResults ->
        fun ?nextToken ->
          fun ?regionOptStatusContains ->
            fun () ->
              { accountId; maxResults; nextToken; regionOptStatusContains }
    let to_value x =
      structure_to_value
        [("AccountId", (Option.map x.accountId ~f:AccountId.to_value));
        ("MaxResults",
          (Option.map x.maxResults
             ~f:ListRegionsRequestMaxResultsInteger.to_value));
        ("NextToken",
          (Option.map x.nextToken
             ~f:ListRegionsRequestNextTokenString.to_value));
        ("RegionOptStatusContains",
          (Option.map x.regionOptStatusContains
             ~f:RegionOptStatusList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let regionOptStatusContains =
        (Option.map ~f:RegionOptStatusList.of_xml)
          (Xml.child xml_arg0 "RegionOptStatusContains") in
      let nextToken =
        (Option.map ~f:ListRegionsRequestNextTokenString.of_xml)
          (Xml.child xml_arg0 "NextToken") in
      let maxResults =
        (Option.map ~f:ListRegionsRequestMaxResultsInteger.of_xml)
          (Xml.child xml_arg0 "MaxResults") in
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      make ?regionOptStatusContains ?nextToken ?maxResults ?accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let regionOptStatusContains =
        field_map json__ "RegionOptStatusContains"
          RegionOptStatusList.of_json in
      let nextToken =
        field_map json__ "NextToken"
          ListRegionsRequestNextTokenString.of_json in
      let maxResults =
        field_map json__ "MaxResults"
          ListRegionsRequestMaxResultsInteger.of_json in
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      make ?regionOptStatusContains ?nextToken ?maxResults ?accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists all the Regions for a given account and their respective opt-in statuses. Optionally, this list can be filtered by the region-opt-status-contains parameter."]
module GetRegionOptStatusResponse =
  struct
    type nonrec t =
      {
      regionName: RegionName.t option
        [@ocaml.doc "The Region code that was passed in."];
      regionOptStatus: RegionOptStatus.t option
        [@ocaml.doc
          "One of the potential statuses a Region can undergo (Enabled, Enabling, Disabled, Disabling, Enabled_By_Default)."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?regionName =
      fun ?regionOptStatus -> fun () -> { regionName; regionOptStatus }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("RegionName", (Option.map x.regionName ~f:RegionName.to_value));
        ("RegionOptStatus",
          (Option.map x.regionOptStatus ~f:RegionOptStatus.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let regionOptStatus =
        (Option.map ~f:RegionOptStatus.of_xml)
          (Xml.child xml_arg0 "RegionOptStatus") in
      let regionName =
        (Option.map ~f:RegionName.of_xml) (Xml.child xml_arg0 "RegionName") in
      make ?regionOptStatus ?regionName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let regionOptStatus =
        field_map json__ "RegionOptStatus" RegionOptStatus.of_json in
      let regionName = field_map json__ "RegionName" RegionName.of_json in
      make ?regionOptStatus ?regionName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Retrieves the opt-in status of a particular Region."]
module GetRegionOptStatusRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don't specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. The management account can't specify its own AccountId. It must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, don't specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."];
      regionName: RegionName.t
        [@ocaml.doc
          "Specifies the Region-code for a given Region name (for example, af-south-1). This function will return the status of whatever Region you pass into this parameter."]}
    let context_ = "GetRegionOptStatusRequest"
    let make ?accountId =
      fun ~regionName -> fun () -> { accountId; regionName }
    let to_value x =
      structure_to_value
        [("AccountId", (Option.map x.accountId ~f:AccountId.to_value));
        ("RegionName", (Some (RegionName.to_value x.regionName)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let regionName =
        RegionName.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "RegionName") in
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      make ~regionName ?accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let regionName = field_map_exn json__ "RegionName" RegionName.of_json in
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      make ~regionName ?accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Retrieves the opt-in status of a particular Region."]
module GetPrimaryEmailResponse =
  struct
    type nonrec t =
      {
      primaryEmail: PrimaryEmailAddress.t option
        [@ocaml.doc
          "Retrieves the primary email address associated with the specified account."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?primaryEmail = fun () -> { primaryEmail }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("PrimaryEmail",
           (Option.map x.primaryEmail ~f:PrimaryEmailAddress.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let primaryEmail =
        (Option.map ~f:PrimaryEmailAddress.of_xml)
          (Xml.child xml_arg0 "PrimaryEmail") in
      make ?primaryEmail ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let primaryEmail =
        field_map json__ "PrimaryEmail" PrimaryEmailAddress.of_json in
      make ?primaryEmail ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the primary email address for the specified account."]
module GetPrimaryEmailRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. This operation can only be called from the management account or the delegated administrator account of an organization for a member account. The management account can't specify its own AccountId."]}
    let context_ = "GetPrimaryEmailRequest"
    let make ~accountId = fun () -> { accountId }
    let to_value x =
      structure_to_value
        [("AccountId", (Some (AccountId.to_value x.accountId)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountId =
        AccountId.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AccountId") in
      make ~accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountId = field_map_exn json__ "AccountId" AccountId.of_json in
      make ~accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the primary email address for the specified account."]
module GetGovCloudAccountInformationResponse =
  struct
    type nonrec t =
      {
      govCloudAccountId: AccountId.t option
        [@ocaml.doc
          "The 12-digit account ID number of the linked GovCloud account."];
      accountState: AwsAccountState.t option
        [@ocaml.doc "The account state of the linked GovCloud account."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ResourceUnavailableException of ResourceUnavailableException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?govCloudAccountId =
      fun ?accountState -> fun () -> { govCloudAccountId; accountState }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ResourceUnavailableException" ->
          `ResourceUnavailableException
            (ResourceUnavailableException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ResourceUnavailableException" ->
          `ResourceUnavailableException
            (ResourceUnavailableException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ResourceUnavailableException e ->
          `Assoc
            [("error", (`String "ResourceUnavailableException"));
            ("details", (ResourceUnavailableException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("GovCloudAccountId",
           (Option.map x.govCloudAccountId ~f:AccountId.to_value));
        ("AccountState",
          (Option.map x.accountState ~f:AwsAccountState.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountState =
        (Option.map ~f:AwsAccountState.of_xml)
          (Xml.child xml_arg0 "AccountState") in
      let govCloudAccountId =
        (Option.map ~f:AccountId.of_xml)
          (Xml.child xml_arg0 "GovCloudAccountId") in
      make ?accountState ?govCloudAccountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountState =
        field_map json__ "AccountState" AwsAccountState.of_json in
      let govCloudAccountId =
        field_map json__ "GovCloudAccountId" AccountId.of_json in
      make ?accountState ?govCloudAccountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves information about the GovCloud account linked to the specified standard account (if it exists) including the GovCloud account ID and state. To use this API, an IAM user or role must have the account:GetGovCloudAccountInformation IAM permission."]
module GetGovCloudAccountInformationRequest =
  struct
    type nonrec t =
      {
      standardAccountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated administrator account assigned. The management account can't specify its own AccountId; it must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, then don't specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."]}
    let make ?standardAccountId = fun () -> { standardAccountId }
    let to_value x =
      structure_to_value
        [("StandardAccountId",
           (Option.map x.standardAccountId ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let standardAccountId =
        (Option.map ~f:AccountId.of_xml)
          (Xml.child xml_arg0 "StandardAccountId") in
      make ?standardAccountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let standardAccountId =
        field_map json__ "StandardAccountId" AccountId.of_json in
      make ?standardAccountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves information about the GovCloud account linked to the specified standard account (if it exists) including the GovCloud account ID and state. To use this API, an IAM user or role must have the account:GetGovCloudAccountInformation IAM permission."]
module GetContactInformationResponse =
  struct
    type nonrec t =
      {
      contactInformation: ContactInformation.t option
        [@ocaml.doc
          "Contains the details of the primary contact information associated with an Amazon Web Services account."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?contactInformation = fun () -> { contactInformation }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("ContactInformation",
           (Option.map x.contactInformation ~f:ContactInformation.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let contactInformation =
        (Option.map ~f:ContactInformation.of_xml)
          (Xml.child xml_arg0 "ContactInformation") in
      make ?contactInformation ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let contactInformation =
        field_map json__ "ContactInformation" ContactInformation.of_json in
      make ?contactInformation ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the primary contact information of an Amazon Web Services account. For complete details about how to use the primary contact operations, see Update the primary contact for your Amazon Web Services account."]
module GetContactInformationRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don't specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. The management account can't specify its own AccountId. It must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, don't specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."]}
    let make ?accountId = fun () -> { accountId }
    let to_value x =
      structure_to_value
        [("AccountId", (Option.map x.accountId ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      make ?accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      make ?accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the primary contact information of an Amazon Web Services account. For complete details about how to use the primary contact operations, see Update the primary contact for your Amazon Web Services account."]
module GetAlternateContactResponse =
  struct
    type nonrec t =
      {
      alternateContact: AlternateContact.t option
        [@ocaml.doc
          "A structure that contains the details for the specified alternate contact."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?alternateContact = fun () -> { alternateContact }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("AlternateContact",
           (Option.map x.alternateContact ~f:AlternateContact.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let alternateContact =
        (Option.map ~f:AlternateContact.of_xml)
          (Xml.child xml_arg0 "AlternateContact") in
      make ?alternateContact ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let alternateContact =
        field_map json__ "AlternateContact" AlternateContact.of_json in
      make ?alternateContact ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the specified alternate contact attached to an Amazon Web Services account. For complete details about how to use the alternate contact operations, see Update the alternate contacts for your Amazon Web Services account. Before you can update the alternate contact information for an Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management and Organizations. For more information, see Enable trusted access for Amazon Web Services Account Management."]
module GetAlternateContactRequest =
  struct
    type nonrec t =
      {
      alternateContactType: AlternateContactType.t
        [@ocaml.doc
          "Specifies which alternate contact you want to retrieve."];
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated administrator account assigned. The management account can't specify its own AccountId; it must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, then don't specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."]}
    let context_ = "GetAlternateContactRequest"
    let make ?accountId =
      fun ~alternateContactType ->
        fun () -> { accountId; alternateContactType }
    let to_value x =
      structure_to_value
        [("AlternateContactType",
           (Some (AlternateContactType.to_value x.alternateContactType)));
        ("AccountId", (Option.map x.accountId ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      let alternateContactType =
        AlternateContactType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AlternateContactType") in
      make ?accountId ~alternateContactType ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      let alternateContactType =
        field_map_exn json__ "AlternateContactType"
          AlternateContactType.of_json in
      make ?accountId ~alternateContactType ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves the specified alternate contact attached to an Amazon Web Services account. For complete details about how to use the alternate contact operations, see Update the alternate contacts for your Amazon Web Services account. Before you can update the alternate contact information for an Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management and Organizations. For more information, see Enable trusted access for Amazon Web Services Account Management."]
module GetAccountInformationResponse =
  struct
    type nonrec t =
      {
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. This operation can only be called from the management account or the delegated administrator account of an organization for a member account. The management account can't specify its own AccountId."];
      accountName: AccountName.t option
        [@ocaml.doc "The name of the account."];
      accountCreatedDate: AccountCreatedDate.t option
        [@ocaml.doc "The date and time the account was created."];
      accountState: AccountState.t option
        [@ocaml.doc
          "The state of the account. Each account state represents a specific phase in the account lifecycle. Use this information to manage account access, automate workflows, or trigger actions based on account state changes. Valid values: PENDING_ACTIVATION | ACTIVE | SUSPENDED | CLOSED"]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?accountId =
      fun ?accountName ->
        fun ?accountCreatedDate ->
          fun ?accountState ->
            fun () ->
              { accountId; accountName; accountCreatedDate; accountState }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("AccountId", (Option.map x.accountId ~f:AccountId.to_value));
        ("AccountName", (Option.map x.accountName ~f:AccountName.to_value));
        ("AccountCreatedDate",
          (Option.map x.accountCreatedDate ~f:AccountCreatedDate.to_value));
        ("AccountState",
          (Option.map x.accountState ~f:AccountState.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountState =
        (Option.map ~f:AccountState.of_xml)
          (Xml.child xml_arg0 "AccountState") in
      let accountCreatedDate =
        (Option.map ~f:AccountCreatedDate.of_xml)
          (Xml.child xml_arg0 "AccountCreatedDate") in
      let accountName =
        (Option.map ~f:AccountName.of_xml) (Xml.child xml_arg0 "AccountName") in
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      make ?accountState ?accountCreatedDate ?accountName ?accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountState = field_map json__ "AccountState" AccountState.of_json in
      let accountCreatedDate =
        field_map json__ "AccountCreatedDate" AccountCreatedDate.of_json in
      let accountName = field_map json__ "AccountName" AccountName.of_json in
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      make ?accountState ?accountCreatedDate ?accountName ?accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves information about the specified account including its account name, account ID, account creation date and time, and account state. To use this API, an IAM user or role must have the account:GetAccountInformation IAM permission."]
module GetAccountInformationRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated administrator account assigned. The management account can't specify its own AccountId; it must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, then don't specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."]}
    let make ?accountId = fun () -> { accountId }
    let to_value x =
      structure_to_value
        [("AccountId", (Option.map x.accountId ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      make ?accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      make ?accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Retrieves information about the specified account including its account name, account ID, account creation date and time, and account state. To use this API, an IAM user or role must have the account:GetAccountInformation IAM permission."]
module EnableRegionRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don't specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. The management account can't specify its own AccountId. It must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, don't specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."];
      regionName: RegionName.t
        [@ocaml.doc
          "Specifies the Region-code for a given Region name (for example, af-south-1). When you enable a Region, Amazon Web Services performs actions to prepare your account in that Region, such as distributing your IAM resources to the Region. This process takes a few minutes for most accounts, but it can take several hours. You cannot use the Region until this process is complete. Furthermore, you cannot disable the Region until the enabling process is fully completed."]}
    let context_ = "EnableRegionRequest"
    let make ?accountId =
      fun ~regionName -> fun () -> { accountId; regionName }
    let to_value x =
      structure_to_value
        [("AccountId", (Option.map x.accountId ~f:AccountId.to_value));
        ("RegionName", (Some (RegionName.to_value x.regionName)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let regionName =
        RegionName.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "RegionName") in
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      make ~regionName ?accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let regionName = field_map_exn json__ "RegionName" RegionName.of_json in
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      make ~regionName ?accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Enables (opts-in) a particular Region for an account."]
module DisableRegionRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you don't specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. The management account can't specify its own AccountId. It must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, don't specify this parameter. Instead, call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."];
      regionName: RegionName.t
        [@ocaml.doc
          "Specifies the Region-code for a given Region name (for example, af-south-1). When you disable a Region, Amazon Web Services performs actions to deactivate that Region in your account, such as destroying IAM resources in the Region. This process takes a few minutes for most accounts, but this can take several hours. You cannot enable the Region until the disabling process is fully completed."]}
    let context_ = "DisableRegionRequest"
    let make ?accountId =
      fun ~regionName -> fun () -> { accountId; regionName }
    let to_value x =
      structure_to_value
        [("AccountId", (Option.map x.accountId ~f:AccountId.to_value));
        ("RegionName", (Some (RegionName.to_value x.regionName)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let regionName =
        RegionName.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "RegionName") in
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      make ~regionName ?accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let regionName = field_map_exn json__ "RegionName" RegionName.of_json in
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      make ~regionName ?accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Disables (opts-out) a particular Region for an account. The act of disabling a Region will remove all IAM access to any resources that reside in that Region."]
module DeleteAlternateContactRequest =
  struct
    type nonrec t =
      {
      alternateContactType: AlternateContactType.t
        [@ocaml.doc "Specifies which of the alternate contacts to delete."];
      accountId: AccountId.t option
        [@ocaml.doc
          "Specifies the 12 digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. If you do not specify this parameter, it defaults to the Amazon Web Services account of the identity used to call the operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and the specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated administrator account assigned. The management account can't specify its own AccountId; it must call the operation in standalone context by not including the AccountId parameter. To call this operation on an account that is not a member of an organization, then don't specify this parameter, and call the operation using an identity belonging to the account whose contacts you wish to retrieve or modify."]}
    let context_ = "DeleteAlternateContactRequest"
    let make ?accountId =
      fun ~alternateContactType ->
        fun () -> { accountId; alternateContactType }
    let to_value x =
      structure_to_value
        [("AlternateContactType",
           (Some (AlternateContactType.to_value x.alternateContactType)));
        ("AccountId", (Option.map x.accountId ~f:AccountId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "AccountId") in
      let alternateContactType =
        AlternateContactType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AlternateContactType") in
      make ?accountId ~alternateContactType ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let accountId = field_map json__ "AccountId" AccountId.of_json in
      let alternateContactType =
        field_map_exn json__ "AlternateContactType"
          AlternateContactType.of_json in
      make ?accountId ~alternateContactType ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Deletes the specified alternate contact from an Amazon Web Services account. For complete details about how to use the alternate contact operations, see Update the alternate contacts for your Amazon Web Services account. Before you can update the alternate contact information for an Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management and Organizations. For more information, see Enable trusted access for Amazon Web Services Account Management."]
module AcceptPrimaryEmailUpdateResponse =
  struct
    type nonrec t =
      {
      status: PrimaryEmailUpdateStatus.t option
        [@ocaml.doc
          "Retrieves the status of the accepted primary email update request."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `TooManyRequestsException of TooManyRequestsException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?status = fun () -> { status }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "TooManyRequestsException" ->
          `TooManyRequestsException (TooManyRequestsException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `TooManyRequestsException e ->
          `Assoc
            [("error", (`String "TooManyRequestsException"));
            ("details", (TooManyRequestsException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("Status",
           (Option.map x.status ~f:PrimaryEmailUpdateStatus.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let status =
        (Option.map ~f:PrimaryEmailUpdateStatus.of_xml)
          (Xml.child xml_arg0 "Status") in
      make ?status ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let status = field_map json__ "Status" PrimaryEmailUpdateStatus.of_json in
      make ?status ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Accepts the request that originated from StartPrimaryEmailUpdate to update the primary email address (also known as the root user email address) for the specified account."]
module AcceptPrimaryEmailUpdateRequest =
  struct
    type nonrec t =
      {
      accountId: AccountId.t
        [@ocaml.doc
          "Specifies the 12-digit account ID number of the Amazon Web Services account that you want to access or modify with this operation. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned. This operation can only be called from the management account or the delegated administrator account of an organization for a member account. The management account can't specify its own AccountId."];
      primaryEmail: PrimaryEmailAddress.t
        [@ocaml.doc
          "The new primary email address for use with the specified account. This must match the PrimaryEmail from the StartPrimaryEmailUpdate API call."];
      otp: Otp.t
        [@ocaml.doc
          "The OTP code sent to the PrimaryEmail specified on the StartPrimaryEmailUpdate API call."]}
    let context_ = "AcceptPrimaryEmailUpdateRequest"
    let make ~accountId =
      fun ~primaryEmail ->
        fun ~otp -> fun () -> { accountId; primaryEmail; otp }
    let to_value x =
      structure_to_value
        [("AccountId", (Some (AccountId.to_value x.accountId)));
        ("PrimaryEmail",
          (Some (PrimaryEmailAddress.to_value x.primaryEmail)));
        ("Otp", (Some (Otp.to_value x.otp)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let otp = Otp.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Otp") in
      let primaryEmail =
        PrimaryEmailAddress.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "PrimaryEmail") in
      let accountId =
        AccountId.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "AccountId") in
      make ~otp ~primaryEmail ~accountId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let otp = field_map_exn json__ "Otp" Otp.of_json in
      let primaryEmail =
        field_map_exn json__ "PrimaryEmail" PrimaryEmailAddress.of_json in
      let accountId = field_map_exn json__ "AccountId" AccountId.of_json in
      make ~otp ~primaryEmail ~accountId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Accepts the request that originated from StartPrimaryEmailUpdate to update the primary email address (also known as the root user email address) for the specified account."]