pub struct Client { }
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.
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 theClient
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.
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;
Source§ Source§ Source
Constructs a fluent builder for the BatchGetItem
operation.
request_items(impl Into<String>, KeysAndAttributes)
/ set_request_items(Option<HashMap::<String, KeysAndAttributes>>)
:A 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
- If true
, a strongly consistent read is used; if false
(the default), an eventually consistent read is used.
ExpressionAttributeNames
- One or more substitution tokens for attribute names in the ProjectionExpression
parameter. 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 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. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
return_consumed_capacity(ReturnConsumedCapacity)
/ set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
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 as RequestItems
, so the value can be provided directly to a subsequent BatchGetItem
operation. For more information, see RequestItems
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 to true
, 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.
SdkError<BatchGetItemError>
Constructs a fluent builder for the BatchWriteItem
operation.
request_items(impl Into<String>, Vec::<WriteRequest>)
/ set_request_items(Option<HashMap::<String, Vec::<WriteRequest>>>)
:A map of one or more table names or table ARNs and, for each table, a list of operations to be performed (DeleteRequest
or PutRequest
). Each element in the map consists of the following:
DeleteRequest
- Perform a DeleteItem
operation on the specified item. The item to be deleted is identified by a Key
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 a PutItem
operation on the specified item. The item to be put is identified by an Item
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 a ValidationException
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>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
return_item_collection_metrics(ReturnItemCollectionMetrics)
/ set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:Determines 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 to NONE
(the default), no statistics are returned.
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 as RequestItems
, so you can provide this value directly to a subsequent BatchWriteItem
operation. For more information, see RequestItems
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
or PutRequest
).
DeleteRequest
- Perform a DeleteItem
operation on the specified item. The item to be deleted is identified by a Key
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 a PutItem
operation on the specified item. The item to be put is identified by an Item
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 a ValidationException
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 individual DeleteItem
or PutItem
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.
SdkError<BatchWriteItemError>
Constructs a fluent builder for the CreateTable
operation.
attribute_definitions(AttributeDefinition)
/ set_attribute_definitions(Option<Vec::<AttributeDefinition>>)
:An array of attributes that describe the key schema for the table and indexes.
table_name(impl Into<String>)
/ set_table_name(Option<String>)
:The 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>>)
:Specifies the attributes that make up the primary key for a table or an index. The attributes in KeySchema
must also be defined in the AttributeDefinitions
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
of HASH
.
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
of HASH
, and the second element must have a KeyType
of RANGE
.
For more information, see Working with Tables in the Amazon DynamoDB Developer Guide.
local_secondary_indexes(LocalSecondaryIndex)
/ set_local_secondary_indexes(Option<Vec::<LocalSecondaryIndex>>)
:One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.
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 in NonKeyAttributes
.
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 in NonKeyAttributes
, 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. This limit only applies when you specify the ProjectionType of INCLUDE
. You still can specify the ProjectionType of ALL
to project all attributes from the source table, even if the table has more than 100 attributes.
global_secondary_indexes(GlobalSecondaryIndex)
/ set_global_secondary_indexes(Option<Vec::<GlobalSecondaryIndex>>)
:One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:
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 in NonKeyAttributes
.
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 in NonKeyAttributes
, 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. This limit only applies when you specify the ProjectionType of INCLUDE
. You still can specify the ProjectionType of ALL
to project all attributes from the source table, even if the table has more than 100 attributes.
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>)
:Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.
PAY_PER_REQUEST
- We recommend using PAY_PER_REQUEST
for most DynamoDB workloads. PAY_PER_REQUEST
sets the billing mode to On-demand capacity mode.
PROVISIONED
- We recommend using PROVISIONED
for steady workloads with predictable growth where capacity requirements can be reliably forecasted. PROVISIONED
sets the billing mode to Provisioned capacity mode.
provisioned_throughput(ProvisionedThroughput)
/ set_provisioned_throughput(Option<ProvisionedThroughput>)
:Represents 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 as PAY_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>)
:The 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 for StreamViewType
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>)
:Represents the settings used to enable server-side encryption.
tags(Tag)
/ set_tags(Option<Vec::<Tag>>)
:A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB.
table_class(TableClass)
/ set_table_class(Option<TableClass>)
:The table class of the new table. Valid values are STANDARD
and STANDARD_INFREQUENT_ACCESS
.
deletion_protection_enabled(bool)
/ set_deletion_protection_enabled(Option<bool>)
:Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
warm_throughput(WarmThroughput)
/ set_warm_throughput(Option<WarmThroughput>)
:Represents the warm throughput (in read units per second and write units per second) for creating a table.
resource_policy(impl Into<String>)
/ set_resource_policy(Option<String>)
:An 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
and PutResourcePolicy
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>)
:Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify MaxReadRequestUnits
, MaxWriteRequestUnits
, or both.
CreateTableOutput
with field(s):
table_description(Option<TableDescription>)
:
Represents the properties of the table.
SdkError<CreateTableError>
Constructs a fluent builder for the DeleteItem
operation.
table_name(impl Into<String>)
/ set_table_name(Option<String>)
:The 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>>)
:A 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>>)
:This 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>)
:This 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>)
:Use ReturnValues
if you want to get the item attributes as they appeared before they were deleted. For DeleteItem
, the valid values are:
NONE
- If ReturnValues
is not specified, or if its value is NONE
, then nothing is returned. (This setting is the default for ReturnValues
.)
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 than NONE
or ALL_OLD
.
return_consumed_capacity(ReturnConsumedCapacity)
/ set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
return_item_collection_metrics(ReturnItemCollectionMetrics)
/ set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:Determines 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 to NONE
(the default), no statistics are returned.
condition_expression(impl Into<String>)
/ set_condition_expression(Option<String>)
:A 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>>)
:One 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>>)
:One 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>)
:An 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.
DeleteItemOutput
with field(s):
attributes(Option<HashMap::<String, AttributeValue>>)
:
A map of attribute names to AttributeValue
objects, representing the item as it appeared before the DeleteItem
operation. This map appears in the response only if ReturnValues
was specified as ALL_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 the ReturnConsumedCapacity
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 the ReturnItemCollectionMetrics
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.
SdkError<DeleteItemError>
Constructs a fluent builder for the DeleteResourcePolicy
operation.
resource_arn(impl Into<String>)
/ set_resource_arn(Option<String>)
:The 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>)
:A 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
.
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.
SdkError<DeleteResourcePolicyError>
Constructs a fluent builder for the ExecuteStatement
operation.
statement(impl Into<String>)
/ set_statement(Option<String>)
:The PartiQL statement representing the operation to run.
parameters(AttributeValue)
/ set_parameters(Option<Vec::<AttributeValue>>)
:The parameters for the PartiQL statement, if any.
consistent_read(bool)
/ set_consistent_read(Option<bool>)
:The 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>)
:Set this value to get remaining results, if NextToken
was returned in the statement response.
return_consumed_capacity(ReturnConsumedCapacity)
/ set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
limit(i32)
/ set_limit(Option<i32>)
:The 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 in LastEvaluatedKey
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>)
:An 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.
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. 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 when LastEvaluatedKey
is empty.
SdkError<ExecuteStatementError>
Constructs a fluent builder for the GetItem
operation.
table_name(impl Into<String>)
/ set_table_name(Option<String>)
:The 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>>)
:A 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>>)
:This 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>)
:Determines 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>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
projection_expression(impl Into<String>)
/ set_projection_expression(Option<String>)
: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 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>>)
:One 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.
GetItemOutput
with field(s):
item(Option<HashMap::<String, AttributeValue>>)
:
A map of attribute names to AttributeValue
objects, as specified by ProjectionExpression
.
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 the ReturnConsumedCapacity
parameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.
SdkError<GetItemError>
Constructs a fluent builder for the ImportTable
operation.
client_token(impl Into<String>)
/ set_client_token(Option<String>)
:Providing a ClientToken
makes the call to ImportTableInput
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>)
:The S3 bucket that provides the source for the import.
input_format(InputFormat)
/ set_input_format(Option<InputFormat>)
:The format of the source data. Valid values for ImportFormat
are CSV
, DYNAMODB_JSON
or ION
.
input_format_options(InputFormatOptions)
/ set_input_format_options(Option<InputFormatOptions>)
:Additional properties that specify how the input is formatted,
input_compression_type(InputCompressionType)
/ set_input_compression_type(Option<InputCompressionType>)
:Type of compression to be used on the input coming from the imported table.
table_creation_parameters(TableCreationParameters)
/ set_table_creation_parameters(Option<TableCreationParameters>)
:Parameters for the table to import the data into.
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.
SdkError<ImportTableError>
Constructs a fluent builder for the ListTables
operation. This operation supports pagination; See into_paginator()
.
exclusive_start_table_name(impl Into<String>)
/ set_exclusive_start_table_name(Option<String>)
:The 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>)
:A maximum number of table names to return. If this parameter is not specified, the limit is 100.
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 the ExclusiveStartTableName
parameter in a subsequent ListTables
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.
SdkError<ListTablesError>
Constructs a fluent builder for the PutItem
operation.
table_name(impl Into<String>)
/ set_table_name(Option<String>)
:The 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>>)
:A 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 an AttributeValue
object.
expected(impl Into<String>, ExpectedAttributeValue)
/ set_expected(Option<HashMap::<String, ExpectedAttributeValue>>)
:This 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>)
:Use ReturnValues
if you want to get the item attributes as they appeared before they were updated with the PutItem
request. For PutItem
, the valid values are:
NONE
- If ReturnValues
is not specified, or if its value is NONE
, then nothing is returned. (This setting is the default for ReturnValues
.)
ALL_OLD
- If PutItem
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 than NONE
or ALL_OLD
.
return_consumed_capacity(ReturnConsumedCapacity)
/ set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
return_item_collection_metrics(ReturnItemCollectionMetrics)
/ set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:Determines 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 to NONE
(the default), no statistics are returned.
conditional_operator(ConditionalOperator)
/ set_conditional_operator(Option<ConditionalOperator>)
:This 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>)
:A 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>>)
:One 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>>)
:One 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>)
:An 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.
PutItemOutput
with field(s):
attributes(Option<HashMap::<String, AttributeValue>>)
:
The attribute values as they appeared before the PutItem
operation, but only if ReturnValues
is specified as ALL_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 the ReturnConsumedCapacity
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 the ReturnItemCollectionMetrics
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.
SdkError<PutItemError>
Constructs a fluent builder for the PutResourcePolicy
operation.
resource_arn(impl Into<String>)
/ set_resource_arn(Option<String>)
:The 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 given Statement
in your policy document. Alternatively, to specify different permissions for your table, indexes, or both, you can define multiple Statement
fields in your policy document.
policy(impl Into<String>)
/ set_policy(Option<String>)
:An 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>)
:A 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>)
:Set this parameter to true
to confirm that you want to remove your permissions to change the policy of this resource in the future.
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.
SdkError<PutResourcePolicyError>
Constructs a fluent builder for the Query
operation. This operation supports pagination; See into_paginator()
.
table_name(impl Into<String>)
/ set_table_name(Option<String>)
:The 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>)
:The 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 provide TableName.
select(Select)
/ set_select(Option<Select>)
:The 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 specifying ALL_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 in ProjectionExpression
. This return value is equivalent to specifying ProjectionExpression
without specifying any value for Select
.
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
nor ProjectionExpression
are specified, DynamoDB defaults to ALL_ATTRIBUTES
when accessing a table, and ALL_PROJECTED_ATTRIBUTES
when accessing an index. You cannot use both Select
and ProjectionExpression
together in a single request, unless the value for Select
is SPECIFIC_ATTRIBUTES
. (This usage is equivalent to specifying ProjectionExpression
without any value for Select
.)
If you use the ProjectionExpression
parameter, then the value for Select
can only be SPECIFIC_ATTRIBUTES
. Any other value for Select
will return an error.
attributes_to_get(impl Into<String>)
/ set_attributes_to_get(Option<Vec::<String>>)
:This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
limit(i32)
/ set_limit(Option<i32>)
:The 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 in LastEvaluatedKey
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>)
:Determines 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 to true
, you will receive a ValidationException
.
key_conditions(impl Into<String>, Condition)
/ set_key_conditions(Option<HashMap::<String, Condition>>)
:This 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>>)
:This 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>)
:This 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>)
:Specifies the order for index traversal: If true
(default), the traversal is performed in ascending order; if false
, 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
is true
, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If ScanIndexForward
is false
, 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>>)
:The 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>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
projection_expression(impl Into<String>)
/ set_projection_expression(Option<String>)
: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 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>)
:A string that contains conditions that DynamoDB applies after the Query
operation, but before the data is returned to you. Items that do not satisfy the FilterExpression
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>)
:The 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 name begins_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 following KeyConditionExpression
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
and ExpressionAttributeValues
, 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>>)
:One 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>>)
:One 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.
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, then Count
is the number of items returned after the filter was applied, and ScannedCount
is the number of matching items before the filter was applied.
If you did not use a filter in the request, then Count
and ScannedCount
are the same.
scanned_count(i32)
:
The number of items evaluated, before any QueryFilter
is applied. A high ScannedCount
value with few, or no, Count
results indicates an inefficient Query
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 as Count
.
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 when LastEvaluatedKey
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 the ReturnConsumedCapacity
parameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.
SdkError<QueryError>
Constructs a fluent builder for the Scan
operation. This operation supports pagination; See into_paginator()
.
table_name(impl Into<String>)
/ set_table_name(Option<String>)
:The 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>)
:The 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 provide TableName
.
attributes_to_get(impl Into<String>)
/ set_attributes_to_get(Option<Vec::<String>>)
:This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
limit(i32)
/ set_limit(Option<i32>)
:The 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 in LastEvaluatedKey
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>)
:The 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 specifying ALL_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 in ProjectionExpression
. This return value is equivalent to specifying ProjectionExpression
without specifying any value for Select
.
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
nor ProjectionExpression
are specified, DynamoDB defaults to ALL_ATTRIBUTES
when accessing a table, and ALL_PROJECTED_ATTRIBUTES
when accessing an index. You cannot use both Select
and ProjectionExpression
together in a single request, unless the value for Select
is SPECIFIC_ATTRIBUTES
. (This usage is equivalent to specifying ProjectionExpression
without any value for Select
.)
If you use the ProjectionExpression
parameter, then the value for Select
can only be SPECIFIC_ATTRIBUTES
. Any other value for Select
will return an error.
scan_filter(impl Into<String>, Condition)
/ set_scan_filter(Option<HashMap::<String, Condition>>)
:This 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>)
:This 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>>)
:The 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 includes ExclusiveStartKey
must specify the same segment whose previous Scan
returned the corresponding value of LastEvaluatedKey
.
return_consumed_capacity(ReturnConsumedCapacity)
/ set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
total_segments(i32)
/ set_total_segments(Option<i32>)
:For a parallel Scan
request, TotalSegments
represents the total number of segments into which the Scan
operation will be divided. The value of TotalSegments
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 a TotalSegments
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 a TotalSegments
value of 1, the Scan
operation will be sequential rather than parallel.
If you specify TotalSegments
, you must also specify Segment
.
segment(i32)
/ set_segment(Option<i32>)
:For 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 parallel Scan
request must be used as ExclusiveStartKey
with the same segment ID in a subsequent Scan
operation.
The value for Segment
must be greater than or equal to 0, and less than the value provided for TotalSegments
.
If you provide Segment
, you must also provide TotalSegments
.
projection_expression(impl Into<String>)
/ set_projection_expression(Option<String>)
:A 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>)
:A string that contains conditions that DynamoDB applies after the Scan
operation, but before the data is returned to you. Items that do not satisfy the FilterExpression
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>>)
:One 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>>)
:One 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>)
:A Boolean value that determines the read consistency model during the scan:
If ConsistentRead
is false
, then the data returned from Scan
might not contain the results from other recently completed write operations (PutItem
, UpdateItem
, or DeleteItem
).
If ConsistentRead
is true
, then all of the write operations that completed before the Scan
began are guaranteed to be contained in the Scan
response.
The default setting for ConsistentRead
is false
.
The ConsistentRead
parameter is not supported on global secondary indexes. If you scan a global secondary index with ConsistentRead
set to true, you will receive a ValidationException
.
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, then Count
is the number of items returned after the filter was applied, and ScannedCount
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 as ScannedCount
.
scanned_count(i32)
:
The number of items evaluated, before any ScanFilter
is applied. A high ScannedCount
value with few, or no, Count
results indicates an inefficient Scan
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 as Count
.
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 when LastEvaluatedKey
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 the ReturnConsumedCapacity
parameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.
SdkError<ScanError>
Constructs a fluent builder for the TransactGetItems
operation.
transact_items(TransactGetItem)
/ set_transact_items(Option<Vec::<TransactGetItem>>)
:An ordered array of up to 100 TransactGetItem
objects, each of which contains a Get
structure.
return_consumed_capacity(ReturnConsumedCapacity)
/ set_return_consumed_capacity(Option<ReturnConsumedCapacity>)
:A value of TOTAL
causes consumed capacity information to be returned, and a value of NONE
prevents that information from being returned. No other value is valid.
TransactGetItemsOutput
with field(s):
consumed_capacity(Option<Vec::<ConsumedCapacity>>)
:
If the ReturnConsumedCapacity value was TOTAL
, this is an array of ConsumedCapacity
objects, one for each table addressed by TransactGetItem
objects in the TransactItems parameter. These ConsumedCapacity
objects report the read-capacity units consumed by the TransactGetItems
call in that table.
responses(Option<Vec::<ItemResponse>>)
:
An ordered array of up to 100 ItemResponse
objects, each of which corresponds to the TransactGetItem
object in the same position in the TransactItems array. Each ItemResponse
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 corresponding ItemResponse
object is an empty Map.
SdkError<TransactGetItemsError>
Constructs a fluent builder for the TransactWriteItems
operation.
transact_items(TransactWriteItem)
/ set_transact_items(Option<Vec::<TransactWriteItem>>)
:An ordered array of up to 100 TransactWriteItem
objects, each of which contains a ConditionCheck
, Put
, Update
, or Delete
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>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
return_item_collection_metrics(ReturnItemCollectionMetrics)
/ set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:Determines 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 to NONE
(the default), no statistics are returned.
client_request_token(impl Into<String>)
/ set_client_request_token(Option<String>)
:Providing a ClientRequestToken
makes the call to TransactWriteItems
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 initial TransactWriteItems
call returns the amount of write capacity units consumed in making the changes. Subsequent TransactWriteItems
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.
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 the TransactItems
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 individual UpdateItem
, PutItem
, or DeleteItem
operations.
SdkError<TransactWriteItemsError>
Constructs a fluent builder for the UpdateItem
operation.
table_name(impl Into<String>)
/ set_table_name(Option<String>)
:The 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>>)
:The 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>>)
:This 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>>)
:This 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>)
:This 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>)
:Use ReturnValues
if you want to get the item attributes as they appear before or after they are successfully updated. For UpdateItem
, the valid values are:
NONE
- If ReturnValues
is not specified, or if its value is NONE
, then nothing is returned. (This setting is the default for ReturnValues
.)
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>)
:Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
INDEXES
- The response includes the aggregate ConsumedCapacity
for the operation, together with ConsumedCapacity
for each table and secondary index that was accessed.
Note that some operations, such as GetItem
and BatchGetItem
, do not access any indexes at all. In these cases, specifying INDEXES
will only return ConsumedCapacity
information for table(s).
TOTAL
- The response includes only the aggregate ConsumedCapacity
for the operation.
NONE
- No ConsumedCapacity
details are included in the response.
return_item_collection_metrics(ReturnItemCollectionMetrics)
/ set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>)
:Determines 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 to NONE
(the default), no statistics are returned.
update_expression(impl Into<String>)
/ set_update_expression(Option<String>)
:An 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 use SET
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, then if_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 of ADD
depends on the data type of the attribute:
If the existing attribute is a number, and if Value
is also a number, then Value
is mathematically added to the existing attribute. If Value
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 uses 0
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 uses 0
as the initial value. For example, suppose that the item you want to update doesn’t have an attribute named itemcount
, but you decide to ADD
the number 3
to this attribute anyway. DynamoDB will create the itemcount
attribute, set its initial value to 0
, and finally add 3
to it. The result will be a new itemcount
attribute in the item, with a value of 3
.
If the existing data type is a set and if Value
is also a set, then Value
is added to the existing set. For example, if the attribute value is the set [1,2]
, and the ADD
action specified [3]
, then the final attribute value is [1,2,3]
. An error occurs if an ADD
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 the DELETE
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>)
:A 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>>)
:One 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>>)
:One 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>)
:An 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.
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 the ReturnValues
parameter.
The Attributes
map is only present if the update was successful and ReturnValues
was specified as something other than NONE
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 the ReturnConsumedCapacity
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 the ReturnItemCollectionMetrics
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.
SdkError<UpdateItemError>
Constructs a fluent builder for the UpdateTable
operation.
attribute_definitions(AttributeDefinition)
/ set_attribute_definitions(Option<Vec::<AttributeDefinition>>)
:An 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>)
:The 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>)
:Controls 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.
PAY_PER_REQUEST
- We recommend using PAY_PER_REQUEST
for most DynamoDB workloads. PAY_PER_REQUEST
sets the billing mode to On-demand capacity mode.
PROVISIONED
- We recommend using PROVISIONED
for steady workloads with predictable growth where capacity requirements can be reliably forecasted. PROVISIONED
sets the billing mode to Provisioned capacity mode.
provisioned_throughput(ProvisionedThroughput)
/ set_provisioned_throughput(Option<ProvisionedThroughput>)
:The new provisioned throughput settings for the specified table or index.
global_secondary_index_updates(GlobalSecondaryIndexUpdate)
/ set_global_secondary_index_updates(Option<Vec::<GlobalSecondaryIndexUpdate>>)
:An 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>)
:Represents 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>)
:The new server-side encryption settings for the specified table.
replica_updates(ReplicationGroupUpdate)
/ set_replica_updates(Option<Vec::<ReplicationGroupUpdate>>)
:A list of replica update actions (create, delete, or update) for the table.
table_class(TableClass)
/ set_table_class(Option<TableClass>)
:The table class of the table to be updated. Valid values are STANDARD
and STANDARD_INFREQUENT_ACCESS
.
deletion_protection_enabled(bool)
/ set_deletion_protection_enabled(Option<bool>)
:Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
multi_region_consistency(MultiRegionConsistency)
/ set_multi_region_consistency(Option<MultiRegionConsistency>)
:Specifies the consistency mode for a new global table. This parameter is only valid when you create a global table by specifying one or more Create actions in the ReplicaUpdates action list.
You can specify one of the following consistency modes:
EVENTUAL
: Configures a new global table for multi-Region eventual consistency (MREC). This is the default consistency mode for global tables.
STRONG
: Configures a new global table for multi-Region strong consistency (MRSC).
If you don’t specify this field, the global table consistency mode defaults to EVENTUAL
. For more information about global tables consistency modes, see Consistency modes in DynamoDB developer guide.
global_table_witness_updates(GlobalTableWitnessGroupUpdate)
/ set_global_table_witness_updates(Option<Vec::<GlobalTableWitnessGroupUpdate>>)
:A list of witness updates for a MRSC global table. A witness provides a cost-effective alternative to a full replica in a MRSC global table by maintaining replicated change data written to global table replicas. You cannot perform read or write operations on a witness. For each witness, you can request one action:
Create
- add a new witness to the global table.
Delete
- remove a witness from the global table.
You can create or delete only one witness per UpdateTable
operation.
For more information, see Multi-Region strong consistency (MRSC) in the Amazon DynamoDB Developer Guide
on_demand_throughput(OnDemandThroughput)
/ set_on_demand_throughput(Option<OnDemandThroughput>)
:Updates 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.
warm_throughput(WarmThroughput)
/ set_warm_throughput(Option<WarmThroughput>)
:Represents the warm throughput (in read units per second and write units per second) for updating a table.
UpdateTableOutput
with field(s):
table_description(Option<TableDescription>)
:
Represents the properties of the table.
SdkError<UpdateTableError>
Creates a new client from the service Config
.
This method will panic in the following cases:
sleep_impl
configured.sleep_impl
and time_source
configured.behavior_version
is provided.The panic message for each of these will have instructions on how to resolve them.
SourceReturns the client’s configuration.
Source§ SourceCreates a new client from an SDK Config.
§Panicssdk_config
is missing an async sleep implementation. If you experience this panic, set the sleep_impl
on the Config passed into this function to fix it.sdk_config
is missing an HTTP connector. If you experience this panic, set the http_connector
on the Config passed into this function to fix it.BehaviorVersion
is provided. If you experience this panic, set behavior_version
on the Config or enable the behavior-version-latest
Cargo feature.🔬This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dest
.
Read more Source§ Source§Returns the argument unchanged.
Source§ Source§ Source§Calls U::from(self)
.
That is, this conversion is whatever the implementation of From<T> for U
chooses to do.
Creates a shared type from an unshared type.
Source§ Source§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.
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();
Source§
Returns self
with the fg()
set to [Color :: Primary
].
println!("{}", value.primary());
Source§
Returns self
with the fg()
set to [Color :: Fixed
].
println!("{}", value.fixed(color));
Source§
Returns self
with the fg()
set to [Color :: Rgb
].
println!("{}", value.rgb(r, g, b));
Source§
Returns self
with the fg()
set to [Color :: Black
].
println!("{}", value.black());
Source§
Returns self
with the fg()
set to [Color :: Red
].
println!("{}", value.red());
Source§
Returns self
with the fg()
set to [Color :: Green
].
println!("{}", value.green());
Source§
Returns self
with the fg()
set to [Color :: Yellow
].
println!("{}", value.yellow());
Source§
Returns self
with the fg()
set to [Color :: Blue
].
println!("{}", value.blue());
Source§
Returns self
with the fg()
set to [Color :: Magenta
].
println!("{}", value.magenta());
Source§
Returns self
with the fg()
set to [Color :: Cyan
].
println!("{}", value.cyan());
Source§
Returns self
with the fg()
set to [Color :: White
].
println!("{}", value.white());
Source§
Returns self
with the fg()
set to [Color :: BrightBlack
].
println!("{}", value.bright_black());
Source§
Returns self
with the fg()
set to [Color :: BrightRed
].
println!("{}", value.bright_red());
Source§
Returns self
with the fg()
set to [Color :: BrightGreen
].
println!("{}", value.bright_green());
Source§
Returns self
with the fg()
set to [Color :: BrightYellow
].
println!("{}", value.bright_yellow());
Source§
Returns self
with the fg()
set to [Color :: BrightBlue
].
println!("{}", value.bright_blue());
Source§
Returns self
with the fg()
set to [Color :: BrightMagenta
].
println!("{}", value.bright_magenta());
Source§
Returns self
with the fg()
set to [Color :: BrightCyan
].
println!("{}", value.bright_cyan());
Source§
Returns self
with the fg()
set to [Color :: BrightWhite
].
println!("{}", value.bright_white());
Source§
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.
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();
Source§
Returns self
with the bg()
set to [Color :: Primary
].
println!("{}", value.on_primary());
Source§
Returns self
with the bg()
set to [Color :: Fixed
].
println!("{}", value.on_fixed(color));
Source§
Returns self
with the bg()
set to [Color :: Rgb
].
println!("{}", value.on_rgb(r, g, b));
Source§
Returns self
with the bg()
set to [Color :: Black
].
println!("{}", value.on_black());
Source§
Returns self
with the bg()
set to [Color :: Red
].
println!("{}", value.on_red());
Source§
Returns self
with the bg()
set to [Color :: Green
].
println!("{}", value.on_green());
Source§
Returns self
with the bg()
set to [Color :: Yellow
].
println!("{}", value.on_yellow());
Source§
Returns self
with the bg()
set to [Color :: Blue
].
println!("{}", value.on_blue());
Source§
Returns self
with the bg()
set to [Color :: Magenta
].
println!("{}", value.on_magenta());
Source§
Returns self
with the bg()
set to [Color :: Cyan
].
println!("{}", value.on_cyan());
Source§
Returns self
with the bg()
set to [Color :: White
].
println!("{}", value.on_white());
Source§
Returns self
with the bg()
set to [Color :: BrightBlack
].
println!("{}", value.on_bright_black());
Source§
Returns self
with the bg()
set to [Color :: BrightRed
].
println!("{}", value.on_bright_red());
Source§
Returns self
with the bg()
set to [Color :: BrightGreen
].
println!("{}", value.on_bright_green());
Source§
Returns self
with the bg()
set to [Color :: BrightYellow
].
println!("{}", value.on_bright_yellow());
Source§
Returns self
with the bg()
set to [Color :: BrightBlue
].
println!("{}", value.on_bright_blue());
Source§
Returns self
with the bg()
set to [Color :: BrightMagenta
].
println!("{}", value.on_bright_magenta());
Source§
Returns self
with the bg()
set to [Color :: BrightCyan
].
println!("{}", value.on_bright_cyan());
Source§
Returns self
with the bg()
set to [Color :: BrightWhite
].
println!("{}", value.on_bright_white());
Source§
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.
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§
Returns self
with the attr()
set to [Attribute :: Bold
].
println!("{}", value.bold());
Source§
Returns self
with the attr()
set to [Attribute :: Dim
].
println!("{}", value.dim());
Source§
Returns self
with the attr()
set to [Attribute :: Italic
].
println!("{}", value.italic());
Source§
Returns self
with the attr()
set to [Attribute :: Underline
].
println!("{}", value.underline());
Source§
Returns self
with the attr()
set to [Attribute :: Blink
].
println!("{}", value.blink());
Source§
Returns self
with the attr()
set to [Attribute :: RapidBlink
].
println!("{}", value.rapid_blink());
Source§
Returns self
with the attr()
set to [Attribute :: Invert
].
println!("{}", value.invert());
Source§
Returns self
with the attr()
set to [Attribute :: Conceal
].
println!("{}", value.conceal());
Source§
Returns self
with the attr()
set to [Attribute :: Strike
].
println!("{}", value.strike());
Source§
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.
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§
Returns self
with the quirk()
set to [Quirk :: Mask
].
println!("{}", value.mask());
Source§
Returns self
with the quirk()
set to [Quirk :: Wrap
].
println!("{}", value.wrap());
Source§
Returns self
with the quirk()
set to [Quirk :: Linger
].
println!("{}", value.linger());
Source§
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
. The clear()
method will be removed in a future release.
Returns self
with the quirk()
set to [Quirk :: Clear
].
println!("{}", value.clear());
Source§
Returns self
with the quirk()
set to [Quirk :: Resetting
].
println!("{}", value.resetting());
Source§
Returns self
with the quirk()
set to [Quirk :: Bright
].
println!("{}", value.bright());
Source§
Returns self
with the quirk()
set to [Quirk :: OnBright
].
println!("{}", value.on_bright());
Source§
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§ExampleEnable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§ Source§
Apply a style wholesale to
self
. Any previous style is replaced.
Read more Source§ Source§ Source§The resulting type after obtaining ownership.
Source§Creates owned data from borrowed data, usually by cloning.
Read more Source§Uses borrowed data to replace owned data, usually by cloning.
Read more Source§ Source§The type returned in the event of a conversion error.
Source§Performs the conversion.
Source§ Source§The type returned in the event of a conversion error.
Source§Performs the conversion.
Source§ Source§RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4