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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents all of the data describing a particular stream.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Stream {
    /// <p>The Amazon Resource Name (ARN) for the stream.</p>
    pub stream_arn: std::option::Option<std::string::String>,
    /// <p>The DynamoDB table with which the stream is associated.</p>
    pub table_name: std::option::Option<std::string::String>,
    /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
    /// <p>Note that <code>LatestStreamLabel</code> 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:</p>
    /// <ul>
    /// <li>
    /// <p>the AWS customer ID.</p>
    /// </li>
    /// <li>
    /// <p>the table name</p>
    /// </li>
    /// <li>
    /// <p>the <code>StreamLabel</code>
    /// </p>
    /// </li>
    /// </ul>
    pub stream_label: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for Stream {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("Stream");
        formatter.field("stream_arn", &self.stream_arn);
        formatter.field("table_name", &self.table_name);
        formatter.field("stream_label", &self.stream_label);
        formatter.finish()
    }
}
/// See [`Stream`](crate::model::Stream)
pub mod stream {
    /// A builder for [`Stream`](crate::model::Stream)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) stream_arn: std::option::Option<std::string::String>,
        pub(crate) table_name: std::option::Option<std::string::String>,
        pub(crate) stream_label: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>The Amazon Resource Name (ARN) for the stream.</p>
        pub fn stream_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.stream_arn = Some(input.into());
            self
        }
        /// <p>The Amazon Resource Name (ARN) for the stream.</p>
        pub fn set_stream_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.stream_arn = input;
            self
        }
        /// <p>The DynamoDB table with which the stream is associated.</p>
        pub fn table_name(mut self, input: impl Into<std::string::String>) -> Self {
            self.table_name = Some(input.into());
            self
        }
        /// <p>The DynamoDB table with which the stream is associated.</p>
        pub fn set_table_name(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.table_name = input;
            self
        }
        /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
        /// <p>Note that <code>LatestStreamLabel</code> 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:</p>
        /// <ul>
        /// <li>
        /// <p>the AWS customer ID.</p>
        /// </li>
        /// <li>
        /// <p>the table name</p>
        /// </li>
        /// <li>
        /// <p>the <code>StreamLabel</code>
        /// </p>
        /// </li>
        /// </ul>
        pub fn stream_label(mut self, input: impl Into<std::string::String>) -> Self {
            self.stream_label = Some(input.into());
            self
        }
        /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
        /// <p>Note that <code>LatestStreamLabel</code> 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:</p>
        /// <ul>
        /// <li>
        /// <p>the AWS customer ID.</p>
        /// </li>
        /// <li>
        /// <p>the table name</p>
        /// </li>
        /// <li>
        /// <p>the <code>StreamLabel</code>
        /// </p>
        /// </li>
        /// </ul>
        pub fn set_stream_label(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.stream_label = input;
            self
        }
        /// Consumes the builder and constructs a [`Stream`](crate::model::Stream)
        pub fn build(self) -> crate::model::Stream {
            crate::model::Stream {
                stream_arn: self.stream_arn,
                table_name: self.table_name,
                stream_label: self.stream_label,
            }
        }
    }
}
impl Stream {
    /// Creates a new builder-style object to manufacture [`Stream`](crate::model::Stream)
    pub fn builder() -> crate::model::stream::Builder {
        crate::model::stream::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum ShardIteratorType {
    #[allow(missing_docs)] // documentation missing in model
    AfterSequenceNumber,
    #[allow(missing_docs)] // documentation missing in model
    AtSequenceNumber,
    #[allow(missing_docs)] // documentation missing in model
    Latest,
    #[allow(missing_docs)] // documentation missing in model
    TrimHorizon,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for ShardIteratorType {
    fn from(s: &str) -> Self {
        match s {
            "AFTER_SEQUENCE_NUMBER" => ShardIteratorType::AfterSequenceNumber,
            "AT_SEQUENCE_NUMBER" => ShardIteratorType::AtSequenceNumber,
            "LATEST" => ShardIteratorType::Latest,
            "TRIM_HORIZON" => ShardIteratorType::TrimHorizon,
            other => ShardIteratorType::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for ShardIteratorType {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(ShardIteratorType::from(s))
    }
}
impl ShardIteratorType {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            ShardIteratorType::AfterSequenceNumber => "AFTER_SEQUENCE_NUMBER",
            ShardIteratorType::AtSequenceNumber => "AT_SEQUENCE_NUMBER",
            ShardIteratorType::Latest => "LATEST",
            ShardIteratorType::TrimHorizon => "TRIM_HORIZON",
            ShardIteratorType::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &[
            "AFTER_SEQUENCE_NUMBER",
            "AT_SEQUENCE_NUMBER",
            "LATEST",
            "TRIM_HORIZON",
        ]
    }
}
impl AsRef<str> for ShardIteratorType {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>A description of a unique event within a stream.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Record {
    /// <p>A globally unique identifier for the event that was recorded in this stream record.</p>
    pub event_id: std::option::Option<std::string::String>,
    /// <p>The type of data modification that was performed on the DynamoDB table:</p>
    /// <ul>
    /// <li>
    /// <p>
    /// <code>INSERT</code> - a new item was added to the table.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>MODIFY</code> - one or more of an existing item's attributes were modified.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>REMOVE</code> - the item was deleted from the table</p>
    /// </li>
    /// </ul>
    pub event_name: std::option::Option<crate::model::OperationType>,
    /// <p>The version number of the stream record format.  This number is updated whenever the structure of <code>Record</code> is modified.</p>
    /// <p>Client applications must not assume that <code>eventVersion</code> will remain at a particular
    /// value, as this number is subject to change at any time. In general, <code>eventVersion</code> will
    /// only increase as the low-level DynamoDB Streams API evolves.</p>
    pub event_version: std::option::Option<std::string::String>,
    /// <p>The AWS service from which the stream record originated.  For DynamoDB Streams, this is <code>aws:dynamodb</code>.</p>
    pub event_source: std::option::Option<std::string::String>,
    /// <p>The region in which the <code>GetRecords</code> request was received.</p>
    pub aws_region: std::option::Option<std::string::String>,
    /// <p>The main body of the stream record, containing all of the DynamoDB-specific fields.</p>
    pub dynamodb: std::option::Option<crate::model::StreamRecord>,
    /// <p>Items that are deleted by the Time to Live process after expiration have the following fields: </p>
    /// <ul>
    /// <li>
    /// <p>Records[].userIdentity.type</p>
    /// <p>"Service"</p>
    /// </li>
    /// <li>
    /// <p>Records[].userIdentity.principalId</p>
    /// <p>"dynamodb.amazonaws.com"</p>
    /// </li>
    /// </ul>
    pub user_identity: std::option::Option<crate::model::Identity>,
}
impl std::fmt::Debug for Record {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("Record");
        formatter.field("event_id", &self.event_id);
        formatter.field("event_name", &self.event_name);
        formatter.field("event_version", &self.event_version);
        formatter.field("event_source", &self.event_source);
        formatter.field("aws_region", &self.aws_region);
        formatter.field("dynamodb", &self.dynamodb);
        formatter.field("user_identity", &self.user_identity);
        formatter.finish()
    }
}
/// See [`Record`](crate::model::Record)
pub mod record {
    /// A builder for [`Record`](crate::model::Record)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) event_id: std::option::Option<std::string::String>,
        pub(crate) event_name: std::option::Option<crate::model::OperationType>,
        pub(crate) event_version: std::option::Option<std::string::String>,
        pub(crate) event_source: std::option::Option<std::string::String>,
        pub(crate) aws_region: std::option::Option<std::string::String>,
        pub(crate) dynamodb: std::option::Option<crate::model::StreamRecord>,
        pub(crate) user_identity: std::option::Option<crate::model::Identity>,
    }
    impl Builder {
        /// <p>A globally unique identifier for the event that was recorded in this stream record.</p>
        pub fn event_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.event_id = Some(input.into());
            self
        }
        /// <p>A globally unique identifier for the event that was recorded in this stream record.</p>
        pub fn set_event_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.event_id = input;
            self
        }
        /// <p>The type of data modification that was performed on the DynamoDB table:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>INSERT</code> - a new item was added to the table.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>MODIFY</code> - one or more of an existing item's attributes were modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>REMOVE</code> - the item was deleted from the table</p>
        /// </li>
        /// </ul>
        pub fn event_name(mut self, input: crate::model::OperationType) -> Self {
            self.event_name = Some(input);
            self
        }
        /// <p>The type of data modification that was performed on the DynamoDB table:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>INSERT</code> - a new item was added to the table.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>MODIFY</code> - one or more of an existing item's attributes were modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>REMOVE</code> - the item was deleted from the table</p>
        /// </li>
        /// </ul>
        pub fn set_event_name(
            mut self,
            input: std::option::Option<crate::model::OperationType>,
        ) -> Self {
            self.event_name = input;
            self
        }
        /// <p>The version number of the stream record format.  This number is updated whenever the structure of <code>Record</code> is modified.</p>
        /// <p>Client applications must not assume that <code>eventVersion</code> will remain at a particular
        /// value, as this number is subject to change at any time. In general, <code>eventVersion</code> will
        /// only increase as the low-level DynamoDB Streams API evolves.</p>
        pub fn event_version(mut self, input: impl Into<std::string::String>) -> Self {
            self.event_version = Some(input.into());
            self
        }
        /// <p>The version number of the stream record format.  This number is updated whenever the structure of <code>Record</code> is modified.</p>
        /// <p>Client applications must not assume that <code>eventVersion</code> will remain at a particular
        /// value, as this number is subject to change at any time. In general, <code>eventVersion</code> will
        /// only increase as the low-level DynamoDB Streams API evolves.</p>
        pub fn set_event_version(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.event_version = input;
            self
        }
        /// <p>The AWS service from which the stream record originated.  For DynamoDB Streams, this is <code>aws:dynamodb</code>.</p>
        pub fn event_source(mut self, input: impl Into<std::string::String>) -> Self {
            self.event_source = Some(input.into());
            self
        }
        /// <p>The AWS service from which the stream record originated.  For DynamoDB Streams, this is <code>aws:dynamodb</code>.</p>
        pub fn set_event_source(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.event_source = input;
            self
        }
        /// <p>The region in which the <code>GetRecords</code> request was received.</p>
        pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
            self.aws_region = Some(input.into());
            self
        }
        /// <p>The region in which the <code>GetRecords</code> request was received.</p>
        pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.aws_region = input;
            self
        }
        /// <p>The main body of the stream record, containing all of the DynamoDB-specific fields.</p>
        pub fn dynamodb(mut self, input: crate::model::StreamRecord) -> Self {
            self.dynamodb = Some(input);
            self
        }
        /// <p>The main body of the stream record, containing all of the DynamoDB-specific fields.</p>
        pub fn set_dynamodb(
            mut self,
            input: std::option::Option<crate::model::StreamRecord>,
        ) -> Self {
            self.dynamodb = input;
            self
        }
        /// <p>Items that are deleted by the Time to Live process after expiration have the following fields: </p>
        /// <ul>
        /// <li>
        /// <p>Records[].userIdentity.type</p>
        /// <p>"Service"</p>
        /// </li>
        /// <li>
        /// <p>Records[].userIdentity.principalId</p>
        /// <p>"dynamodb.amazonaws.com"</p>
        /// </li>
        /// </ul>
        pub fn user_identity(mut self, input: crate::model::Identity) -> Self {
            self.user_identity = Some(input);
            self
        }
        /// <p>Items that are deleted by the Time to Live process after expiration have the following fields: </p>
        /// <ul>
        /// <li>
        /// <p>Records[].userIdentity.type</p>
        /// <p>"Service"</p>
        /// </li>
        /// <li>
        /// <p>Records[].userIdentity.principalId</p>
        /// <p>"dynamodb.amazonaws.com"</p>
        /// </li>
        /// </ul>
        pub fn set_user_identity(
            mut self,
            input: std::option::Option<crate::model::Identity>,
        ) -> Self {
            self.user_identity = input;
            self
        }
        /// Consumes the builder and constructs a [`Record`](crate::model::Record)
        pub fn build(self) -> crate::model::Record {
            crate::model::Record {
                event_id: self.event_id,
                event_name: self.event_name,
                event_version: self.event_version,
                event_source: self.event_source,
                aws_region: self.aws_region,
                dynamodb: self.dynamodb,
                user_identity: self.user_identity,
            }
        }
    }
}
impl Record {
    /// Creates a new builder-style object to manufacture [`Record`](crate::model::Record)
    pub fn builder() -> crate::model::record::Builder {
        crate::model::record::Builder::default()
    }
}

/// <p>Contains details about the type of identity that made the request.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Identity {
    /// <p>A unique identifier for the entity that made the call. For Time To Live, the
    /// principalId is "dynamodb.amazonaws.com".</p>
    pub principal_id: std::option::Option<std::string::String>,
    /// <p>The type of the identity. For Time To Live, the type is "Service".</p>
    pub r#type: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for Identity {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("Identity");
        formatter.field("principal_id", &self.principal_id);
        formatter.field("r#type", &self.r#type);
        formatter.finish()
    }
}
/// See [`Identity`](crate::model::Identity)
pub mod identity {
    /// A builder for [`Identity`](crate::model::Identity)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) principal_id: std::option::Option<std::string::String>,
        pub(crate) r#type: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>A unique identifier for the entity that made the call. For Time To Live, the
        /// principalId is "dynamodb.amazonaws.com".</p>
        pub fn principal_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.principal_id = Some(input.into());
            self
        }
        /// <p>A unique identifier for the entity that made the call. For Time To Live, the
        /// principalId is "dynamodb.amazonaws.com".</p>
        pub fn set_principal_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.principal_id = input;
            self
        }
        /// <p>The type of the identity. For Time To Live, the type is "Service".</p>
        pub fn r#type(mut self, input: impl Into<std::string::String>) -> Self {
            self.r#type = Some(input.into());
            self
        }
        /// <p>The type of the identity. For Time To Live, the type is "Service".</p>
        pub fn set_type(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.r#type = input;
            self
        }
        /// Consumes the builder and constructs a [`Identity`](crate::model::Identity)
        pub fn build(self) -> crate::model::Identity {
            crate::model::Identity {
                principal_id: self.principal_id,
                r#type: self.r#type,
            }
        }
    }
}
impl Identity {
    /// Creates a new builder-style object to manufacture [`Identity`](crate::model::Identity)
    pub fn builder() -> crate::model::identity::Builder {
        crate::model::identity::Builder::default()
    }
}

/// <p>A description of a single data modification that was performed on an item in a DynamoDB table.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct StreamRecord {
    /// <p>The approximate date and time when the stream record was created, in <a href="http://www.epochconverter.com/">UNIX epoch time</a> format.</p>
    pub approximate_creation_date_time: std::option::Option<aws_smithy_types::Instant>,
    /// <p>The primary key attribute(s) for the DynamoDB item that was modified.</p>
    pub keys: std::option::Option<
        std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
    >,
    /// <p>The item in the DynamoDB table as it appeared after it was modified.</p>
    pub new_image: std::option::Option<
        std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
    >,
    /// <p>The item in the DynamoDB table as it appeared before it was modified.</p>
    pub old_image: std::option::Option<
        std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
    >,
    /// <p>The sequence number of the stream record.</p>
    pub sequence_number: std::option::Option<std::string::String>,
    /// <p>The size of the stream record, in bytes.</p>
    pub size_bytes: std::option::Option<i64>,
    /// <p>The type of data from the modified DynamoDB item that was captured in this stream record:</p>
    /// <ul>
    /// <li>
    /// <p>
    /// <code>KEYS_ONLY</code> - only the key attributes of the modified item.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>NEW_IMAGE</code> - the entire item, as it appeared after it was modified.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>OLD_IMAGE</code> - the entire item, as it appeared before it was modified.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>NEW_AND_OLD_IMAGES</code> - both the new and the old item images of the item.</p>
    /// </li>
    /// </ul>
    pub stream_view_type: std::option::Option<crate::model::StreamViewType>,
}
impl std::fmt::Debug for StreamRecord {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("StreamRecord");
        formatter.field(
            "approximate_creation_date_time",
            &self.approximate_creation_date_time,
        );
        formatter.field("keys", &self.keys);
        formatter.field("new_image", &self.new_image);
        formatter.field("old_image", &self.old_image);
        formatter.field("sequence_number", &self.sequence_number);
        formatter.field("size_bytes", &self.size_bytes);
        formatter.field("stream_view_type", &self.stream_view_type);
        formatter.finish()
    }
}
/// See [`StreamRecord`](crate::model::StreamRecord)
pub mod stream_record {
    /// A builder for [`StreamRecord`](crate::model::StreamRecord)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) approximate_creation_date_time: std::option::Option<aws_smithy_types::Instant>,
        pub(crate) keys: std::option::Option<
            std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
        >,
        pub(crate) new_image: std::option::Option<
            std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
        >,
        pub(crate) old_image: std::option::Option<
            std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
        >,
        pub(crate) sequence_number: std::option::Option<std::string::String>,
        pub(crate) size_bytes: std::option::Option<i64>,
        pub(crate) stream_view_type: std::option::Option<crate::model::StreamViewType>,
    }
    impl Builder {
        /// <p>The approximate date and time when the stream record was created, in <a href="http://www.epochconverter.com/">UNIX epoch time</a> format.</p>
        pub fn approximate_creation_date_time(mut self, input: aws_smithy_types::Instant) -> Self {
            self.approximate_creation_date_time = Some(input);
            self
        }
        /// <p>The approximate date and time when the stream record was created, in <a href="http://www.epochconverter.com/">UNIX epoch time</a> format.</p>
        pub fn set_approximate_creation_date_time(
            mut self,
            input: std::option::Option<aws_smithy_types::Instant>,
        ) -> Self {
            self.approximate_creation_date_time = input;
            self
        }
        /// Adds a key-value pair to `keys`.
        ///
        /// To override the contents of this collection use [`set_keys`](Self::set_keys).
        ///
        /// <p>The primary key attribute(s) for the DynamoDB item that was modified.</p>
        pub fn keys(
            mut self,
            k: impl Into<std::string::String>,
            v: impl Into<crate::model::AttributeValue>,
        ) -> Self {
            let mut hash_map = self.keys.unwrap_or_default();
            hash_map.insert(k.into(), v.into());
            self.keys = Some(hash_map);
            self
        }
        /// <p>The primary key attribute(s) for the DynamoDB item that was modified.</p>
        pub fn set_keys(
            mut self,
            input: std::option::Option<
                std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
            >,
        ) -> Self {
            self.keys = input;
            self
        }
        /// Adds a key-value pair to `new_image`.
        ///
        /// To override the contents of this collection use [`set_new_image`](Self::set_new_image).
        ///
        /// <p>The item in the DynamoDB table as it appeared after it was modified.</p>
        pub fn new_image(
            mut self,
            k: impl Into<std::string::String>,
            v: impl Into<crate::model::AttributeValue>,
        ) -> Self {
            let mut hash_map = self.new_image.unwrap_or_default();
            hash_map.insert(k.into(), v.into());
            self.new_image = Some(hash_map);
            self
        }
        /// <p>The item in the DynamoDB table as it appeared after it was modified.</p>
        pub fn set_new_image(
            mut self,
            input: std::option::Option<
                std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
            >,
        ) -> Self {
            self.new_image = input;
            self
        }
        /// Adds a key-value pair to `old_image`.
        ///
        /// To override the contents of this collection use [`set_old_image`](Self::set_old_image).
        ///
        /// <p>The item in the DynamoDB table as it appeared before it was modified.</p>
        pub fn old_image(
            mut self,
            k: impl Into<std::string::String>,
            v: impl Into<crate::model::AttributeValue>,
        ) -> Self {
            let mut hash_map = self.old_image.unwrap_or_default();
            hash_map.insert(k.into(), v.into());
            self.old_image = Some(hash_map);
            self
        }
        /// <p>The item in the DynamoDB table as it appeared before it was modified.</p>
        pub fn set_old_image(
            mut self,
            input: std::option::Option<
                std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
            >,
        ) -> Self {
            self.old_image = input;
            self
        }
        /// <p>The sequence number of the stream record.</p>
        pub fn sequence_number(mut self, input: impl Into<std::string::String>) -> Self {
            self.sequence_number = Some(input.into());
            self
        }
        /// <p>The sequence number of the stream record.</p>
        pub fn set_sequence_number(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.sequence_number = input;
            self
        }
        /// <p>The size of the stream record, in bytes.</p>
        pub fn size_bytes(mut self, input: i64) -> Self {
            self.size_bytes = Some(input);
            self
        }
        /// <p>The size of the stream record, in bytes.</p>
        pub fn set_size_bytes(mut self, input: std::option::Option<i64>) -> Self {
            self.size_bytes = input;
            self
        }
        /// <p>The type of data from the modified DynamoDB item that was captured in this stream record:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>KEYS_ONLY</code> - only the key attributes of the modified item.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>NEW_IMAGE</code> - the entire item, as it appeared after it was modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>OLD_IMAGE</code> - the entire item, as it appeared before it was modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>NEW_AND_OLD_IMAGES</code> - both the new and the old item images of the item.</p>
        /// </li>
        /// </ul>
        pub fn stream_view_type(mut self, input: crate::model::StreamViewType) -> Self {
            self.stream_view_type = Some(input);
            self
        }
        /// <p>The type of data from the modified DynamoDB item that was captured in this stream record:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>KEYS_ONLY</code> - only the key attributes of the modified item.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>NEW_IMAGE</code> - the entire item, as it appeared after it was modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>OLD_IMAGE</code> - the entire item, as it appeared before it was modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>NEW_AND_OLD_IMAGES</code> - both the new and the old item images of the item.</p>
        /// </li>
        /// </ul>
        pub fn set_stream_view_type(
            mut self,
            input: std::option::Option<crate::model::StreamViewType>,
        ) -> Self {
            self.stream_view_type = input;
            self
        }
        /// Consumes the builder and constructs a [`StreamRecord`](crate::model::StreamRecord)
        pub fn build(self) -> crate::model::StreamRecord {
            crate::model::StreamRecord {
                approximate_creation_date_time: self.approximate_creation_date_time,
                keys: self.keys,
                new_image: self.new_image,
                old_image: self.old_image,
                sequence_number: self.sequence_number,
                size_bytes: self.size_bytes,
                stream_view_type: self.stream_view_type,
            }
        }
    }
}
impl StreamRecord {
    /// Creates a new builder-style object to manufacture [`StreamRecord`](crate::model::StreamRecord)
    pub fn builder() -> crate::model::stream_record::Builder {
        crate::model::stream_record::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum StreamViewType {
    #[allow(missing_docs)] // documentation missing in model
    KeysOnly,
    #[allow(missing_docs)] // documentation missing in model
    NewAndOldImages,
    #[allow(missing_docs)] // documentation missing in model
    NewImage,
    #[allow(missing_docs)] // documentation missing in model
    OldImage,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for StreamViewType {
    fn from(s: &str) -> Self {
        match s {
            "KEYS_ONLY" => StreamViewType::KeysOnly,
            "NEW_AND_OLD_IMAGES" => StreamViewType::NewAndOldImages,
            "NEW_IMAGE" => StreamViewType::NewImage,
            "OLD_IMAGE" => StreamViewType::OldImage,
            other => StreamViewType::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for StreamViewType {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(StreamViewType::from(s))
    }
}
impl StreamViewType {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            StreamViewType::KeysOnly => "KEYS_ONLY",
            StreamViewType::NewAndOldImages => "NEW_AND_OLD_IMAGES",
            StreamViewType::NewImage => "NEW_IMAGE",
            StreamViewType::OldImage => "OLD_IMAGE",
            StreamViewType::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["KEYS_ONLY", "NEW_AND_OLD_IMAGES", "NEW_IMAGE", "OLD_IMAGE"]
    }
}
impl AsRef<str> for StreamViewType {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>Represents the data for an attribute.</p>
/// <p>Each attribute value is described as a name-value pair.  The name is the data type, and the value is the data itself.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes">Data Types</a> in the
/// <i>Amazon DynamoDB Developer Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum AttributeValue {
    /// <p>An attribute of type Binary.  For example:</p>
    /// <p>
    /// <code>"B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"</code>
    /// </p>
    B(aws_smithy_types::Blob),
    /// <p>An attribute of type Boolean.  For example:</p>
    /// <p>
    /// <code>"BOOL": true</code>
    /// </p>
    Bool(bool),
    /// <p>An attribute of type Binary Set.  For example:</p>
    /// <p>
    /// <code>"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]</code>
    /// </p>
    Bs(std::vec::Vec<aws_smithy_types::Blob>),
    /// <p>An attribute of type List.  For example:</p>
    /// <p>
    /// <code>"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]</code>
    /// </p>
    L(std::vec::Vec<crate::model::AttributeValue>),
    /// <p>An attribute of type Map.  For example:</p>
    /// <p>
    /// <code>"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}</code>
    /// </p>
    M(std::collections::HashMap<std::string::String, crate::model::AttributeValue>),
    /// <p>An attribute of type Number. For example:</p>
    /// <p>
    /// <code>"N": "123.45"</code>
    /// </p>
    /// <p>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.</p>
    N(std::string::String),
    /// <p>An attribute of type Number Set.  For example:</p>
    /// <p>
    /// <code>"NS": ["42.2", "-19", "7.5", "3.14"]</code>
    /// </p>
    /// <p>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.</p>
    Ns(std::vec::Vec<std::string::String>),
    /// <p>An attribute of type Null.  For example:</p>
    /// <p>
    /// <code>"NULL": true</code>
    /// </p>
    Null(bool),
    /// <p>An attribute of type  String. For example:</p>
    /// <p>
    /// <code>"S": "Hello"</code>
    /// </p>
    S(std::string::String),
    /// <p>An attribute of type String Set.  For example:</p>
    /// <p>
    /// <code>"SS": ["Giraffe", "Hippo" ,"Zebra"]</code>
    /// </p>
    Ss(std::vec::Vec<std::string::String>),
}
impl AttributeValue {
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_b(&self) -> std::result::Result<&aws_smithy_types::Blob, &Self> {
        if let AttributeValue::B(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_b(&self) -> bool {
        self.as_b().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_bool(&self) -> std::result::Result<&bool, &Self> {
        if let AttributeValue::Bool(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_bool(&self) -> bool {
        self.as_bool().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_bs(&self) -> std::result::Result<&std::vec::Vec<aws_smithy_types::Blob>, &Self> {
        if let AttributeValue::Bs(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_bs(&self) -> bool {
        self.as_bs().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_l(&self) -> std::result::Result<&std::vec::Vec<crate::model::AttributeValue>, &Self> {
        if let AttributeValue::L(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_l(&self) -> bool {
        self.as_l().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_m(
        &self,
    ) -> std::result::Result<
        &std::collections::HashMap<std::string::String, crate::model::AttributeValue>,
        &Self,
    > {
        if let AttributeValue::M(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_m(&self) -> bool {
        self.as_m().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_n(&self) -> std::result::Result<&std::string::String, &Self> {
        if let AttributeValue::N(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_n(&self) -> bool {
        self.as_n().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_ns(&self) -> std::result::Result<&std::vec::Vec<std::string::String>, &Self> {
        if let AttributeValue::Ns(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_ns(&self) -> bool {
        self.as_ns().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_null(&self) -> std::result::Result<&bool, &Self> {
        if let AttributeValue::Null(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_null(&self) -> bool {
        self.as_null().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_s(&self) -> std::result::Result<&std::string::String, &Self> {
        if let AttributeValue::S(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_s(&self) -> bool {
        self.as_s().is_ok()
    }
    /// Tries to convert the enum instance into its [`AttributeValue`](crate::model::AttributeValue) variant.
    /// Returns `Err(&Self) if it can't be converted.`
    pub fn as_ss(&self) -> std::result::Result<&std::vec::Vec<std::string::String>, &Self> {
        if let AttributeValue::Ss(val) = &self {
            Ok(&val)
        } else {
            Err(&self)
        }
    }
    /// Returns true if the enum instance is the `AttributeValue` variant.
    pub fn is_ss(&self) -> bool {
        self.as_ss().is_ok()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum OperationType {
    #[allow(missing_docs)] // documentation missing in model
    Insert,
    #[allow(missing_docs)] // documentation missing in model
    Modify,
    #[allow(missing_docs)] // documentation missing in model
    Remove,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for OperationType {
    fn from(s: &str) -> Self {
        match s {
            "INSERT" => OperationType::Insert,
            "MODIFY" => OperationType::Modify,
            "REMOVE" => OperationType::Remove,
            other => OperationType::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for OperationType {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(OperationType::from(s))
    }
}
impl OperationType {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            OperationType::Insert => "INSERT",
            OperationType::Modify => "MODIFY",
            OperationType::Remove => "REMOVE",
            OperationType::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["INSERT", "MODIFY", "REMOVE"]
    }
}
impl AsRef<str> for OperationType {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>Represents all of the data describing a particular stream.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct StreamDescription {
    /// <p>The Amazon Resource Name (ARN) for the stream.</p>
    pub stream_arn: std::option::Option<std::string::String>,
    /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
    /// <p>Note that <code>LatestStreamLabel</code> 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:</p>
    /// <ul>
    /// <li>
    /// <p>the AWS customer ID.</p>
    /// </li>
    /// <li>
    /// <p>the table name</p>
    /// </li>
    /// <li>
    /// <p>the <code>StreamLabel</code>
    /// </p>
    /// </li>
    /// </ul>
    pub stream_label: std::option::Option<std::string::String>,
    /// <p>Indicates the current status of the stream:</p>
    /// <ul>
    /// <li>
    /// <p>
    /// <code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>ENABLED</code> - the stream is enabled.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>DISABLED</code> - the stream is disabled.</p>
    /// </li>
    /// </ul>
    pub stream_status: std::option::Option<crate::model::StreamStatus>,
    /// <p>Indicates the format of the records within this stream:</p>
    /// <ul>
    /// <li>
    /// <p>
    /// <code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p>
    /// </li>
    /// </ul>
    pub stream_view_type: std::option::Option<crate::model::StreamViewType>,
    /// <p>The date and time when the request to create this stream was issued.</p>
    pub creation_request_date_time: std::option::Option<aws_smithy_types::Instant>,
    /// <p>The DynamoDB table with which the stream is associated.</p>
    pub table_name: std::option::Option<std::string::String>,
    /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
    pub key_schema: std::option::Option<std::vec::Vec<crate::model::KeySchemaElement>>,
    /// <p>The shards that comprise the stream.</p>
    pub shards: std::option::Option<std::vec::Vec<crate::model::Shard>>,
    /// <p>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.</p>
    /// <p>If <code>LastEvaluatedShardId</code> is empty, then the "last page" of results has been
    /// processed and there is currently no more data to be retrieved.</p>
    /// <p>If <code>LastEvaluatedShardId</code> 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 <code>LastEvaluatedShardId</code> is empty.</p>
    pub last_evaluated_shard_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for StreamDescription {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("StreamDescription");
        formatter.field("stream_arn", &self.stream_arn);
        formatter.field("stream_label", &self.stream_label);
        formatter.field("stream_status", &self.stream_status);
        formatter.field("stream_view_type", &self.stream_view_type);
        formatter.field(
            "creation_request_date_time",
            &self.creation_request_date_time,
        );
        formatter.field("table_name", &self.table_name);
        formatter.field("key_schema", &self.key_schema);
        formatter.field("shards", &self.shards);
        formatter.field("last_evaluated_shard_id", &self.last_evaluated_shard_id);
        formatter.finish()
    }
}
/// See [`StreamDescription`](crate::model::StreamDescription)
pub mod stream_description {
    /// A builder for [`StreamDescription`](crate::model::StreamDescription)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) stream_arn: std::option::Option<std::string::String>,
        pub(crate) stream_label: std::option::Option<std::string::String>,
        pub(crate) stream_status: std::option::Option<crate::model::StreamStatus>,
        pub(crate) stream_view_type: std::option::Option<crate::model::StreamViewType>,
        pub(crate) creation_request_date_time: std::option::Option<aws_smithy_types::Instant>,
        pub(crate) table_name: std::option::Option<std::string::String>,
        pub(crate) key_schema: std::option::Option<std::vec::Vec<crate::model::KeySchemaElement>>,
        pub(crate) shards: std::option::Option<std::vec::Vec<crate::model::Shard>>,
        pub(crate) last_evaluated_shard_id: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>The Amazon Resource Name (ARN) for the stream.</p>
        pub fn stream_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.stream_arn = Some(input.into());
            self
        }
        /// <p>The Amazon Resource Name (ARN) for the stream.</p>
        pub fn set_stream_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.stream_arn = input;
            self
        }
        /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
        /// <p>Note that <code>LatestStreamLabel</code> 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:</p>
        /// <ul>
        /// <li>
        /// <p>the AWS customer ID.</p>
        /// </li>
        /// <li>
        /// <p>the table name</p>
        /// </li>
        /// <li>
        /// <p>the <code>StreamLabel</code>
        /// </p>
        /// </li>
        /// </ul>
        pub fn stream_label(mut self, input: impl Into<std::string::String>) -> Self {
            self.stream_label = Some(input.into());
            self
        }
        /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
        /// <p>Note that <code>LatestStreamLabel</code> 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:</p>
        /// <ul>
        /// <li>
        /// <p>the AWS customer ID.</p>
        /// </li>
        /// <li>
        /// <p>the table name</p>
        /// </li>
        /// <li>
        /// <p>the <code>StreamLabel</code>
        /// </p>
        /// </li>
        /// </ul>
        pub fn set_stream_label(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.stream_label = input;
            self
        }
        /// <p>Indicates the current status of the stream:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>ENABLED</code> - the stream is enabled.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>DISABLED</code> - the stream is disabled.</p>
        /// </li>
        /// </ul>
        pub fn stream_status(mut self, input: crate::model::StreamStatus) -> Self {
            self.stream_status = Some(input);
            self
        }
        /// <p>Indicates the current status of the stream:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>ENABLED</code> - the stream is enabled.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>DISABLED</code> - the stream is disabled.</p>
        /// </li>
        /// </ul>
        pub fn set_stream_status(
            mut self,
            input: std::option::Option<crate::model::StreamStatus>,
        ) -> Self {
            self.stream_status = input;
            self
        }
        /// <p>Indicates the format of the records within this stream:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p>
        /// </li>
        /// </ul>
        pub fn stream_view_type(mut self, input: crate::model::StreamViewType) -> Self {
            self.stream_view_type = Some(input);
            self
        }
        /// <p>Indicates the format of the records within this stream:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p>
        /// </li>
        /// </ul>
        pub fn set_stream_view_type(
            mut self,
            input: std::option::Option<crate::model::StreamViewType>,
        ) -> Self {
            self.stream_view_type = input;
            self
        }
        /// <p>The date and time when the request to create this stream was issued.</p>
        pub fn creation_request_date_time(mut self, input: aws_smithy_types::Instant) -> Self {
            self.creation_request_date_time = Some(input);
            self
        }
        /// <p>The date and time when the request to create this stream was issued.</p>
        pub fn set_creation_request_date_time(
            mut self,
            input: std::option::Option<aws_smithy_types::Instant>,
        ) -> Self {
            self.creation_request_date_time = input;
            self
        }
        /// <p>The DynamoDB table with which the stream is associated.</p>
        pub fn table_name(mut self, input: impl Into<std::string::String>) -> Self {
            self.table_name = Some(input.into());
            self
        }
        /// <p>The DynamoDB table with which the stream is associated.</p>
        pub fn set_table_name(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.table_name = input;
            self
        }
        /// Appends an item to `key_schema`.
        ///
        /// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
        ///
        /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
        pub fn key_schema(mut self, input: impl Into<crate::model::KeySchemaElement>) -> Self {
            let mut v = self.key_schema.unwrap_or_default();
            v.push(input.into());
            self.key_schema = Some(v);
            self
        }
        /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
        pub fn set_key_schema(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::KeySchemaElement>>,
        ) -> Self {
            self.key_schema = input;
            self
        }
        /// Appends an item to `shards`.
        ///
        /// To override the contents of this collection use [`set_shards`](Self::set_shards).
        ///
        /// <p>The shards that comprise the stream.</p>
        pub fn shards(mut self, input: impl Into<crate::model::Shard>) -> Self {
            let mut v = self.shards.unwrap_or_default();
            v.push(input.into());
            self.shards = Some(v);
            self
        }
        /// <p>The shards that comprise the stream.</p>
        pub fn set_shards(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Shard>>,
        ) -> Self {
            self.shards = input;
            self
        }
        /// <p>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.</p>
        /// <p>If <code>LastEvaluatedShardId</code> is empty, then the "last page" of results has been
        /// processed and there is currently no more data to be retrieved.</p>
        /// <p>If <code>LastEvaluatedShardId</code> 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 <code>LastEvaluatedShardId</code> is empty.</p>
        pub fn last_evaluated_shard_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.last_evaluated_shard_id = Some(input.into());
            self
        }
        /// <p>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.</p>
        /// <p>If <code>LastEvaluatedShardId</code> is empty, then the "last page" of results has been
        /// processed and there is currently no more data to be retrieved.</p>
        /// <p>If <code>LastEvaluatedShardId</code> 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 <code>LastEvaluatedShardId</code> is empty.</p>
        pub fn set_last_evaluated_shard_id(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.last_evaluated_shard_id = input;
            self
        }
        /// Consumes the builder and constructs a [`StreamDescription`](crate::model::StreamDescription)
        pub fn build(self) -> crate::model::StreamDescription {
            crate::model::StreamDescription {
                stream_arn: self.stream_arn,
                stream_label: self.stream_label,
                stream_status: self.stream_status,
                stream_view_type: self.stream_view_type,
                creation_request_date_time: self.creation_request_date_time,
                table_name: self.table_name,
                key_schema: self.key_schema,
                shards: self.shards,
                last_evaluated_shard_id: self.last_evaluated_shard_id,
            }
        }
    }
}
impl StreamDescription {
    /// Creates a new builder-style object to manufacture [`StreamDescription`](crate::model::StreamDescription)
    pub fn builder() -> crate::model::stream_description::Builder {
        crate::model::stream_description::Builder::default()
    }
}

/// <p>A uniquely identified group of stream records within a stream.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Shard {
    /// <p>The system-generated identifier for this shard.</p>
    pub shard_id: std::option::Option<std::string::String>,
    /// <p>The range of possible sequence numbers for the shard.</p>
    pub sequence_number_range: std::option::Option<crate::model::SequenceNumberRange>,
    /// <p>The shard ID of the current shard's parent.</p>
    pub parent_shard_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for Shard {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("Shard");
        formatter.field("shard_id", &self.shard_id);
        formatter.field("sequence_number_range", &self.sequence_number_range);
        formatter.field("parent_shard_id", &self.parent_shard_id);
        formatter.finish()
    }
}
/// See [`Shard`](crate::model::Shard)
pub mod shard {
    /// A builder for [`Shard`](crate::model::Shard)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) shard_id: std::option::Option<std::string::String>,
        pub(crate) sequence_number_range: std::option::Option<crate::model::SequenceNumberRange>,
        pub(crate) parent_shard_id: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>The system-generated identifier for this shard.</p>
        pub fn shard_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.shard_id = Some(input.into());
            self
        }
        /// <p>The system-generated identifier for this shard.</p>
        pub fn set_shard_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.shard_id = input;
            self
        }
        /// <p>The range of possible sequence numbers for the shard.</p>
        pub fn sequence_number_range(mut self, input: crate::model::SequenceNumberRange) -> Self {
            self.sequence_number_range = Some(input);
            self
        }
        /// <p>The range of possible sequence numbers for the shard.</p>
        pub fn set_sequence_number_range(
            mut self,
            input: std::option::Option<crate::model::SequenceNumberRange>,
        ) -> Self {
            self.sequence_number_range = input;
            self
        }
        /// <p>The shard ID of the current shard's parent.</p>
        pub fn parent_shard_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.parent_shard_id = Some(input.into());
            self
        }
        /// <p>The shard ID of the current shard's parent.</p>
        pub fn set_parent_shard_id(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.parent_shard_id = input;
            self
        }
        /// Consumes the builder and constructs a [`Shard`](crate::model::Shard)
        pub fn build(self) -> crate::model::Shard {
            crate::model::Shard {
                shard_id: self.shard_id,
                sequence_number_range: self.sequence_number_range,
                parent_shard_id: self.parent_shard_id,
            }
        }
    }
}
impl Shard {
    /// Creates a new builder-style object to manufacture [`Shard`](crate::model::Shard)
    pub fn builder() -> crate::model::shard::Builder {
        crate::model::shard::Builder::default()
    }
}

/// <p>The beginning and ending sequence numbers for the stream records contained within a shard.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SequenceNumberRange {
    /// <p>The first sequence number for the stream records contained within a shard. String contains numeric characters only.</p>
    pub starting_sequence_number: std::option::Option<std::string::String>,
    /// <p>The last sequence number for the stream records contained within a shard. String contains numeric characters only.</p>
    pub ending_sequence_number: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for SequenceNumberRange {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("SequenceNumberRange");
        formatter.field("starting_sequence_number", &self.starting_sequence_number);
        formatter.field("ending_sequence_number", &self.ending_sequence_number);
        formatter.finish()
    }
}
/// See [`SequenceNumberRange`](crate::model::SequenceNumberRange)
pub mod sequence_number_range {
    /// A builder for [`SequenceNumberRange`](crate::model::SequenceNumberRange)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) starting_sequence_number: std::option::Option<std::string::String>,
        pub(crate) ending_sequence_number: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>The first sequence number for the stream records contained within a shard. String contains numeric characters only.</p>
        pub fn starting_sequence_number(mut self, input: impl Into<std::string::String>) -> Self {
            self.starting_sequence_number = Some(input.into());
            self
        }
        /// <p>The first sequence number for the stream records contained within a shard. String contains numeric characters only.</p>
        pub fn set_starting_sequence_number(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.starting_sequence_number = input;
            self
        }
        /// <p>The last sequence number for the stream records contained within a shard. String contains numeric characters only.</p>
        pub fn ending_sequence_number(mut self, input: impl Into<std::string::String>) -> Self {
            self.ending_sequence_number = Some(input.into());
            self
        }
        /// <p>The last sequence number for the stream records contained within a shard. String contains numeric characters only.</p>
        pub fn set_ending_sequence_number(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.ending_sequence_number = input;
            self
        }
        /// Consumes the builder and constructs a [`SequenceNumberRange`](crate::model::SequenceNumberRange)
        pub fn build(self) -> crate::model::SequenceNumberRange {
            crate::model::SequenceNumberRange {
                starting_sequence_number: self.starting_sequence_number,
                ending_sequence_number: self.ending_sequence_number,
            }
        }
    }
}
impl SequenceNumberRange {
    /// Creates a new builder-style object to manufacture [`SequenceNumberRange`](crate::model::SequenceNumberRange)
    pub fn builder() -> crate::model::sequence_number_range::Builder {
        crate::model::sequence_number_range::Builder::default()
    }
}

/// <p>Represents <i>a single element</i> 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.</p>
/// <p>A <code>KeySchemaElement</code> represents exactly one attribute of the primary key. For
/// example, a simple primary key would be represented by one <code>KeySchemaElement</code>
/// (for the partition key). A composite primary key would require one
/// <code>KeySchemaElement</code> for the partition key, and another
/// <code>KeySchemaElement</code> for the sort key.</p>
/// <p>A <code>KeySchemaElement</code> 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.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct KeySchemaElement {
    /// <p>The name of a key attribute.</p>
    pub attribute_name: std::option::Option<std::string::String>,
    /// <p>The role that this key attribute will assume:</p>
    /// <ul>
    /// <li>
    /// <p>
    /// <code>HASH</code> - partition key</p>
    /// </li>
    /// <li>
    /// <p>
    /// <code>RANGE</code> - sort key</p>
    /// </li>
    /// </ul>
    /// <note>
    /// <p>The partition key of an item is also known as its <i>hash
    /// attribute</i>. 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.</p>
    /// <p>The sort key of an item is also known as its <i>range
    /// attribute</i>. 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.</p>
    /// </note>
    pub key_type: std::option::Option<crate::model::KeyType>,
}
impl std::fmt::Debug for KeySchemaElement {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("KeySchemaElement");
        formatter.field("attribute_name", &self.attribute_name);
        formatter.field("key_type", &self.key_type);
        formatter.finish()
    }
}
/// See [`KeySchemaElement`](crate::model::KeySchemaElement)
pub mod key_schema_element {
    /// A builder for [`KeySchemaElement`](crate::model::KeySchemaElement)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) attribute_name: std::option::Option<std::string::String>,
        pub(crate) key_type: std::option::Option<crate::model::KeyType>,
    }
    impl Builder {
        /// <p>The name of a key attribute.</p>
        pub fn attribute_name(mut self, input: impl Into<std::string::String>) -> Self {
            self.attribute_name = Some(input.into());
            self
        }
        /// <p>The name of a key attribute.</p>
        pub fn set_attribute_name(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.attribute_name = input;
            self
        }
        /// <p>The role that this key attribute will assume:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>HASH</code> - partition key</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>RANGE</code> - sort key</p>
        /// </li>
        /// </ul>
        /// <note>
        /// <p>The partition key of an item is also known as its <i>hash
        /// attribute</i>. 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.</p>
        /// <p>The sort key of an item is also known as its <i>range
        /// attribute</i>. 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.</p>
        /// </note>
        pub fn key_type(mut self, input: crate::model::KeyType) -> Self {
            self.key_type = Some(input);
            self
        }
        /// <p>The role that this key attribute will assume:</p>
        /// <ul>
        /// <li>
        /// <p>
        /// <code>HASH</code> - partition key</p>
        /// </li>
        /// <li>
        /// <p>
        /// <code>RANGE</code> - sort key</p>
        /// </li>
        /// </ul>
        /// <note>
        /// <p>The partition key of an item is also known as its <i>hash
        /// attribute</i>. 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.</p>
        /// <p>The sort key of an item is also known as its <i>range
        /// attribute</i>. 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.</p>
        /// </note>
        pub fn set_key_type(mut self, input: std::option::Option<crate::model::KeyType>) -> Self {
            self.key_type = input;
            self
        }
        /// Consumes the builder and constructs a [`KeySchemaElement`](crate::model::KeySchemaElement)
        pub fn build(self) -> crate::model::KeySchemaElement {
            crate::model::KeySchemaElement {
                attribute_name: self.attribute_name,
                key_type: self.key_type,
            }
        }
    }
}
impl KeySchemaElement {
    /// Creates a new builder-style object to manufacture [`KeySchemaElement`](crate::model::KeySchemaElement)
    pub fn builder() -> crate::model::key_schema_element::Builder {
        crate::model::key_schema_element::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum KeyType {
    #[allow(missing_docs)] // documentation missing in model
    Hash,
    #[allow(missing_docs)] // documentation missing in model
    Range,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for KeyType {
    fn from(s: &str) -> Self {
        match s {
            "HASH" => KeyType::Hash,
            "RANGE" => KeyType::Range,
            other => KeyType::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for KeyType {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(KeyType::from(s))
    }
}
impl KeyType {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            KeyType::Hash => "HASH",
            KeyType::Range => "RANGE",
            KeyType::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["HASH", "RANGE"]
    }
}
impl AsRef<str> for KeyType {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum StreamStatus {
    #[allow(missing_docs)] // documentation missing in model
    Disabled,
    #[allow(missing_docs)] // documentation missing in model
    Disabling,
    #[allow(missing_docs)] // documentation missing in model
    Enabled,
    #[allow(missing_docs)] // documentation missing in model
    Enabling,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for StreamStatus {
    fn from(s: &str) -> Self {
        match s {
            "DISABLED" => StreamStatus::Disabled,
            "DISABLING" => StreamStatus::Disabling,
            "ENABLED" => StreamStatus::Enabled,
            "ENABLING" => StreamStatus::Enabling,
            other => StreamStatus::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for StreamStatus {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(StreamStatus::from(s))
    }
}
impl StreamStatus {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            StreamStatus::Disabled => "DISABLED",
            StreamStatus::Disabling => "DISABLING",
            StreamStatus::Enabled => "ENABLED",
            StreamStatus::Enabling => "ENABLING",
            StreamStatus::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["DISABLED", "DISABLING", "ENABLED", "ENABLING"]
    }
}
impl AsRef<str> for StreamStatus {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}