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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents the input of a <code>CreateTable</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTableInput {
/// <p>An array of attributes that describe the key schema for the table and indexes.</p>
pub attribute_definitions: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>,
/// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
pub table_name: ::std::option::Option<::std::string::String>,
/// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
/// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
/// <ul>
/// <li>
/// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
/// <li>
/// <p><code>KeyType</code> - The role that the 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></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 the DynamoDB 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>
/// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
/// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub key_schema: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>,
/// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
/// <p>Each local secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// </ul>
pub local_secondary_indexes: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>,
/// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// <li>
/// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
/// </ul>
pub global_secondary_indexes: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>,
/// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
/// <ul>
/// <li>
/// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
/// <li>
/// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
/// </ul>
pub billing_mode: ::std::option::Option<crate::types::BillingMode>,
/// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
/// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
/// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
/// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
/// <ul>
/// <li>
/// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
/// <li>
/// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
/// </ul></li>
/// </ul>
pub stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
/// <p>Represents the settings used to enable server-side encryption.</p>
pub sse_specification: ::std::option::Option<crate::types::SseSpecification>,
/// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
/// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
pub table_class: ::std::option::Option<crate::types::TableClass>,
/// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
pub deletion_protection_enabled: ::std::option::Option<bool>,
/// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
/// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
/// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
/// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
/// </note>
pub resource_policy: ::std::option::Option<::std::string::String>,
/// <p>Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
pub on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
}
impl CreateTableInput {
/// <p>An array of attributes that describe the key schema for the table and indexes.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attribute_definitions.is_none()`.
pub fn attribute_definitions(&self) -> &[crate::types::AttributeDefinition] {
self.attribute_definitions.as_deref().unwrap_or_default()
}
/// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
pub fn table_name(&self) -> ::std::option::Option<&str> {
self.table_name.as_deref()
}
/// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
/// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
/// <ul>
/// <li>
/// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
/// <li>
/// <p><code>KeyType</code> - The role that the 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></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 the DynamoDB 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>
/// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
/// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.key_schema.is_none()`.
pub fn key_schema(&self) -> &[crate::types::KeySchemaElement] {
self.key_schema.as_deref().unwrap_or_default()
}
/// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
/// <p>Each local secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// </ul>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.local_secondary_indexes.is_none()`.
pub fn local_secondary_indexes(&self) -> &[crate::types::LocalSecondaryIndex] {
self.local_secondary_indexes.as_deref().unwrap_or_default()
}
/// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// <li>
/// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
/// </ul>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.global_secondary_indexes.is_none()`.
pub fn global_secondary_indexes(&self) -> &[crate::types::GlobalSecondaryIndex] {
self.global_secondary_indexes.as_deref().unwrap_or_default()
}
/// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
/// <ul>
/// <li>
/// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
/// <li>
/// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
/// </ul>
pub fn billing_mode(&self) -> ::std::option::Option<&crate::types::BillingMode> {
self.billing_mode.as_ref()
}
/// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
/// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
/// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub fn provisioned_throughput(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughput> {
self.provisioned_throughput.as_ref()
}
/// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
/// <ul>
/// <li>
/// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
/// <li>
/// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
/// </ul></li>
/// </ul>
pub fn stream_specification(&self) -> ::std::option::Option<&crate::types::StreamSpecification> {
self.stream_specification.as_ref()
}
/// <p>Represents the settings used to enable server-side encryption.</p>
pub fn sse_specification(&self) -> ::std::option::Option<&crate::types::SseSpecification> {
self.sse_specification.as_ref()
}
/// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
/// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
pub fn table_class(&self) -> ::std::option::Option<&crate::types::TableClass> {
self.table_class.as_ref()
}
/// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
self.deletion_protection_enabled
}
/// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
/// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
/// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
/// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
/// </note>
pub fn resource_policy(&self) -> ::std::option::Option<&str> {
self.resource_policy.as_deref()
}
/// <p>Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
pub fn on_demand_throughput(&self) -> ::std::option::Option<&crate::types::OnDemandThroughput> {
self.on_demand_throughput.as_ref()
}
}
impl CreateTableInput {
/// Creates a new builder-style object to manufacture [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
pub fn builder() -> crate::operation::create_table::builders::CreateTableInputBuilder {
crate::operation::create_table::builders::CreateTableInputBuilder::default()
}
}
/// A builder for [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTableInputBuilder {
pub(crate) attribute_definitions: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>,
pub(crate) table_name: ::std::option::Option<::std::string::String>,
pub(crate) key_schema: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>,
pub(crate) local_secondary_indexes: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>,
pub(crate) global_secondary_indexes: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>,
pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
pub(crate) provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
pub(crate) stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
pub(crate) sse_specification: ::std::option::Option<crate::types::SseSpecification>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) table_class: ::std::option::Option<crate::types::TableClass>,
pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
pub(crate) resource_policy: ::std::option::Option<::std::string::String>,
pub(crate) on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
}
impl CreateTableInputBuilder {
/// Appends an item to `attribute_definitions`.
///
/// To override the contents of this collection use [`set_attribute_definitions`](Self::set_attribute_definitions).
///
/// <p>An array of attributes that describe the key schema for the table and indexes.</p>
pub fn attribute_definitions(mut self, input: crate::types::AttributeDefinition) -> Self {
let mut v = self.attribute_definitions.unwrap_or_default();
v.push(input);
self.attribute_definitions = ::std::option::Option::Some(v);
self
}
/// <p>An array of attributes that describe the key schema for the table and indexes.</p>
pub fn set_attribute_definitions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>) -> Self {
self.attribute_definitions = input;
self
}
/// <p>An array of attributes that describe the key schema for the table and indexes.</p>
pub fn get_attribute_definitions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>> {
&self.attribute_definitions
}
/// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
/// This field is required.
pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.table_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.table_name = input;
self
}
/// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
&self.table_name
}
/// Appends an item to `key_schema`.
///
/// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
///
/// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
/// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
/// <ul>
/// <li>
/// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
/// <li>
/// <p><code>KeyType</code> - The role that the 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></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 the DynamoDB 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>
/// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
/// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub fn key_schema(mut self, input: crate::types::KeySchemaElement) -> Self {
let mut v = self.key_schema.unwrap_or_default();
v.push(input);
self.key_schema = ::std::option::Option::Some(v);
self
}
/// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
/// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
/// <ul>
/// <li>
/// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
/// <li>
/// <p><code>KeyType</code> - The role that the 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></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 the DynamoDB 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>
/// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
/// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub fn set_key_schema(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>) -> Self {
self.key_schema = input;
self
}
/// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
/// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
/// <ul>
/// <li>
/// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
/// <li>
/// <p><code>KeyType</code> - The role that the 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></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 the DynamoDB 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>
/// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
/// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub fn get_key_schema(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>> {
&self.key_schema
}
/// Appends an item to `local_secondary_indexes`.
///
/// To override the contents of this collection use [`set_local_secondary_indexes`](Self::set_local_secondary_indexes).
///
/// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
/// <p>Each local secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// </ul>
pub fn local_secondary_indexes(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
let mut v = self.local_secondary_indexes.unwrap_or_default();
v.push(input);
self.local_secondary_indexes = ::std::option::Option::Some(v);
self
}
/// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
/// <p>Each local secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// </ul>
pub fn set_local_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>) -> Self {
self.local_secondary_indexes = input;
self
}
/// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
/// <p>Each local secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// </ul>
pub fn get_local_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>> {
&self.local_secondary_indexes
}
/// Appends an item to `global_secondary_indexes`.
///
/// To override the contents of this collection use [`set_global_secondary_indexes`](Self::set_global_secondary_indexes).
///
/// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// <li>
/// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
/// </ul>
pub fn global_secondary_indexes(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
let mut v = self.global_secondary_indexes.unwrap_or_default();
v.push(input);
self.global_secondary_indexes = ::std::option::Option::Some(v);
self
}
/// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// <li>
/// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
/// </ul>
pub fn set_global_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>) -> Self {
self.global_secondary_indexes = input;
self
}
/// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
/// <ul>
/// <li>
/// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
/// <p></p></li>
/// <li>
/// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
/// <li>
/// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
/// <ul>
/// <li>
/// <p><code>ProjectionType</code> - One of the following:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
/// <li>
/// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
/// <li>
/// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
/// </ul></li>
/// <li>
/// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.</p></li>
/// </ul></li>
/// <li>
/// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
/// </ul>
pub fn get_global_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>> {
&self.global_secondary_indexes
}
/// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
/// <ul>
/// <li>
/// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
/// <li>
/// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
/// </ul>
pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
self.billing_mode = ::std::option::Option::Some(input);
self
}
/// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
/// <ul>
/// <li>
/// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
/// <li>
/// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
/// </ul>
pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
self.billing_mode = input;
self
}
/// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
/// <ul>
/// <li>
/// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
/// <li>
/// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
/// </ul>
pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
&self.billing_mode
}
/// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
/// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
/// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
self.provisioned_throughput = ::std::option::Option::Some(input);
self
}
/// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
/// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
/// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub fn set_provisioned_throughput(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
self.provisioned_throughput = input;
self
}
/// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
/// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
/// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
pub fn get_provisioned_throughput(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
&self.provisioned_throughput
}
/// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
/// <ul>
/// <li>
/// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
/// <li>
/// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
/// </ul></li>
/// </ul>
pub fn stream_specification(mut self, input: crate::types::StreamSpecification) -> Self {
self.stream_specification = ::std::option::Option::Some(input);
self
}
/// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
/// <ul>
/// <li>
/// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
/// <li>
/// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
/// </ul></li>
/// </ul>
pub fn set_stream_specification(mut self, input: ::std::option::Option<crate::types::StreamSpecification>) -> Self {
self.stream_specification = input;
self
}
/// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
/// <ul>
/// <li>
/// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
/// <li>
/// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
/// <ul>
/// <li>
/// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
/// </ul></li>
/// </ul>
pub fn get_stream_specification(&self) -> &::std::option::Option<crate::types::StreamSpecification> {
&self.stream_specification
}
/// <p>Represents the settings used to enable server-side encryption.</p>
pub fn sse_specification(mut self, input: crate::types::SseSpecification) -> Self {
self.sse_specification = ::std::option::Option::Some(input);
self
}
/// <p>Represents the settings used to enable server-side encryption.</p>
pub fn set_sse_specification(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
self.sse_specification = input;
self
}
/// <p>Represents the settings used to enable server-side encryption.</p>
pub fn get_sse_specification(&self) -> &::std::option::Option<crate::types::SseSpecification> {
&self.sse_specification
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
pub fn table_class(mut self, input: crate::types::TableClass) -> Self {
self.table_class = ::std::option::Option::Some(input);
self
}
/// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
pub fn set_table_class(mut self, input: ::std::option::Option<crate::types::TableClass>) -> Self {
self.table_class = input;
self
}
/// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
pub fn get_table_class(&self) -> &::std::option::Option<crate::types::TableClass> {
&self.table_class
}
/// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
self.deletion_protection_enabled = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.deletion_protection_enabled = input;
self
}
/// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
&self.deletion_protection_enabled
}
/// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
/// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
/// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
/// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
/// </note>
pub fn resource_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_policy = ::std::option::Option::Some(input.into());
self
}
/// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
/// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
/// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
/// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
/// </note>
pub fn set_resource_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_policy = input;
self
}
/// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
/// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
/// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
/// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
/// </note>
pub fn get_resource_policy(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_policy
}
/// <p>Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
pub fn on_demand_throughput(mut self, input: crate::types::OnDemandThroughput) -> Self {
self.on_demand_throughput = ::std::option::Option::Some(input);
self
}
/// <p>Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
pub fn set_on_demand_throughput(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
self.on_demand_throughput = input;
self
}
/// <p>Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
pub fn get_on_demand_throughput(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
&self.on_demand_throughput
}
/// Consumes the builder and constructs a [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
pub fn build(self) -> ::std::result::Result<crate::operation::create_table::CreateTableInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_table::CreateTableInput {
attribute_definitions: self.attribute_definitions,
table_name: self.table_name,
key_schema: self.key_schema,
local_secondary_indexes: self.local_secondary_indexes,
global_secondary_indexes: self.global_secondary_indexes,
billing_mode: self.billing_mode,
provisioned_throughput: self.provisioned_throughput,
stream_specification: self.stream_specification,
sse_specification: self.sse_specification,
tags: self.tags,
table_class: self.table_class,
deletion_protection_enabled: self.deletion_protection_enabled,
resource_policy: self.resource_policy,
on_demand_throughput: self.on_demand_throughput,
})
}
}