pub struct Builder { /* private fields */ }
Expand description

A builder for BatchWriteItemInput.

Implementations§

Adds a key-value pair to request_items.

To override the contents of this collection use set_request_items.

A map of one or more table names 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.

Examples found in repository?
src/client.rs (line 1244)
1239
1240
1241
1242
1243
1244
1245
1246
        pub fn request_items(
            mut self,
            k: impl Into<std::string::String>,
            v: std::vec::Vec<crate::model::WriteRequest>,
        ) -> Self {
            self.inner = self.inner.request_items(k.into(), v);
            self
        }

A map of one or more table names 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.

Examples found in repository?
src/client.rs (line 1267)
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
        pub fn set_request_items(
            mut self,
            input: std::option::Option<
                std::collections::HashMap<
                    std::string::String,
                    std::vec::Vec<crate::model::WriteRequest>,
                >,
            >,
        ) -> Self {
            self.inner = self.inner.set_request_items(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 1280)
1276
1277
1278
1279
1280
1281
1282
        pub fn return_consumed_capacity(
            mut self,
            input: crate::model::ReturnConsumedCapacity,
        ) -> Self {
            self.inner = self.inner.return_consumed_capacity(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 1293)
1289
1290
1291
1292
1293
1294
1295
        pub fn set_return_consumed_capacity(
            mut self,
            input: std::option::Option<crate::model::ReturnConsumedCapacity>,
        ) -> Self {
            self.inner = self.inner.set_return_consumed_capacity(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 1301)
1297
1298
1299
1300
1301
1302
1303
        pub fn return_item_collection_metrics(
            mut self,
            input: crate::model::ReturnItemCollectionMetrics,
        ) -> Self {
            self.inner = self.inner.return_item_collection_metrics(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 1309)
1305
1306
1307
1308
1309
1310
1311
        pub fn set_return_item_collection_metrics(
            mut self,
            input: std::option::Option<crate::model::ReturnItemCollectionMetrics>,
        ) -> Self {
            self.inner = self.inner.set_return_item_collection_metrics(input);
            self
        }

Consumes the builder and constructs a BatchWriteItemInput.

Examples found in repository?
src/client.rs (line 1193)
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
        pub async fn customize(
            self,
        ) -> std::result::Result<
            crate::operation::customize::CustomizableOperation<
                crate::operation::BatchWriteItem,
                aws_http::retry::AwsResponseRetryClassifier,
            >,
            aws_smithy_http::result::SdkError<crate::error::BatchWriteItemError>,
        > {
            let handle = self.handle.clone();
            let operation = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            Ok(crate::operation::customize::CustomizableOperation { handle, operation })
        }

        /// Sends the request and returns the response.
        ///
        /// If an error occurs, an `SdkError` will be returned with additional details that
        /// can be matched against.
        ///
        /// By default, any retryable failures will be retried twice. Retry behavior
        /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
        /// set when configuring the client.
        pub async fn send(
            self,
        ) -> std::result::Result<
            crate::output::BatchWriteItemOutput,
            aws_smithy_http::result::SdkError<crate::error::BatchWriteItemError>,
        > {
            let op = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&self.handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            self.handle.client.call(op).await
        }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more