aws-sdk-dynamodb 1.111.0

AWS SDK for Amazon DynamoDB
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents the output of a <code>BatchWriteItem</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchWriteItemOutput {
    /// <p>A map of tables and requests against those tables that were not processed. The <code>UnprocessedItems</code> value is in the same form as <code>RequestItems</code>, so you can provide this value directly to a subsequent <code>BatchWriteItem</code> operation. For more information, see <code>RequestItems</code> in the Request Parameters section.</p>
    /// <p>Each <code>UnprocessedItems</code> entry consists of a table name or table ARN and, for that table, a list of operations to perform (<code>DeleteRequest</code> or <code>PutRequest</code>).</p>
    /// <ul>
    /// <li>
    /// <p><code>DeleteRequest</code> - Perform a <code>DeleteItem</code> operation on the specified item. The item to be deleted is identified by a <code>Key</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Key</code> - 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.</p></li>
    /// </ul></li>
    /// <li>
    /// <p><code>PutRequest</code> - Perform a <code>PutItem</code> operation on the specified item. The item to be put is identified by an <code>Item</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Item</code> - 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 <code>ValidationException</code> exception.</p>
    /// <p>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.</p></li>
    /// </ul></li>
    /// </ul>
    /// <p>If there are no unprocessed items remaining, the response contains an empty <code>UnprocessedItems</code> map.</p>
    pub unprocessed_items: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::WriteRequest>>>,
    /// <p>A list of tables that were processed by <code>BatchWriteItem</code> and, for each table, information about any item collections that were affected by individual <code>DeleteItem</code> or <code>PutItem</code> operations.</p>
    /// <p>Each entry consists of the following subelements:</p>
    /// <ul>
    /// <li>
    /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item.</p></li>
    /// <li>
    /// <p><code>SizeEstimateRangeGB</code> - 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.</p>
    /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
    /// </ul>
    pub item_collection_metrics:
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>>,
    /// <p>The capacity units consumed by the entire <code>BatchWriteItem</code> operation.</p>
    /// <p>Each element consists of:</p>
    /// <ul>
    /// <li>
    /// <p><code>TableName</code> - The table that consumed the provisioned throughput.</p></li>
    /// <li>
    /// <p><code>CapacityUnits</code> - The total number of capacity units consumed.</p></li>
    /// </ul>
    pub consumed_capacity: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
    _request_id: Option<String>,
}
impl BatchWriteItemOutput {
    /// <p>A map of tables and requests against those tables that were not processed. The <code>UnprocessedItems</code> value is in the same form as <code>RequestItems</code>, so you can provide this value directly to a subsequent <code>BatchWriteItem</code> operation. For more information, see <code>RequestItems</code> in the Request Parameters section.</p>
    /// <p>Each <code>UnprocessedItems</code> entry consists of a table name or table ARN and, for that table, a list of operations to perform (<code>DeleteRequest</code> or <code>PutRequest</code>).</p>
    /// <ul>
    /// <li>
    /// <p><code>DeleteRequest</code> - Perform a <code>DeleteItem</code> operation on the specified item. The item to be deleted is identified by a <code>Key</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Key</code> - 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.</p></li>
    /// </ul></li>
    /// <li>
    /// <p><code>PutRequest</code> - Perform a <code>PutItem</code> operation on the specified item. The item to be put is identified by an <code>Item</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Item</code> - 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 <code>ValidationException</code> exception.</p>
    /// <p>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.</p></li>
    /// </ul></li>
    /// </ul>
    /// <p>If there are no unprocessed items remaining, the response contains an empty <code>UnprocessedItems</code> map.</p>
    pub fn unprocessed_items(
        &self,
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::WriteRequest>>> {
        self.unprocessed_items.as_ref()
    }
    /// <p>A list of tables that were processed by <code>BatchWriteItem</code> and, for each table, information about any item collections that were affected by individual <code>DeleteItem</code> or <code>PutItem</code> operations.</p>
    /// <p>Each entry consists of the following subelements:</p>
    /// <ul>
    /// <li>
    /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item.</p></li>
    /// <li>
    /// <p><code>SizeEstimateRangeGB</code> - 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.</p>
    /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
    /// </ul>
    pub fn item_collection_metrics(
        &self,
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>> {
        self.item_collection_metrics.as_ref()
    }
    /// <p>The capacity units consumed by the entire <code>BatchWriteItem</code> operation.</p>
    /// <p>Each element consists of:</p>
    /// <ul>
    /// <li>
    /// <p><code>TableName</code> - The table that consumed the provisioned throughput.</p></li>
    /// <li>
    /// <p><code>CapacityUnits</code> - The total number of capacity units consumed.</p></li>
    /// </ul>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.consumed_capacity.is_none()`.
    pub fn consumed_capacity(&self) -> &[crate::types::ConsumedCapacity] {
        self.consumed_capacity.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for BatchWriteItemOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl BatchWriteItemOutput {
    /// Creates a new builder-style object to manufacture [`BatchWriteItemOutput`](crate::operation::batch_write_item::BatchWriteItemOutput).
    pub fn builder() -> crate::operation::batch_write_item::builders::BatchWriteItemOutputBuilder {
        crate::operation::batch_write_item::builders::BatchWriteItemOutputBuilder::default()
    }
}

/// A builder for [`BatchWriteItemOutput`](crate::operation::batch_write_item::BatchWriteItemOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchWriteItemOutputBuilder {
    pub(crate) unprocessed_items:
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::WriteRequest>>>,
    pub(crate) item_collection_metrics:
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>>,
    pub(crate) consumed_capacity: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
    _request_id: Option<String>,
}
impl BatchWriteItemOutputBuilder {
    /// Adds a key-value pair to `unprocessed_items`.
    ///
    /// To override the contents of this collection use [`set_unprocessed_items`](Self::set_unprocessed_items).
    ///
    /// <p>A map of tables and requests against those tables that were not processed. The <code>UnprocessedItems</code> value is in the same form as <code>RequestItems</code>, so you can provide this value directly to a subsequent <code>BatchWriteItem</code> operation. For more information, see <code>RequestItems</code> in the Request Parameters section.</p>
    /// <p>Each <code>UnprocessedItems</code> entry consists of a table name or table ARN and, for that table, a list of operations to perform (<code>DeleteRequest</code> or <code>PutRequest</code>).</p>
    /// <ul>
    /// <li>
    /// <p><code>DeleteRequest</code> - Perform a <code>DeleteItem</code> operation on the specified item. The item to be deleted is identified by a <code>Key</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Key</code> - 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.</p></li>
    /// </ul></li>
    /// <li>
    /// <p><code>PutRequest</code> - Perform a <code>PutItem</code> operation on the specified item. The item to be put is identified by an <code>Item</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Item</code> - 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 <code>ValidationException</code> exception.</p>
    /// <p>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.</p></li>
    /// </ul></li>
    /// </ul>
    /// <p>If there are no unprocessed items remaining, the response contains an empty <code>UnprocessedItems</code> map.</p>
    pub fn unprocessed_items(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<crate::types::WriteRequest>) -> Self {
        let mut hash_map = self.unprocessed_items.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.unprocessed_items = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A map of tables and requests against those tables that were not processed. The <code>UnprocessedItems</code> value is in the same form as <code>RequestItems</code>, so you can provide this value directly to a subsequent <code>BatchWriteItem</code> operation. For more information, see <code>RequestItems</code> in the Request Parameters section.</p>
    /// <p>Each <code>UnprocessedItems</code> entry consists of a table name or table ARN and, for that table, a list of operations to perform (<code>DeleteRequest</code> or <code>PutRequest</code>).</p>
    /// <ul>
    /// <li>
    /// <p><code>DeleteRequest</code> - Perform a <code>DeleteItem</code> operation on the specified item. The item to be deleted is identified by a <code>Key</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Key</code> - 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.</p></li>
    /// </ul></li>
    /// <li>
    /// <p><code>PutRequest</code> - Perform a <code>PutItem</code> operation on the specified item. The item to be put is identified by an <code>Item</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Item</code> - 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 <code>ValidationException</code> exception.</p>
    /// <p>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.</p></li>
    /// </ul></li>
    /// </ul>
    /// <p>If there are no unprocessed items remaining, the response contains an empty <code>UnprocessedItems</code> map.</p>
    pub fn set_unprocessed_items(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::WriteRequest>>>,
    ) -> Self {
        self.unprocessed_items = input;
        self
    }
    /// <p>A map of tables and requests against those tables that were not processed. The <code>UnprocessedItems</code> value is in the same form as <code>RequestItems</code>, so you can provide this value directly to a subsequent <code>BatchWriteItem</code> operation. For more information, see <code>RequestItems</code> in the Request Parameters section.</p>
    /// <p>Each <code>UnprocessedItems</code> entry consists of a table name or table ARN and, for that table, a list of operations to perform (<code>DeleteRequest</code> or <code>PutRequest</code>).</p>
    /// <ul>
    /// <li>
    /// <p><code>DeleteRequest</code> - Perform a <code>DeleteItem</code> operation on the specified item. The item to be deleted is identified by a <code>Key</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Key</code> - 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.</p></li>
    /// </ul></li>
    /// <li>
    /// <p><code>PutRequest</code> - Perform a <code>PutItem</code> operation on the specified item. The item to be put is identified by an <code>Item</code> subelement:</p>
    /// <ul>
    /// <li>
    /// <p><code>Item</code> - 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 <code>ValidationException</code> exception.</p>
    /// <p>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.</p></li>
    /// </ul></li>
    /// </ul>
    /// <p>If there are no unprocessed items remaining, the response contains an empty <code>UnprocessedItems</code> map.</p>
    pub fn get_unprocessed_items(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::WriteRequest>>> {
        &self.unprocessed_items
    }
    /// Adds a key-value pair to `item_collection_metrics`.
    ///
    /// To override the contents of this collection use [`set_item_collection_metrics`](Self::set_item_collection_metrics).
    ///
    /// <p>A list of tables that were processed by <code>BatchWriteItem</code> and, for each table, information about any item collections that were affected by individual <code>DeleteItem</code> or <code>PutItem</code> operations.</p>
    /// <p>Each entry consists of the following subelements:</p>
    /// <ul>
    /// <li>
    /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item.</p></li>
    /// <li>
    /// <p><code>SizeEstimateRangeGB</code> - 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.</p>
    /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
    /// </ul>
    pub fn item_collection_metrics(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: ::std::vec::Vec<crate::types::ItemCollectionMetrics>,
    ) -> Self {
        let mut hash_map = self.item_collection_metrics.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.item_collection_metrics = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A list of tables that were processed by <code>BatchWriteItem</code> and, for each table, information about any item collections that were affected by individual <code>DeleteItem</code> or <code>PutItem</code> operations.</p>
    /// <p>Each entry consists of the following subelements:</p>
    /// <ul>
    /// <li>
    /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item.</p></li>
    /// <li>
    /// <p><code>SizeEstimateRangeGB</code> - 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.</p>
    /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
    /// </ul>
    pub fn set_item_collection_metrics(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>>,
    ) -> Self {
        self.item_collection_metrics = input;
        self
    }
    /// <p>A list of tables that were processed by <code>BatchWriteItem</code> and, for each table, information about any item collections that were affected by individual <code>DeleteItem</code> or <code>PutItem</code> operations.</p>
    /// <p>Each entry consists of the following subelements:</p>
    /// <ul>
    /// <li>
    /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item.</p></li>
    /// <li>
    /// <p><code>SizeEstimateRangeGB</code> - 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.</p>
    /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
    /// </ul>
    pub fn get_item_collection_metrics(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>> {
        &self.item_collection_metrics
    }
    /// Appends an item to `consumed_capacity`.
    ///
    /// To override the contents of this collection use [`set_consumed_capacity`](Self::set_consumed_capacity).
    ///
    /// <p>The capacity units consumed by the entire <code>BatchWriteItem</code> operation.</p>
    /// <p>Each element consists of:</p>
    /// <ul>
    /// <li>
    /// <p><code>TableName</code> - The table that consumed the provisioned throughput.</p></li>
    /// <li>
    /// <p><code>CapacityUnits</code> - The total number of capacity units consumed.</p></li>
    /// </ul>
    pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
        let mut v = self.consumed_capacity.unwrap_or_default();
        v.push(input);
        self.consumed_capacity = ::std::option::Option::Some(v);
        self
    }
    /// <p>The capacity units consumed by the entire <code>BatchWriteItem</code> operation.</p>
    /// <p>Each element consists of:</p>
    /// <ul>
    /// <li>
    /// <p><code>TableName</code> - The table that consumed the provisioned throughput.</p></li>
    /// <li>
    /// <p><code>CapacityUnits</code> - The total number of capacity units consumed.</p></li>
    /// </ul>
    pub fn set_consumed_capacity(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>) -> Self {
        self.consumed_capacity = input;
        self
    }
    /// <p>The capacity units consumed by the entire <code>BatchWriteItem</code> operation.</p>
    /// <p>Each element consists of:</p>
    /// <ul>
    /// <li>
    /// <p><code>TableName</code> - The table that consumed the provisioned throughput.</p></li>
    /// <li>
    /// <p><code>CapacityUnits</code> - The total number of capacity units consumed.</p></li>
    /// </ul>
    pub fn get_consumed_capacity(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>> {
        &self.consumed_capacity
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`BatchWriteItemOutput`](crate::operation::batch_write_item::BatchWriteItemOutput).
    pub fn build(self) -> crate::operation::batch_write_item::BatchWriteItemOutput {
        crate::operation::batch_write_item::BatchWriteItemOutput {
            unprocessed_items: self.unprocessed_items,
            item_collection_metrics: self.item_collection_metrics,
            consumed_capacity: self.consumed_capacity,
            _request_id: self._request_id,
        }
    }
}