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
(* 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.dynamodbstreams
let apiVersion = "2012-08-10"
let endpointPrefix = "streams.dynamodb"
let serviceFullName = "Amazon DynamoDB Streams"
let signatureVersion = "v4"
let protocol = "json"
let globalEndpoint = endpointPrefix ^ ".amazonaws.com"
let targetPrefix = "DynamoDBStreams_20120810"
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 StringAttributeValue =
  struct
    type nonrec t = string
    let context_ = "StringAttributeValue"
    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:"StringAttributeValue" j
    let to_json = simple_to_json to_value
  end
module StringSetAttributeValue =
  struct
    type nonrec t = StringAttributeValue.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:StringAttributeValue.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:StringAttributeValue.of_xml)
    let of_json j =
      list_of_json ~kind:"StringSetAttributeValue"
        ~of_json:StringAttributeValue.of_json j
    let to_json v = composed_to_json to_value v
  end
module NumberAttributeValue =
  struct
    type nonrec t = string
    let context_ = "NumberAttributeValue"
    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:"NumberAttributeValue" j
    let to_json = simple_to_json to_value
  end
module NumberSetAttributeValue =
  struct
    type nonrec t = NumberAttributeValue.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:NumberAttributeValue.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:NumberAttributeValue.of_xml)
    let of_json j =
      list_of_json ~kind:"NumberSetAttributeValue"
        ~of_json:NumberAttributeValue.of_json j
    let to_json v = composed_to_json to_value v
  end
module NullAttributeValue =
  struct
    type nonrec t = bool
    let make i = i
    let of_string = Bool.of_string
    let to_value x = `Boolean x
    let to_query v = to_query to_value v
    let to_header x = Bool.to_string x
    let of_xml xml_arg0 =
      Bool.of_string (string_of_xml ~kind:"a boolean" xml_arg0)
    let of_json = bool_of_json
    let to_json = simple_to_json to_value
  end
module AttributeName =
  struct
    type nonrec t = string
    let context_ = "AttributeName"
    let make i =
      let open Result in ok_or_failwith (check_string_max i ~max:65535); 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:"AttributeName" j
    let to_json = simple_to_json to_value
  end
module BooleanAttributeValue =
  struct
    type nonrec t = bool
    let make i = i
    let of_string = Bool.of_string
    let to_value x = `Boolean x
    let to_query v = to_query to_value v
    let to_header x = Bool.to_string x
    let of_xml xml_arg0 =
      Bool.of_string (string_of_xml ~kind:"a boolean" xml_arg0)
    let of_json = bool_of_json
    let to_json = simple_to_json to_value
  end
module BinaryAttributeValue =
  struct
    type nonrec t = string
    let make i = i
    let of_string x = x
    let to_value x = `Blob x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml xml_arg0 = string_of_xml ~kind:"a blob" xml_arg0
    let of_json j = string_of_json ~kind:"a blob" j
    let to_json = simple_to_json to_value
  end
module BinarySetAttributeValue =
  struct
    type nonrec t = BinaryAttributeValue.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:BinaryAttributeValue.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:BinaryAttributeValue.of_xml)
    let of_json j =
      list_of_json ~kind:"BinarySetAttributeValue"
        ~of_json:BinaryAttributeValue.of_json j
    let to_json v = composed_to_json to_value v
  end
module rec
  AttributeValue:sig
                   type nonrec t =
                     {
                     s: StringAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type String. For example: \"S\": \"Hello\""];
                     n: NumberAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type Number. For example: \"N\": \"123.45\" Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations."];
                     b: BinaryAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type Binary. For example: \"B\": \"dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk\""];
                     sS: StringSetAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type String Set. For example: \"SS\": \\[\"Giraffe\", \"Hippo\" ,\"Zebra\"\\]"];
                     nS: NumberSetAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type Number Set. For example: \"NS\": \\[\"42.2\", \"-19\", \"7.5\", \"3.14\"\\] Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations."];
                     bS: BinarySetAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type Binary Set. For example: \"BS\": \\[\"U3Vubnk=\", \"UmFpbnk=\", \"U25vd3k=\"\\]"];
                     m: MapAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type Map. For example: \"M\": \\{\"Name\": \\{\"S\": \"Joe\"\\}, \"Age\": \\{\"N\": \"35\"\\}\\}"];
                     l: ListAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type List. For example: \"L\": \\[ \\{\"S\": \"Cookies\"\\} , \\{\"S\": \"Coffee\"\\}, \\{\"N\": \"3.14159\"\\}\\]"];
                     nULL: NullAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type Null. For example: \"NULL\": true"];
                     bOOL: BooleanAttributeValue.t option
                       [@ocaml.doc
                         "An attribute of type Boolean. For example: \"BOOL\": true"]}
                   val make :
                     ?s:StringAttributeValue.t ->
                       ?n:NumberAttributeValue.t ->
                         ?b:BinaryAttributeValue.t ->
                           ?sS:StringSetAttributeValue.t ->
                             ?nS:NumberSetAttributeValue.t ->
                               ?bS:BinarySetAttributeValue.t ->
                                 ?m:MapAttributeValue.t ->
                                   ?l:ListAttributeValue.t ->
                                     ?nULL:NullAttributeValue.t ->
                                       ?bOOL:BooleanAttributeValue.t ->
                                         unit -> t
                   val to_value : t -> Botodata.value
                   val to_query : t -> Client.Query.t
                   val of_xml : Xml.t -> t
                   val of_json : Yojson.Safe.t -> t
                   val to_json : t -> Yojson.Safe.t
                 end =
  struct
    type nonrec t =
      {
      s: StringAttributeValue.t option
        [@ocaml.doc
          "An attribute of type String. For example: \"S\": \"Hello\""];
      n: NumberAttributeValue.t option
        [@ocaml.doc
          "An attribute of type Number. For example: \"N\": \"123.45\" Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations."];
      b: BinaryAttributeValue.t option
        [@ocaml.doc
          "An attribute of type Binary. For example: \"B\": \"dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk\""];
      sS: StringSetAttributeValue.t option
        [@ocaml.doc
          "An attribute of type String Set. For example: \"SS\": \\[\"Giraffe\", \"Hippo\" ,\"Zebra\"\\]"];
      nS: NumberSetAttributeValue.t option
        [@ocaml.doc
          "An attribute of type Number Set. For example: \"NS\": \\[\"42.2\", \"-19\", \"7.5\", \"3.14\"\\] Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations."];
      bS: BinarySetAttributeValue.t option
        [@ocaml.doc
          "An attribute of type Binary Set. For example: \"BS\": \\[\"U3Vubnk=\", \"UmFpbnk=\", \"U25vd3k=\"\\]"];
      m: MapAttributeValue.t option
        [@ocaml.doc
          "An attribute of type Map. For example: \"M\": \\{\"Name\": \\{\"S\": \"Joe\"\\}, \"Age\": \\{\"N\": \"35\"\\}\\}"];
      l: ListAttributeValue.t option
        [@ocaml.doc
          "An attribute of type List. For example: \"L\": \\[ \\{\"S\": \"Cookies\"\\} , \\{\"S\": \"Coffee\"\\}, \\{\"N\": \"3.14159\"\\}\\]"];
      nULL: NullAttributeValue.t option
        [@ocaml.doc "An attribute of type Null. For example: \"NULL\": true"];
      bOOL: BooleanAttributeValue.t option
        [@ocaml.doc
          "An attribute of type Boolean. For example: \"BOOL\": true"]}
    let make ?s =
      fun ?n ->
        fun ?b ->
          fun ?sS ->
            fun ?nS ->
              fun ?bS ->
                fun ?m ->
                  fun ?l ->
                    fun ?nULL ->
                      fun ?bOOL ->
                        fun () -> { s; n; b; sS; nS; bS; m; l; nULL; bOOL }
    let to_value x =
      structure_to_value
        [("S", (Option.map x.s ~f:StringAttributeValue.to_value));
        ("N", (Option.map x.n ~f:NumberAttributeValue.to_value));
        ("B", (Option.map x.b ~f:BinaryAttributeValue.to_value));
        ("SS", (Option.map x.sS ~f:StringSetAttributeValue.to_value));
        ("NS", (Option.map x.nS ~f:NumberSetAttributeValue.to_value));
        ("BS", (Option.map x.bS ~f:BinarySetAttributeValue.to_value));
        ("M", (Option.map x.m ~f:MapAttributeValue.to_value));
        ("L", (Option.map x.l ~f:ListAttributeValue.to_value));
        ("NULL", (Option.map x.nULL ~f:NullAttributeValue.to_value));
        ("BOOL", (Option.map x.bOOL ~f:BooleanAttributeValue.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let bOOL =
        (Option.map ~f:BooleanAttributeValue.of_xml)
          (Xml.child xml_arg0 "BOOL") in
      let nULL =
        (Option.map ~f:NullAttributeValue.of_xml) (Xml.child xml_arg0 "NULL") in
      let l =
        (Option.map ~f:ListAttributeValue.of_xml) (Xml.child xml_arg0 "L") in
      let m =
        (Option.map ~f:MapAttributeValue.of_xml) (Xml.child xml_arg0 "M") in
      let bS =
        (Option.map ~f:BinarySetAttributeValue.of_xml)
          (Xml.child xml_arg0 "BS") in
      let nS =
        (Option.map ~f:NumberSetAttributeValue.of_xml)
          (Xml.child xml_arg0 "NS") in
      let sS =
        (Option.map ~f:StringSetAttributeValue.of_xml)
          (Xml.child xml_arg0 "SS") in
      let b =
        (Option.map ~f:BinaryAttributeValue.of_xml) (Xml.child xml_arg0 "B") in
      let n =
        (Option.map ~f:NumberAttributeValue.of_xml) (Xml.child xml_arg0 "N") in
      let s =
        (Option.map ~f:StringAttributeValue.of_xml) (Xml.child xml_arg0 "S") in
      make ?bOOL ?nULL ?l ?m ?bS ?nS ?sS ?b ?n ?s ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let bOOL = field_map json__ "BOOL" BooleanAttributeValue.of_json in
      let nULL = field_map json__ "NULL" NullAttributeValue.of_json in
      let l = field_map json__ "L" ListAttributeValue.of_json in
      let m = field_map json__ "M" MapAttributeValue.of_json in
      let bS = field_map json__ "BS" BinarySetAttributeValue.of_json in
      let nS = field_map json__ "NS" NumberSetAttributeValue.of_json in
      let sS = field_map json__ "SS" StringSetAttributeValue.of_json in
      let b = field_map json__ "B" BinaryAttributeValue.of_json in
      let n = field_map json__ "N" NumberAttributeValue.of_json in
      let s = field_map json__ "S" StringAttributeValue.of_json in
      make ?bOOL ?nULL ?l ?m ?bS ?nS ?sS ?b ?n ?s ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents the data for an attribute. Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself. For more information, see Data Types in the Amazon DynamoDB Developer Guide."]
 and
  ListAttributeValue:sig
                       type nonrec t = AttributeValue.t list
                       val make : AttributeValue.t list -> t
                       val to_value : t -> Botodata.value
                       val to_query : t -> Client.Query.t
                       val of_xml : Xml.t -> AttributeValue.t list
                       val of_json : Yojson.Safe.t -> t
                       val to_json : t -> Yojson.Safe.t
                       val to_header : t -> string
                     end =
  struct
    type nonrec t = AttributeValue.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:AttributeValue.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:AttributeValue.of_xml)
    let of_json j =
      list_of_json ~kind:"ListAttributeValue" ~of_json:AttributeValue.of_json
        j
    let to_json v = composed_to_json to_value v
  end and
       MapAttributeValue:sig
                           type nonrec t =
                             (AttributeName.t * AttributeValue.t) list
                           val make :
                             (AttributeName.t * AttributeValue.t) list -> t
                           val to_value : t -> Botodata.value
                           val to_query : t -> Client.Query.t
                           val of_xml : Xml.t -> t
                           val of_json : Yojson.Safe.t -> t
                           val to_json : t -> Yojson.Safe.t
                           val of_header :
                             (string, string) List.Assoc.t ->
                               (AttributeName.t, AttributeValue.t)
                                 List.Assoc.t
                           val to_header : t -> string
                         end =
       struct
         type nonrec t = (AttributeName.t * AttributeValue.t) list
         let make i = i
         let of_header xs =
           make
             (List.filter_map xs
                ~f:(fun (k, v) ->
                      (Base.String.chop_prefix k ~prefix:"x-amz-meta-") |>
                        (Option.map
                           ~f:(fun chopped ->
                                 let (_ : string) = v in
                                 let (_ : string) = chopped in
                                 failwith
                                   "no of_header for complex types AttributeName AttributeValue"))))
         let to_value xs =
           (xs |>
              (List.map
                 ~f:(fun (x, y) ->
                       (AttributeName.to_value x) |>
                         (fun x ->
                            (AttributeValue.to_value y) |> (fun y -> (x, y))))))
             |> (fun x -> `Map x)
         let to_query v = to_query to_value v
         let to_header _ =
           failwithf "to_header is not implemented for Map_shape objects" ()
         let of_xml _ =
           failwith
             "of_xml_converter_of_shape: Map_shape case not implemented"
         let of_json j =
           object_of_json ~key_of_string:AttributeName.of_string
             ~of_json:AttributeValue.of_json j
         let to_json v = composed_to_json to_value v
       end
module AttributeMap =
  struct
    type nonrec t = (AttributeName.t * AttributeValue.t) list
    let make i = i
    let of_header xs =
      make
        (List.filter_map xs
           ~f:(fun (k, v) ->
                 (Base.String.chop_prefix k ~prefix:"x-amz-meta-") |>
                   (Option.map
                      ~f:(fun chopped ->
                            let (_ : string) = v in
                            let (_ : string) = chopped in
                            failwith
                              "no of_header for complex types AttributeName AttributeValue"))))
    let to_value xs =
      (xs |>
         (List.map
            ~f:(fun (x, y) ->
                  (AttributeName.to_value x) |>
                    (fun x ->
                       (AttributeValue.to_value y) |> (fun y -> (x, y))))))
        |> (fun x -> `Map x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for Map_shape objects" ()
    let of_xml _ =
      failwith "of_xml_converter_of_shape: Map_shape case not implemented"
    let of_json j =
      object_of_json ~key_of_string:AttributeName.of_string
        ~of_json:AttributeValue.of_json j
    let to_json v = composed_to_json to_value v
  end
module Date =
  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 StreamArn =
  struct
    type nonrec t = string
    let context_ = "StreamArn"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:1024) >>=
             (fun () -> check_string_min i ~min:37));
        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:"StreamArn" j
    let to_json = simple_to_json to_value
  end
module ShardId =
  struct
    type nonrec t = string
    let context_ = "ShardId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:65) >>=
             (fun () -> check_string_min i ~min:28));
        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:"ShardId" j
    let to_json = simple_to_json to_value
  end
module ShardFilterType =
  struct
    type nonrec t =
      | CHILD_SHARDS 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function | CHILD_SHARDS -> "CHILD_SHARDS" | Non_static_id s -> s
    let of_string =
      function | "CHILD_SHARDS" -> CHILD_SHARDS | 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 ShardFilterType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"ShardFilterType" j)
    let to_json = simple_to_json to_value
  end
module ShardFilter =
  struct
    type nonrec t =
      {
      type_: ShardFilterType.t option
        [@ocaml.doc
          "Contains the type of filter to be applied on the DescribeStream API. Currently, the only value this parameter accepts is CHILD_SHARDS."];
      shardId: ShardId.t option
        [@ocaml.doc
          "Contains the shardId of the parent shard for which you are requesting child shards. Sample request:"]}
    let make ?type_ = fun ?shardId -> fun () -> { type_; shardId }
    let to_value x =
      structure_to_value
        [("Type", (Option.map x.type_ ~f:ShardFilterType.to_value));
        ("ShardId", (Option.map x.shardId ~f:ShardId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let shardId =
        (Option.map ~f:ShardId.of_xml) (Xml.child xml_arg0 "ShardId") in
      let type_ =
        (Option.map ~f:ShardFilterType.of_xml) (Xml.child xml_arg0 "Type") in
      make ?shardId ?type_ ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let shardId = field_map json__ "ShardId" ShardId.of_json in
      let type_ = field_map json__ "Type" ShardFilterType.of_json in
      make ?shardId ?type_ ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "This optional field contains the filter definition for the DescribeStream API."]
module PositiveIntegerObject =
  struct
    type nonrec t = int
    let make i =
      let open Result in ok_or_failwith (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 PositiveIntegerObject" 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 DescribeStreamInput =
  struct
    type nonrec t =
      {
      streamArn: StreamArn.t
        [@ocaml.doc "The Amazon Resource Name (ARN) for the stream."];
      limit: PositiveIntegerObject.t option
        [@ocaml.doc
          "The maximum number of shard objects to return. The upper limit is 100."];
      exclusiveStartShardId: ShardId.t option
        [@ocaml.doc
          "The shard ID of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedShardId in the previous operation."];
      shardFilter: ShardFilter.t option
        [@ocaml.doc
          "This optional field contains the filter definition for the DescribeStream API."]}
    let context_ = "DescribeStreamInput"
    let make ?limit =
      fun ?exclusiveStartShardId ->
        fun ?shardFilter ->
          fun ~streamArn ->
            fun () ->
              { limit; exclusiveStartShardId; shardFilter; streamArn }
    let to_value x =
      structure_to_value
        [("StreamArn", (Some (StreamArn.to_value x.streamArn)));
        ("Limit", (Option.map x.limit ~f:PositiveIntegerObject.to_value));
        ("ExclusiveStartShardId",
          (Option.map x.exclusiveStartShardId ~f:ShardId.to_value));
        ("ShardFilter", (Option.map x.shardFilter ~f:ShardFilter.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let shardFilter =
        (Option.map ~f:ShardFilter.of_xml) (Xml.child xml_arg0 "ShardFilter") in
      let exclusiveStartShardId =
        (Option.map ~f:ShardId.of_xml)
          (Xml.child xml_arg0 "ExclusiveStartShardId") in
      let limit =
        (Option.map ~f:PositiveIntegerObject.of_xml)
          (Xml.child xml_arg0 "Limit") in
      let streamArn =
        StreamArn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "StreamArn") in
      make ?shardFilter ?exclusiveStartShardId ?limit ~streamArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let shardFilter = field_map json__ "ShardFilter" ShardFilter.of_json in
      let exclusiveStartShardId =
        field_map json__ "ExclusiveStartShardId" ShardId.of_json in
      let limit = field_map json__ "Limit" PositiveIntegerObject.of_json in
      let streamArn = field_map_exn json__ "StreamArn" StreamArn.of_json in
      make ?shardFilter ?exclusiveStartShardId ?limit ~streamArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Represents the input of a DescribeStream operation."]
module TableName =
  struct
    type nonrec t = string
    let context_ = "TableName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:3) >>=
             (fun () ->
                (check_string_max i ~max:255) >>=
                  (fun () -> check_pattern i ~pattern:"[a-zA-Z0-9_.-]+")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"TableName" 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 StreamViewType =
  struct
    type nonrec t =
      | NEW_IMAGE 
      | OLD_IMAGE 
      | NEW_AND_OLD_IMAGES 
      | KEYS_ONLY 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | NEW_IMAGE -> "NEW_IMAGE"
      | OLD_IMAGE -> "OLD_IMAGE"
      | NEW_AND_OLD_IMAGES -> "NEW_AND_OLD_IMAGES"
      | KEYS_ONLY -> "KEYS_ONLY"
      | Non_static_id s -> s
    let of_string =
      function
      | "NEW_IMAGE" -> NEW_IMAGE
      | "OLD_IMAGE" -> OLD_IMAGE
      | "NEW_AND_OLD_IMAGES" -> NEW_AND_OLD_IMAGES
      | "KEYS_ONLY" -> KEYS_ONLY
      | 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 StreamViewType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"StreamViewType" j)
    let to_json = simple_to_json to_value
  end
module StreamStatus =
  struct
    type nonrec t =
      | ENABLING 
      | ENABLED 
      | DISABLING 
      | DISABLED 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | ENABLING -> "ENABLING"
      | ENABLED -> "ENABLED"
      | DISABLING -> "DISABLING"
      | DISABLED -> "DISABLED"
      | Non_static_id s -> s
    let of_string =
      function
      | "ENABLING" -> ENABLING
      | "ENABLED" -> ENABLED
      | "DISABLING" -> DISABLING
      | "DISABLED" -> DISABLED
      | 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 StreamStatus" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"StreamStatus" j)
    let to_json = simple_to_json to_value
  end
module SequenceNumber =
  struct
    type nonrec t = string
    let context_ = "SequenceNumber"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:40) >>=
             (fun () -> check_string_min i ~min:21));
        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:"SequenceNumber" j
    let to_json = simple_to_json to_value
  end
module SequenceNumberRange =
  struct
    type nonrec t =
      {
      startingSequenceNumber: SequenceNumber.t option
        [@ocaml.doc
          "The first sequence number for the stream records contained within a shard. String contains numeric characters only."];
      endingSequenceNumber: SequenceNumber.t option
        [@ocaml.doc
          "The last sequence number for the stream records contained within a shard. String contains numeric characters only."]}
    let make ?startingSequenceNumber =
      fun ?endingSequenceNumber ->
        fun () -> { startingSequenceNumber; endingSequenceNumber }
    let to_value x =
      structure_to_value
        [("StartingSequenceNumber",
           (Option.map x.startingSequenceNumber ~f:SequenceNumber.to_value));
        ("EndingSequenceNumber",
          (Option.map x.endingSequenceNumber ~f:SequenceNumber.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let endingSequenceNumber =
        (Option.map ~f:SequenceNumber.of_xml)
          (Xml.child xml_arg0 "EndingSequenceNumber") in
      let startingSequenceNumber =
        (Option.map ~f:SequenceNumber.of_xml)
          (Xml.child xml_arg0 "StartingSequenceNumber") in
      make ?endingSequenceNumber ?startingSequenceNumber ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let endingSequenceNumber =
        field_map json__ "EndingSequenceNumber" SequenceNumber.of_json in
      let startingSequenceNumber =
        field_map json__ "StartingSequenceNumber" SequenceNumber.of_json in
      make ?endingSequenceNumber ?startingSequenceNumber ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The beginning and ending sequence numbers for the stream records contained within a shard."]
module Shard =
  struct
    type nonrec t =
      {
      shardId: ShardId.t option
        [@ocaml.doc "The system-generated identifier for this shard."];
      sequenceNumberRange: SequenceNumberRange.t option
        [@ocaml.doc "The range of possible sequence numbers for the shard."];
      parentShardId: ShardId.t option
        [@ocaml.doc "The shard ID of the current shard's parent."]}
    let make ?shardId =
      fun ?sequenceNumberRange ->
        fun ?parentShardId ->
          fun () -> { shardId; sequenceNumberRange; parentShardId }
    let to_value x =
      structure_to_value
        [("ShardId", (Option.map x.shardId ~f:ShardId.to_value));
        ("SequenceNumberRange",
          (Option.map x.sequenceNumberRange ~f:SequenceNumberRange.to_value));
        ("ParentShardId", (Option.map x.parentShardId ~f:ShardId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let parentShardId =
        (Option.map ~f:ShardId.of_xml) (Xml.child xml_arg0 "ParentShardId") in
      let sequenceNumberRange =
        (Option.map ~f:SequenceNumberRange.of_xml)
          (Xml.child xml_arg0 "SequenceNumberRange") in
      let shardId =
        (Option.map ~f:ShardId.of_xml) (Xml.child xml_arg0 "ShardId") in
      make ?parentShardId ?sequenceNumberRange ?shardId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let parentShardId = field_map json__ "ParentShardId" ShardId.of_json in
      let sequenceNumberRange =
        field_map json__ "SequenceNumberRange" SequenceNumberRange.of_json in
      let shardId = field_map json__ "ShardId" ShardId.of_json in
      make ?parentShardId ?sequenceNumberRange ?shardId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "A uniquely identified group of stream records within a stream."]
module ShardDescriptionList =
  struct
    type nonrec t = Shard.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:Shard.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:Shard.of_xml)
    let of_json j =
      list_of_json ~kind:"ShardDescriptionList" ~of_json:Shard.of_json j
    let to_json v = composed_to_json to_value v
  end
module KeyType =
  struct
    type nonrec t =
      | HASH 
      | RANGE 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function | HASH -> "HASH" | RANGE -> "RANGE" | Non_static_id s -> s
    let of_string =
      function | "HASH" -> HASH | "RANGE" -> RANGE | 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 KeyType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"KeyType" j)
    let to_json = simple_to_json to_value
  end
module KeySchemaAttributeName =
  struct
    type nonrec t = string
    let context_ = "KeySchemaAttributeName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:255) >>=
             (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:"KeySchemaAttributeName" j
    let to_json = simple_to_json to_value
  end
module KeySchemaElement =
  struct
    type nonrec t =
      {
      attributeName: KeySchemaAttributeName.t option
        [@ocaml.doc "The name of a key attribute."];
      keyType: KeyType.t option
        [@ocaml.doc
          "The role that this key attribute will assume: HASH - partition key RANGE - sort key The partition key of an item is also known as its hash attribute. The term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. The sort key of an item is also known as its range attribute. The term \"range attribute\" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value."]}
    let make ?attributeName =
      fun ?keyType -> fun () -> { attributeName; keyType }
    let to_value x =
      structure_to_value
        [("AttributeName",
           (Option.map x.attributeName ~f:KeySchemaAttributeName.to_value));
        ("KeyType", (Option.map x.keyType ~f:KeyType.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let keyType =
        (Option.map ~f:KeyType.of_xml) (Xml.child xml_arg0 "KeyType") in
      let attributeName =
        (Option.map ~f:KeySchemaAttributeName.of_xml)
          (Xml.child xml_arg0 "AttributeName") in
      make ?keyType ?attributeName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let keyType = field_map json__ "KeyType" KeyType.of_json in
      let attributeName =
        field_map json__ "AttributeName" KeySchemaAttributeName.of_json in
      make ?keyType ?attributeName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index. A KeySchemaElement represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one KeySchemaElement (for the partition key). A composite primary key would require one KeySchemaElement for the partition key, and another KeySchemaElement for the sort key. A KeySchemaElement must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map."]
module KeySchema =
  struct
    type nonrec t = KeySchemaElement.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:2) >>= (fun () -> check_list_min i ~min:1));
        i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:KeySchemaElement.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:KeySchemaElement.of_xml)
    let of_json j =
      list_of_json ~kind:"KeySchema" ~of_json:KeySchemaElement.of_json j
    let to_json v = composed_to_json to_value v
  end
module StreamDescription =
  struct
    type nonrec t =
      {
      streamArn: StreamArn.t option
        [@ocaml.doc "The Amazon Resource Name (ARN) for the stream."];
      streamLabel: String_.t option
        [@ocaml.doc
          "A timestamp, in ISO 8601 format, for this stream. Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique: the Amazon Web Services customer ID. the table name the StreamLabel"];
      streamStatus: StreamStatus.t option
        [@ocaml.doc
          "Indicates the current status of the stream: ENABLING - Streams is currently being enabled on the DynamoDB table. ENABLED - the stream is enabled. DISABLING - Streams is currently being disabled on the DynamoDB table. DISABLED - the stream is disabled."];
      streamViewType: StreamViewType.t option
        [@ocaml.doc
          "Indicates the format of the records within this stream: KEYS_ONLY - only the key attributes of items that were modified in the DynamoDB table. NEW_IMAGE - entire items from the table, as they appeared after they were modified. OLD_IMAGE - entire items from the table, as they appeared before they were modified. NEW_AND_OLD_IMAGES - both the new and the old images of the items from the table."];
      creationRequestDateTime: Date.t option
        [@ocaml.doc
          "The date and time when the request to create this stream was issued."];
      tableName: TableName.t option
        [@ocaml.doc
          "The DynamoDB table with which the stream is associated."];
      keySchema: KeySchema.t option
        [@ocaml.doc "The key attribute(s) of the stream's DynamoDB table."];
      shards: ShardDescriptionList.t option
        [@ocaml.doc "The shards that comprise the stream."];
      lastEvaluatedShardId: ShardId.t option
        [@ocaml.doc
          "The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedShardId is empty, then the \"last page\" of results has been processed and there is currently no more data to be retrieved. If LastEvaluatedShardId is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedShardId is empty."]}
    let make ?streamArn =
      fun ?streamLabel ->
        fun ?streamStatus ->
          fun ?streamViewType ->
            fun ?creationRequestDateTime ->
              fun ?tableName ->
                fun ?keySchema ->
                  fun ?shards ->
                    fun ?lastEvaluatedShardId ->
                      fun () ->
                        {
                          streamArn;
                          streamLabel;
                          streamStatus;
                          streamViewType;
                          creationRequestDateTime;
                          tableName;
                          keySchema;
                          shards;
                          lastEvaluatedShardId
                        }
    let to_value x =
      structure_to_value
        [("StreamArn", (Option.map x.streamArn ~f:StreamArn.to_value));
        ("StreamLabel", (Option.map x.streamLabel ~f:String_.to_value));
        ("StreamStatus",
          (Option.map x.streamStatus ~f:StreamStatus.to_value));
        ("StreamViewType",
          (Option.map x.streamViewType ~f:StreamViewType.to_value));
        ("CreationRequestDateTime",
          (Option.map x.creationRequestDateTime ~f:Date.to_value));
        ("TableName", (Option.map x.tableName ~f:TableName.to_value));
        ("KeySchema", (Option.map x.keySchema ~f:KeySchema.to_value));
        ("Shards", (Option.map x.shards ~f:ShardDescriptionList.to_value));
        ("LastEvaluatedShardId",
          (Option.map x.lastEvaluatedShardId ~f:ShardId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let lastEvaluatedShardId =
        (Option.map ~f:ShardId.of_xml)
          (Xml.child xml_arg0 "LastEvaluatedShardId") in
      let shards =
        (Option.map ~f:ShardDescriptionList.of_xml)
          (Xml.child xml_arg0 "Shards") in
      let keySchema =
        (Option.map ~f:KeySchema.of_xml) (Xml.child xml_arg0 "KeySchema") in
      let tableName =
        (Option.map ~f:TableName.of_xml) (Xml.child xml_arg0 "TableName") in
      let creationRequestDateTime =
        (Option.map ~f:Date.of_xml)
          (Xml.child xml_arg0 "CreationRequestDateTime") in
      let streamViewType =
        (Option.map ~f:StreamViewType.of_xml)
          (Xml.child xml_arg0 "StreamViewType") in
      let streamStatus =
        (Option.map ~f:StreamStatus.of_xml)
          (Xml.child xml_arg0 "StreamStatus") in
      let streamLabel =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "StreamLabel") in
      let streamArn =
        (Option.map ~f:StreamArn.of_xml) (Xml.child xml_arg0 "StreamArn") in
      make ?lastEvaluatedShardId ?shards ?keySchema ?tableName
        ?creationRequestDateTime ?streamViewType ?streamStatus ?streamLabel
        ?streamArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let lastEvaluatedShardId =
        field_map json__ "LastEvaluatedShardId" ShardId.of_json in
      let shards = field_map json__ "Shards" ShardDescriptionList.of_json in
      let keySchema = field_map json__ "KeySchema" KeySchema.of_json in
      let tableName = field_map json__ "TableName" TableName.of_json in
      let creationRequestDateTime =
        field_map json__ "CreationRequestDateTime" Date.of_json in
      let streamViewType =
        field_map json__ "StreamViewType" StreamViewType.of_json in
      let streamStatus = field_map json__ "StreamStatus" StreamStatus.of_json in
      let streamLabel = field_map json__ "StreamLabel" String_.of_json in
      let streamArn = field_map json__ "StreamArn" StreamArn.of_json in
      make ?lastEvaluatedShardId ?shards ?keySchema ?tableName
        ?creationRequestDateTime ?streamViewType ?streamStatus ?streamLabel
        ?streamArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents all of the data describing a particular stream."]
module ErrorMessage =
  struct
    type nonrec t = string
    let context_ = "ErrorMessage"
    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:"ErrorMessage" j
    let to_json = simple_to_json to_value
  end
module ResourceNotFoundException =
  struct
    type nonrec t =
      {
      message: ErrorMessage.t option
        [@ocaml.doc "The resource which is being requested does not exist."]}
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:ErrorMessage.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:ErrorMessage.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" ErrorMessage.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be ACTIVE."]
module InternalServerError =
  struct
    type nonrec t =
      {
      message: ErrorMessage.t option
        [@ocaml.doc
          "The server encountered an internal error trying to fulfill the request."]}
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:ErrorMessage.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:ErrorMessage.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" ErrorMessage.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "An error occurred on the server side."]
module DescribeStreamOutput =
  struct
    type nonrec t =
      {
      streamDescription: StreamDescription.t option
        [@ocaml.doc
          "A complete description of the stream, including its creation date and time, the DynamoDB table associated with the stream, the shard IDs within the stream, and the beginning and ending sequence numbers of stream records within the shards."]}
    type nonrec error =
      [ `InternalServerError of InternalServerError.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?streamDescription = fun () -> { streamDescription }
    let error_of_json name json =
      match name with
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("StreamDescription",
           (Option.map x.streamDescription ~f:StreamDescription.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let streamDescription =
        (Option.map ~f:StreamDescription.of_xml)
          (Xml.child xml_arg0 "StreamDescription") in
      make ?streamDescription ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let streamDescription =
        field_map json__ "StreamDescription" StreamDescription.of_json in
      make ?streamDescription ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Represents the output of a DescribeStream operation."]
module ExpiredIteratorException =
  struct
    type nonrec t =
      {
      message: ErrorMessage.t option
        [@ocaml.doc "The provided iterator exceeds the maximum age allowed."]}
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:ErrorMessage.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:ErrorMessage.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" ErrorMessage.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The shard iterator has expired and can no longer be used to retrieve stream records. A shard iterator expires 15 minutes after it is retrieved using the GetShardIterator action."]
module ShardIterator =
  struct
    type nonrec t = string
    let context_ = "ShardIterator"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:2048) >>=
             (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:"ShardIterator" j
    let to_json = simple_to_json to_value
  end
module GetRecordsInput =
  struct
    type nonrec t =
      {
      shardIterator: ShardIterator.t
        [@ocaml.doc
          "A shard iterator that was retrieved from a previous GetShardIterator operation. This iterator can be used to access the stream records in this shard."];
      limit: PositiveIntegerObject.t option
        [@ocaml.doc
          "The maximum number of records to return from the shard. The upper limit is 1000."]}
    let context_ = "GetRecordsInput"
    let make ?limit =
      fun ~shardIterator -> fun () -> { limit; shardIterator }
    let to_value x =
      structure_to_value
        [("ShardIterator", (Some (ShardIterator.to_value x.shardIterator)));
        ("Limit", (Option.map x.limit ~f:PositiveIntegerObject.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let limit =
        (Option.map ~f:PositiveIntegerObject.of_xml)
          (Xml.child xml_arg0 "Limit") in
      let shardIterator =
        ShardIterator.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "ShardIterator") in
      make ?limit ~shardIterator ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let limit = field_map json__ "Limit" PositiveIntegerObject.of_json in
      let shardIterator =
        field_map_exn json__ "ShardIterator" ShardIterator.of_json in
      make ?limit ~shardIterator ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Represents the input of a GetRecords operation."]
module TrimmedDataAccessException =
  struct
    type nonrec t =
      {
      message: ErrorMessage.t option
        [@ocaml.doc "\"The data you are trying to access has been trimmed."]}
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:ErrorMessage.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:ErrorMessage.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" ErrorMessage.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The operation attempted to read past the oldest stream record in a shard. In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose age exceeds this limit are subject to removal (trimming) from the stream. You might receive a TrimmedDataAccessException if: You request a shard iterator with a sequence number older than the trim point (24 hours). You obtain a shard iterator, but before you use the iterator in a GetRecords request, a stream record in the shard exceeds the 24 hour period and is trimmed. This causes the iterator to access a record that no longer exists."]
module PositiveLongObject =
  struct
    type nonrec t = Int64.t
    let make i =
      let open Result in ok_or_failwith (check_int64_min i ~min:1L); i
    let of_string = Int64.of_string
    let to_value x = `Long x
    let to_query v = to_query to_value v
    let to_header x = Int64.to_string x
    let of_xml xml_arg0 =
      Int64.of_string (string_of_xml ~kind:"a long" xml_arg0)
    let of_json j = Int64.of_float (float_of_json ~kind:"a long" j)
    let to_json = simple_to_json to_value
  end
module StreamRecord =
  struct
    type nonrec t =
      {
      approximateCreationDateTime: Date.t option
        [@ocaml.doc
          "The approximate date and time when the stream record was created, in ISO 8601 format and rounded down to the closest second."];
      keys: AttributeMap.t option
        [@ocaml.doc
          "The primary key attribute(s) for the DynamoDB item that was modified."];
      newImage: AttributeMap.t option
        [@ocaml.doc
          "The item in the DynamoDB table as it appeared after it was modified."];
      oldImage: AttributeMap.t option
        [@ocaml.doc
          "The item in the DynamoDB table as it appeared before it was modified."];
      sequenceNumber: SequenceNumber.t option
        [@ocaml.doc "The sequence number of the stream record."];
      sizeBytes: PositiveLongObject.t option
        [@ocaml.doc "The size of the stream record, in bytes."];
      streamViewType: StreamViewType.t option
        [@ocaml.doc
          "The type of data from the modified DynamoDB item that was captured in this stream record: KEYS_ONLY - only the key attributes of the modified item. NEW_IMAGE - the entire item, as it appeared after it was modified. OLD_IMAGE - the entire item, as it appeared before it was modified. NEW_AND_OLD_IMAGES - both the new and the old item images of the item."]}
    let make ?approximateCreationDateTime =
      fun ?keys ->
        fun ?newImage ->
          fun ?oldImage ->
            fun ?sequenceNumber ->
              fun ?sizeBytes ->
                fun ?streamViewType ->
                  fun () ->
                    {
                      approximateCreationDateTime;
                      keys;
                      newImage;
                      oldImage;
                      sequenceNumber;
                      sizeBytes;
                      streamViewType
                    }
    let to_value x =
      structure_to_value
        [("ApproximateCreationDateTime",
           (Option.map x.approximateCreationDateTime ~f:Date.to_value));
        ("Keys", (Option.map x.keys ~f:AttributeMap.to_value));
        ("NewImage", (Option.map x.newImage ~f:AttributeMap.to_value));
        ("OldImage", (Option.map x.oldImage ~f:AttributeMap.to_value));
        ("SequenceNumber",
          (Option.map x.sequenceNumber ~f:SequenceNumber.to_value));
        ("SizeBytes",
          (Option.map x.sizeBytes ~f:PositiveLongObject.to_value));
        ("StreamViewType",
          (Option.map x.streamViewType ~f:StreamViewType.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let streamViewType =
        (Option.map ~f:StreamViewType.of_xml)
          (Xml.child xml_arg0 "StreamViewType") in
      let sizeBytes =
        (Option.map ~f:PositiveLongObject.of_xml)
          (Xml.child xml_arg0 "SizeBytes") in
      let sequenceNumber =
        (Option.map ~f:SequenceNumber.of_xml)
          (Xml.child xml_arg0 "SequenceNumber") in
      let oldImage =
        (Option.map ~f:AttributeMap.of_xml) (Xml.child xml_arg0 "OldImage") in
      let newImage =
        (Option.map ~f:AttributeMap.of_xml) (Xml.child xml_arg0 "NewImage") in
      let keys =
        (Option.map ~f:AttributeMap.of_xml) (Xml.child xml_arg0 "Keys") in
      let approximateCreationDateTime =
        (Option.map ~f:Date.of_xml)
          (Xml.child xml_arg0 "ApproximateCreationDateTime") in
      make ?streamViewType ?sizeBytes ?sequenceNumber ?oldImage ?newImage
        ?keys ?approximateCreationDateTime ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let streamViewType =
        field_map json__ "StreamViewType" StreamViewType.of_json in
      let sizeBytes = field_map json__ "SizeBytes" PositiveLongObject.of_json in
      let sequenceNumber =
        field_map json__ "SequenceNumber" SequenceNumber.of_json in
      let oldImage = field_map json__ "OldImage" AttributeMap.of_json in
      let newImage = field_map json__ "NewImage" AttributeMap.of_json in
      let keys = field_map json__ "Keys" AttributeMap.of_json in
      let approximateCreationDateTime =
        field_map json__ "ApproximateCreationDateTime" Date.of_json in
      make ?streamViewType ?sizeBytes ?sequenceNumber ?oldImage ?newImage
        ?keys ?approximateCreationDateTime ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "A description of a single data modification that was performed on an item in a DynamoDB table."]
module OperationType =
  struct
    type nonrec t =
      | INSERT 
      | MODIFY 
      | REMOVE 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | INSERT -> "INSERT"
      | MODIFY -> "MODIFY"
      | REMOVE -> "REMOVE"
      | Non_static_id s -> s
    let of_string =
      function
      | "INSERT" -> INSERT
      | "MODIFY" -> MODIFY
      | "REMOVE" -> REMOVE
      | 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 OperationType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"OperationType" j)
    let to_json = simple_to_json to_value
  end
module Identity =
  struct
    type nonrec t =
      {
      principalId: String_.t option
        [@ocaml.doc
          "A unique identifier for the entity that made the call. For Time To Live, the principalId is \"dynamodb.amazonaws.com\"."];
      type_: String_.t option
        [@ocaml.doc
          "The type of the identity. For Time To Live, the type is \"Service\"."]}
    let make ?principalId = fun ?type_ -> fun () -> { principalId; type_ }
    let to_value x =
      structure_to_value
        [("PrincipalId", (Option.map x.principalId ~f:String_.to_value));
        ("Type", (Option.map x.type_ ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let type_ = (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "Type") in
      let principalId =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "PrincipalId") in
      make ?type_ ?principalId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let type_ = field_map json__ "Type" String_.of_json in
      let principalId = field_map json__ "PrincipalId" String_.of_json in
      make ?type_ ?principalId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains details about the type of identity that made the request."]
module Record =
  struct
    type nonrec t =
      {
      eventID: String_.t option
        [@ocaml.doc
          "A globally unique identifier for the event that was recorded in this stream record."];
      eventName: OperationType.t option
        [@ocaml.doc
          "The type of data modification that was performed on the DynamoDB table: INSERT - a new item was added to the table. MODIFY - one or more of an existing item's attributes were modified. REMOVE - the item was deleted from the table"];
      eventVersion: String_.t option
        [@ocaml.doc
          "The version number of the stream record format. This number is updated whenever the structure of Record is modified. Client applications must not assume that eventVersion will remain at a particular value, as this number is subject to change at any time. In general, eventVersion will only increase as the low-level DynamoDB Streams API evolves."];
      eventSource: String_.t option
        [@ocaml.doc
          "The Amazon Web Services service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb."];
      awsRegion: String_.t option
        [@ocaml.doc
          "The region in which the GetRecords request was received."];
      dynamodb: StreamRecord.t option
        [@ocaml.doc
          "The main body of the stream record, containing all of the DynamoDB-specific fields."];
      userIdentity: Identity.t option
        [@ocaml.doc
          "Items that are deleted by the Time to Live process after expiration have the following fields: Records\\[\\].userIdentity.type \"Service\" Records\\[\\].userIdentity.principalId \"dynamodb.amazonaws.com\""]}
    let make ?eventID =
      fun ?eventName ->
        fun ?eventVersion ->
          fun ?eventSource ->
            fun ?awsRegion ->
              fun ?dynamodb ->
                fun ?userIdentity ->
                  fun () ->
                    {
                      eventID;
                      eventName;
                      eventVersion;
                      eventSource;
                      awsRegion;
                      dynamodb;
                      userIdentity
                    }
    let to_value x =
      structure_to_value
        [("eventID", (Option.map x.eventID ~f:String_.to_value));
        ("eventName", (Option.map x.eventName ~f:OperationType.to_value));
        ("eventVersion", (Option.map x.eventVersion ~f:String_.to_value));
        ("eventSource", (Option.map x.eventSource ~f:String_.to_value));
        ("awsRegion", (Option.map x.awsRegion ~f:String_.to_value));
        ("dynamodb", (Option.map x.dynamodb ~f:StreamRecord.to_value));
        ("userIdentity", (Option.map x.userIdentity ~f:Identity.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let userIdentity =
        (Option.map ~f:Identity.of_xml) (Xml.child xml_arg0 "userIdentity") in
      let dynamodb =
        (Option.map ~f:StreamRecord.of_xml) (Xml.child xml_arg0 "dynamodb") in
      let awsRegion =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "awsRegion") in
      let eventSource =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "eventSource") in
      let eventVersion =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "eventVersion") in
      let eventName =
        (Option.map ~f:OperationType.of_xml) (Xml.child xml_arg0 "eventName") in
      let eventID =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "eventID") in
      make ?userIdentity ?dynamodb ?awsRegion ?eventSource ?eventVersion
        ?eventName ?eventID ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let userIdentity = field_map json__ "userIdentity" Identity.of_json in
      let dynamodb = field_map json__ "dynamodb" StreamRecord.of_json in
      let awsRegion = field_map json__ "awsRegion" String_.of_json in
      let eventSource = field_map json__ "eventSource" String_.of_json in
      let eventVersion = field_map json__ "eventVersion" String_.of_json in
      let eventName = field_map json__ "eventName" OperationType.of_json in
      let eventID = field_map json__ "eventID" String_.of_json in
      make ?userIdentity ?dynamodb ?awsRegion ?eventSource ?eventVersion
        ?eventName ?eventID ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "A description of a unique event within a stream."]
module RecordList =
  struct
    type nonrec t = Record.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:Record.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:Record.of_xml)
    let of_json j = list_of_json ~kind:"RecordList" ~of_json:Record.of_json j
    let to_json v = composed_to_json to_value v
  end
module LimitExceededException =
  struct
    type nonrec t =
      {
      message: ErrorMessage.t option
        [@ocaml.doc "Too many operations for a given subscriber."]}
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:ErrorMessage.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:ErrorMessage.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" ErrorMessage.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "There is no limit to the number of daily on-demand backups that can be taken. For most purposes, up to 500 simultaneous table operations are allowed per account. These operations include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, and RestoreTableToPointInTime. When you are creating a table with one or more secondary indexes, you can have up to 250 such requests running at a time. However, if the table or index specifications are complex, then DynamoDB might temporarily reduce the number of concurrent operations. When importing into DynamoDB, up to 50 simultaneous import table operations are allowed per account. There is a soft account quota of 2,500 tables. GetRecords was called with a value of more than 1000 for the limit request parameter. More than 2 processes are reading from the same streams shard at the same time. Exceeding this limit may result in request throttling."]
module GetRecordsOutput =
  struct
    type nonrec t =
      {
      records: RecordList.t option
        [@ocaml.doc
          "The stream records from the shard, which were retrieved using the shard iterator."];
      nextShardIterator: ShardIterator.t option
        [@ocaml.doc
          "The next position in the shard from which to start sequentially reading stream records. If set to null, the shard has been closed and the requested iterator will not return any more data."]}
    type nonrec error =
      [ `ExpiredIteratorException of ExpiredIteratorException.t 
      | `InternalServerError of InternalServerError.t 
      | `LimitExceededException of LimitExceededException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `TrimmedDataAccessException of TrimmedDataAccessException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?records =
      fun ?nextShardIterator -> fun () -> { records; nextShardIterator }
    let error_of_json name json =
      match name with
      | "ExpiredIteratorException" ->
          `ExpiredIteratorException (ExpiredIteratorException.of_json json)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | "LimitExceededException" ->
          `LimitExceededException (LimitExceededException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "TrimmedDataAccessException" ->
          `TrimmedDataAccessException
            (TrimmedDataAccessException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "ExpiredIteratorException" ->
          `ExpiredIteratorException (ExpiredIteratorException.of_xml xml)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | "LimitExceededException" ->
          `LimitExceededException (LimitExceededException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "TrimmedDataAccessException" ->
          `TrimmedDataAccessException (TrimmedDataAccessException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `ExpiredIteratorException e ->
          `Assoc
            [("error", (`String "ExpiredIteratorException"));
            ("details", (ExpiredIteratorException.to_json e))]
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.to_json e))]
      | `LimitExceededException e ->
          `Assoc
            [("error", (`String "LimitExceededException"));
            ("details", (LimitExceededException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `TrimmedDataAccessException e ->
          `Assoc
            [("error", (`String "TrimmedDataAccessException"));
            ("details", (TrimmedDataAccessException.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
        [("Records", (Option.map x.records ~f:RecordList.to_value));
        ("NextShardIterator",
          (Option.map x.nextShardIterator ~f:ShardIterator.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let nextShardIterator =
        (Option.map ~f:ShardIterator.of_xml)
          (Xml.child xml_arg0 "NextShardIterator") in
      let records =
        (Option.map ~f:RecordList.of_xml) (Xml.child xml_arg0 "Records") in
      make ?nextShardIterator ?records ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let nextShardIterator =
        field_map json__ "NextShardIterator" ShardIterator.of_json in
      let records = field_map json__ "Records" RecordList.of_json in
      make ?nextShardIterator ?records ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Represents the output of a GetRecords operation."]
module ShardIteratorType =
  struct
    type nonrec t =
      | TRIM_HORIZON 
      | LATEST 
      | AT_SEQUENCE_NUMBER 
      | AFTER_SEQUENCE_NUMBER 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | TRIM_HORIZON -> "TRIM_HORIZON"
      | LATEST -> "LATEST"
      | AT_SEQUENCE_NUMBER -> "AT_SEQUENCE_NUMBER"
      | AFTER_SEQUENCE_NUMBER -> "AFTER_SEQUENCE_NUMBER"
      | Non_static_id s -> s
    let of_string =
      function
      | "TRIM_HORIZON" -> TRIM_HORIZON
      | "LATEST" -> LATEST
      | "AT_SEQUENCE_NUMBER" -> AT_SEQUENCE_NUMBER
      | "AFTER_SEQUENCE_NUMBER" -> AFTER_SEQUENCE_NUMBER
      | 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 ShardIteratorType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"ShardIteratorType" j)
    let to_json = simple_to_json to_value
  end
module GetShardIteratorInput =
  struct
    type nonrec t =
      {
      streamArn: StreamArn.t
        [@ocaml.doc "The Amazon Resource Name (ARN) for the stream."];
      shardId: ShardId.t
        [@ocaml.doc
          "The identifier of the shard. The iterator will be returned for this shard ID."];
      shardIteratorType: ShardIteratorType.t
        [@ocaml.doc
          "Determines how the shard iterator is used to start reading stream records from the shard: AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number. AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number. TRIM_HORIZON - Start reading at the last (untrimmed) stream record, which is the oldest record in the shard. In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose age exceeds this limit are subject to removal (trimming) from the stream. LATEST - Start reading just after the most recent stream record in the shard, so that you always read the most recent data in the shard."];
      sequenceNumber: SequenceNumber.t option
        [@ocaml.doc
          "The sequence number of a stream record in the shard from which to start reading."]}
    let context_ = "GetShardIteratorInput"
    let make ?sequenceNumber =
      fun ~streamArn ->
        fun ~shardId ->
          fun ~shardIteratorType ->
            fun () ->
              { sequenceNumber; streamArn; shardId; shardIteratorType }
    let to_value x =
      structure_to_value
        [("StreamArn", (Some (StreamArn.to_value x.streamArn)));
        ("ShardId", (Some (ShardId.to_value x.shardId)));
        ("ShardIteratorType",
          (Some (ShardIteratorType.to_value x.shardIteratorType)));
        ("SequenceNumber",
          (Option.map x.sequenceNumber ~f:SequenceNumber.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let sequenceNumber =
        (Option.map ~f:SequenceNumber.of_xml)
          (Xml.child xml_arg0 "SequenceNumber") in
      let shardIteratorType =
        ShardIteratorType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "ShardIteratorType") in
      let shardId =
        ShardId.of_xml (Xml.child_exn ~context:context_ xml_arg0 "ShardId") in
      let streamArn =
        StreamArn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "StreamArn") in
      make ?sequenceNumber ~shardIteratorType ~shardId ~streamArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let sequenceNumber =
        field_map json__ "SequenceNumber" SequenceNumber.of_json in
      let shardIteratorType =
        field_map_exn json__ "ShardIteratorType" ShardIteratorType.of_json in
      let shardId = field_map_exn json__ "ShardId" ShardId.of_json in
      let streamArn = field_map_exn json__ "StreamArn" StreamArn.of_json in
      make ?sequenceNumber ~shardIteratorType ~shardId ~streamArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Represents the input of a GetShardIterator operation."]
module GetShardIteratorOutput =
  struct
    type nonrec t =
      {
      shardIterator: ShardIterator.t option
        [@ocaml.doc
          "The position in the shard from which to start reading stream records sequentially. A shard iterator specifies this position using the sequence number of a stream record in a shard."]}
    type nonrec error =
      [ `InternalServerError of InternalServerError.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `TrimmedDataAccessException of TrimmedDataAccessException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?shardIterator = fun () -> { shardIterator }
    let error_of_json name json =
      match name with
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "TrimmedDataAccessException" ->
          `TrimmedDataAccessException
            (TrimmedDataAccessException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "TrimmedDataAccessException" ->
          `TrimmedDataAccessException (TrimmedDataAccessException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `TrimmedDataAccessException e ->
          `Assoc
            [("error", (`String "TrimmedDataAccessException"));
            ("details", (TrimmedDataAccessException.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
        [("ShardIterator",
           (Option.map x.shardIterator ~f:ShardIterator.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let shardIterator =
        (Option.map ~f:ShardIterator.of_xml)
          (Xml.child xml_arg0 "ShardIterator") in
      make ?shardIterator ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let shardIterator =
        field_map json__ "ShardIterator" ShardIterator.of_json in
      make ?shardIterator ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Represents the output of a GetShardIterator operation."]
module ListStreamsInput =
  struct
    type nonrec t =
      {
      tableName: TableName.t option
        [@ocaml.doc
          "If this parameter is provided, then only the streams associated with this table name are returned."];
      limit: PositiveIntegerObject.t option
        [@ocaml.doc
          "The maximum number of streams to return. The upper limit is 100."];
      exclusiveStartStreamArn: StreamArn.t option
        [@ocaml.doc
          "The ARN (Amazon Resource Name) of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedStreamArn in the previous operation."]}
    let make ?tableName =
      fun ?limit ->
        fun ?exclusiveStartStreamArn ->
          fun () -> { tableName; limit; exclusiveStartStreamArn }
    let to_value x =
      structure_to_value
        [("TableName", (Option.map x.tableName ~f:TableName.to_value));
        ("Limit", (Option.map x.limit ~f:PositiveIntegerObject.to_value));
        ("ExclusiveStartStreamArn",
          (Option.map x.exclusiveStartStreamArn ~f:StreamArn.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let exclusiveStartStreamArn =
        (Option.map ~f:StreamArn.of_xml)
          (Xml.child xml_arg0 "ExclusiveStartStreamArn") in
      let limit =
        (Option.map ~f:PositiveIntegerObject.of_xml)
          (Xml.child xml_arg0 "Limit") in
      let tableName =
        (Option.map ~f:TableName.of_xml) (Xml.child xml_arg0 "TableName") in
      make ?exclusiveStartStreamArn ?limit ?tableName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let exclusiveStartStreamArn =
        field_map json__ "ExclusiveStartStreamArn" StreamArn.of_json in
      let limit = field_map json__ "Limit" PositiveIntegerObject.of_json in
      let tableName = field_map json__ "TableName" TableName.of_json in
      make ?exclusiveStartStreamArn ?limit ?tableName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Represents the input of a ListStreams operation."]
module Stream =
  struct
    type nonrec t =
      {
      streamArn: StreamArn.t option
        [@ocaml.doc "The Amazon Resource Name (ARN) for the stream."];
      tableName: TableName.t option
        [@ocaml.doc
          "The DynamoDB table with which the stream is associated."];
      streamLabel: String_.t option
        [@ocaml.doc
          "A timestamp, in ISO 8601 format, for this stream. Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique: the Amazon Web Services customer ID. the table name the StreamLabel"]}
    let make ?streamArn =
      fun ?tableName ->
        fun ?streamLabel -> fun () -> { streamArn; tableName; streamLabel }
    let to_value x =
      structure_to_value
        [("StreamArn", (Option.map x.streamArn ~f:StreamArn.to_value));
        ("TableName", (Option.map x.tableName ~f:TableName.to_value));
        ("StreamLabel", (Option.map x.streamLabel ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let streamLabel =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "StreamLabel") in
      let tableName =
        (Option.map ~f:TableName.of_xml) (Xml.child xml_arg0 "TableName") in
      let streamArn =
        (Option.map ~f:StreamArn.of_xml) (Xml.child xml_arg0 "StreamArn") in
      make ?streamLabel ?tableName ?streamArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let streamLabel = field_map json__ "StreamLabel" String_.of_json in
      let tableName = field_map json__ "TableName" TableName.of_json in
      let streamArn = field_map json__ "StreamArn" StreamArn.of_json in
      make ?streamLabel ?tableName ?streamArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents all of the data describing a particular stream."]
module StreamList =
  struct
    type nonrec t = Stream.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:Stream.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:Stream.of_xml)
    let of_json j = list_of_json ~kind:"StreamList" ~of_json:Stream.of_json j
    let to_json v = composed_to_json to_value v
  end
module ListStreamsOutput =
  struct
    type nonrec t =
      {
      streams: StreamList.t option
        [@ocaml.doc
          "A list of stream descriptors associated with the current account and endpoint."];
      lastEvaluatedStreamArn: StreamArn.t option
        [@ocaml.doc
          "The stream ARN of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedStreamArn is empty, then the \"last page\" of results has been processed and there is no more data to be retrieved. If LastEvaluatedStreamArn is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedStreamArn is empty."]}
    type nonrec error =
      [ `InternalServerError of InternalServerError.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?streams =
      fun ?lastEvaluatedStreamArn ->
        fun () -> { streams; lastEvaluatedStreamArn }
    let error_of_json name json =
      match name with
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("Streams", (Option.map x.streams ~f:StreamList.to_value));
        ("LastEvaluatedStreamArn",
          (Option.map x.lastEvaluatedStreamArn ~f:StreamArn.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let lastEvaluatedStreamArn =
        (Option.map ~f:StreamArn.of_xml)
          (Xml.child xml_arg0 "LastEvaluatedStreamArn") in
      let streams =
        (Option.map ~f:StreamList.of_xml) (Xml.child xml_arg0 "Streams") in
      make ?lastEvaluatedStreamArn ?streams ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let lastEvaluatedStreamArn =
        field_map json__ "LastEvaluatedStreamArn" StreamArn.of_json in
      let streams = field_map json__ "Streams" StreamList.of_json in
      make ?lastEvaluatedStreamArn ?streams ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Represents the output of a ListStreams operation."]