pub struct Builder { /* private fields */ }
Expand description
A builder for GlobalTableAlreadyExistsException
.
Implementations§
source§impl Builder
impl Builder
pub fn message(self, input: impl Into<String>) -> Self
sourcepub fn set_message(self, input: Option<String>) -> Self
pub fn set_message(self, input: Option<String>) -> Self
Examples found in repository?
src/json_deser.rs (lines 770-776)
752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799
pub(crate) fn deser_structure_crate_error_global_table_already_exists_exception_json_err(
value: &[u8],
mut builder: crate::error::global_table_already_exists_exception::Builder,
) -> Result<
crate::error::global_table_already_exists_exception::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() {
"message" => {
builder = builder.set_message(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => 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) -> GlobalTableAlreadyExistsException
pub fn build(self) -> GlobalTableAlreadyExistsException
Consumes the builder and constructs a GlobalTableAlreadyExistsException
.
Examples found in repository?
src/operation_deser.rs (line 512)
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590
pub fn parse_create_global_table_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateGlobalTableOutput, crate::error::CreateGlobalTableError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateGlobalTableError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateGlobalTableError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"GlobalTableAlreadyExistsException" => crate::error::CreateGlobalTableError {
meta: generic,
kind: crate::error::CreateGlobalTableErrorKind::GlobalTableAlreadyExistsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::global_table_already_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_global_table_already_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGlobalTableError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerError" => crate::error::CreateGlobalTableError {
meta: generic,
kind: crate::error::CreateGlobalTableErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGlobalTableError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidEndpointException" => crate::error::CreateGlobalTableError {
meta: generic,
kind: crate::error::CreateGlobalTableErrorKind::InvalidEndpointException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_endpoint_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_endpoint_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGlobalTableError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"LimitExceededException" => crate::error::CreateGlobalTableError {
meta: generic,
kind: crate::error::CreateGlobalTableErrorKind::LimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGlobalTableError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TableNotFoundException" => crate::error::CreateGlobalTableError {
meta: generic,
kind: crate::error::CreateGlobalTableErrorKind::TableNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::table_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_table_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateGlobalTableError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateGlobalTableError::generic(generic),
})
}