aws_sdk_ec2/protocol_serde/
shape_delete_vpc_endpoint_connection_notifications.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::unnecessary_wraps)]
3pub fn de_delete_vpc_endpoint_connection_notifications_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::delete_vpc_endpoint_connection_notifications::DeleteVpcEndpointConnectionNotificationsOutput,
9    crate::operation::delete_vpc_endpoint_connection_notifications::DeleteVpcEndpointConnectionNotificationsError,
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::delete_vpc_endpoint_connection_notifications::DeleteVpcEndpointConnectionNotificationsError::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::delete_vpc_endpoint_connection_notifications::DeleteVpcEndpointConnectionNotificationsError::generic(generic))
17}
18
19#[allow(clippy::unnecessary_wraps)]
20pub fn de_delete_vpc_endpoint_connection_notifications_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::delete_vpc_endpoint_connection_notifications::DeleteVpcEndpointConnectionNotificationsOutput,
26    crate::operation::delete_vpc_endpoint_connection_notifications::DeleteVpcEndpointConnectionNotificationsError,
27> {
28    Ok({
29        #[allow(unused_mut)]
30        let mut output =
31            crate::operation::delete_vpc_endpoint_connection_notifications::builders::DeleteVpcEndpointConnectionNotificationsOutputBuilder::default(
32            );
33        output = crate::protocol_serde::shape_delete_vpc_endpoint_connection_notifications::de_delete_vpc_endpoint_connection_notifications(
34            _response_body,
35            output,
36        )
37        .map_err(crate::operation::delete_vpc_endpoint_connection_notifications::DeleteVpcEndpointConnectionNotificationsError::unhandled)?;
38        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
39        output.build()
40    })
41}
42
43#[allow(unused_mut)]
44pub fn de_delete_vpc_endpoint_connection_notifications(
45    inp: &[u8],
46    mut builder: crate::operation::delete_vpc_endpoint_connection_notifications::builders::DeleteVpcEndpointConnectionNotificationsOutputBuilder,
47) -> std::result::Result<
48    crate::operation::delete_vpc_endpoint_connection_notifications::builders::DeleteVpcEndpointConnectionNotificationsOutputBuilder,
49    ::aws_smithy_xml::decode::XmlDecodeError,
50> {
51    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
52
53    #[allow(unused_mut)]
54    let mut decoder = doc.root_element()?;
55    #[allow(unused_variables)]
56    let start_el = decoder.start_el();
57    if !(start_el.matches("DeleteVpcEndpointConnectionNotificationsResponse")) {
58        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
59            "invalid root, expected DeleteVpcEndpointConnectionNotificationsResponse got {:?}",
60            start_el
61        )));
62    }
63    while let Some(mut tag) = decoder.next_tag() {
64        match tag.start_el() {
65            s if s.matches("unsuccessful") /* Unsuccessful com.amazonaws.ec2.synthetic#DeleteVpcEndpointConnectionNotificationsOutput$Unsuccessful */ =>  {
66                let var_1 =
67                    Some(
68                        crate::protocol_serde::shape_unsuccessful_item_set::de_unsuccessful_item_set(&mut tag)
69                        ?
70                    )
71                ;
72                builder = builder.set_unsuccessful(var_1);
73            }
74            ,
75            _ => {}
76        }
77    }
78    Ok(builder)
79}