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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Enable custom Time to Live (TTL) settings for rows and columns without setting a TTL default for the specified table.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/TTL-how-it-works.html#ttl-howitworks_enabling">Enabling TTL on tables</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TimeToLive {
/// <p>Shows how to enable custom Time to Live (TTL) settings for the specified table.</p>
#[doc(hidden)]
pub status: std::option::Option<crate::model::TimeToLiveStatus>,
}
impl TimeToLive {
/// <p>Shows how to enable custom Time to Live (TTL) settings for the specified table.</p>
pub fn status(&self) -> std::option::Option<&crate::model::TimeToLiveStatus> {
self.status.as_ref()
}
}
/// See [`TimeToLive`](crate::model::TimeToLive).
pub mod time_to_live {
/// A builder for [`TimeToLive`](crate::model::TimeToLive).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) status: std::option::Option<crate::model::TimeToLiveStatus>,
}
impl Builder {
/// <p>Shows how to enable custom Time to Live (TTL) settings for the specified table.</p>
pub fn status(mut self, input: crate::model::TimeToLiveStatus) -> Self {
self.status = Some(input);
self
}
/// <p>Shows how to enable custom Time to Live (TTL) settings for the specified table.</p>
pub fn set_status(
mut self,
input: std::option::Option<crate::model::TimeToLiveStatus>,
) -> Self {
self.status = input;
self
}
/// Consumes the builder and constructs a [`TimeToLive`](crate::model::TimeToLive).
pub fn build(self) -> crate::model::TimeToLive {
crate::model::TimeToLive {
status: self.status,
}
}
}
}
impl TimeToLive {
/// Creates a new builder-style object to manufacture [`TimeToLive`](crate::model::TimeToLive).
pub fn builder() -> crate::model::time_to_live::Builder {
crate::model::time_to_live::Builder::default()
}
}
/// When writing a match expression against `TimeToLiveStatus`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let timetolivestatus = unimplemented!();
/// match timetolivestatus {
/// TimeToLiveStatus::Enabled => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `timetolivestatus` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `TimeToLiveStatus::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `TimeToLiveStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `TimeToLiveStatus::NewFeature` is defined.
/// Specifically, when `timetolivestatus` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `TimeToLiveStatus::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[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 TimeToLiveStatus {
#[allow(missing_docs)] // documentation missing in model
Enabled,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for TimeToLiveStatus {
fn from(s: &str) -> Self {
match s {
"ENABLED" => TimeToLiveStatus::Enabled,
other => TimeToLiveStatus::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for TimeToLiveStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(TimeToLiveStatus::from(s))
}
}
impl TimeToLiveStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
TimeToLiveStatus::Enabled => "ENABLED",
TimeToLiveStatus::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ENABLED"]
}
}
impl AsRef<str> for TimeToLiveStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Point-in-time recovery (PITR) helps protect your Amazon Keyspaces tables from accidental write or delete operations by providing you continuous backups of your table data.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery.html">Point-in-time recovery</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PointInTimeRecovery {
/// <p>The options are:</p>
/// <p>• <code>ENABLED</code> </p>
/// <p>• <code>DISABLED</code> </p>
#[doc(hidden)]
pub status: std::option::Option<crate::model::PointInTimeRecoveryStatus>,
}
impl PointInTimeRecovery {
/// <p>The options are:</p>
/// <p>• <code>ENABLED</code> </p>
/// <p>• <code>DISABLED</code> </p>
pub fn status(&self) -> std::option::Option<&crate::model::PointInTimeRecoveryStatus> {
self.status.as_ref()
}
}
/// See [`PointInTimeRecovery`](crate::model::PointInTimeRecovery).
pub mod point_in_time_recovery {
/// A builder for [`PointInTimeRecovery`](crate::model::PointInTimeRecovery).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) status: std::option::Option<crate::model::PointInTimeRecoveryStatus>,
}
impl Builder {
/// <p>The options are:</p>
/// <p>• <code>ENABLED</code> </p>
/// <p>• <code>DISABLED</code> </p>
pub fn status(mut self, input: crate::model::PointInTimeRecoveryStatus) -> Self {
self.status = Some(input);
self
}
/// <p>The options are:</p>
/// <p>• <code>ENABLED</code> </p>
/// <p>• <code>DISABLED</code> </p>
pub fn set_status(
mut self,
input: std::option::Option<crate::model::PointInTimeRecoveryStatus>,
) -> Self {
self.status = input;
self
}
/// Consumes the builder and constructs a [`PointInTimeRecovery`](crate::model::PointInTimeRecovery).
pub fn build(self) -> crate::model::PointInTimeRecovery {
crate::model::PointInTimeRecovery {
status: self.status,
}
}
}
}
impl PointInTimeRecovery {
/// Creates a new builder-style object to manufacture [`PointInTimeRecovery`](crate::model::PointInTimeRecovery).
pub fn builder() -> crate::model::point_in_time_recovery::Builder {
crate::model::point_in_time_recovery::Builder::default()
}
}
/// When writing a match expression against `PointInTimeRecoveryStatus`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let pointintimerecoverystatus = unimplemented!();
/// match pointintimerecoverystatus {
/// PointInTimeRecoveryStatus::Disabled => { /* ... */ },
/// PointInTimeRecoveryStatus::Enabled => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `pointintimerecoverystatus` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `PointInTimeRecoveryStatus::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `PointInTimeRecoveryStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `PointInTimeRecoveryStatus::NewFeature` is defined.
/// Specifically, when `pointintimerecoverystatus` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `PointInTimeRecoveryStatus::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[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 PointInTimeRecoveryStatus {
#[allow(missing_docs)] // documentation missing in model
Disabled,
#[allow(missing_docs)] // documentation missing in model
Enabled,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for PointInTimeRecoveryStatus {
fn from(s: &str) -> Self {
match s {
"DISABLED" => PointInTimeRecoveryStatus::Disabled,
"ENABLED" => PointInTimeRecoveryStatus::Enabled,
other => PointInTimeRecoveryStatus::Unknown(crate::types::UnknownVariantValue(
other.to_owned(),
)),
}
}
}
impl std::str::FromStr for PointInTimeRecoveryStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(PointInTimeRecoveryStatus::from(s))
}
}
impl PointInTimeRecoveryStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
PointInTimeRecoveryStatus::Disabled => "DISABLED",
PointInTimeRecoveryStatus::Enabled => "ENABLED",
PointInTimeRecoveryStatus::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["DISABLED", "ENABLED"]
}
}
impl AsRef<str> for PointInTimeRecoveryStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Amazon Keyspaces encrypts and decrypts the table data at rest transparently and integrates with Key Management Service for storing and managing the encryption key. You can choose one of the following KMS keys (KMS keys):</p>
/// <p>• Amazon Web Services owned key - This is the default encryption type. The key is owned by Amazon Keyspaces (no additional charge). </p>
/// <p>• Customer managed key - This key is stored in your account and is created, owned, and managed by you. You have full control over the customer managed key (KMS charges apply).</p>
/// <p>For more information about encryption at rest in Amazon Keyspaces, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
/// <p>For more information about KMS, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">KMS management service concepts</a> in the <i>Key Management Service Developer Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EncryptionSpecification {
/// <p>The encryption option specified for the table. You can choose one of the following KMS keys (KMS keys):</p>
/// <p>• <code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces. </p>
/// <p>• <code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input. </p>
/// <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>. </p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::EncryptionType>,
/// <p>The Amazon Resource Name (ARN) of the customer managed KMS key, for example <code>kms_key_identifier:ARN</code>.</p>
#[doc(hidden)]
pub kms_key_identifier: std::option::Option<std::string::String>,
}
impl EncryptionSpecification {
/// <p>The encryption option specified for the table. You can choose one of the following KMS keys (KMS keys):</p>
/// <p>• <code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces. </p>
/// <p>• <code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input. </p>
/// <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>. </p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn r#type(&self) -> std::option::Option<&crate::model::EncryptionType> {
self.r#type.as_ref()
}
/// <p>The Amazon Resource Name (ARN) of the customer managed KMS key, for example <code>kms_key_identifier:ARN</code>.</p>
pub fn kms_key_identifier(&self) -> std::option::Option<&str> {
self.kms_key_identifier.as_deref()
}
}
/// See [`EncryptionSpecification`](crate::model::EncryptionSpecification).
pub mod encryption_specification {
/// A builder for [`EncryptionSpecification`](crate::model::EncryptionSpecification).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) r#type: std::option::Option<crate::model::EncryptionType>,
pub(crate) kms_key_identifier: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The encryption option specified for the table. You can choose one of the following KMS keys (KMS keys):</p>
/// <p>• <code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces. </p>
/// <p>• <code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input. </p>
/// <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>. </p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn r#type(mut self, input: crate::model::EncryptionType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The encryption option specified for the table. You can choose one of the following KMS keys (KMS keys):</p>
/// <p>• <code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces. </p>
/// <p>• <code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input. </p>
/// <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>. </p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::EncryptionType>,
) -> Self {
self.r#type = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the customer managed KMS key, for example <code>kms_key_identifier:ARN</code>.</p>
pub fn kms_key_identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_identifier = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the customer managed KMS key, for example <code>kms_key_identifier:ARN</code>.</p>
pub fn set_kms_key_identifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.kms_key_identifier = input;
self
}
/// Consumes the builder and constructs a [`EncryptionSpecification`](crate::model::EncryptionSpecification).
pub fn build(self) -> crate::model::EncryptionSpecification {
crate::model::EncryptionSpecification {
r#type: self.r#type,
kms_key_identifier: self.kms_key_identifier,
}
}
}
}
impl EncryptionSpecification {
/// Creates a new builder-style object to manufacture [`EncryptionSpecification`](crate::model::EncryptionSpecification).
pub fn builder() -> crate::model::encryption_specification::Builder {
crate::model::encryption_specification::Builder::default()
}
}
/// When writing a match expression against `EncryptionType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let encryptiontype = unimplemented!();
/// match encryptiontype {
/// EncryptionType::AwsOwnedKmsKey => { /* ... */ },
/// EncryptionType::CustomerManagedKmsKey => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `encryptiontype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `EncryptionType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `EncryptionType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `EncryptionType::NewFeature` is defined.
/// Specifically, when `encryptiontype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `EncryptionType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[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 EncryptionType {
#[allow(missing_docs)] // documentation missing in model
AwsOwnedKmsKey,
#[allow(missing_docs)] // documentation missing in model
CustomerManagedKmsKey,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for EncryptionType {
fn from(s: &str) -> Self {
match s {
"AWS_OWNED_KMS_KEY" => EncryptionType::AwsOwnedKmsKey,
"CUSTOMER_MANAGED_KMS_KEY" => EncryptionType::CustomerManagedKmsKey,
other => EncryptionType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for EncryptionType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(EncryptionType::from(s))
}
}
impl EncryptionType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
EncryptionType::AwsOwnedKmsKey => "AWS_OWNED_KMS_KEY",
EncryptionType::CustomerManagedKmsKey => "CUSTOMER_MANAGED_KMS_KEY",
EncryptionType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["AWS_OWNED_KMS_KEY", "CUSTOMER_MANAGED_KMS_KEY"]
}
}
impl AsRef<str> for EncryptionType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Amazon Keyspaces has two read/write capacity modes for processing reads and writes on your tables: </p>
/// <p>• On-demand (default)</p>
/// <p>• Provisioned</p>
/// <p> The read/write capacity mode that you choose controls how you are charged for read and write throughput and how table throughput capacity is managed.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CapacitySpecification {
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p>
/// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[doc(hidden)]
pub throughput_mode: std::option::Option<crate::model::ThroughputMode>,
/// <p>The throughput capacity specified for <code>read</code> operations defined in <code>read capacity units</code> <code>(RCUs)</code>.</p>
#[doc(hidden)]
pub read_capacity_units: std::option::Option<i64>,
/// <p>The throughput capacity specified for <code>write</code> operations defined in <code>write capacity units</code> <code>(WCUs)</code>.</p>
#[doc(hidden)]
pub write_capacity_units: std::option::Option<i64>,
}
impl CapacitySpecification {
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p>
/// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn throughput_mode(&self) -> std::option::Option<&crate::model::ThroughputMode> {
self.throughput_mode.as_ref()
}
/// <p>The throughput capacity specified for <code>read</code> operations defined in <code>read capacity units</code> <code>(RCUs)</code>.</p>
pub fn read_capacity_units(&self) -> std::option::Option<i64> {
self.read_capacity_units
}
/// <p>The throughput capacity specified for <code>write</code> operations defined in <code>write capacity units</code> <code>(WCUs)</code>.</p>
pub fn write_capacity_units(&self) -> std::option::Option<i64> {
self.write_capacity_units
}
}
/// See [`CapacitySpecification`](crate::model::CapacitySpecification).
pub mod capacity_specification {
/// A builder for [`CapacitySpecification`](crate::model::CapacitySpecification).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) throughput_mode: std::option::Option<crate::model::ThroughputMode>,
pub(crate) read_capacity_units: std::option::Option<i64>,
pub(crate) write_capacity_units: std::option::Option<i64>,
}
impl Builder {
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p>
/// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn throughput_mode(mut self, input: crate::model::ThroughputMode) -> Self {
self.throughput_mode = Some(input);
self
}
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p>
/// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn set_throughput_mode(
mut self,
input: std::option::Option<crate::model::ThroughputMode>,
) -> Self {
self.throughput_mode = input;
self
}
/// <p>The throughput capacity specified for <code>read</code> operations defined in <code>read capacity units</code> <code>(RCUs)</code>.</p>
pub fn read_capacity_units(mut self, input: i64) -> Self {
self.read_capacity_units = Some(input);
self
}
/// <p>The throughput capacity specified for <code>read</code> operations defined in <code>read capacity units</code> <code>(RCUs)</code>.</p>
pub fn set_read_capacity_units(mut self, input: std::option::Option<i64>) -> Self {
self.read_capacity_units = input;
self
}
/// <p>The throughput capacity specified for <code>write</code> operations defined in <code>write capacity units</code> <code>(WCUs)</code>.</p>
pub fn write_capacity_units(mut self, input: i64) -> Self {
self.write_capacity_units = Some(input);
self
}
/// <p>The throughput capacity specified for <code>write</code> operations defined in <code>write capacity units</code> <code>(WCUs)</code>.</p>
pub fn set_write_capacity_units(mut self, input: std::option::Option<i64>) -> Self {
self.write_capacity_units = input;
self
}
/// Consumes the builder and constructs a [`CapacitySpecification`](crate::model::CapacitySpecification).
pub fn build(self) -> crate::model::CapacitySpecification {
crate::model::CapacitySpecification {
throughput_mode: self.throughput_mode,
read_capacity_units: self.read_capacity_units,
write_capacity_units: self.write_capacity_units,
}
}
}
}
impl CapacitySpecification {
/// Creates a new builder-style object to manufacture [`CapacitySpecification`](crate::model::CapacitySpecification).
pub fn builder() -> crate::model::capacity_specification::Builder {
crate::model::capacity_specification::Builder::default()
}
}
/// When writing a match expression against `ThroughputMode`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let throughputmode = unimplemented!();
/// match throughputmode {
/// ThroughputMode::PayPerRequest => { /* ... */ },
/// ThroughputMode::Provisioned => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `throughputmode` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ThroughputMode::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ThroughputMode::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ThroughputMode::NewFeature` is defined.
/// Specifically, when `throughputmode` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ThroughputMode::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[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 ThroughputMode {
#[allow(missing_docs)] // documentation missing in model
PayPerRequest,
#[allow(missing_docs)] // documentation missing in model
Provisioned,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ThroughputMode {
fn from(s: &str) -> Self {
match s {
"PAY_PER_REQUEST" => ThroughputMode::PayPerRequest,
"PROVISIONED" => ThroughputMode::Provisioned,
other => ThroughputMode::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for ThroughputMode {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ThroughputMode::from(s))
}
}
impl ThroughputMode {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ThroughputMode::PayPerRequest => "PAY_PER_REQUEST",
ThroughputMode::Provisioned => "PROVISIONED",
ThroughputMode::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["PAY_PER_REQUEST", "PROVISIONED"]
}
}
impl AsRef<str> for ThroughputMode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The names and data types of regular columns.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ColumnDefinition {
/// <p>The name of the column.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>The data type of the column. For a list of available data types, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/cql.elements.html#cql.data-types">Data types</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[doc(hidden)]
pub r#type: std::option::Option<std::string::String>,
}
impl ColumnDefinition {
/// <p>The name of the column.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The data type of the column. For a list of available data types, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/cql.elements.html#cql.data-types">Data types</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn r#type(&self) -> std::option::Option<&str> {
self.r#type.as_deref()
}
}
/// See [`ColumnDefinition`](crate::model::ColumnDefinition).
pub mod column_definition {
/// A builder for [`ColumnDefinition`](crate::model::ColumnDefinition).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the column.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the column.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The data type of the column. For a list of available data types, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/cql.elements.html#cql.data-types">Data types</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn r#type(mut self, input: impl Into<std::string::String>) -> Self {
self.r#type = Some(input.into());
self
}
/// <p>The data type of the column. For a list of available data types, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/cql.elements.html#cql.data-types">Data types</a> in the <i>Amazon Keyspaces Developer Guide</i>.</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 [`ColumnDefinition`](crate::model::ColumnDefinition).
pub fn build(self) -> crate::model::ColumnDefinition {
crate::model::ColumnDefinition {
name: self.name,
r#type: self.r#type,
}
}
}
}
impl ColumnDefinition {
/// Creates a new builder-style object to manufacture [`ColumnDefinition`](crate::model::ColumnDefinition).
pub fn builder() -> crate::model::column_definition::Builder {
crate::model::column_definition::Builder::default()
}
}
/// <p>Describes a tag. A tag is a key-value pair. You can add up to 50 tags to a single Amazon Keyspaces resource.</p>
/// <p>Amazon Web Services-assigned tag names and values are automatically assigned the <code>aws:</code> prefix, which the user cannot assign. Amazon Web Services-assigned tag names do not count towards the tag limit of 50. User-assigned tag names have the prefix <code>user:</code> in the Cost Allocation Report. You cannot backdate the application of a tag.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Tag {
/// <p>The key of the tag. Tag keys are case sensitive. Each Amazon Keyspaces resource can only have up to one tag with the same key. If you try to add an existing tag (same key), the existing tag value will be updated to the new value.</p>
#[doc(hidden)]
pub key: std::option::Option<std::string::String>,
/// <p>The value of the tag. Tag values are case-sensitive and can be null.</p>
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
}
impl Tag {
/// <p>The key of the tag. Tag keys are case sensitive. Each Amazon Keyspaces resource can only have up to one tag with the same key. If you try to add an existing tag (same key), the existing tag value will be updated to the new value.</p>
pub fn key(&self) -> std::option::Option<&str> {
self.key.as_deref()
}
/// <p>The value of the tag. Tag values are case-sensitive and can be null.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
/// See [`Tag`](crate::model::Tag).
pub mod tag {
/// A builder for [`Tag`](crate::model::Tag).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The key of the tag. Tag keys are case sensitive. Each Amazon Keyspaces resource can only have up to one tag with the same key. If you try to add an existing tag (same key), the existing tag value will be updated to the new value.</p>
pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
self.key = Some(input.into());
self
}
/// <p>The key of the tag. Tag keys are case sensitive. Each Amazon Keyspaces resource can only have up to one tag with the same key. If you try to add an existing tag (same key), the existing tag value will be updated to the new value.</p>
pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.key = input;
self
}
/// <p>The value of the tag. Tag values are case-sensitive and can be null.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value of the tag. Tag values are case-sensitive and can be null.</p>
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
/// Consumes the builder and constructs a [`Tag`](crate::model::Tag).
pub fn build(self) -> crate::model::Tag {
crate::model::Tag {
key: self.key,
value: self.value,
}
}
}
}
impl Tag {
/// Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag).
pub fn builder() -> crate::model::tag::Builder {
crate::model::tag::Builder::default()
}
}
/// <p>Returns the name of the specified table, the keyspace it is stored in, and the unique identifier in the format of an Amazon Resource Name (ARN).</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TableSummary {
/// <p>The name of the keyspace that the table is stored in.</p>
#[doc(hidden)]
pub keyspace_name: std::option::Option<std::string::String>,
/// <p>The name of the table.</p>
#[doc(hidden)]
pub table_name: std::option::Option<std::string::String>,
/// <p>The unique identifier of the table in the format of an Amazon Resource Name (ARN).</p>
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl TableSummary {
/// <p>The name of the keyspace that the table is stored in.</p>
pub fn keyspace_name(&self) -> std::option::Option<&str> {
self.keyspace_name.as_deref()
}
/// <p>The name of the table.</p>
pub fn table_name(&self) -> std::option::Option<&str> {
self.table_name.as_deref()
}
/// <p>The unique identifier of the table in the format of an Amazon Resource Name (ARN).</p>
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
/// See [`TableSummary`](crate::model::TableSummary).
pub mod table_summary {
/// A builder for [`TableSummary`](crate::model::TableSummary).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) keyspace_name: std::option::Option<std::string::String>,
pub(crate) table_name: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the keyspace that the table is stored in.</p>
pub fn keyspace_name(mut self, input: impl Into<std::string::String>) -> Self {
self.keyspace_name = Some(input.into());
self
}
/// <p>The name of the keyspace that the table is stored in.</p>
pub fn set_keyspace_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.keyspace_name = input;
self
}
/// <p>The name of the table.</p>
pub fn table_name(mut self, input: impl Into<std::string::String>) -> Self {
self.table_name = Some(input.into());
self
}
/// <p>The name of the table.</p>
pub fn set_table_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.table_name = input;
self
}
/// <p>The unique identifier of the table in the format of an Amazon Resource Name (ARN).</p>
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
/// <p>The unique identifier of the table in the format of an Amazon Resource Name (ARN).</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
/// Consumes the builder and constructs a [`TableSummary`](crate::model::TableSummary).
pub fn build(self) -> crate::model::TableSummary {
crate::model::TableSummary {
keyspace_name: self.keyspace_name,
table_name: self.table_name,
resource_arn: self.resource_arn,
}
}
}
}
impl TableSummary {
/// Creates a new builder-style object to manufacture [`TableSummary`](crate::model::TableSummary).
pub fn builder() -> crate::model::table_summary::Builder {
crate::model::table_summary::Builder::default()
}
}
/// <p>Represents the properties of a keyspace.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct KeyspaceSummary {
/// <p>The name of the keyspace.</p>
#[doc(hidden)]
pub keyspace_name: std::option::Option<std::string::String>,
/// <p>The unique identifier of the keyspace in the format of an Amazon Resource Name (ARN).</p>
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl KeyspaceSummary {
/// <p>The name of the keyspace.</p>
pub fn keyspace_name(&self) -> std::option::Option<&str> {
self.keyspace_name.as_deref()
}
/// <p>The unique identifier of the keyspace in the format of an Amazon Resource Name (ARN).</p>
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
/// See [`KeyspaceSummary`](crate::model::KeyspaceSummary).
pub mod keyspace_summary {
/// A builder for [`KeyspaceSummary`](crate::model::KeyspaceSummary).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) keyspace_name: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the keyspace.</p>
pub fn keyspace_name(mut self, input: impl Into<std::string::String>) -> Self {
self.keyspace_name = Some(input.into());
self
}
/// <p>The name of the keyspace.</p>
pub fn set_keyspace_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.keyspace_name = input;
self
}
/// <p>The unique identifier of the keyspace in the format of an Amazon Resource Name (ARN).</p>
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
/// <p>The unique identifier of the keyspace in the format of an Amazon Resource Name (ARN).</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
/// Consumes the builder and constructs a [`KeyspaceSummary`](crate::model::KeyspaceSummary).
pub fn build(self) -> crate::model::KeyspaceSummary {
crate::model::KeyspaceSummary {
keyspace_name: self.keyspace_name,
resource_arn: self.resource_arn,
}
}
}
}
impl KeyspaceSummary {
/// Creates a new builder-style object to manufacture [`KeyspaceSummary`](crate::model::KeyspaceSummary).
pub fn builder() -> crate::model::keyspace_summary::Builder {
crate::model::keyspace_summary::Builder::default()
}
}
/// <p>An optional comment that describes the table.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Comment {
/// <p>An optional description of the table.</p>
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl Comment {
/// <p>An optional description of the table.</p>
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
/// See [`Comment`](crate::model::Comment).
pub mod comment {
/// A builder for [`Comment`](crate::model::Comment).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>An optional description of the table.</p>
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
/// <p>An optional description of the table.</p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`Comment`](crate::model::Comment).
pub fn build(self) -> crate::model::Comment {
crate::model::Comment {
message: self.message,
}
}
}
}
impl Comment {
/// Creates a new builder-style object to manufacture [`Comment`](crate::model::Comment).
pub fn builder() -> crate::model::comment::Builder {
crate::model::comment::Builder::default()
}
}
/// <p>The point-in-time recovery status of the specified table.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PointInTimeRecoverySummary {
/// <p>Shows if point-in-time recovery is enabled or disabled for the specified table.</p>
#[doc(hidden)]
pub status: std::option::Option<crate::model::PointInTimeRecoveryStatus>,
/// <p>Specifies the earliest possible restore point of the table in ISO 8601 format.</p>
#[doc(hidden)]
pub earliest_restorable_timestamp: std::option::Option<aws_smithy_types::DateTime>,
}
impl PointInTimeRecoverySummary {
/// <p>Shows if point-in-time recovery is enabled or disabled for the specified table.</p>
pub fn status(&self) -> std::option::Option<&crate::model::PointInTimeRecoveryStatus> {
self.status.as_ref()
}
/// <p>Specifies the earliest possible restore point of the table in ISO 8601 format.</p>
pub fn earliest_restorable_timestamp(
&self,
) -> std::option::Option<&aws_smithy_types::DateTime> {
self.earliest_restorable_timestamp.as_ref()
}
}
/// See [`PointInTimeRecoverySummary`](crate::model::PointInTimeRecoverySummary).
pub mod point_in_time_recovery_summary {
/// A builder for [`PointInTimeRecoverySummary`](crate::model::PointInTimeRecoverySummary).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) status: std::option::Option<crate::model::PointInTimeRecoveryStatus>,
pub(crate) earliest_restorable_timestamp: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>Shows if point-in-time recovery is enabled or disabled for the specified table.</p>
pub fn status(mut self, input: crate::model::PointInTimeRecoveryStatus) -> Self {
self.status = Some(input);
self
}
/// <p>Shows if point-in-time recovery is enabled or disabled for the specified table.</p>
pub fn set_status(
mut self,
input: std::option::Option<crate::model::PointInTimeRecoveryStatus>,
) -> Self {
self.status = input;
self
}
/// <p>Specifies the earliest possible restore point of the table in ISO 8601 format.</p>
pub fn earliest_restorable_timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.earliest_restorable_timestamp = Some(input);
self
}
/// <p>Specifies the earliest possible restore point of the table in ISO 8601 format.</p>
pub fn set_earliest_restorable_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.earliest_restorable_timestamp = input;
self
}
/// Consumes the builder and constructs a [`PointInTimeRecoverySummary`](crate::model::PointInTimeRecoverySummary).
pub fn build(self) -> crate::model::PointInTimeRecoverySummary {
crate::model::PointInTimeRecoverySummary {
status: self.status,
earliest_restorable_timestamp: self.earliest_restorable_timestamp,
}
}
}
}
impl PointInTimeRecoverySummary {
/// Creates a new builder-style object to manufacture [`PointInTimeRecoverySummary`](crate::model::PointInTimeRecoverySummary).
pub fn builder() -> crate::model::point_in_time_recovery_summary::Builder {
crate::model::point_in_time_recovery_summary::Builder::default()
}
}
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CapacitySpecificationSummary {
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input. </p>
/// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
#[doc(hidden)]
pub throughput_mode: std::option::Option<crate::model::ThroughputMode>,
/// <p>The throughput capacity specified for <code>read</code> operations defined in <code>read capacity units</code> <code>(RCUs)</code>.</p>
#[doc(hidden)]
pub read_capacity_units: std::option::Option<i64>,
/// <p>The throughput capacity specified for <code>write</code> operations defined in <code>write capacity units</code> <code>(WCUs)</code>.</p>
#[doc(hidden)]
pub write_capacity_units: std::option::Option<i64>,
/// <p>The timestamp of the last operation that changed the provisioned throughput capacity of a table.</p>
#[doc(hidden)]
pub last_update_to_pay_per_request_timestamp: std::option::Option<aws_smithy_types::DateTime>,
}
impl CapacitySpecificationSummary {
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input. </p>
/// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn throughput_mode(&self) -> std::option::Option<&crate::model::ThroughputMode> {
self.throughput_mode.as_ref()
}
/// <p>The throughput capacity specified for <code>read</code> operations defined in <code>read capacity units</code> <code>(RCUs)</code>.</p>
pub fn read_capacity_units(&self) -> std::option::Option<i64> {
self.read_capacity_units
}
/// <p>The throughput capacity specified for <code>write</code> operations defined in <code>write capacity units</code> <code>(WCUs)</code>.</p>
pub fn write_capacity_units(&self) -> std::option::Option<i64> {
self.write_capacity_units
}
/// <p>The timestamp of the last operation that changed the provisioned throughput capacity of a table.</p>
pub fn last_update_to_pay_per_request_timestamp(
&self,
) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_update_to_pay_per_request_timestamp.as_ref()
}
}
/// See [`CapacitySpecificationSummary`](crate::model::CapacitySpecificationSummary).
pub mod capacity_specification_summary {
/// A builder for [`CapacitySpecificationSummary`](crate::model::CapacitySpecificationSummary).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) throughput_mode: std::option::Option<crate::model::ThroughputMode>,
pub(crate) read_capacity_units: std::option::Option<i64>,
pub(crate) write_capacity_units: std::option::Option<i64>,
pub(crate) last_update_to_pay_per_request_timestamp:
std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input. </p>
/// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn throughput_mode(mut self, input: crate::model::ThroughputMode) -> Self {
self.throughput_mode = Some(input);
self
}
/// <p>The read/write throughput capacity mode for a table. The options are:</p>
/// <p>• <code>throughputMode:PAY_PER_REQUEST</code> and </p>
/// <p>• <code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input. </p>
/// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
pub fn set_throughput_mode(
mut self,
input: std::option::Option<crate::model::ThroughputMode>,
) -> Self {
self.throughput_mode = input;
self
}
/// <p>The throughput capacity specified for <code>read</code> operations defined in <code>read capacity units</code> <code>(RCUs)</code>.</p>
pub fn read_capacity_units(mut self, input: i64) -> Self {
self.read_capacity_units = Some(input);
self
}
/// <p>The throughput capacity specified for <code>read</code> operations defined in <code>read capacity units</code> <code>(RCUs)</code>.</p>
pub fn set_read_capacity_units(mut self, input: std::option::Option<i64>) -> Self {
self.read_capacity_units = input;
self
}
/// <p>The throughput capacity specified for <code>write</code> operations defined in <code>write capacity units</code> <code>(WCUs)</code>.</p>
pub fn write_capacity_units(mut self, input: i64) -> Self {
self.write_capacity_units = Some(input);
self
}
/// <p>The throughput capacity specified for <code>write</code> operations defined in <code>write capacity units</code> <code>(WCUs)</code>.</p>
pub fn set_write_capacity_units(mut self, input: std::option::Option<i64>) -> Self {
self.write_capacity_units = input;
self
}
/// <p>The timestamp of the last operation that changed the provisioned throughput capacity of a table.</p>
pub fn last_update_to_pay_per_request_timestamp(
mut self,
input: aws_smithy_types::DateTime,
) -> Self {
self.last_update_to_pay_per_request_timestamp = Some(input);
self
}
/// <p>The timestamp of the last operation that changed the provisioned throughput capacity of a table.</p>
pub fn set_last_update_to_pay_per_request_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_update_to_pay_per_request_timestamp = input;
self
}
/// Consumes the builder and constructs a [`CapacitySpecificationSummary`](crate::model::CapacitySpecificationSummary).
pub fn build(self) -> crate::model::CapacitySpecificationSummary {
crate::model::CapacitySpecificationSummary {
throughput_mode: self.throughput_mode,
read_capacity_units: self.read_capacity_units,
write_capacity_units: self.write_capacity_units,
last_update_to_pay_per_request_timestamp: self
.last_update_to_pay_per_request_timestamp,
}
}
}
}
impl CapacitySpecificationSummary {
/// Creates a new builder-style object to manufacture [`CapacitySpecificationSummary`](crate::model::CapacitySpecificationSummary).
pub fn builder() -> crate::model::capacity_specification_summary::Builder {
crate::model::capacity_specification_summary::Builder::default()
}
}
/// <p>Describes the schema of the table.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SchemaDefinition {
/// <p>The regular columns of the table.</p>
#[doc(hidden)]
pub all_columns: std::option::Option<std::vec::Vec<crate::model::ColumnDefinition>>,
/// <p>The columns that are part of the partition key of the table .</p>
#[doc(hidden)]
pub partition_keys: std::option::Option<std::vec::Vec<crate::model::PartitionKey>>,
/// <p>The columns that are part of the clustering key of the table.</p>
#[doc(hidden)]
pub clustering_keys: std::option::Option<std::vec::Vec<crate::model::ClusteringKey>>,
/// <p>The columns that have been defined as <code>STATIC</code>. Static columns store values that are shared by all rows in the same partition.</p>
#[doc(hidden)]
pub static_columns: std::option::Option<std::vec::Vec<crate::model::StaticColumn>>,
}
impl SchemaDefinition {
/// <p>The regular columns of the table.</p>
pub fn all_columns(&self) -> std::option::Option<&[crate::model::ColumnDefinition]> {
self.all_columns.as_deref()
}
/// <p>The columns that are part of the partition key of the table .</p>
pub fn partition_keys(&self) -> std::option::Option<&[crate::model::PartitionKey]> {
self.partition_keys.as_deref()
}
/// <p>The columns that are part of the clustering key of the table.</p>
pub fn clustering_keys(&self) -> std::option::Option<&[crate::model::ClusteringKey]> {
self.clustering_keys.as_deref()
}
/// <p>The columns that have been defined as <code>STATIC</code>. Static columns store values that are shared by all rows in the same partition.</p>
pub fn static_columns(&self) -> std::option::Option<&[crate::model::StaticColumn]> {
self.static_columns.as_deref()
}
}
/// See [`SchemaDefinition`](crate::model::SchemaDefinition).
pub mod schema_definition {
/// A builder for [`SchemaDefinition`](crate::model::SchemaDefinition).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) all_columns: std::option::Option<std::vec::Vec<crate::model::ColumnDefinition>>,
pub(crate) partition_keys: std::option::Option<std::vec::Vec<crate::model::PartitionKey>>,
pub(crate) clustering_keys: std::option::Option<std::vec::Vec<crate::model::ClusteringKey>>,
pub(crate) static_columns: std::option::Option<std::vec::Vec<crate::model::StaticColumn>>,
}
impl Builder {
/// Appends an item to `all_columns`.
///
/// To override the contents of this collection use [`set_all_columns`](Self::set_all_columns).
///
/// <p>The regular columns of the table.</p>
pub fn all_columns(mut self, input: crate::model::ColumnDefinition) -> Self {
let mut v = self.all_columns.unwrap_or_default();
v.push(input);
self.all_columns = Some(v);
self
}
/// <p>The regular columns of the table.</p>
pub fn set_all_columns(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ColumnDefinition>>,
) -> Self {
self.all_columns = input;
self
}
/// Appends an item to `partition_keys`.
///
/// To override the contents of this collection use [`set_partition_keys`](Self::set_partition_keys).
///
/// <p>The columns that are part of the partition key of the table .</p>
pub fn partition_keys(mut self, input: crate::model::PartitionKey) -> Self {
let mut v = self.partition_keys.unwrap_or_default();
v.push(input);
self.partition_keys = Some(v);
self
}
/// <p>The columns that are part of the partition key of the table .</p>
pub fn set_partition_keys(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PartitionKey>>,
) -> Self {
self.partition_keys = input;
self
}
/// Appends an item to `clustering_keys`.
///
/// To override the contents of this collection use [`set_clustering_keys`](Self::set_clustering_keys).
///
/// <p>The columns that are part of the clustering key of the table.</p>
pub fn clustering_keys(mut self, input: crate::model::ClusteringKey) -> Self {
let mut v = self.clustering_keys.unwrap_or_default();
v.push(input);
self.clustering_keys = Some(v);
self
}
/// <p>The columns that are part of the clustering key of the table.</p>
pub fn set_clustering_keys(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ClusteringKey>>,
) -> Self {
self.clustering_keys = input;
self
}
/// Appends an item to `static_columns`.
///
/// To override the contents of this collection use [`set_static_columns`](Self::set_static_columns).
///
/// <p>The columns that have been defined as <code>STATIC</code>. Static columns store values that are shared by all rows in the same partition.</p>
pub fn static_columns(mut self, input: crate::model::StaticColumn) -> Self {
let mut v = self.static_columns.unwrap_or_default();
v.push(input);
self.static_columns = Some(v);
self
}
/// <p>The columns that have been defined as <code>STATIC</code>. Static columns store values that are shared by all rows in the same partition.</p>
pub fn set_static_columns(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::StaticColumn>>,
) -> Self {
self.static_columns = input;
self
}
/// Consumes the builder and constructs a [`SchemaDefinition`](crate::model::SchemaDefinition).
pub fn build(self) -> crate::model::SchemaDefinition {
crate::model::SchemaDefinition {
all_columns: self.all_columns,
partition_keys: self.partition_keys,
clustering_keys: self.clustering_keys,
static_columns: self.static_columns,
}
}
}
}
impl SchemaDefinition {
/// Creates a new builder-style object to manufacture [`SchemaDefinition`](crate::model::SchemaDefinition).
pub fn builder() -> crate::model::schema_definition::Builder {
crate::model::schema_definition::Builder::default()
}
}
/// <p>The static columns of the table. Static columns store values that are shared by all rows in the same partition.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct StaticColumn {
/// <p>The name of the static column.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
}
impl StaticColumn {
/// <p>The name of the static column.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
}
/// See [`StaticColumn`](crate::model::StaticColumn).
pub mod static_column {
/// A builder for [`StaticColumn`](crate::model::StaticColumn).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the static column.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the static column.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// Consumes the builder and constructs a [`StaticColumn`](crate::model::StaticColumn).
pub fn build(self) -> crate::model::StaticColumn {
crate::model::StaticColumn { name: self.name }
}
}
}
impl StaticColumn {
/// Creates a new builder-style object to manufacture [`StaticColumn`](crate::model::StaticColumn).
pub fn builder() -> crate::model::static_column::Builder {
crate::model::static_column::Builder::default()
}
}
/// <p>The optional clustering column portion of your primary key determines how the data is clustered and sorted within each partition.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ClusteringKey {
/// <p>The name(s) of the clustering column(s).</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>Sets the ascendant (<code>ASC</code>) or descendant (<code>DESC</code>) order modifier.</p>
#[doc(hidden)]
pub order_by: std::option::Option<crate::model::SortOrder>,
}
impl ClusteringKey {
/// <p>The name(s) of the clustering column(s).</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>Sets the ascendant (<code>ASC</code>) or descendant (<code>DESC</code>) order modifier.</p>
pub fn order_by(&self) -> std::option::Option<&crate::model::SortOrder> {
self.order_by.as_ref()
}
}
/// See [`ClusteringKey`](crate::model::ClusteringKey).
pub mod clustering_key {
/// A builder for [`ClusteringKey`](crate::model::ClusteringKey).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) order_by: std::option::Option<crate::model::SortOrder>,
}
impl Builder {
/// <p>The name(s) of the clustering column(s).</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name(s) of the clustering column(s).</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>Sets the ascendant (<code>ASC</code>) or descendant (<code>DESC</code>) order modifier.</p>
pub fn order_by(mut self, input: crate::model::SortOrder) -> Self {
self.order_by = Some(input);
self
}
/// <p>Sets the ascendant (<code>ASC</code>) or descendant (<code>DESC</code>) order modifier.</p>
pub fn set_order_by(mut self, input: std::option::Option<crate::model::SortOrder>) -> Self {
self.order_by = input;
self
}
/// Consumes the builder and constructs a [`ClusteringKey`](crate::model::ClusteringKey).
pub fn build(self) -> crate::model::ClusteringKey {
crate::model::ClusteringKey {
name: self.name,
order_by: self.order_by,
}
}
}
}
impl ClusteringKey {
/// Creates a new builder-style object to manufacture [`ClusteringKey`](crate::model::ClusteringKey).
pub fn builder() -> crate::model::clustering_key::Builder {
crate::model::clustering_key::Builder::default()
}
}
/// When writing a match expression against `SortOrder`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let sortorder = unimplemented!();
/// match sortorder {
/// SortOrder::Asc => { /* ... */ },
/// SortOrder::Desc => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `sortorder` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `SortOrder::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `SortOrder::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `SortOrder::NewFeature` is defined.
/// Specifically, when `sortorder` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `SortOrder::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[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 SortOrder {
#[allow(missing_docs)] // documentation missing in model
Asc,
#[allow(missing_docs)] // documentation missing in model
Desc,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for SortOrder {
fn from(s: &str) -> Self {
match s {
"ASC" => SortOrder::Asc,
"DESC" => SortOrder::Desc,
other => SortOrder::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for SortOrder {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(SortOrder::from(s))
}
}
impl SortOrder {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
SortOrder::Asc => "ASC",
SortOrder::Desc => "DESC",
SortOrder::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ASC", "DESC"]
}
}
impl AsRef<str> for SortOrder {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The partition key portion of the primary key is required and determines how Amazon Keyspaces stores the data. The partition key can be a single column, or it can be a compound value composed of two or more columns.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PartitionKey {
/// <p>The name(s) of the partition key column(s).</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
}
impl PartitionKey {
/// <p>The name(s) of the partition key column(s).</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
}
/// See [`PartitionKey`](crate::model::PartitionKey).
pub mod partition_key {
/// A builder for [`PartitionKey`](crate::model::PartitionKey).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name(s) of the partition key column(s).</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name(s) of the partition key column(s).</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// Consumes the builder and constructs a [`PartitionKey`](crate::model::PartitionKey).
pub fn build(self) -> crate::model::PartitionKey {
crate::model::PartitionKey { name: self.name }
}
}
}
impl PartitionKey {
/// Creates a new builder-style object to manufacture [`PartitionKey`](crate::model::PartitionKey).
pub fn builder() -> crate::model::partition_key::Builder {
crate::model::partition_key::Builder::default()
}
}
/// When writing a match expression against `TableStatus`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let tablestatus = unimplemented!();
/// match tablestatus {
/// TableStatus::Active => { /* ... */ },
/// TableStatus::Creating => { /* ... */ },
/// TableStatus::Deleted => { /* ... */ },
/// TableStatus::Deleting => { /* ... */ },
/// TableStatus::InaccessibleEncryptionCredentials => { /* ... */ },
/// TableStatus::Restoring => { /* ... */ },
/// TableStatus::Updating => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `tablestatus` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `TableStatus::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `TableStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `TableStatus::NewFeature` is defined.
/// Specifically, when `tablestatus` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `TableStatus::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[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 TableStatus {
#[allow(missing_docs)] // documentation missing in model
Active,
#[allow(missing_docs)] // documentation missing in model
Creating,
#[allow(missing_docs)] // documentation missing in model
Deleted,
#[allow(missing_docs)] // documentation missing in model
Deleting,
#[allow(missing_docs)] // documentation missing in model
InaccessibleEncryptionCredentials,
#[allow(missing_docs)] // documentation missing in model
Restoring,
#[allow(missing_docs)] // documentation missing in model
Updating,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for TableStatus {
fn from(s: &str) -> Self {
match s {
"ACTIVE" => TableStatus::Active,
"CREATING" => TableStatus::Creating,
"DELETED" => TableStatus::Deleted,
"DELETING" => TableStatus::Deleting,
"INACCESSIBLE_ENCRYPTION_CREDENTIALS" => TableStatus::InaccessibleEncryptionCredentials,
"RESTORING" => TableStatus::Restoring,
"UPDATING" => TableStatus::Updating,
other => TableStatus::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for TableStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(TableStatus::from(s))
}
}
impl TableStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
TableStatus::Active => "ACTIVE",
TableStatus::Creating => "CREATING",
TableStatus::Deleted => "DELETED",
TableStatus::Deleting => "DELETING",
TableStatus::InaccessibleEncryptionCredentials => "INACCESSIBLE_ENCRYPTION_CREDENTIALS",
TableStatus::Restoring => "RESTORING",
TableStatus::Updating => "UPDATING",
TableStatus::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&[
"ACTIVE",
"CREATING",
"DELETED",
"DELETING",
"INACCESSIBLE_ENCRYPTION_CREDENTIALS",
"RESTORING",
"UPDATING",
]
}
}
impl AsRef<str> for TableStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}