Struct aws_sdk_dynamodb::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon DynamoDB
Client for invoking operations on Amazon DynamoDB. Each operation on Amazon DynamoDB is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_dynamodb::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Builder
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_dynamodb::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the BatchExecuteStatement
operation has
a Client::batch_execute_statement
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.batch_execute_statement()
.return_consumed_capacity("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
§Waiters
This client provides wait_until
methods behind the Waiters
trait.
To use them, simply import the trait, and then call one of the wait_until
methods. This will
return a waiter fluent builder that takes various parameters, which are documented on the builder
type. Once parameters have been provided, the wait
method can be called to initiate waiting.
For example, if there was a wait_until_thing
method, it could look like:
let result = client.wait_until_thing()
.thing_id("someId")
.wait(Duration::from_secs(120))
.await;
Implementations§
source§impl Client
impl Client
sourcepub fn batch_execute_statement(&self) -> BatchExecuteStatementFluentBuilder
pub fn batch_execute_statement(&self) -> BatchExecuteStatementFluentBuilder
Constructs a fluent builder for the BatchExecuteStatement
operation.
- The fluent builder is configurable:
statements(BatchStatementRequest)
/set_statements(Option<Vec::<BatchStatementRequest>>)
:
required: trueThe list of PartiQL statements representing the batch to run.
return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
- On success, responds with
BatchExecuteStatementOutput
with field(s):responses(Option<Vec::<BatchStatementResponse>>)
:The response to each PartiQL statement in the batch. The values of the list are ordered according to the ordering of the request statements.
consumed_capacity(Option<Vec::<ConsumedCapacity>>)
:The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.
- On failure, responds with
SdkError<BatchExecuteStatementError>
source§impl Client
impl Client
sourcepub fn batch_get_item(&self) -> BatchGetItemFluentBuilder
pub fn batch_get_item(&self) -> BatchGetItemFluentBuilder
Constructs a fluent builder for the BatchGetItem
operation.
- The fluent builder is configurable:
request_items(impl Into<String>, KeysAndAttributes)
/set_request_items(Option<HashMap::<String, KeysAndAttributes>>)
:
required: trueA map of one or more table names or table ARNs and, for each table, a map that describes one or more items to retrieve from that table. Each table name or ARN can be used only once per
BatchGetItem
request.Each element in the map of items to retrieve consists of the following:
-
ConsistentRead
- Iftrue
, a strongly consistent read is used; iffalse
(the default), an eventually consistent read is used. -
ExpressionAttributeNames
- One or more substitution tokens for attribute names in theProjectionExpression
parameter. The following are some use cases for usingExpressionAttributeNames
:-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:-
{“#P”:“Percentile”}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information about expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
-
-
Keys
- An array of primary key attribute values that define specific items in the table. For each primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide the partition key value. For a composite key, you must provide both the partition key value and the sort key value. -
ProjectionExpression
- A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.
For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
-
AttributesToGet
- This is a legacy parameter. UseProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
-
return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
- On success, responds with
BatchGetItemOutput
with field(s):responses(Option<HashMap::<String, Vec::<HashMap::<String, AttributeValue>>>>)
:A map of table name or table ARN to a list of items. Each object in
Responses
consists of a table name or ARN, along with a map of attribute data consisting of the data type and attribute value.unprocessed_keys(Option<HashMap::<String, KeysAndAttributes>>)
:A map of tables and their respective keys that were not processed with the current response. The
UnprocessedKeys
value is in the same form asRequestItems
, so the value can be provided directly to a subsequentBatchGetItem
operation. For more information, seeRequestItems
in the Request Parameters section.Each element consists of:
-
Keys
- An array of primary key attribute values that define specific items in the table. -
ProjectionExpression
- One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result. -
ConsistentRead
- The consistency of a read operation. If set totrue
, then a strongly consistent read is used; otherwise, an eventually consistent read is used.
If there are no unprocessed keys remaining, the response contains an empty
UnprocessedKeys
map.-
consumed_capacity(Option<Vec::<ConsumedCapacity>>)
:The read capacity units consumed by the entire
BatchGetItem
operation.Each element consists of:
-
TableName
- The table that consumed the provisioned throughput. -
CapacityUnits
- The total number of capacity units consumed.
-
- On failure, responds with
SdkError<BatchGetItemError>
source§impl Client
impl Client
sourcepub fn batch_write_item(&self) -> BatchWriteItemFluentBuilder
pub fn batch_write_item(&self) -> BatchWriteItemFluentBuilder
Constructs a fluent builder for the BatchWriteItem
operation.
- The fluent builder is configurable:
request_items(impl Into<String>, Vec::<WriteRequest>)
/set_request_items(Option<HashMap::<String, Vec::<WriteRequest>>>)
:
required: trueA map of one or more table names or table ARNs and, for each table, a list of operations to be performed (
DeleteRequest
orPutRequest
). Each element in the map consists of the following:-
DeleteRequest
- Perform aDeleteItem
operation on the specified item. The item to be deleted is identified by aKey
subelement:-
Key
- A map of primary key attribute values that uniquely identify the item. Each entry in this map consists of an attribute name and an attribute value. For each primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
-
-
PutRequest
- Perform aPutItem
operation on the specified item. The item to be put is identified by anItem
subelement:-
Item
- A map of attributes and their values. Each entry in this map consists of an attribute name and an attribute value. Attribute values must not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests that contain empty values are rejected with aValidationException
exception.If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table’s attribute definition.
-
-
return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
return_item_collection_metrics(ReturnItemCollectionMetrics)
/set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:
required: falseDetermines whether item collection metrics are returned. If set to
SIZE
, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set toNONE
(the default), no statistics are returned.
- On success, responds with
BatchWriteItemOutput
with field(s):unprocessed_items(Option<HashMap::<String, Vec::<WriteRequest>>>)
:A map of tables and requests against those tables that were not processed. The
UnprocessedItems
value is in the same form asRequestItems
, so you can provide this value directly to a subsequentBatchWriteItem
operation. For more information, seeRequestItems
in the Request Parameters section.Each
UnprocessedItems
entry consists of a table name or table ARN and, for that table, a list of operations to perform (DeleteRequest
orPutRequest
).-
DeleteRequest
- Perform aDeleteItem
operation on the specified item. The item to be deleted is identified by aKey
subelement:-
Key
- A map of primary key attribute values that uniquely identify the item. Each entry in this map consists of an attribute name and an attribute value.
-
-
PutRequest
- Perform aPutItem
operation on the specified item. The item to be put is identified by anItem
subelement:-
Item
- A map of attributes and their values. Each entry in this map consists of an attribute name and an attribute value. Attribute values must not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests that contain empty values will be rejected with aValidationException
exception.If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table’s attribute definition.
-
If there are no unprocessed items remaining, the response contains an empty
UnprocessedItems
map.-
item_collection_metrics(Option<HashMap::<String, Vec::<ItemCollectionMetrics>>>)
:A list of tables that were processed by
BatchWriteItem
and, for each table, information about any item collections that were affected by individualDeleteItem
orPutItem
operations.Each entry consists of the following subelements:
-
ItemCollectionKey
- The partition key value of the item collection. This is the same as the partition key value of the item. -
SizeEstimateRangeGB
- An estimate of item collection size, expressed in GB. This is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on the table. Use this estimate to measure whether a local secondary index is approaching its size limit.The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.
-
consumed_capacity(Option<Vec::<ConsumedCapacity>>)
:The capacity units consumed by the entire
BatchWriteItem
operation.Each element consists of:
-
TableName
- The table that consumed the provisioned throughput. -
CapacityUnits
- The total number of capacity units consumed.
-
- On failure, responds with
SdkError<BatchWriteItemError>
source§impl Client
impl Client
sourcepub fn create_backup(&self) -> CreateBackupFluentBuilder
pub fn create_backup(&self) -> CreateBackupFluentBuilder
Constructs a fluent builder for the CreateBackup
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
backup_name(impl Into<String>)
/set_backup_name(Option<String>)
:
required: trueSpecified name for the backup.
- On success, responds with
CreateBackupOutput
with field(s):backup_details(Option<BackupDetails>)
:Contains the details of the backup created for the table.
- On failure, responds with
SdkError<CreateBackupError>
source§impl Client
impl Client
sourcepub fn create_global_table(&self) -> CreateGlobalTableFluentBuilder
pub fn create_global_table(&self) -> CreateGlobalTableFluentBuilder
Constructs a fluent builder for the CreateGlobalTable
operation.
- The fluent builder is configurable:
global_table_name(impl Into<String>)
/set_global_table_name(Option<String>)
:
required: trueThe global table name.
replication_group(Replica)
/set_replication_group(Option<Vec::<Replica>>)
:
required: trueThe Regions where the global table needs to be created.
- On success, responds with
CreateGlobalTableOutput
with field(s):global_table_description(Option<GlobalTableDescription>)
:Contains the details of the global table.
- On failure, responds with
SdkError<CreateGlobalTableError>
source§impl Client
impl Client
sourcepub fn create_table(&self) -> CreateTableFluentBuilder
pub fn create_table(&self) -> CreateTableFluentBuilder
Constructs a fluent builder for the CreateTable
operation.
- The fluent builder is configurable:
attribute_definitions(AttributeDefinition)
/set_attribute_definitions(Option<Vec::<AttributeDefinition>>)
:
required: trueAn array of attributes that describe the key schema for the table and indexes.
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
key_schema(KeySchemaElement)
/set_key_schema(Option<Vec::<KeySchemaElement>>)
:
required: trueSpecifies the attributes that make up the primary key for a table or an index. The attributes in
KeySchema
must also be defined in theAttributeDefinitions
array. For more information, see Data Model in the Amazon DynamoDB Developer Guide.Each
KeySchemaElement
in the array is composed of:-
AttributeName
- The name of this key attribute. -
KeyType
- The role that the key attribute will assume:-
HASH
- partition key -
RANGE
- sort key
-
The partition key of an item is also known as its hash attribute. The term “hash attribute” derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute. The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
For a simple primary key (partition key), you must provide exactly one element with a
KeyType
ofHASH
.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
KeyType
ofHASH
, and the second element must have aKeyType
ofRANGE
.For more information, see Working with Tables in the Amazon DynamoDB Developer Guide.
-
local_secondary_indexes(LocalSecondaryIndex)
/set_local_secondary_indexes(Option<Vec::<LocalSecondaryIndex>>)
:
required: falseOne 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.
Each local secondary index in the array includes the following:
-
IndexName
- The name of the local secondary index. Must be unique only for this table. -
KeySchema
- Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table. -
Projection
- 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:-
ProjectionType
- One of the following:-
KEYS_ONLY
- Only the index and primary keys are projected into the index. -
INCLUDE
- Only the specified table attributes are projected into the index. The list of projected attributes is inNonKeyAttributes
. -
ALL
- All of the table attributes are projected into the index.
-
-
NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided inNonKeyAttributes
, 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.
-
-
global_secondary_indexes(GlobalSecondaryIndex)
/set_global_secondary_indexes(Option<Vec::<GlobalSecondaryIndex>>)
:
required: falseOne 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:
-
IndexName
- The name of the global secondary index. Must be unique only for this table. -
KeySchema
- Specifies the key schema for the global secondary index. -
Projection
- 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:-
ProjectionType
- One of the following:-
KEYS_ONLY
- Only the index and primary keys are projected into the index. -
INCLUDE
- Only the specified table attributes are projected into the index. The list of projected attributes is inNonKeyAttributes
. -
ALL
- All of the table attributes are projected into the index.
-
-
NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided inNonKeyAttributes
, 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.
-
-
ProvisionedThroughput
- The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.
-
billing_mode(BillingMode)
/set_billing_mode(Option<BillingMode>)
:
required: falseControls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.
-
PROVISIONED
- We recommend usingPROVISIONED
for predictable workloads.PROVISIONED
sets the billing mode to Provisioned capacity mode. -
PAY_PER_REQUEST
- We recommend usingPAY_PER_REQUEST
for unpredictable workloads.PAY_PER_REQUEST
sets the billing mode to On-demand capacity mode.
-
provisioned_throughput(ProvisionedThroughput)
/set_provisioned_throughput(Option<ProvisionedThroughput>)
:
required: falseRepresents the provisioned throughput settings for a specified table or index. The settings can be modified using the
UpdateTable
operation.If you set BillingMode as
PROVISIONED
, you must specify this property. If you set BillingMode asPAY_PER_REQUEST
, you cannot specify this property.For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.
stream_specification(StreamSpecification)
/set_stream_specification(Option<StreamSpecification>)
:
required: falseThe settings for DynamoDB Streams on the table. These settings consist of:
-
StreamEnabled
- Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false). -
StreamViewType
- When an item in the table is modified,StreamViewType
determines what information is written to the table’s stream. Valid values forStreamViewType
are:-
KEYS_ONLY
- Only the key attributes of the modified item are written to the stream. -
NEW_IMAGE
- The entire item, as it appears after it was modified, is written to the stream. -
OLD_IMAGE
- The entire item, as it appeared before it was modified, is written to the stream. -
NEW_AND_OLD_IMAGES
- Both the new and the old item images of the item are written to the stream.
-
-
sse_specification(SseSpecification)
/set_sse_specification(Option<SseSpecification>)
:
required: falseRepresents the settings used to enable server-side encryption.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseA list of key-value pairs to label the table. For more information, see Tagging for DynamoDB.
table_class(TableClass)
/set_table_class(Option<TableClass>)
:
required: falseThe table class of the new table. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
.deletion_protection_enabled(bool)
/set_deletion_protection_enabled(Option<bool>)
:
required: falseIndicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
resource_policy(impl Into<String>)
/set_resource_policy(Option<String>)
:
required: falseAn Amazon Web Services resource-based policy document in JSON format that will be attached to the table.
When you attach a resource-based policy while creating a table, the policy application is strongly consistent.
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 Resource-based policy considerations.
You need to specify the
CreateTable
andPutResourcePolicy
IAM actions for authorizing a user to create a table with a resource-based policy.on_demand_throughput(OnDemandThroughput)
/set_on_demand_throughput(Option<OnDemandThroughput>)
:
required: falseSets 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
MaxReadRequestUnits
,MaxWriteRequestUnits
, or both.
- On success, responds with
CreateTableOutput
with field(s):table_description(Option<TableDescription>)
:Represents the properties of the table.
- On failure, responds with
SdkError<CreateTableError>
source§impl Client
impl Client
sourcepub fn delete_backup(&self) -> DeleteBackupFluentBuilder
pub fn delete_backup(&self) -> DeleteBackupFluentBuilder
Constructs a fluent builder for the DeleteBackup
operation.
- The fluent builder is configurable:
backup_arn(impl Into<String>)
/set_backup_arn(Option<String>)
:
required: trueThe ARN associated with the backup.
- On success, responds with
DeleteBackupOutput
with field(s):backup_description(Option<BackupDescription>)
:Contains the description of the backup created for the table.
- On failure, responds with
SdkError<DeleteBackupError>
source§impl Client
impl Client
sourcepub fn delete_item(&self) -> DeleteItemFluentBuilder
pub fn delete_item(&self) -> DeleteItemFluentBuilder
Constructs a fluent builder for the DeleteItem
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table from which to delete the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
key(impl Into<String>, AttributeValue)
/set_key(Option<HashMap::<String, AttributeValue>>)
:
required: trueA map of attribute names to
AttributeValue
objects, representing the primary key of the item to delete.For the primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
expected(impl Into<String>, ExpectedAttributeValue)
/set_expected(Option<HashMap::<String, ExpectedAttributeValue>>)
:
required: falseThis is a legacy parameter. Use
ConditionExpression
instead. For more information, see Expected in the Amazon DynamoDB Developer Guide.conditional_operator(ConditionalOperator)
/set_conditional_operator(Option<ConditionalOperator>)
:
required: falseThis is a legacy parameter. Use
ConditionExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.return_values(ReturnValue)
/set_return_values(Option<ReturnValue>)
:
required: falseUse
ReturnValues
if you want to get the item attributes as they appeared before they were deleted. ForDeleteItem
, the valid values are:-
NONE
- IfReturnValues
is not specified, or if its value isNONE
, then nothing is returned. (This setting is the default forReturnValues
.) -
ALL_OLD
- The content of the old item is returned.
There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
The
ReturnValues
parameter is used by several DynamoDB operations; however,DeleteItem
does not recognize any values other thanNONE
orALL_OLD
.-
return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
return_item_collection_metrics(ReturnItemCollectionMetrics)
/set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:
required: falseDetermines whether item collection metrics are returned. If set to
SIZE
, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set toNONE
(the default), no statistics are returned.condition_expression(impl Into<String>)
/set_condition_expression(Option<String>)
:
required: falseA condition that must be satisfied in order for a conditional
DeleteItem
to succeed.An expression can contain any of the following:
-
Functions:
attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size
These function names are case-sensitive.
-
Comparison operators:
= | <> | < | > | <= | >= | BETWEEN | IN
-
Logical operators:
AND | OR | NOT
For more information about condition expressions, see Condition Expressions in the Amazon DynamoDB Developer Guide.
-
expression_attribute_names(impl Into<String>, impl Into<String>)
/set_expression_attribute_names(Option<HashMap::<String, String>>)
:
required: falseOne or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:-
{“#P”:“Percentile”}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
-
expression_attribute_values(impl Into<String>, AttributeValue)
/set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>)
:
required: falseOne or more values that can be substituted in an expression.
Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:
Available | Backordered | Discontinued
You would first need to specify
ExpressionAttributeValues
as follows:{ “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }
You could then use these values in an expression, such as this:
ProductStatus IN (:avail, :back, :disc)
For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide.
return_values_on_condition_check_failure(ReturnValuesOnConditionCheckFailure)
/set_return_values_on_condition_check_failure(Option<ReturnValuesOnConditionCheckFailure>)
:
required: falseAn optional parameter that returns the item attributes for a
DeleteItem
operation that failed a condition check.There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
- On success, responds with
DeleteItemOutput
with field(s):attributes(Option<HashMap::<String, AttributeValue>>)
:A map of attribute names to
AttributeValue
objects, representing the item as it appeared before theDeleteItem
operation. This map appears in the response only ifReturnValues
was specified asALL_OLD
in the request.consumed_capacity(Option<ConsumedCapacity>)
:The capacity units consumed by the
DeleteItem
operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.ConsumedCapacity
is only returned if theReturnConsumedCapacity
parameter was specified. For more information, see Provisioned capacity mode in the Amazon DynamoDB Developer Guide.item_collection_metrics(Option<ItemCollectionMetrics>)
:Information about item collections, if any, that were affected by the
DeleteItem
operation.ItemCollectionMetrics
is only returned if theReturnItemCollectionMetrics
parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.Each
ItemCollectionMetrics
element consists of:-
ItemCollectionKey
- The partition key value of the item collection. This is the same as the partition key value of the item itself. -
SizeEstimateRangeGB
- An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.
-
- On failure, responds with
SdkError<DeleteItemError>
source§impl Client
impl Client
sourcepub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder
pub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder
Constructs a fluent builder for the DeleteResourcePolicy
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the DynamoDB resource from which the policy will be removed. The resources you can specify include tables and streams. If you remove the policy of a table, it will also remove the permissions for the table’s indexes defined in that policy document. This is because index permissions are defined in the table’s policy.
expected_revision_id(impl Into<String>)
/set_expected_revision_id(Option<String>)
:
required: falseA string value that you can use to conditionally delete your policy. When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn’t match or if there’s no policy attached to the resource, the request will fail and return a
PolicyNotFoundException
.
- On success, responds with
DeleteResourcePolicyOutput
with field(s):revision_id(Option<String>)
:A unique string that represents the revision ID of the policy. If you’re comparing revision IDs, make sure to always use string comparison logic.
This value will be empty if you make a request against a resource without a policy.
- On failure, responds with
SdkError<DeleteResourcePolicyError>
source§impl Client
impl Client
sourcepub fn delete_table(&self) -> DeleteTableFluentBuilder
pub fn delete_table(&self) -> DeleteTableFluentBuilder
Constructs a fluent builder for the DeleteTable
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table to delete. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
- On success, responds with
DeleteTableOutput
with field(s):table_description(Option<TableDescription>)
:Represents the properties of a table.
- On failure, responds with
SdkError<DeleteTableError>
source§impl Client
impl Client
sourcepub fn describe_backup(&self) -> DescribeBackupFluentBuilder
pub fn describe_backup(&self) -> DescribeBackupFluentBuilder
Constructs a fluent builder for the DescribeBackup
operation.
- The fluent builder is configurable:
backup_arn(impl Into<String>)
/set_backup_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) associated with the backup.
- On success, responds with
DescribeBackupOutput
with field(s):backup_description(Option<BackupDescription>)
:Contains the description of the backup created for the table.
- On failure, responds with
SdkError<DescribeBackupError>
source§impl Client
impl Client
sourcepub fn describe_continuous_backups(
&self,
) -> DescribeContinuousBackupsFluentBuilder
pub fn describe_continuous_backups( &self, ) -> DescribeContinuousBackupsFluentBuilder
Constructs a fluent builder for the DescribeContinuousBackups
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueName of the table for which the customer wants to check the continuous backups and point in time recovery settings.
You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
- On success, responds with
DescribeContinuousBackupsOutput
with field(s):continuous_backups_description(Option<ContinuousBackupsDescription>)
:Represents the continuous backups and point in time recovery settings on the table.
- On failure, responds with
SdkError<DescribeContinuousBackupsError>
source§impl Client
impl Client
sourcepub fn describe_contributor_insights(
&self,
) -> DescribeContributorInsightsFluentBuilder
pub fn describe_contributor_insights( &self, ) -> DescribeContributorInsightsFluentBuilder
Constructs a fluent builder for the DescribeContributorInsights
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
index_name(impl Into<String>)
/set_index_name(Option<String>)
:
required: falseThe name of the global secondary index to describe, if applicable.
- On success, responds with
DescribeContributorInsightsOutput
with field(s):table_name(Option<String>)
:The name of the table being described.
index_name(Option<String>)
:The name of the global secondary index being described.
contributor_insights_rule_list(Option<Vec::<String>>)
:List of names of the associated contributor insights rules.
contributor_insights_status(Option<ContributorInsightsStatus>)
:Current status of contributor insights.
last_update_date_time(Option<DateTime>)
:Timestamp of the last time the status was changed.
failure_exception(Option<FailureException>)
:Returns information about the last failure that was encountered.
The most common exceptions for a FAILED status are:
-
LimitExceededException - Per-account Amazon CloudWatch Contributor Insights rule limit reached. Please disable Contributor Insights for other tables/indexes OR disable Contributor Insights rules before retrying.
-
AccessDeniedException - Amazon CloudWatch Contributor Insights rules cannot be modified due to insufficient permissions.
-
AccessDeniedException - Failed to create service-linked role for Contributor Insights due to insufficient permissions.
-
InternalServerError - Failed to create Amazon CloudWatch Contributor Insights rules. Please retry request.
-
- On failure, responds with
SdkError<DescribeContributorInsightsError>
source§impl Client
impl Client
sourcepub fn describe_endpoints(&self) -> DescribeEndpointsFluentBuilder
pub fn describe_endpoints(&self) -> DescribeEndpointsFluentBuilder
Constructs a fluent builder for the DescribeEndpoints
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeEndpointsOutput
with field(s):endpoints(Vec::<Endpoint>)
:List of endpoints.
- On failure, responds with
SdkError<DescribeEndpointsError>
source§impl Client
impl Client
sourcepub fn describe_export(&self) -> DescribeExportFluentBuilder
pub fn describe_export(&self) -> DescribeExportFluentBuilder
Constructs a fluent builder for the DescribeExport
operation.
- The fluent builder is configurable:
export_arn(impl Into<String>)
/set_export_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) associated with the export.
- On success, responds with
DescribeExportOutput
with field(s):export_description(Option<ExportDescription>)
:Represents the properties of the export.
- On failure, responds with
SdkError<DescribeExportError>
source§impl Client
impl Client
sourcepub fn describe_global_table(&self) -> DescribeGlobalTableFluentBuilder
pub fn describe_global_table(&self) -> DescribeGlobalTableFluentBuilder
Constructs a fluent builder for the DescribeGlobalTable
operation.
- The fluent builder is configurable:
global_table_name(impl Into<String>)
/set_global_table_name(Option<String>)
:
required: trueThe name of the global table.
- On success, responds with
DescribeGlobalTableOutput
with field(s):global_table_description(Option<GlobalTableDescription>)
:Contains the details of the global table.
- On failure, responds with
SdkError<DescribeGlobalTableError>
source§impl Client
impl Client
sourcepub fn describe_global_table_settings(
&self,
) -> DescribeGlobalTableSettingsFluentBuilder
pub fn describe_global_table_settings( &self, ) -> DescribeGlobalTableSettingsFluentBuilder
Constructs a fluent builder for the DescribeGlobalTableSettings
operation.
- The fluent builder is configurable:
global_table_name(impl Into<String>)
/set_global_table_name(Option<String>)
:
required: trueThe name of the global table to describe.
- On success, responds with
DescribeGlobalTableSettingsOutput
with field(s):global_table_name(Option<String>)
:The name of the global table.
replica_settings(Option<Vec::<ReplicaSettingsDescription>>)
:The Region-specific settings for the global table.
- On failure, responds with
SdkError<DescribeGlobalTableSettingsError>
source§impl Client
impl Client
sourcepub fn describe_import(&self) -> DescribeImportFluentBuilder
pub fn describe_import(&self) -> DescribeImportFluentBuilder
Constructs a fluent builder for the DescribeImport
operation.
- The fluent builder is configurable:
import_arn(impl Into<String>)
/set_import_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) associated with the table you’re importing to.
- On success, responds with
DescribeImportOutput
with field(s):import_table_description(Option<ImportTableDescription>)
:Represents the properties of the table created for the import, and parameters of the import. The import parameters include import status, how many items were processed, and how many errors were encountered.
- On failure, responds with
SdkError<DescribeImportError>
source§impl Client
impl Client
sourcepub fn describe_kinesis_streaming_destination(
&self,
) -> DescribeKinesisStreamingDestinationFluentBuilder
pub fn describe_kinesis_streaming_destination( &self, ) -> DescribeKinesisStreamingDestinationFluentBuilder
Constructs a fluent builder for the DescribeKinesisStreamingDestination
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table being described. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
- On success, responds with
DescribeKinesisStreamingDestinationOutput
with field(s):table_name(Option<String>)
:The name of the table being described.
kinesis_data_stream_destinations(Option<Vec::<KinesisDataStreamDestination>>)
:The list of replica structures for the table being described.
- On failure, responds with
SdkError<DescribeKinesisStreamingDestinationError>
source§impl Client
impl Client
sourcepub fn describe_limits(&self) -> DescribeLimitsFluentBuilder
pub fn describe_limits(&self) -> DescribeLimitsFluentBuilder
Constructs a fluent builder for the DescribeLimits
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeLimitsOutput
with field(s):account_max_read_capacity_units(Option<i64>)
:The maximum total read capacity units that your account allows you to provision across all of your tables in this Region.
account_max_write_capacity_units(Option<i64>)
:The maximum total write capacity units that your account allows you to provision across all of your tables in this Region.
table_max_read_capacity_units(Option<i64>)
:The maximum read capacity units that your account allows you to provision for a new table that you are creating in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).
table_max_write_capacity_units(Option<i64>)
:The maximum write capacity units that your account allows you to provision for a new table that you are creating in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).
- On failure, responds with
SdkError<DescribeLimitsError>
source§impl Client
impl Client
sourcepub fn describe_table(&self) -> DescribeTableFluentBuilder
pub fn describe_table(&self) -> DescribeTableFluentBuilder
Constructs a fluent builder for the DescribeTable
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
- On success, responds with
DescribeTableOutput
with field(s):table(Option<TableDescription>)
:The properties of the table.
- On failure, responds with
SdkError<DescribeTableError>
source§impl Client
impl Client
sourcepub fn describe_table_replica_auto_scaling(
&self,
) -> DescribeTableReplicaAutoScalingFluentBuilder
pub fn describe_table_replica_auto_scaling( &self, ) -> DescribeTableReplicaAutoScalingFluentBuilder
Constructs a fluent builder for the DescribeTableReplicaAutoScaling
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
- On success, responds with
DescribeTableReplicaAutoScalingOutput
with field(s):table_auto_scaling_description(Option<TableAutoScalingDescription>)
:Represents the auto scaling properties of the table.
- On failure, responds with
SdkError<DescribeTableReplicaAutoScalingError>
source§impl Client
impl Client
sourcepub fn describe_time_to_live(&self) -> DescribeTimeToLiveFluentBuilder
pub fn describe_time_to_live(&self) -> DescribeTimeToLiveFluentBuilder
Constructs a fluent builder for the DescribeTimeToLive
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table to be described. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
- On success, responds with
DescribeTimeToLiveOutput
with field(s): - On failure, responds with
SdkError<DescribeTimeToLiveError>
source§impl Client
impl Client
sourcepub fn disable_kinesis_streaming_destination(
&self,
) -> DisableKinesisStreamingDestinationFluentBuilder
pub fn disable_kinesis_streaming_destination( &self, ) -> DisableKinesisStreamingDestinationFluentBuilder
Constructs a fluent builder for the DisableKinesisStreamingDestination
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the DynamoDB table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: trueThe ARN for a Kinesis data stream.
enable_kinesis_streaming_configuration(EnableKinesisStreamingConfiguration)
/set_enable_kinesis_streaming_configuration(Option<EnableKinesisStreamingConfiguration>)
:
required: falseThe source for the Kinesis streaming information that is being enabled.
- On success, responds with
DisableKinesisStreamingDestinationOutput
with field(s):table_name(Option<String>)
:The name of the table being modified.
stream_arn(Option<String>)
:The ARN for the specific Kinesis data stream.
destination_status(Option<DestinationStatus>)
:The current status of the replication.
enable_kinesis_streaming_configuration(Option<EnableKinesisStreamingConfiguration>)
:The destination for the Kinesis streaming information that is being enabled.
- On failure, responds with
SdkError<DisableKinesisStreamingDestinationError>
source§impl Client
impl Client
sourcepub fn enable_kinesis_streaming_destination(
&self,
) -> EnableKinesisStreamingDestinationFluentBuilder
pub fn enable_kinesis_streaming_destination( &self, ) -> EnableKinesisStreamingDestinationFluentBuilder
Constructs a fluent builder for the EnableKinesisStreamingDestination
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the DynamoDB table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: trueThe ARN for a Kinesis data stream.
enable_kinesis_streaming_configuration(EnableKinesisStreamingConfiguration)
/set_enable_kinesis_streaming_configuration(Option<EnableKinesisStreamingConfiguration>)
:
required: falseThe source for the Kinesis streaming information that is being enabled.
- On success, responds with
EnableKinesisStreamingDestinationOutput
with field(s):table_name(Option<String>)
:The name of the table being modified.
stream_arn(Option<String>)
:The ARN for the specific Kinesis data stream.
destination_status(Option<DestinationStatus>)
:The current status of the replication.
enable_kinesis_streaming_configuration(Option<EnableKinesisStreamingConfiguration>)
:The destination for the Kinesis streaming information that is being enabled.
- On failure, responds with
SdkError<EnableKinesisStreamingDestinationError>
source§impl Client
impl Client
sourcepub fn execute_statement(&self) -> ExecuteStatementFluentBuilder
pub fn execute_statement(&self) -> ExecuteStatementFluentBuilder
Constructs a fluent builder for the ExecuteStatement
operation.
- The fluent builder is configurable:
statement(impl Into<String>)
/set_statement(Option<String>)
:
required: trueThe PartiQL statement representing the operation to run.
parameters(AttributeValue)
/set_parameters(Option<Vec::<AttributeValue>>)
:
required: falseThe parameters for the PartiQL statement, if any.
consistent_read(bool)
/set_consistent_read(Option<bool>)
:
required: falseThe consistency of a read operation. If set to
true
, then a strongly consistent read is used; otherwise, an eventually consistent read is used.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSet this value to get remaining results, if
NextToken
was returned in the statement response.return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
limit(i32)
/set_limit(Option<i32>)
:
required: falseThe maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, along with a key in
LastEvaluatedKey
to apply in a subsequent operation so you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key inLastEvaluatedKey
to apply in a subsequent operation to continue the operation.return_values_on_condition_check_failure(ReturnValuesOnConditionCheckFailure)
/set_return_values_on_condition_check_failure(Option<ReturnValuesOnConditionCheckFailure>)
:
required: falseAn optional parameter that returns the item attributes for an
ExecuteStatement
operation that failed a condition check.There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
- On success, responds with
ExecuteStatementOutput
with field(s):items(Option<Vec::<HashMap::<String, AttributeValue>>>)
:If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.
next_token(Option<String>)
:If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.
consumed_capacity(Option<ConsumedCapacity>)
:The capacity units consumed by an operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.
ConsumedCapacity
is only returned if the request asked for it. For more information, see Provisioned capacity mode in the Amazon DynamoDB Developer Guide.last_evaluated_key(Option<HashMap::<String, AttributeValue>>)
:The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If
LastEvaluatedKey
is empty, then the “last page” of results has been processed and there is no more data to be retrieved. IfLastEvaluatedKey
is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is whenLastEvaluatedKey
is empty.
- On failure, responds with
SdkError<ExecuteStatementError>
source§impl Client
impl Client
sourcepub fn execute_transaction(&self) -> ExecuteTransactionFluentBuilder
pub fn execute_transaction(&self) -> ExecuteTransactionFluentBuilder
Constructs a fluent builder for the ExecuteTransaction
operation.
- The fluent builder is configurable:
transact_statements(ParameterizedStatement)
/set_transact_statements(Option<Vec::<ParameterizedStatement>>)
:
required: trueThe list of PartiQL statements representing the transaction to run.
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseSet this value to get remaining results, if
NextToken
was returned in the statement response.return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response. For more information, see TransactGetItems and TransactWriteItems.
- On success, responds with
ExecuteTransactionOutput
with field(s):responses(Option<Vec::<ItemResponse>>)
:The response to a PartiQL transaction.
consumed_capacity(Option<Vec::<ConsumedCapacity>>)
:The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.
- On failure, responds with
SdkError<ExecuteTransactionError>
source§impl Client
impl Client
sourcepub fn export_table_to_point_in_time(
&self,
) -> ExportTableToPointInTimeFluentBuilder
pub fn export_table_to_point_in_time( &self, ) -> ExportTableToPointInTimeFluentBuilder
Constructs a fluent builder for the ExportTableToPointInTime
operation.
- The fluent builder is configurable:
table_arn(impl Into<String>)
/set_table_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) associated with the table to export.
export_time(DateTime)
/set_export_time(Option<DateTime>)
:
required: falseTime in the past from which to export table data, counted in seconds from the start of the Unix epoch. The table export will be a snapshot of the table’s state at this point in time.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseProviding a
ClientToken
makes the call toExportTableToPointInTimeInput
idempotent, meaning that multiple identical calls have the same effect as one single call.A client token is valid for 8 hours after the first request that uses it is completed. After 8 hours, any request with the same client token is treated as a new request. Do not resubmit the same request with the same client token for more than 8 hours, or the result might not be idempotent.
If you submit a request with the same client token but a change in other parameters within the 8-hour idempotency window, DynamoDB returns an
ImportConflictException
.s3_bucket(impl Into<String>)
/set_s3_bucket(Option<String>)
:
required: trueThe name of the Amazon S3 bucket to export the snapshot to.
s3_bucket_owner(impl Into<String>)
/set_s3_bucket_owner(Option<String>)
:
required: falseThe ID of the Amazon Web Services account that owns the bucket the export will be stored in.
S3BucketOwner is a required parameter when exporting to a S3 bucket in another account.
s3_prefix(impl Into<String>)
/set_s3_prefix(Option<String>)
:
required: falseThe Amazon S3 bucket prefix to use as the file name and path of the exported snapshot.
s3_sse_algorithm(S3SseAlgorithm)
/set_s3_sse_algorithm(Option<S3SseAlgorithm>)
:
required: falseType of encryption used on the bucket where export data will be stored. Valid values for
S3SseAlgorithm
are:-
AES256
- server-side encryption with Amazon S3 managed keys -
KMS
- server-side encryption with KMS managed keys
-
s3_sse_kms_key_id(impl Into<String>)
/set_s3_sse_kms_key_id(Option<String>)
:
required: falseThe ID of the KMS managed key used to encrypt the S3 bucket where export data will be stored (if applicable).
export_format(ExportFormat)
/set_export_format(Option<ExportFormat>)
:
required: falseThe format for the exported data. Valid values for
ExportFormat
areDYNAMODB_JSON
orION
.export_type(ExportType)
/set_export_type(Option<ExportType>)
:
required: falseChoice of whether to execute as a full export or incremental export. Valid values are FULL_EXPORT or INCREMENTAL_EXPORT. The default value is FULL_EXPORT. If INCREMENTAL_EXPORT is provided, the IncrementalExportSpecification must also be used.
incremental_export_specification(IncrementalExportSpecification)
/set_incremental_export_specification(Option<IncrementalExportSpecification>)
:
required: falseOptional object containing the parameters specific to an incremental export.
- On success, responds with
ExportTableToPointInTimeOutput
with field(s):export_description(Option<ExportDescription>)
:Contains a description of the table export.
- On failure, responds with
SdkError<ExportTableToPointInTimeError>
source§impl Client
impl Client
sourcepub fn get_item(&self) -> GetItemFluentBuilder
pub fn get_item(&self) -> GetItemFluentBuilder
Constructs a fluent builder for the GetItem
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table containing the requested item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
key(impl Into<String>, AttributeValue)
/set_key(Option<HashMap::<String, AttributeValue>>)
:
required: trueA map of attribute names to
AttributeValue
objects, representing the primary key of the item to retrieve.For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
attributes_to_get(impl Into<String>)
/set_attributes_to_get(Option<Vec::<String>>)
:
required: falseThis is a legacy parameter. Use
ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.consistent_read(bool)
/set_consistent_read(Option<bool>)
:
required: falseDetermines the read consistency model: If set to
true
, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
projection_expression(impl Into<String>)
/set_projection_expression(Option<String>)
:
required: falseA string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.
For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
expression_attribute_names(impl Into<String>, impl Into<String>)
/set_expression_attribute_names(Option<HashMap::<String, String>>)
:
required: falseOne or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:-
{“#P”:“Percentile”}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
-
- On success, responds with
GetItemOutput
with field(s):item(Option<HashMap::<String, AttributeValue>>)
:A map of attribute names to
AttributeValue
objects, as specified byProjectionExpression
.consumed_capacity(Option<ConsumedCapacity>)
:The capacity units consumed by the
GetItem
operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.ConsumedCapacity
is only returned if theReturnConsumedCapacity
parameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.
- On failure, responds with
SdkError<GetItemError>
source§impl Client
impl Client
sourcepub fn get_resource_policy(&self) -> GetResourcePolicyFluentBuilder
pub fn get_resource_policy(&self) -> GetResourcePolicyFluentBuilder
Constructs a fluent builder for the GetResourcePolicy
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the DynamoDB resource to which the policy is attached. The resources you can specify include tables and streams.
- On success, responds with
GetResourcePolicyOutput
with field(s):policy(Option<String>)
:The resource-based policy document attached to the resource, which can be a table or stream, in JSON format.
revision_id(Option<String>)
:A unique string that represents the revision ID of the policy. If you’re comparing revision IDs, make sure to always use string comparison logic.
- On failure, responds with
SdkError<GetResourcePolicyError>
source§impl Client
impl Client
sourcepub fn import_table(&self) -> ImportTableFluentBuilder
pub fn import_table(&self) -> ImportTableFluentBuilder
Constructs a fluent builder for the ImportTable
operation.
- The fluent builder is configurable:
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseProviding a
ClientToken
makes the call toImportTableInput
idempotent, meaning that multiple identical calls have the same effect as one single call.A client token is valid for 8 hours after the first request that uses it is completed. After 8 hours, any request with the same client token is treated as a new request. Do not resubmit the same request with the same client token for more than 8 hours, or the result might not be idempotent.
If you submit a request with the same client token but a change in other parameters within the 8-hour idempotency window, DynamoDB returns an
IdempotentParameterMismatch
exception.s3_bucket_source(S3BucketSource)
/set_s3_bucket_source(Option<S3BucketSource>)
:
required: trueThe S3 bucket that provides the source for the import.
input_format(InputFormat)
/set_input_format(Option<InputFormat>)
:
required: trueThe format of the source data. Valid values for
ImportFormat
areCSV
,DYNAMODB_JSON
orION
.input_format_options(InputFormatOptions)
/set_input_format_options(Option<InputFormatOptions>)
:
required: falseAdditional properties that specify how the input is formatted,
input_compression_type(InputCompressionType)
/set_input_compression_type(Option<InputCompressionType>)
:
required: falseType of compression to be used on the input coming from the imported table.
table_creation_parameters(TableCreationParameters)
/set_table_creation_parameters(Option<TableCreationParameters>)
:
required: trueParameters for the table to import the data into.
- On success, responds with
ImportTableOutput
with field(s):import_table_description(Option<ImportTableDescription>)
:Represents the properties of the table created for the import, and parameters of the import. The import parameters include import status, how many items were processed, and how many errors were encountered.
- On failure, responds with
SdkError<ImportTableError>
source§impl Client
impl Client
sourcepub fn list_backups(&self) -> ListBackupsFluentBuilder
pub fn list_backups(&self) -> ListBackupsFluentBuilder
Constructs a fluent builder for the ListBackups
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: falseLists the backups from the table specified in
TableName
. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.limit(i32)
/set_limit(Option<i32>)
:
required: falseMaximum number of backups to return at once.
time_range_lower_bound(DateTime)
/set_time_range_lower_bound(Option<DateTime>)
:
required: falseOnly backups created after this time are listed.
TimeRangeLowerBound
is inclusive.time_range_upper_bound(DateTime)
/set_time_range_upper_bound(Option<DateTime>)
:
required: falseOnly backups created before this time are listed.
TimeRangeUpperBound
is exclusive.exclusive_start_backup_arn(impl Into<String>)
/set_exclusive_start_backup_arn(Option<String>)
:
required: falseLastEvaluatedBackupArn
is the Amazon Resource Name (ARN) of the backup last evaluated when the current page of results was returned, inclusive of the current page of results. This value may be specified as theExclusiveStartBackupArn
of a newListBackups
operation in order to fetch the next page of results.backup_type(BackupTypeFilter)
/set_backup_type(Option<BackupTypeFilter>)
:
required: falseThe backups from the table specified by
BackupType
are listed.Where
BackupType
can be:-
USER
- On-demand backup created by you. (The default setting if no other backup types are specified.) -
SYSTEM
- On-demand backup automatically created by DynamoDB. -
ALL
- All types of on-demand backups (USER and SYSTEM).
-
- On success, responds with
ListBackupsOutput
with field(s):backup_summaries(Option<Vec::<BackupSummary>>)
:List of
BackupSummary
objects.last_evaluated_backup_arn(Option<String>)
:The ARN of the backup last evaluated when the current page of results was returned, inclusive of the current page of results. This value may be specified as the
ExclusiveStartBackupArn
of a newListBackups
operation in order to fetch the next page of results.If
LastEvaluatedBackupArn
is empty, then the last page of results has been processed and there are no more results to be retrieved.If
LastEvaluatedBackupArn
is not empty, this may or may not indicate that there is more data to be returned. All results are guaranteed to have been returned if and only if no value forLastEvaluatedBackupArn
is returned.
- On failure, responds with
SdkError<ListBackupsError>
source§impl Client
impl Client
sourcepub fn list_contributor_insights(&self) -> ListContributorInsightsFluentBuilder
pub fn list_contributor_insights(&self) -> ListContributorInsightsFluentBuilder
Constructs a fluent builder for the ListContributorInsights
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: falseThe name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA token to for the desired page, if there is one.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseMaximum number of results to return per page.
- On success, responds with
ListContributorInsightsOutput
with field(s):contributor_insights_summaries(Option<Vec::<ContributorInsightsSummary>>)
:A list of ContributorInsightsSummary.
next_token(Option<String>)
:A token to go to the next page if there is one.
- On failure, responds with
SdkError<ListContributorInsightsError>
source§impl Client
impl Client
sourcepub fn list_exports(&self) -> ListExportsFluentBuilder
pub fn list_exports(&self) -> ListExportsFluentBuilder
Constructs a fluent builder for the ListExports
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
table_arn(impl Into<String>)
/set_table_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) associated with the exported table.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseMaximum number of results to return per page.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseAn optional string that, if supplied, must be copied from the output of a previous call to
ListExports
. When provided in this manner, the API fetches the next page of results.
- On success, responds with
ListExportsOutput
with field(s):export_summaries(Option<Vec::<ExportSummary>>)
:A list of
ExportSummary
objects.next_token(Option<String>)
:If this value is returned, there are additional results to be displayed. To retrieve them, call
ListExports
again, withNextToken
set to this value.
- On failure, responds with
SdkError<ListExportsError>
source§impl Client
impl Client
sourcepub fn list_global_tables(&self) -> ListGlobalTablesFluentBuilder
pub fn list_global_tables(&self) -> ListGlobalTablesFluentBuilder
Constructs a fluent builder for the ListGlobalTables
operation.
- The fluent builder is configurable:
exclusive_start_global_table_name(impl Into<String>)
/set_exclusive_start_global_table_name(Option<String>)
:
required: falseThe first global table name that this operation will evaluate.
limit(i32)
/set_limit(Option<i32>)
:
required: falseThe maximum number of table names to return, if the parameter is not specified DynamoDB defaults to 100.
If the number of global tables DynamoDB finds reaches this limit, it stops the operation and returns the table names collected up to that point, with a table name in the
LastEvaluatedGlobalTableName
to apply in a subsequent operation to theExclusiveStartGlobalTableName
parameter.region_name(impl Into<String>)
/set_region_name(Option<String>)
:
required: falseLists the global tables in a specific Region.
- On success, responds with
ListGlobalTablesOutput
with field(s):global_tables(Option<Vec::<GlobalTable>>)
:List of global table names.
last_evaluated_global_table_name(Option<String>)
:Last evaluated global table name.
- On failure, responds with
SdkError<ListGlobalTablesError>
source§impl Client
impl Client
sourcepub fn list_imports(&self) -> ListImportsFluentBuilder
pub fn list_imports(&self) -> ListImportsFluentBuilder
Constructs a fluent builder for the ListImports
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
table_arn(impl Into<String>)
/set_table_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) associated with the table that was imported to.
page_size(i32)
/set_page_size(Option<i32>)
:
required: falseThe number of
ImportSummary
objects returned in a single page.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseAn optional string that, if supplied, must be copied from the output of a previous call to
ListImports
. When provided in this manner, the API fetches the next page of results.
- On success, responds with
ListImportsOutput
with field(s):import_summary_list(Option<Vec::<ImportSummary>>)
:A list of
ImportSummary
objects.next_token(Option<String>)
:If this value is returned, there are additional results to be displayed. To retrieve them, call
ListImports
again, withNextToken
set to this value.
- On failure, responds with
SdkError<ListImportsError>
source§impl Client
impl Client
sourcepub fn list_tables(&self) -> ListTablesFluentBuilder
pub fn list_tables(&self) -> ListTablesFluentBuilder
Constructs a fluent builder for the ListTables
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
exclusive_start_table_name(impl Into<String>)
/set_exclusive_start_table_name(Option<String>)
:
required: falseThe first table name that this operation will evaluate. Use the value that was returned for
LastEvaluatedTableName
in a previous operation, so that you can obtain the next page of results.limit(i32)
/set_limit(Option<i32>)
:
required: falseA maximum number of table names to return. If this parameter is not specified, the limit is 100.
- On success, responds with
ListTablesOutput
with field(s):table_names(Option<Vec::<String>>)
:The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.
If
LastEvaluatedTableName
also appears in the output, you can use this value as theExclusiveStartTableName
parameter in a subsequentListTables
request and obtain the next page of results.last_evaluated_table_name(Option<String>)
:The name of the last table in the current page of results. Use this value as the
ExclusiveStartTableName
in a new request to obtain the next page of results, until all the table names are returned.If you do not receive a
LastEvaluatedTableName
value in the response, this means that there are no more table names to be retrieved.
- On failure, responds with
SdkError<ListTablesError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsOfResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon DynamoDB resource with tags to be listed. This value is an Amazon Resource Name (ARN).
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseAn optional string that, if supplied, must be copied from the output of a previous call to ListTagOfResource. When provided in this manner, this API fetches the next page of results.
- On success, responds with
ListTagsOfResourceOutput
with field(s):tags(Option<Vec::<Tag>>)
:The tags currently associated with the Amazon DynamoDB resource.
next_token(Option<String>)
:If this value is returned, there are additional results to be displayed. To retrieve them, call ListTagsOfResource again, with NextToken set to this value.
- On failure, responds with
SdkError<ListTagsOfResourceError>
source§impl Client
impl Client
sourcepub fn put_item(&self) -> PutItemFluentBuilder
pub fn put_item(&self) -> PutItemFluentBuilder
Constructs a fluent builder for the PutItem
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table to contain the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
item(impl Into<String>, AttributeValue)
/set_item(Option<HashMap::<String, AttributeValue>>)
:
required: trueA map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.
You must provide all of the attributes for the primary key. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide both values for both the partition key and the sort key.
If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table’s attribute definition.
Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.
For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
Each element in the
Item
map is anAttributeValue
object.expected(impl Into<String>, ExpectedAttributeValue)
/set_expected(Option<HashMap::<String, ExpectedAttributeValue>>)
:
required: falseThis is a legacy parameter. Use
ConditionExpression
instead. For more information, see Expected in the Amazon DynamoDB Developer Guide.return_values(ReturnValue)
/set_return_values(Option<ReturnValue>)
:
required: falseUse
ReturnValues
if you want to get the item attributes as they appeared before they were updated with thePutItem
request. ForPutItem
, the valid values are:-
NONE
- IfReturnValues
is not specified, or if its value isNONE
, then nothing is returned. (This setting is the default forReturnValues
.) -
ALL_OLD
- IfPutItem
overwrote an attribute name-value pair, then the content of the old item is returned.
The values returned are strongly consistent.
There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
The
ReturnValues
parameter is used by several DynamoDB operations; however,PutItem
does not recognize any values other thanNONE
orALL_OLD
.-
return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
return_item_collection_metrics(ReturnItemCollectionMetrics)
/set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:
required: falseDetermines whether item collection metrics are returned. If set to
SIZE
, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set toNONE
(the default), no statistics are returned.conditional_operator(ConditionalOperator)
/set_conditional_operator(Option<ConditionalOperator>)
:
required: falseThis is a legacy parameter. Use
ConditionExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.condition_expression(impl Into<String>)
/set_condition_expression(Option<String>)
:
required: falseA condition that must be satisfied in order for a conditional
PutItem
operation to succeed.An expression can contain any of the following:
-
Functions:
attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size
These function names are case-sensitive.
-
Comparison operators:
= | <> | < | > | <= | >= | BETWEEN | IN
-
Logical operators:
AND | OR | NOT
For more information on condition expressions, see Condition Expressions in the Amazon DynamoDB Developer Guide.
-
expression_attribute_names(impl Into<String>, impl Into<String>)
/set_expression_attribute_names(Option<HashMap::<String, String>>)
:
required: falseOne or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:-
{“#P”:“Percentile”}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
-
expression_attribute_values(impl Into<String>, AttributeValue)
/set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>)
:
required: falseOne or more values that can be substituted in an expression.
Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:
Available | Backordered | Discontinued
You would first need to specify
ExpressionAttributeValues
as follows:{ “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }
You could then use these values in an expression, such as this:
ProductStatus IN (:avail, :back, :disc)
For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide.
return_values_on_condition_check_failure(ReturnValuesOnConditionCheckFailure)
/set_return_values_on_condition_check_failure(Option<ReturnValuesOnConditionCheckFailure>)
:
required: falseAn optional parameter that returns the item attributes for a
PutItem
operation that failed a condition check.There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
- On success, responds with
PutItemOutput
with field(s):attributes(Option<HashMap::<String, AttributeValue>>)
:The attribute values as they appeared before the
PutItem
operation, but only ifReturnValues
is specified asALL_OLD
in the request. Each element consists of an attribute name and an attribute value.consumed_capacity(Option<ConsumedCapacity>)
:The capacity units consumed by the
PutItem
operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.ConsumedCapacity
is only returned if theReturnConsumedCapacity
parameter was specified. For more information, see Capacity unity consumption for write operations in the Amazon DynamoDB Developer Guide.item_collection_metrics(Option<ItemCollectionMetrics>)
:Information about item collections, if any, that were affected by the
PutItem
operation.ItemCollectionMetrics
is only returned if theReturnItemCollectionMetrics
parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.Each
ItemCollectionMetrics
element consists of:-
ItemCollectionKey
- The partition key value of the item collection. This is the same as the partition key value of the item itself. -
SizeEstimateRangeGB
- An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.
-
- On failure, responds with
SdkError<PutItemError>
source§impl Client
impl Client
sourcepub fn put_resource_policy(&self) -> PutResourcePolicyFluentBuilder
pub fn put_resource_policy(&self) -> PutResourcePolicyFluentBuilder
Constructs a fluent builder for the PutResourcePolicy
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the DynamoDB resource to which the policy will be attached. The resources you can specify include tables and streams.
You can control index permissions using the base table’s policy. To specify the same permission level for your table and its indexes, you can provide both the table and index Amazon Resource Name (ARN)s in the
Resource
field of a givenStatement
in your policy document. Alternatively, to specify different permissions for your table, indexes, or both, you can define multipleStatement
fields in your policy document.policy(impl Into<String>)
/set_policy(Option<String>)
:
required: trueAn Amazon Web Services resource-based policy document in JSON format.
-
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.
-
Within a resource-based policy, if the action for a DynamoDB service-linked role (SLR) to replicate data for a global table is denied, adding or deleting a replica will fail with an error.
For a full list of all considerations that apply while attaching a resource-based policy, see Resource-based policy considerations.
-
expected_revision_id(impl Into<String>)
/set_expected_revision_id(Option<String>)
:
required: falseA string value that you can use to conditionally update your policy. You can provide the revision ID of your existing policy to make mutating requests against that policy.
When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn’t match or if there’s no policy attached to the resource, your request will be rejected with a
PolicyNotFoundException
.To conditionally attach a policy when no policy exists for the resource, specify
NO_POLICY
for the revision ID.confirm_remove_self_resource_access(bool)
/set_confirm_remove_self_resource_access(Option<bool>)
:
required: falseSet this parameter to
true
to confirm that you want to remove your permissions to change the policy of this resource in the future.
- On success, responds with
PutResourcePolicyOutput
with field(s):revision_id(Option<String>)
:A unique string that represents the revision ID of the policy. If you’re comparing revision IDs, make sure to always use string comparison logic.
- On failure, responds with
SdkError<PutResourcePolicyError>
source§impl Client
impl Client
sourcepub fn query(&self) -> QueryFluentBuilder
pub fn query(&self) -> QueryFluentBuilder
Constructs a fluent builder for the Query
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
index_name(impl Into<String>)
/set_index_name(Option<String>)
:
required: falseThe name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the
IndexName
parameter, you must also provideTableName.
select(Select)
/set_select(Option<Select>)
:
required: falseThe attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.
-
ALL_ATTRIBUTES
- Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required. -
ALL_PROJECTED_ATTRIBUTES
- Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifyingALL_ATTRIBUTES
. -
COUNT
- Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations. -
SPECIFIC_ATTRIBUTES
- Returns only the attributes listed inProjectionExpression
. This return value is equivalent to specifyingProjectionExpression
without specifying any value forSelect
.If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.
If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.
If neither
Select
norProjectionExpression
are specified, DynamoDB defaults toALL_ATTRIBUTES
when accessing a table, andALL_PROJECTED_ATTRIBUTES
when accessing an index. You cannot use bothSelect
andProjectionExpression
together in a single request, unless the value forSelect
isSPECIFIC_ATTRIBUTES
. (This usage is equivalent to specifyingProjectionExpression
without any value forSelect
.)If you use the
ProjectionExpression
parameter, then the value forSelect
can only beSPECIFIC_ATTRIBUTES
. Any other value forSelect
will return an error.-
attributes_to_get(impl Into<String>)
/set_attributes_to_get(Option<Vec::<String>>)
:
required: falseThis is a legacy parameter. Use
ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.limit(i32)
/set_limit(Option<i32>)
:
required: falseThe maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in
LastEvaluatedKey
to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key inLastEvaluatedKey
to apply in a subsequent operation to continue the operation. For more information, see Query and Scan in the Amazon DynamoDB Developer Guide.consistent_read(bool)
/set_consistent_read(Option<bool>)
:
required: falseDetermines the read consistency model: If set to
true
, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with
ConsistentRead
set totrue
, you will receive aValidationException
.key_conditions(impl Into<String>, Condition)
/set_key_conditions(Option<HashMap::<String, Condition>>)
:
required: falseThis is a legacy parameter. Use
KeyConditionExpression
instead. For more information, see KeyConditions in the Amazon DynamoDB Developer Guide.query_filter(impl Into<String>, Condition)
/set_query_filter(Option<HashMap::<String, Condition>>)
:
required: falseThis is a legacy parameter. Use
FilterExpression
instead. For more information, see QueryFilter in the Amazon DynamoDB Developer Guide.conditional_operator(ConditionalOperator)
/set_conditional_operator(Option<ConditionalOperator>)
:
required: falseThis is a legacy parameter. Use
FilterExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.scan_index_forward(bool)
/set_scan_index_forward(Option<bool>)
:
required: falseSpecifies the order for index traversal: If
true
(default), the traversal is performed in ascending order; iffalse
, the traversal is performed in descending order.Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.
If
ScanIndexForward
istrue
, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. IfScanIndexForward
isfalse
, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.exclusive_start_key(impl Into<String>, AttributeValue)
/set_exclusive_start_key(Option<HashMap::<String, AttributeValue>>)
:
required: falseThe primary key of the first item that this operation will evaluate. Use the value that was returned for
LastEvaluatedKey
in the previous operation.The data type for
ExclusiveStartKey
must be String, Number, or Binary. No set data types are allowed.return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
projection_expression(impl Into<String>)
/set_projection_expression(Option<String>)
:
required: falseA string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
filter_expression(impl Into<String>)
/set_filter_expression(Option<String>)
:
required: falseA string that contains conditions that DynamoDB applies after the
Query
operation, but before the data is returned to you. Items that do not satisfy theFilterExpression
criteria are not returned.A
FilterExpression
does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.A
FilterExpression
is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.For more information, see Filter Expressions in the Amazon DynamoDB Developer Guide.
key_condition_expression(impl Into<String>)
/set_key_condition_expression(Option<String>)
:
required: falseThe condition that specifies the key values for items to be retrieved by the
Query
action.The condition must perform an equality test on a single partition key value.
The condition can optionally perform one of several comparison tests on a single sort key value. This allows
Query
to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.The partition key equality test is required, and must be specified in the following format:
partitionKeyName
=:partitionkeyval
If you also want to provide a condition for the sort key, it must be combined using
AND
with the condition for the sort key. Following is an example, using the = comparison operator for the sort key:partitionKeyName
=
:partitionkeyval
AND
sortKeyName
=
:sortkeyval
Valid comparisons for the sort key condition are as follows:
-
sortKeyName
=
:sortkeyval
- true if the sort key value is equal to:sortkeyval
. -
sortKeyName
<
:sortkeyval
- true if the sort key value is less than:sortkeyval
. -
sortKeyName
<=
:sortkeyval
- true if the sort key value is less than or equal to:sortkeyval
. -
sortKeyName
>
:sortkeyval
- true if the sort key value is greater than:sortkeyval
. -
sortKeyName
>=
:sortkeyval
- true if the sort key value is greater than or equal to:sortkeyval
. -
sortKeyName
BETWEEN
:sortkeyval1
AND
:sortkeyval2
- true if the sort key value is greater than or equal to:sortkeyval1
, and less than or equal to:sortkeyval2
. -
begins_with (
sortKeyName
,:sortkeyval
)
- true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function namebegins_with
is case-sensitive.
Use the
ExpressionAttributeValues
parameter to replace tokens such as:partitionval
and:sortval
with actual values at runtime.You can optionally use the
ExpressionAttributeNames
parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the followingKeyConditionExpression
parameter causes an error because Size is a reserved word:-
Size = :myval
To work around this, define a placeholder (such a
#S
) to represent the attribute name Size.KeyConditionExpression
then is as follows:-
#S = :myval
For a list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.
For more information on
ExpressionAttributeNames
andExpressionAttributeValues
, see Using Placeholders for Attribute Names and Values in the Amazon DynamoDB Developer Guide.-
expression_attribute_names(impl Into<String>, impl Into<String>)
/set_expression_attribute_names(Option<HashMap::<String, String>>)
:
required: falseOne or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:-
{“#P”:“Percentile”}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
-
expression_attribute_values(impl Into<String>, AttributeValue)
/set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>)
:
required: falseOne or more values that can be substituted in an expression.
Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:
Available | Backordered | Discontinued
You would first need to specify
ExpressionAttributeValues
as follows:{ “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }
You could then use these values in an expression, such as this:
ProductStatus IN (:avail, :back, :disc)
For more information on expression attribute values, see Specifying Conditions in the Amazon DynamoDB Developer Guide.
- On success, responds with
QueryOutput
with field(s):items(Option<Vec::<HashMap::<String, AttributeValue>>>)
:An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.
count(i32)
:The number of items in the response.
If you used a
QueryFilter
in the request, thenCount
is the number of items returned after the filter was applied, andScannedCount
is the number of matching items before the filter was applied.If you did not use a filter in the request, then
Count
andScannedCount
are the same.scanned_count(i32)
:The number of items evaluated, before any
QueryFilter
is applied. A highScannedCount
value with few, or no,Count
results indicates an inefficientQuery
operation. For more information, see Count and ScannedCount in the Amazon DynamoDB Developer Guide.If you did not use a filter in the request, then
ScannedCount
is the same asCount
.last_evaluated_key(Option<HashMap::<String, AttributeValue>>)
:The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.
If
LastEvaluatedKey
is empty, then the “last page” of results has been processed and there is no more data to be retrieved.If
LastEvaluatedKey
is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is whenLastEvaluatedKey
is empty.consumed_capacity(Option<ConsumedCapacity>)
:The capacity units consumed by the
Query
operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.ConsumedCapacity
is only returned if theReturnConsumedCapacity
parameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.
- On failure, responds with
SdkError<QueryError>
source§impl Client
impl Client
sourcepub fn restore_table_from_backup(&self) -> RestoreTableFromBackupFluentBuilder
pub fn restore_table_from_backup(&self) -> RestoreTableFromBackupFluentBuilder
Constructs a fluent builder for the RestoreTableFromBackup
operation.
- The fluent builder is configurable:
target_table_name(impl Into<String>)
/set_target_table_name(Option<String>)
:
required: trueThe name of the new table to which the backup must be restored.
backup_arn(impl Into<String>)
/set_backup_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) associated with the backup.
billing_mode_override(BillingMode)
/set_billing_mode_override(Option<BillingMode>)
:
required: falseThe billing mode of the restored table.
global_secondary_index_override(GlobalSecondaryIndex)
/set_global_secondary_index_override(Option<Vec::<GlobalSecondaryIndex>>)
:
required: falseList of global secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.
local_secondary_index_override(LocalSecondaryIndex)
/set_local_secondary_index_override(Option<Vec::<LocalSecondaryIndex>>)
:
required: falseList of local secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.
provisioned_throughput_override(ProvisionedThroughput)
/set_provisioned_throughput_override(Option<ProvisionedThroughput>)
:
required: falseProvisioned throughput settings for the restored table.
on_demand_throughput_override(OnDemandThroughput)
/set_on_demand_throughput_override(Option<OnDemandThroughput>)
:
required: falseSets the maximum number of read and write units for the specified on-demand table. If you use this parameter, you must specify
MaxReadRequestUnits
,MaxWriteRequestUnits
, or both.sse_specification_override(SseSpecification)
/set_sse_specification_override(Option<SseSpecification>)
:
required: falseThe new server-side encryption settings for the restored table.
- On success, responds with
RestoreTableFromBackupOutput
with field(s):table_description(Option<TableDescription>)
:The description of the table created from an existing backup.
- On failure, responds with
SdkError<RestoreTableFromBackupError>
source§impl Client
impl Client
sourcepub fn restore_table_to_point_in_time(
&self,
) -> RestoreTableToPointInTimeFluentBuilder
pub fn restore_table_to_point_in_time( &self, ) -> RestoreTableToPointInTimeFluentBuilder
Constructs a fluent builder for the RestoreTableToPointInTime
operation.
- The fluent builder is configurable:
source_table_arn(impl Into<String>)
/set_source_table_arn(Option<String>)
:
required: falseThe DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).
source_table_name(impl Into<String>)
/set_source_table_name(Option<String>)
:
required: falseName of the source table that is being restored.
target_table_name(impl Into<String>)
/set_target_table_name(Option<String>)
:
required: trueThe name of the new table to which it must be restored to.
use_latest_restorable_time(bool)
/set_use_latest_restorable_time(Option<bool>)
:
required: falseRestore the table to the latest possible time.
LatestRestorableDateTime
is typically 5 minutes before the current time.restore_date_time(DateTime)
/set_restore_date_time(Option<DateTime>)
:
required: falseTime in the past to restore the table to.
billing_mode_override(BillingMode)
/set_billing_mode_override(Option<BillingMode>)
:
required: falseThe billing mode of the restored table.
global_secondary_index_override(GlobalSecondaryIndex)
/set_global_secondary_index_override(Option<Vec::<GlobalSecondaryIndex>>)
:
required: falseList of global secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.
local_secondary_index_override(LocalSecondaryIndex)
/set_local_secondary_index_override(Option<Vec::<LocalSecondaryIndex>>)
:
required: falseList of local secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.
provisioned_throughput_override(ProvisionedThroughput)
/set_provisioned_throughput_override(Option<ProvisionedThroughput>)
:
required: falseProvisioned throughput settings for the restored table.
on_demand_throughput_override(OnDemandThroughput)
/set_on_demand_throughput_override(Option<OnDemandThroughput>)
:
required: falseSets the maximum number of read and write units for the specified on-demand table. If you use this parameter, you must specify
MaxReadRequestUnits
,MaxWriteRequestUnits
, or both.sse_specification_override(SseSpecification)
/set_sse_specification_override(Option<SseSpecification>)
:
required: falseThe new server-side encryption settings for the restored table.
- On success, responds with
RestoreTableToPointInTimeOutput
with field(s):table_description(Option<TableDescription>)
:Represents the properties of a table.
- On failure, responds with
SdkError<RestoreTableToPointInTimeError>
source§impl Client
impl Client
sourcepub fn scan(&self) -> ScanFluentBuilder
pub fn scan(&self) -> ScanFluentBuilder
Constructs a fluent builder for the Scan
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table containing the requested items or if you provide
IndexName
, the name of the table to which that index belongs.You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
index_name(impl Into<String>)
/set_index_name(Option<String>)
:
required: falseThe name of a secondary index to scan. This index can be any local secondary index or global secondary index. Note that if you use the
IndexName
parameter, you must also provideTableName
.attributes_to_get(impl Into<String>)
/set_attributes_to_get(Option<Vec::<String>>)
:
required: falseThis is a legacy parameter. Use
ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.limit(i32)
/set_limit(Option<i32>)
:
required: falseThe maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in
LastEvaluatedKey
to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key inLastEvaluatedKey
to apply in a subsequent operation to continue the operation. For more information, see Working with Queries in the Amazon DynamoDB Developer Guide.select(Select)
/set_select(Option<Select>)
:
required: falseThe attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.
-
ALL_ATTRIBUTES
- Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required. -
ALL_PROJECTED_ATTRIBUTES
- Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifyingALL_ATTRIBUTES
. -
COUNT
- Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations. -
SPECIFIC_ATTRIBUTES
- Returns only the attributes listed inProjectionExpression
. This return value is equivalent to specifyingProjectionExpression
without specifying any value forSelect
.If you query or scan a local secondary index and request only attributes that are projected into that index, the operation reads only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.
If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.
If neither
Select
norProjectionExpression
are specified, DynamoDB defaults toALL_ATTRIBUTES
when accessing a table, andALL_PROJECTED_ATTRIBUTES
when accessing an index. You cannot use bothSelect
andProjectionExpression
together in a single request, unless the value forSelect
isSPECIFIC_ATTRIBUTES
. (This usage is equivalent to specifyingProjectionExpression
without any value forSelect
.)If you use the
ProjectionExpression
parameter, then the value forSelect
can only beSPECIFIC_ATTRIBUTES
. Any other value forSelect
will return an error.-
scan_filter(impl Into<String>, Condition)
/set_scan_filter(Option<HashMap::<String, Condition>>)
:
required: falseThis is a legacy parameter. Use
FilterExpression
instead. For more information, see ScanFilter in the Amazon DynamoDB Developer Guide.conditional_operator(ConditionalOperator)
/set_conditional_operator(Option<ConditionalOperator>)
:
required: falseThis is a legacy parameter. Use
FilterExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.exclusive_start_key(impl Into<String>, AttributeValue)
/set_exclusive_start_key(Option<HashMap::<String, AttributeValue>>)
:
required: falseThe primary key of the first item that this operation will evaluate. Use the value that was returned for
LastEvaluatedKey
in the previous operation.The data type for
ExclusiveStartKey
must be String, Number or Binary. No set data types are allowed.In a parallel scan, a
Scan
request that includesExclusiveStartKey
must specify the same segment whose previousScan
returned the corresponding value ofLastEvaluatedKey
.return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
total_segments(i32)
/set_total_segments(Option<i32>)
:
required: falseFor a parallel
Scan
request,TotalSegments
represents the total number of segments into which theScan
operation will be divided. The value ofTotalSegments
corresponds to the number of application workers that will perform the parallel scan. For example, if you want to use four application threads to scan a table or an index, specify aTotalSegments
value of 4.The value for
TotalSegments
must be greater than or equal to 1, and less than or equal to 1000000. If you specify aTotalSegments
value of 1, theScan
operation will be sequential rather than parallel.If you specify
TotalSegments
, you must also specifySegment
.segment(i32)
/set_segment(Option<i32>)
:
required: falseFor a parallel
Scan
request,Segment
identifies an individual segment to be scanned by an application worker.Segment IDs are zero-based, so the first segment is always 0. For example, if you want to use four application threads to scan a table or an index, then the first thread specifies a
Segment
value of 0, the second thread specifies 1, and so on.The value of
LastEvaluatedKey
returned from a parallelScan
request must be used asExclusiveStartKey
with the same segment ID in a subsequentScan
operation.The value for
Segment
must be greater than or equal to 0, and less than the value provided forTotalSegments
.If you provide
Segment
, you must also provideTotalSegments
.projection_expression(impl Into<String>)
/set_projection_expression(Option<String>)
:
required: falseA string that identifies one or more attributes to retrieve from the specified table or index. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
filter_expression(impl Into<String>)
/set_filter_expression(Option<String>)
:
required: falseA string that contains conditions that DynamoDB applies after the
Scan
operation, but before the data is returned to you. Items that do not satisfy theFilterExpression
criteria are not returned.A
FilterExpression
is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.For more information, see Filter Expressions in the Amazon DynamoDB Developer Guide.
expression_attribute_names(impl Into<String>, impl Into<String>)
/set_expression_attribute_names(Option<HashMap::<String, String>>)
:
required: falseOne or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:-
{“#P”:“Percentile”}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
-
expression_attribute_values(impl Into<String>, AttributeValue)
/set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>)
:
required: falseOne or more values that can be substituted in an expression.
Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the
ProductStatus
attribute was one of the following:Available | Backordered | Discontinued
You would first need to specify
ExpressionAttributeValues
as follows:{ “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }
You could then use these values in an expression, such as this:
ProductStatus IN (:avail, :back, :disc)
For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide.
consistent_read(bool)
/set_consistent_read(Option<bool>)
:
required: falseA Boolean value that determines the read consistency model during the scan:
-
If
ConsistentRead
isfalse
, then the data returned fromScan
might not contain the results from other recently completed write operations (PutItem
,UpdateItem
, orDeleteItem
). -
If
ConsistentRead
istrue
, then all of the write operations that completed before theScan
began are guaranteed to be contained in theScan
response.
The default setting for
ConsistentRead
isfalse
.The
ConsistentRead
parameter is not supported on global secondary indexes. If you scan a global secondary index withConsistentRead
set to true, you will receive aValidationException
.-
- On success, responds with
ScanOutput
with field(s):items(Option<Vec::<HashMap::<String, AttributeValue>>>)
:An array of item attributes that match the scan criteria. Each element in this array consists of an attribute name and the value for that attribute.
count(i32)
:The number of items in the response.
If you set
ScanFilter
in the request, thenCount
is the number of items returned after the filter was applied, andScannedCount
is the number of matching items before the filter was applied.If you did not use a filter in the request, then
Count
is the same asScannedCount
.scanned_count(i32)
:The number of items evaluated, before any
ScanFilter
is applied. A highScannedCount
value with few, or no,Count
results indicates an inefficientScan
operation. For more information, see Count and ScannedCount in the Amazon DynamoDB Developer Guide.If you did not use a filter in the request, then
ScannedCount
is the same asCount
.last_evaluated_key(Option<HashMap::<String, AttributeValue>>)
:The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.
If
LastEvaluatedKey
is empty, then the “last page” of results has been processed and there is no more data to be retrieved.If
LastEvaluatedKey
is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is whenLastEvaluatedKey
is empty.consumed_capacity(Option<ConsumedCapacity>)
:The capacity units consumed by the
Scan
operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.ConsumedCapacity
is only returned if theReturnConsumedCapacity
parameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.
- On failure, responds with
SdkError<ScanError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueIdentifies the Amazon DynamoDB resource to which tags should be added. This value is an Amazon Resource Name (ARN).
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueThe tags to be assigned to the Amazon DynamoDB resource.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn transact_get_items(&self) -> TransactGetItemsFluentBuilder
pub fn transact_get_items(&self) -> TransactGetItemsFluentBuilder
Constructs a fluent builder for the TransactGetItems
operation.
- The fluent builder is configurable:
transact_items(TransactGetItem)
/set_transact_items(Option<Vec::<TransactGetItem>>)
:
required: trueAn ordered array of up to 100
TransactGetItem
objects, each of which contains aGet
structure.return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseA value of
TOTAL
causes consumed capacity information to be returned, and a value ofNONE
prevents that information from being returned. No other value is valid.
- On success, responds with
TransactGetItemsOutput
with field(s):consumed_capacity(Option<Vec::<ConsumedCapacity>>)
:If the ReturnConsumedCapacity value was
TOTAL
, this is an array ofConsumedCapacity
objects, one for each table addressed byTransactGetItem
objects in the TransactItems parameter. TheseConsumedCapacity
objects report the read-capacity units consumed by theTransactGetItems
call in that table.responses(Option<Vec::<ItemResponse>>)
:An ordered array of up to 100
ItemResponse
objects, each of which corresponds to theTransactGetItem
object in the same position in the TransactItems array. EachItemResponse
object contains a Map of the name-value pairs that are the projected attributes of the requested item.If a requested item could not be retrieved, the corresponding
ItemResponse
object is Null, or if the requested item has no projected attributes, the correspondingItemResponse
object is an empty Map.
- On failure, responds with
SdkError<TransactGetItemsError>
source§impl Client
impl Client
sourcepub fn transact_write_items(&self) -> TransactWriteItemsFluentBuilder
pub fn transact_write_items(&self) -> TransactWriteItemsFluentBuilder
Constructs a fluent builder for the TransactWriteItems
operation.
- The fluent builder is configurable:
transact_items(TransactWriteItem)
/set_transact_items(Option<Vec::<TransactWriteItem>>)
:
required: trueAn ordered array of up to 100
TransactWriteItem
objects, each of which contains aConditionCheck
,Put
,Update
, orDelete
object. These can operate on items in different tables, but the tables must reside in the same Amazon Web Services account and Region, and no two of them can operate on the same item.return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
return_item_collection_metrics(ReturnItemCollectionMetrics)
/set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:
required: falseDetermines whether item collection metrics are returned. If set to
SIZE
, the response includes statistics about item collections (if any), that were modified during the operation and are returned in the response. If set toNONE
(the default), no statistics are returned.client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseProviding a
ClientRequestToken
makes the call toTransactWriteItems
idempotent, meaning that multiple identical calls have the same effect as one single call.Although multiple identical calls using the same client request token produce the same result on the server (no side effects), the responses to the calls might not be the same. If the
ReturnConsumedCapacity
parameter is set, then the initialTransactWriteItems
call returns the amount of write capacity units consumed in making the changes. SubsequentTransactWriteItems
calls with the same client token return the number of read capacity units consumed in reading the item.A client request token is valid for 10 minutes after the first request that uses it is completed. After 10 minutes, any request with the same client token is treated as a new request. Do not resubmit the same request with the same client token for more than 10 minutes, or the result might not be idempotent.
If you submit a request with the same client token but a change in other parameters within the 10-minute idempotency window, DynamoDB returns an
IdempotentParameterMismatch
exception.
- On success, responds with
TransactWriteItemsOutput
with field(s):consumed_capacity(Option<Vec::<ConsumedCapacity>>)
:The capacity units consumed by the entire
TransactWriteItems
operation. The values of the list are ordered according to the ordering of theTransactItems
request parameter.item_collection_metrics(Option<HashMap::<String, Vec::<ItemCollectionMetrics>>>)
:A list of tables that were processed by
TransactWriteItems
and, for each table, information about any item collections that were affected by individualUpdateItem
,PutItem
, orDeleteItem
operations.
- On failure, responds with
SdkError<TransactWriteItemsError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe DynamoDB resource that the tags will be removed from. This value is an Amazon Resource Name (ARN).
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueA list of tag keys. Existing tags of the resource whose keys are members of this list will be removed from the DynamoDB resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_continuous_backups(&self) -> UpdateContinuousBackupsFluentBuilder
pub fn update_continuous_backups(&self) -> UpdateContinuousBackupsFluentBuilder
Constructs a fluent builder for the UpdateContinuousBackups
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
point_in_time_recovery_specification(PointInTimeRecoverySpecification)
/set_point_in_time_recovery_specification(Option<PointInTimeRecoverySpecification>)
:
required: trueRepresents the settings used to enable point in time recovery.
- On success, responds with
UpdateContinuousBackupsOutput
with field(s):continuous_backups_description(Option<ContinuousBackupsDescription>)
:Represents the continuous backups and point in time recovery settings on the table.
- On failure, responds with
SdkError<UpdateContinuousBackupsError>
source§impl Client
impl Client
sourcepub fn update_contributor_insights(
&self,
) -> UpdateContributorInsightsFluentBuilder
pub fn update_contributor_insights( &self, ) -> UpdateContributorInsightsFluentBuilder
Constructs a fluent builder for the UpdateContributorInsights
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
index_name(impl Into<String>)
/set_index_name(Option<String>)
:
required: falseThe global secondary index name, if applicable.
contributor_insights_action(ContributorInsightsAction)
/set_contributor_insights_action(Option<ContributorInsightsAction>)
:
required: trueRepresents the contributor insights action.
- On success, responds with
UpdateContributorInsightsOutput
with field(s):table_name(Option<String>)
:The name of the table.
index_name(Option<String>)
:The name of the global secondary index, if applicable.
contributor_insights_status(Option<ContributorInsightsStatus>)
:The status of contributor insights
- On failure, responds with
SdkError<UpdateContributorInsightsError>
source§impl Client
impl Client
sourcepub fn update_global_table(&self) -> UpdateGlobalTableFluentBuilder
pub fn update_global_table(&self) -> UpdateGlobalTableFluentBuilder
Constructs a fluent builder for the UpdateGlobalTable
operation.
- The fluent builder is configurable:
global_table_name(impl Into<String>)
/set_global_table_name(Option<String>)
:
required: trueThe global table name.
replica_updates(ReplicaUpdate)
/set_replica_updates(Option<Vec::<ReplicaUpdate>>)
:
required: trueA list of Regions that should be added or removed from the global table.
- On success, responds with
UpdateGlobalTableOutput
with field(s):global_table_description(Option<GlobalTableDescription>)
:Contains the details of the global table.
- On failure, responds with
SdkError<UpdateGlobalTableError>
source§impl Client
impl Client
sourcepub fn update_global_table_settings(
&self,
) -> UpdateGlobalTableSettingsFluentBuilder
pub fn update_global_table_settings( &self, ) -> UpdateGlobalTableSettingsFluentBuilder
Constructs a fluent builder for the UpdateGlobalTableSettings
operation.
- The fluent builder is configurable:
global_table_name(impl Into<String>)
/set_global_table_name(Option<String>)
:
required: trueThe name of the global table
global_table_billing_mode(BillingMode)
/set_global_table_billing_mode(Option<BillingMode>)
:
required: falseThe billing mode of the global table. If
GlobalTableBillingMode
is not specified, the global table defaults toPROVISIONED
capacity billing mode.-
PROVISIONED
- We recommend usingPROVISIONED
for predictable workloads.PROVISIONED
sets the billing mode to Provisioned capacity mode. -
PAY_PER_REQUEST
- We recommend usingPAY_PER_REQUEST
for unpredictable workloads.PAY_PER_REQUEST
sets the billing mode to On-demand capacity mode.
-
global_table_provisioned_write_capacity_units(i64)
/set_global_table_provisioned_write_capacity_units(Option<i64>)
:
required: falseThe maximum number of writes consumed per second before DynamoDB returns a
ThrottlingException.
global_table_provisioned_write_capacity_auto_scaling_settings_update(AutoScalingSettingsUpdate)
/set_global_table_provisioned_write_capacity_auto_scaling_settings_update(Option<AutoScalingSettingsUpdate>)
:
required: falseAuto scaling settings for managing provisioned write capacity for the global table.
global_table_global_secondary_index_settings_update(GlobalTableGlobalSecondaryIndexSettingsUpdate)
/set_global_table_global_secondary_index_settings_update(Option<Vec::<GlobalTableGlobalSecondaryIndexSettingsUpdate>>)
:
required: falseRepresents the settings of a global secondary index for a global table that will be modified.
replica_settings_update(ReplicaSettingsUpdate)
/set_replica_settings_update(Option<Vec::<ReplicaSettingsUpdate>>)
:
required: falseRepresents the settings for a global table in a Region that will be modified.
- On success, responds with
UpdateGlobalTableSettingsOutput
with field(s):global_table_name(Option<String>)
:The name of the global table.
replica_settings(Option<Vec::<ReplicaSettingsDescription>>)
:The Region-specific settings for the global table.
- On failure, responds with
SdkError<UpdateGlobalTableSettingsError>
source§impl Client
impl Client
sourcepub fn update_item(&self) -> UpdateItemFluentBuilder
pub fn update_item(&self) -> UpdateItemFluentBuilder
Constructs a fluent builder for the UpdateItem
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table containing the item to update. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
key(impl Into<String>, AttributeValue)
/set_key(Option<HashMap::<String, AttributeValue>>)
:
required: trueThe primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
attribute_updates(impl Into<String>, AttributeValueUpdate)
/set_attribute_updates(Option<HashMap::<String, AttributeValueUpdate>>)
:
required: falseThis is a legacy parameter. Use
UpdateExpression
instead. For more information, see AttributeUpdates in the Amazon DynamoDB Developer Guide.expected(impl Into<String>, ExpectedAttributeValue)
/set_expected(Option<HashMap::<String, ExpectedAttributeValue>>)
:
required: falseThis is a legacy parameter. Use
ConditionExpression
instead. For more information, see Expected in the Amazon DynamoDB Developer Guide.conditional_operator(ConditionalOperator)
/set_conditional_operator(Option<ConditionalOperator>)
:
required: falseThis is a legacy parameter. Use
ConditionExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.return_values(ReturnValue)
/set_return_values(Option<ReturnValue>)
:
required: falseUse
ReturnValues
if you want to get the item attributes as they appear before or after they are successfully updated. ForUpdateItem
, the valid values are:-
NONE
- IfReturnValues
is not specified, or if its value isNONE
, then nothing is returned. (This setting is the default forReturnValues
.) -
ALL_OLD
- Returns all of the attributes of the item, as they appeared before the UpdateItem operation. -
UPDATED_OLD
- Returns only the updated attributes, as they appeared before the UpdateItem operation. -
ALL_NEW
- Returns all of the attributes of the item, as they appear after the UpdateItem operation. -
UPDATED_NEW
- Returns only the updated attributes, as they appear after the UpdateItem operation.
There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
The values returned are strongly consistent.
-
return_consumed_capacity(ReturnConsumedCapacity)
/set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:
required: falseDetermines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
-
return_item_collection_metrics(ReturnItemCollectionMetrics)
/set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:
required: falseDetermines whether item collection metrics are returned. If set to
SIZE
, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set toNONE
(the default), no statistics are returned.update_expression(impl Into<String>)
/set_update_expression(Option<String>)
:
required: falseAn expression that defines one or more attributes to be updated, the action to be performed on them, and new values for them.
The following action values are available for
UpdateExpression
.-
SET
- Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. You can also useSET
to add or subtract from an attribute that is of type Number. For example:SET myNum = myNum + :val
SET
supports the following functions:-
if_not_exists (path, operand)
- if the item does not contain an attribute at the specified path, thenif_not_exists
evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item. -
list_append (operand, operand)
- evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands.
These function names are case-sensitive.
-
-
REMOVE
- Removes one or more attributes from an item. -
ADD
- Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior ofADD
depends on the data type of the attribute:-
If the existing attribute is a number, and if
Value
is also a number, thenValue
is mathematically added to the existing attribute. IfValue
is a negative number, then it is subtracted from the existing attribute.If you use
ADD
to increment or decrement a number value for an item that doesn’t exist before the update, DynamoDB uses0
as the initial value.Similarly, if you use
ADD
for an existing item to increment or decrement an attribute value that doesn’t exist before the update, DynamoDB uses0
as the initial value. For example, suppose that the item you want to update doesn’t have an attribute nameditemcount
, but you decide toADD
the number3
to this attribute anyway. DynamoDB will create theitemcount
attribute, set its initial value to0
, and finally add3
to it. The result will be a newitemcount
attribute in the item, with a value of3
. -
If the existing data type is a set and if
Value
is also a set, thenValue
is added to the existing set. For example, if the attribute value is the set[1,2]
, and theADD
action specified[3]
, then the final attribute value is[1,2,3]
. An error occurs if anADD
action is specified for a set attribute and the attribute type specified does not match the existing set type.Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the
Value
must also be a set of strings.
The
ADD
action only supports Number and set data types. In addition,ADD
can only be used on top-level attributes, not nested attributes. -
-
DELETE
- Deletes an element from a set.If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set
[a,b,c]
and theDELETE
action specifies[a,c]
, then the final attribute value is[b]
. Specifying an empty set is an error.The
DELETE
action only supports set data types. In addition,DELETE
can only be used on top-level attributes, not nested attributes.
You can have many actions in a single expression, such as the following:
SET a=:value1, b=:value2 DELETE :value3, :value4, :value5
For more information on update expressions, see Modifying Items and Attributes in the Amazon DynamoDB Developer Guide.
-
condition_expression(impl Into<String>)
/set_condition_expression(Option<String>)
:
required: falseA condition that must be satisfied in order for a conditional update to succeed.
An expression can contain any of the following:
-
Functions:
attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size
These function names are case-sensitive.
-
Comparison operators:
= | <> | < | > | <= | >= | BETWEEN | IN
-
Logical operators:
AND | OR | NOT
For more information about condition expressions, see Specifying Conditions in the Amazon DynamoDB Developer Guide.
-
expression_attribute_names(impl Into<String>, impl Into<String>)
/set_expression_attribute_names(Option<HashMap::<String, String>>)
:
required: falseOne or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.) To work around this, you could specify the following for
ExpressionAttributeNames
:-
{“#P”:“Percentile”}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information about expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
-
expression_attribute_values(impl Into<String>, AttributeValue)
/set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>)
:
required: falseOne or more values that can be substituted in an expression.
Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the
ProductStatus
attribute was one of the following:Available | Backordered | Discontinued
You would first need to specify
ExpressionAttributeValues
as follows:{ “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }
You could then use these values in an expression, such as this:
ProductStatus IN (:avail, :back, :disc)
For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide.
return_values_on_condition_check_failure(ReturnValuesOnConditionCheckFailure)
/set_return_values_on_condition_check_failure(Option<ReturnValuesOnConditionCheckFailure>)
:
required: falseAn optional parameter that returns the item attributes for an
UpdateItem
operation that failed a condition check.There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
- On success, responds with
UpdateItemOutput
with field(s):attributes(Option<HashMap::<String, AttributeValue>>)
:A map of attribute values as they appear before or after the
UpdateItem
operation, as determined by theReturnValues
parameter.The
Attributes
map is only present if the update was successful andReturnValues
was specified as something other thanNONE
in the request. Each element represents one attribute.consumed_capacity(Option<ConsumedCapacity>)
:The capacity units consumed by the
UpdateItem
operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.ConsumedCapacity
is only returned if theReturnConsumedCapacity
parameter was specified. For more information, see Capacity unity consumption for write operations in the Amazon DynamoDB Developer Guide.item_collection_metrics(Option<ItemCollectionMetrics>)
:Information about item collections, if any, that were affected by the
UpdateItem
operation.ItemCollectionMetrics
is only returned if theReturnItemCollectionMetrics
parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.Each
ItemCollectionMetrics
element consists of:-
ItemCollectionKey
- The partition key value of the item collection. This is the same as the partition key value of the item itself. -
SizeEstimateRangeGB
- An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.
-
- On failure, responds with
SdkError<UpdateItemError>
source§impl Client
impl Client
sourcepub fn update_kinesis_streaming_destination(
&self,
) -> UpdateKinesisStreamingDestinationFluentBuilder
pub fn update_kinesis_streaming_destination( &self, ) -> UpdateKinesisStreamingDestinationFluentBuilder
Constructs a fluent builder for the UpdateKinesisStreamingDestination
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe table name for the Kinesis streaming destination input. You can also provide the ARN of the table in this parameter.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) for the Kinesis stream input.
update_kinesis_streaming_configuration(UpdateKinesisStreamingConfiguration)
/set_update_kinesis_streaming_configuration(Option<UpdateKinesisStreamingConfiguration>)
:
required: falseThe command to update the Kinesis stream configuration.
- On success, responds with
UpdateKinesisStreamingDestinationOutput
with field(s):table_name(Option<String>)
:The table name for the Kinesis streaming destination output.
stream_arn(Option<String>)
:The ARN for the Kinesis stream input.
destination_status(Option<DestinationStatus>)
:The status of the attempt to update the Kinesis streaming destination output.
update_kinesis_streaming_configuration(Option<UpdateKinesisStreamingConfiguration>)
:The command to update the Kinesis streaming destination configuration.
- On failure, responds with
SdkError<UpdateKinesisStreamingDestinationError>
source§impl Client
impl Client
sourcepub fn update_table(&self) -> UpdateTableFluentBuilder
pub fn update_table(&self) -> UpdateTableFluentBuilder
Constructs a fluent builder for the UpdateTable
operation.
- The fluent builder is configurable:
attribute_definitions(AttributeDefinition)
/set_attribute_definitions(Option<Vec::<AttributeDefinition>>)
:
required: falseAn array of attributes that describe the key schema for the table and indexes. If you are adding a new global secondary index to the table,
AttributeDefinitions
must include the key element(s) of the new index.table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table to be updated. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
billing_mode(BillingMode)
/set_billing_mode(Option<BillingMode>)
:
required: falseControls how you are charged for read and write throughput and how you manage capacity. When switching from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial provisioned capacity values are estimated based on the consumed read and write capacity of your table and global secondary indexes over the past 30 minutes.
-
PROVISIONED
- We recommend usingPROVISIONED
for predictable workloads.PROVISIONED
sets the billing mode to Provisioned capacity mode. -
PAY_PER_REQUEST
- We recommend usingPAY_PER_REQUEST
for unpredictable workloads.PAY_PER_REQUEST
sets the billing mode to On-demand capacity mode.
-
provisioned_throughput(ProvisionedThroughput)
/set_provisioned_throughput(Option<ProvisionedThroughput>)
:
required: falseThe new provisioned throughput settings for the specified table or index.
global_secondary_index_updates(GlobalSecondaryIndexUpdate)
/set_global_secondary_index_updates(Option<Vec::<GlobalSecondaryIndexUpdate>>)
:
required: falseAn array of one or more global secondary indexes for the table. For each index in the array, you can request one action:
-
Create
- add a new global secondary index to the table. -
Update
- modify the provisioned throughput settings of an existing global secondary index. -
Delete
- remove a global secondary index from the table.
You can create or delete only one global secondary index per
UpdateTable
operation.For more information, see Managing Global Secondary Indexes in the Amazon DynamoDB Developer Guide.
-
stream_specification(StreamSpecification)
/set_stream_specification(Option<StreamSpecification>)
:
required: falseRepresents the DynamoDB Streams configuration for the table.
You receive a
ValidationException
if you try to enable a stream on a table that already has a stream, or if you try to disable a stream on a table that doesn’t have a stream.sse_specification(SseSpecification)
/set_sse_specification(Option<SseSpecification>)
:
required: falseThe new server-side encryption settings for the specified table.
replica_updates(ReplicationGroupUpdate)
/set_replica_updates(Option<Vec::<ReplicationGroupUpdate>>)
:
required: falseA list of replica update actions (create, delete, or update) for the table.
For global tables, this property only applies to global tables using Version 2019.11.21 (Current version).
table_class(TableClass)
/set_table_class(Option<TableClass>)
:
required: falseThe table class of the table to be updated. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
.deletion_protection_enabled(bool)
/set_deletion_protection_enabled(Option<bool>)
:
required: falseIndicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
on_demand_throughput(OnDemandThroughput)
/set_on_demand_throughput(Option<OnDemandThroughput>)
:
required: falseUpdates 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
MaxReadRequestUnits
,MaxWriteRequestUnits
, or both.
- On success, responds with
UpdateTableOutput
with field(s):table_description(Option<TableDescription>)
:Represents the properties of the table.
- On failure, responds with
SdkError<UpdateTableError>
source§impl Client
impl Client
sourcepub fn update_table_replica_auto_scaling(
&self,
) -> UpdateTableReplicaAutoScalingFluentBuilder
pub fn update_table_replica_auto_scaling( &self, ) -> UpdateTableReplicaAutoScalingFluentBuilder
Constructs a fluent builder for the UpdateTableReplicaAutoScaling
operation.
- The fluent builder is configurable:
global_secondary_index_updates(GlobalSecondaryIndexAutoScalingUpdate)
/set_global_secondary_index_updates(Option<Vec::<GlobalSecondaryIndexAutoScalingUpdate>>)
:
required: falseRepresents the auto scaling settings of the global secondary indexes of the replica to be updated.
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the global table to be updated. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
provisioned_write_capacity_auto_scaling_update(AutoScalingSettingsUpdate)
/set_provisioned_write_capacity_auto_scaling_update(Option<AutoScalingSettingsUpdate>)
:
required: falseRepresents the auto scaling settings to be modified for a global table or global secondary index.
replica_updates(ReplicaAutoScalingUpdate)
/set_replica_updates(Option<Vec::<ReplicaAutoScalingUpdate>>)
:
required: falseRepresents the auto scaling settings of replicas of the table that will be modified.
- On success, responds with
UpdateTableReplicaAutoScalingOutput
with field(s):table_auto_scaling_description(Option<TableAutoScalingDescription>)
:Returns information about the auto scaling settings of a table with replicas.
- On failure, responds with
SdkError<UpdateTableReplicaAutoScalingError>
source§impl Client
impl Client
sourcepub fn update_time_to_live(&self) -> UpdateTimeToLiveFluentBuilder
pub fn update_time_to_live(&self) -> UpdateTimeToLiveFluentBuilder
Constructs a fluent builder for the UpdateTimeToLive
operation.
- The fluent builder is configurable:
table_name(impl Into<String>)
/set_table_name(Option<String>)
:
required: trueThe name of the table to be configured. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
time_to_live_specification(TimeToLiveSpecification)
/set_time_to_live_specification(Option<TimeToLiveSpecification>)
:
required: trueRepresents the settings used to enable or disable Time to Live for the specified table.
- On success, responds with
UpdateTimeToLiveOutput
with field(s):time_to_live_specification(Option<TimeToLiveSpecification>)
:Represents the output of an
UpdateTimeToLive
operation.
- On failure, responds with
SdkError<UpdateTimeToLiveError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
source§impl Waiters for Client
impl Waiters for Client
source§fn wait_until_table_exists(&self) -> TableExistsFluentBuilder
fn wait_until_table_exists(&self) -> TableExistsFluentBuilder
table_exists
source§fn wait_until_table_not_exists(&self) -> TableNotExistsFluentBuilder
fn wait_until_table_not_exists(&self) -> TableNotExistsFluentBuilder
table_not_exists
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute
] value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
[Quirk
] value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition
] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);