Struct aws_sdk_cloudfront::error::function_already_exists::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for FunctionAlreadyExists
.
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/xml_deser.rs (line 2929)
2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936
pub fn deser_structure_crate_error_function_already_exists_xml_err(
inp: &[u8],
mut builder: crate::error::function_already_exists::Builder,
) -> Result<crate::error::function_already_exists::Builder, aws_smithy_xml::decode::XmlDecodeError>
{
if inp.is_empty() {
return Ok(builder);
}
let mut document = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
while let Some(mut tag) = error_decoder.next_tag() {
match tag.start_el() {
s if s.matches("Message") /* Message com.amazonaws.cloudfront#FunctionAlreadyExists$Message */ => {
let var_86 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_message(var_86);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn build(self) -> FunctionAlreadyExists
pub fn build(self) -> FunctionAlreadyExists
Consumes the builder and constructs a FunctionAlreadyExists
.
Examples found in repository?
src/operation_deser.rs (line 2643)
2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728
pub fn parse_create_function_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateFunctionOutput, crate::error::CreateFunctionError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateFunctionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateFunctionError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"FunctionAlreadyExists" => crate::error::CreateFunctionError {
meta: generic,
kind: crate::error::CreateFunctionErrorKind::FunctionAlreadyExists({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::function_already_exists::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_function_already_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"FunctionSizeLimitExceeded" => crate::error::CreateFunctionError {
meta: generic,
kind: crate::error::CreateFunctionErrorKind::FunctionSizeLimitExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::function_size_limit_exceeded::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_function_size_limit_exceeded_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidArgument" => crate::error::CreateFunctionError {
meta: generic,
kind: crate::error::CreateFunctionErrorKind::InvalidArgument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::CreateFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyFunctions" => {
crate::error::CreateFunctionError {
meta: generic,
kind: crate::error::CreateFunctionErrorKind::TooManyFunctions({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_functions::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_functions_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"UnsupportedOperation" => crate::error::CreateFunctionError {
meta: generic,
kind: crate::error::CreateFunctionErrorKind::UnsupportedOperation({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unsupported_operation::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_unsupported_operation_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateFunctionError::generic(generic),
})
}