aws_sdk_dynamodb/types/
_item_response.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Details for the requested item.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ItemResponse {
7    /// <p>Map of attribute data consisting of the data type and attribute value.</p>
8    pub item: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
9}
10impl ItemResponse {
11    /// <p>Map of attribute data consisting of the data type and attribute value.</p>
12    pub fn item(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
13        self.item.as_ref()
14    }
15}
16impl ItemResponse {
17    /// Creates a new builder-style object to manufacture [`ItemResponse`](crate::types::ItemResponse).
18    pub fn builder() -> crate::types::builders::ItemResponseBuilder {
19        crate::types::builders::ItemResponseBuilder::default()
20    }
21}
22
23/// A builder for [`ItemResponse`](crate::types::ItemResponse).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct ItemResponseBuilder {
27    pub(crate) item: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
28}
29impl ItemResponseBuilder {
30    /// Adds a key-value pair to `item`.
31    ///
32    /// To override the contents of this collection use [`set_item`](Self::set_item).
33    ///
34    /// <p>Map of attribute data consisting of the data type and attribute value.</p>
35    pub fn item(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
36        let mut hash_map = self.item.unwrap_or_default();
37        hash_map.insert(k.into(), v);
38        self.item = ::std::option::Option::Some(hash_map);
39        self
40    }
41    /// <p>Map of attribute data consisting of the data type and attribute value.</p>
42    pub fn set_item(
43        mut self,
44        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
45    ) -> Self {
46        self.item = input;
47        self
48    }
49    /// <p>Map of attribute data consisting of the data type and attribute value.</p>
50    pub fn get_item(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
51        &self.item
52    }
53    /// Consumes the builder and constructs a [`ItemResponse`](crate::types::ItemResponse).
54    pub fn build(self) -> crate::types::ItemResponse {
55        crate::types::ItemResponse { item: self.item }
56    }
57}