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