aws_sdk_cloudfront/protocol_serde/
shape_create_function_output.rs1pub(crate) fn de_e_tag_header(
3 header_map: &::aws_smithy_runtime_api::http::Headers,
4) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
5 let headers = header_map.get_all("ETag");
6 ::aws_smithy_http::header::one_or_none(headers)
7}
8
9pub(crate) fn de_function_summary_payload(
10 body: &[u8],
11) -> std::result::Result<::std::option::Option<crate::types::FunctionSummary>, crate::operation::create_function::CreateFunctionError> {
12 (!body.is_empty())
13 .then(|| {
14 crate::protocol_serde::shape_create_function_output::de_function_summary(body)
15 .map_err(crate::operation::create_function::CreateFunctionError::unhandled)
16 })
17 .transpose()
18}
19
20pub(crate) fn de_location_header(
21 header_map: &::aws_smithy_runtime_api::http::Headers,
22) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
23 let headers = header_map.get_all("Location");
24 ::aws_smithy_http::header::one_or_none(headers)
25}
26
27pub fn de_function_summary(inp: &[u8]) -> std::result::Result<crate::types::FunctionSummary, ::aws_smithy_xml::decode::XmlDecodeError> {
28 let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
29 #[allow(unused_mut)]
30 let mut decoder = doc.root_element()?;
31 let start_el = decoder.start_el();
32 if !(start_el.matches("FunctionSummary")) {
33 return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
34 "invalid root, expected FunctionSummary got {:?}",
35 start_el
36 )));
37 }
38 crate::protocol_serde::shape_function_summary::de_function_summary(&mut decoder)
39}