aws_sdk_ec2/protocol_serde/
shape_create_public_ipv4_pool.rs1#[allow(clippy::unnecessary_wraps)]
3pub fn de_create_public_ipv4_pool_http_error(
4 _response_status: u16,
5 _response_headers: &::aws_smithy_runtime_api::http::Headers,
6 _response_body: &[u8],
7) -> std::result::Result<
8 crate::operation::create_public_ipv4_pool::CreatePublicIpv4PoolOutput,
9 crate::operation::create_public_ipv4_pool::CreatePublicIpv4PoolError,
10> {
11 #[allow(unused_mut)]
12 let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
13 .map_err(crate::operation::create_public_ipv4_pool::CreatePublicIpv4PoolError::unhandled)?;
14 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
15 let generic = generic_builder.build();
16 Err(crate::operation::create_public_ipv4_pool::CreatePublicIpv4PoolError::generic(generic))
17}
18
19#[allow(clippy::unnecessary_wraps)]
20pub fn de_create_public_ipv4_pool_http_response(
21 _response_status: u16,
22 _response_headers: &::aws_smithy_runtime_api::http::Headers,
23 _response_body: &[u8],
24) -> std::result::Result<
25 crate::operation::create_public_ipv4_pool::CreatePublicIpv4PoolOutput,
26 crate::operation::create_public_ipv4_pool::CreatePublicIpv4PoolError,
27> {
28 Ok({
29 #[allow(unused_mut)]
30 let mut output = crate::operation::create_public_ipv4_pool::builders::CreatePublicIpv4PoolOutputBuilder::default();
31 output = crate::protocol_serde::shape_create_public_ipv4_pool::de_create_public_ipv4_pool(_response_body, output)
32 .map_err(crate::operation::create_public_ipv4_pool::CreatePublicIpv4PoolError::unhandled)?;
33 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
34 output.build()
35 })
36}
37
38#[allow(unused_mut)]
39pub fn de_create_public_ipv4_pool(
40 inp: &[u8],
41 mut builder: crate::operation::create_public_ipv4_pool::builders::CreatePublicIpv4PoolOutputBuilder,
42) -> std::result::Result<
43 crate::operation::create_public_ipv4_pool::builders::CreatePublicIpv4PoolOutputBuilder,
44 ::aws_smithy_xml::decode::XmlDecodeError,
45> {
46 let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
47
48 #[allow(unused_mut)]
49 let mut decoder = doc.root_element()?;
50 #[allow(unused_variables)]
51 let start_el = decoder.start_el();
52 if !(start_el.matches("CreatePublicIpv4PoolResponse")) {
53 return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
54 "invalid root, expected CreatePublicIpv4PoolResponse got {:?}",
55 start_el
56 )));
57 }
58 while let Some(mut tag) = decoder.next_tag() {
59 match tag.start_el() {
60 s if s.matches("poolId") => {
61 let var_1 =
62 Some(
63 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
64 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
65 .into()
66 )
67 ?
68 )
69 ;
70 builder = builder.set_pool_id(var_1);
71 }
72 ,
73 _ => {}
74 }
75 }
76 Ok(builder)
77}