aws_sdk_ec2/protocol_serde/
shape_modify_vpc_endpoint_connection_notification.rs1#[allow(clippy::unnecessary_wraps)]
3pub fn de_modify_vpc_endpoint_connection_notification_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::modify_vpc_endpoint_connection_notification::ModifyVpcEndpointConnectionNotificationOutput,
9 crate::operation::modify_vpc_endpoint_connection_notification::ModifyVpcEndpointConnectionNotificationError,
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::modify_vpc_endpoint_connection_notification::ModifyVpcEndpointConnectionNotificationError::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::modify_vpc_endpoint_connection_notification::ModifyVpcEndpointConnectionNotificationError::generic(generic))
17}
18
19#[allow(clippy::unnecessary_wraps)]
20pub fn de_modify_vpc_endpoint_connection_notification_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::modify_vpc_endpoint_connection_notification::ModifyVpcEndpointConnectionNotificationOutput,
26 crate::operation::modify_vpc_endpoint_connection_notification::ModifyVpcEndpointConnectionNotificationError,
27> {
28 Ok({
29 #[allow(unused_mut)]
30 let mut output =
31 crate::operation::modify_vpc_endpoint_connection_notification::builders::ModifyVpcEndpointConnectionNotificationOutputBuilder::default();
32 output = crate::protocol_serde::shape_modify_vpc_endpoint_connection_notification::de_modify_vpc_endpoint_connection_notification(
33 _response_body,
34 output,
35 )
36 .map_err(crate::operation::modify_vpc_endpoint_connection_notification::ModifyVpcEndpointConnectionNotificationError::unhandled)?;
37 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
38 output.build()
39 })
40}
41
42#[allow(unused_mut)]
43pub fn de_modify_vpc_endpoint_connection_notification(
44 inp: &[u8],
45 mut builder: crate::operation::modify_vpc_endpoint_connection_notification::builders::ModifyVpcEndpointConnectionNotificationOutputBuilder,
46) -> std::result::Result<
47 crate::operation::modify_vpc_endpoint_connection_notification::builders::ModifyVpcEndpointConnectionNotificationOutputBuilder,
48 ::aws_smithy_xml::decode::XmlDecodeError,
49> {
50 let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
51
52 #[allow(unused_mut)]
53 let mut decoder = doc.root_element()?;
54 #[allow(unused_variables)]
55 let start_el = decoder.start_el();
56 if !(start_el.matches("ModifyVpcEndpointConnectionNotificationResponse")) {
57 return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
58 "invalid root, expected ModifyVpcEndpointConnectionNotificationResponse got {:?}",
59 start_el
60 )));
61 }
62 while let Some(mut tag) = decoder.next_tag() {
63 match tag.start_el() {
64 s if s.matches("return") => {
65 let var_1 =
66 Some(
67 {
68 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
69 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
70 )
71 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
72 }
73 ?
74 )
75 ;
76 builder = builder.set_return_value(var_1);
77 }
78 ,
79 _ => {}
80 }
81 }
82 Ok(builder)
83}