Struct aws_sdk_dynamodb::output::transact_get_items_output::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for TransactGetItemsOutput
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn consumed_capacity(self, input: ConsumedCapacity) -> Self
pub fn consumed_capacity(self, input: ConsumedCapacity) -> Self
Appends an item to consumed_capacity
.
To override the contents of this collection use set_consumed_capacity
.
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.
sourcepub fn set_consumed_capacity(self, input: Option<Vec<ConsumedCapacity>>) -> Self
pub fn set_consumed_capacity(self, input: Option<Vec<ConsumedCapacity>>) -> Self
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.
Examples found in repository?
3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713
pub(crate) fn deser_operation_crate_operation_transact_get_items(
value: &[u8],
mut builder: crate::output::transact_get_items_output::Builder,
) -> Result<
crate::output::transact_get_items_output::Builder,
aws_smithy_json::deserialize::error::DeserializeError,
> {
let mut tokens_owned =
aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value))
.peekable();
let tokens = &mut tokens_owned;
aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
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() {
"ConsumedCapacity" => {
builder = builder.set_consumed_capacity(
crate::json_deser::deser_list_com_amazonaws_dynamodb_consumed_capacity_multiple(tokens)?
);
}
"Responses" => {
builder = builder.set_responses(
crate::json_deser::deser_list_com_amazonaws_dynamodb_item_response_list(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
)),
)
}
}
}
if tokens.next().is_some() {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"found more JSON tokens after completing parsing",
),
);
}
Ok(builder)
}
sourcepub fn responses(self, input: ItemResponse) -> Self
pub fn responses(self, input: ItemResponse) -> Self
Appends an item to responses
.
To override the contents of this collection use set_responses
.
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.
sourcepub fn set_responses(self, input: Option<Vec<ItemResponse>>) -> Self
pub fn set_responses(self, input: Option<Vec<ItemResponse>>) -> Self
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.
Examples found in repository?
3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713
pub(crate) fn deser_operation_crate_operation_transact_get_items(
value: &[u8],
mut builder: crate::output::transact_get_items_output::Builder,
) -> Result<
crate::output::transact_get_items_output::Builder,
aws_smithy_json::deserialize::error::DeserializeError,
> {
let mut tokens_owned =
aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value))
.peekable();
let tokens = &mut tokens_owned;
aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
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() {
"ConsumedCapacity" => {
builder = builder.set_consumed_capacity(
crate::json_deser::deser_list_com_amazonaws_dynamodb_consumed_capacity_multiple(tokens)?
);
}
"Responses" => {
builder = builder.set_responses(
crate::json_deser::deser_list_com_amazonaws_dynamodb_item_response_list(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
)),
)
}
}
}
if tokens.next().is_some() {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"found more JSON tokens after completing parsing",
),
);
}
Ok(builder)
}
sourcepub fn build(self) -> TransactGetItemsOutput
pub fn build(self) -> TransactGetItemsOutput
Consumes the builder and constructs a TransactGetItemsOutput
.
Examples found in repository?
4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565
pub fn parse_transact_get_items_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::TransactGetItemsOutput, crate::error::TransactGetItemsError>
{
Ok({
#[allow(unused_mut)]
let mut output = crate::output::transact_get_items_output::Builder::default();
let _ = response;
output = crate::json_deser::deser_operation_crate_operation_transact_get_items(
response.body().as_ref(),
output,
)
.map_err(crate::error::TransactGetItemsError::unhandled)?;
output.build()
})
}