Struct aws_sdk_dynamodb::model::item_response::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for ItemResponse
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn item(self, k: impl Into<String>, v: AttributeValue) -> Self
pub fn item(self, k: impl Into<String>, v: AttributeValue) -> Self
Adds a key-value pair to item
.
To override the contents of this collection use set_item
.
Map of attribute data consisting of the data type and attribute value.
sourcepub fn set_item(self, input: Option<HashMap<String, AttributeValue>>) -> Self
pub fn set_item(self, input: Option<HashMap<String, AttributeValue>>) -> Self
Map of attribute data consisting of the data type and attribute value.
Examples found in repository?
src/json_deser.rs (lines 8985-8987)
8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010
pub(crate) fn deser_structure_crate_model_item_response<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::ItemResponse>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::item_response::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Item" => {
builder = builder.set_item(
crate::json_deser::deser_map_com_amazonaws_dynamodb_attribute_map(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn build(self) -> ItemResponse
pub fn build(self) -> ItemResponse
Consumes the builder and constructs a ItemResponse
.
Examples found in repository?
src/json_deser.rs (line 9002)
8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010
pub(crate) fn deser_structure_crate_model_item_response<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::ItemResponse>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::item_response::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Item" => {
builder = builder.set_item(
crate::json_deser::deser_map_com_amazonaws_dynamodb_attribute_map(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}