Struct aws_sdk_dynamodb::output::execute_statement_output::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for ExecuteStatementOutput
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn items(self, input: HashMap<String, AttributeValue>) -> Self
pub fn items(self, input: HashMap<String, AttributeValue>) -> Self
Appends an item to items
.
To override the contents of this collection use set_items
.
If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.
sourcepub fn set_items(
self,
input: Option<Vec<HashMap<String, AttributeValue>>>
) -> Self
pub fn set_items(
self,
input: Option<Vec<HashMap<String, AttributeValue>>>
) -> Self
If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.
Examples found in repository?
2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330
pub(crate) fn deser_operation_crate_operation_execute_statement(
value: &[u8],
mut builder: crate::output::execute_statement_output::Builder,
) -> Result<
crate::output::execute_statement_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() {
"Items" => {
builder = builder.set_items(
crate::json_deser::deser_list_com_amazonaws_dynamodb_item_list(tokens)?,
);
}
"NextToken" => {
builder = builder.set_next_token(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"ConsumedCapacity" => {
builder = builder.set_consumed_capacity(
crate::json_deser::deser_structure_crate_model_consumed_capacity(
tokens,
)?,
);
}
"LastEvaluatedKey" => {
builder = builder.set_last_evaluated_key(
crate::json_deser::deser_map_com_amazonaws_dynamodb_key(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 next_token(self, input: impl Into<String>) -> Self
pub fn next_token(self, input: impl Into<String>) -> Self
If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.
sourcepub fn set_next_token(self, input: Option<String>) -> Self
pub fn set_next_token(self, input: Option<String>) -> Self
If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.
Examples found in repository?
2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330
pub(crate) fn deser_operation_crate_operation_execute_statement(
value: &[u8],
mut builder: crate::output::execute_statement_output::Builder,
) -> Result<
crate::output::execute_statement_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() {
"Items" => {
builder = builder.set_items(
crate::json_deser::deser_list_com_amazonaws_dynamodb_item_list(tokens)?,
);
}
"NextToken" => {
builder = builder.set_next_token(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"ConsumedCapacity" => {
builder = builder.set_consumed_capacity(
crate::json_deser::deser_structure_crate_model_consumed_capacity(
tokens,
)?,
);
}
"LastEvaluatedKey" => {
builder = builder.set_last_evaluated_key(
crate::json_deser::deser_map_com_amazonaws_dynamodb_key(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 consumed_capacity(self, input: ConsumedCapacity) -> Self
pub fn consumed_capacity(self, input: ConsumedCapacity) -> Self
The capacity units consumed by an operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity
is only returned if the request asked for it. For more information, see Provisioned Throughput in the Amazon DynamoDB Developer Guide.
sourcepub fn set_consumed_capacity(self, input: Option<ConsumedCapacity>) -> Self
pub fn set_consumed_capacity(self, input: Option<ConsumedCapacity>) -> Self
The capacity units consumed by an operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity
is only returned if the request asked for it. For more information, see Provisioned Throughput in the Amazon DynamoDB Developer Guide.
Examples found in repository?
2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330
pub(crate) fn deser_operation_crate_operation_execute_statement(
value: &[u8],
mut builder: crate::output::execute_statement_output::Builder,
) -> Result<
crate::output::execute_statement_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() {
"Items" => {
builder = builder.set_items(
crate::json_deser::deser_list_com_amazonaws_dynamodb_item_list(tokens)?,
);
}
"NextToken" => {
builder = builder.set_next_token(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"ConsumedCapacity" => {
builder = builder.set_consumed_capacity(
crate::json_deser::deser_structure_crate_model_consumed_capacity(
tokens,
)?,
);
}
"LastEvaluatedKey" => {
builder = builder.set_last_evaluated_key(
crate::json_deser::deser_map_com_amazonaws_dynamodb_key(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 last_evaluated_key(self, k: impl Into<String>, v: AttributeValue) -> Self
pub fn last_evaluated_key(self, k: impl Into<String>, v: AttributeValue) -> Self
Adds a key-value pair to last_evaluated_key
.
To override the contents of this collection use set_last_evaluated_key
.
The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedKey
is empty, then the "last page" of results has been processed and there is no more data to be retrieved. If LastEvaluatedKey
is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedKey
is empty.
sourcepub fn set_last_evaluated_key(
self,
input: Option<HashMap<String, AttributeValue>>
) -> Self
pub fn set_last_evaluated_key(
self,
input: Option<HashMap<String, AttributeValue>>
) -> Self
The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedKey
is empty, then the "last page" of results has been processed and there is no more data to be retrieved. If LastEvaluatedKey
is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedKey
is empty.
Examples found in repository?
2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330
pub(crate) fn deser_operation_crate_operation_execute_statement(
value: &[u8],
mut builder: crate::output::execute_statement_output::Builder,
) -> Result<
crate::output::execute_statement_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() {
"Items" => {
builder = builder.set_items(
crate::json_deser::deser_list_com_amazonaws_dynamodb_item_list(tokens)?,
);
}
"NextToken" => {
builder = builder.set_next_token(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"ConsumedCapacity" => {
builder = builder.set_consumed_capacity(
crate::json_deser::deser_structure_crate_model_consumed_capacity(
tokens,
)?,
);
}
"LastEvaluatedKey" => {
builder = builder.set_last_evaluated_key(
crate::json_deser::deser_map_com_amazonaws_dynamodb_key(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) -> ExecuteStatementOutput
pub fn build(self) -> ExecuteStatementOutput
Consumes the builder and constructs a ExecuteStatementOutput
.
Examples found in repository?
2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586
pub fn parse_execute_statement_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ExecuteStatementOutput, crate::error::ExecuteStatementError>
{
Ok({
#[allow(unused_mut)]
let mut output = crate::output::execute_statement_output::Builder::default();
let _ = response;
output = crate::json_deser::deser_operation_crate_operation_execute_statement(
response.body().as_ref(),
output,
)
.map_err(crate::error::ExecuteStatementError::unhandled)?;
output.build()
})
}