aws_sdk_codestarconnections/protocol_serde/
shape_delete_sync_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::unnecessary_wraps)]
3pub fn de_delete_sync_configuration_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_sync_configuration::DeleteSyncConfigurationOutput,
9    crate::operation::delete_sync_configuration::DeleteSyncConfigurationError,
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_sync_configuration::DeleteSyncConfigurationError::unhandled)?;
14    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
15    let generic = generic_builder.build();
16    let error_code = match generic.code() {
17        Some(code) => code,
18        None => {
19            return Err(crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::unhandled(
20                generic,
21            ))
22        }
23    };
24
25    let _error_message = generic.message().map(|msg| msg.to_owned());
26    Err(match error_code {
27        "AccessDeniedException" => crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::AccessDeniedException({
28            #[allow(unused_mut)]
29            let mut tmp = {
30                #[allow(unused_mut)]
31                let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
32                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
33                    .map_err(crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::unhandled)?;
34                let output = output.meta(generic);
35                output.build()
36            };
37            if tmp.message.is_none() {
38                tmp.message = _error_message;
39            }
40            tmp
41        }),
42        "ConcurrentModificationException" => {
43            crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::ConcurrentModificationException({
44                #[allow(unused_mut)]
45                let mut tmp = {
46                    #[allow(unused_mut)]
47                    let mut output = crate::types::error::builders::ConcurrentModificationExceptionBuilder::default();
48                    output = crate::protocol_serde::shape_concurrent_modification_exception::de_concurrent_modification_exception_json_err(
49                        _response_body,
50                        output,
51                    )
52                    .map_err(crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::unhandled)?;
53                    let output = output.meta(generic);
54                    output.build()
55                };
56                if tmp.message.is_none() {
57                    tmp.message = _error_message;
58                }
59                tmp
60            })
61        }
62        "InternalServerException" => crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::InternalServerException({
63            #[allow(unused_mut)]
64            let mut tmp = {
65                #[allow(unused_mut)]
66                let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default();
67                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
68                    .map_err(crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::unhandled)?;
69                let output = output.meta(generic);
70                output.build()
71            };
72            if tmp.message.is_none() {
73                tmp.message = _error_message;
74            }
75            tmp
76        }),
77        "InvalidInputException" => crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::InvalidInputException({
78            #[allow(unused_mut)]
79            let mut tmp = {
80                #[allow(unused_mut)]
81                let mut output = crate::types::error::builders::InvalidInputExceptionBuilder::default();
82                output = crate::protocol_serde::shape_invalid_input_exception::de_invalid_input_exception_json_err(_response_body, output)
83                    .map_err(crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::unhandled)?;
84                let output = output.meta(generic);
85                output.build()
86            };
87            if tmp.message.is_none() {
88                tmp.message = _error_message;
89            }
90            tmp
91        }),
92        "LimitExceededException" => crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::LimitExceededException({
93            #[allow(unused_mut)]
94            let mut tmp = {
95                #[allow(unused_mut)]
96                let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
97                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
98                    .map_err(crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::unhandled)?;
99                let output = output.meta(generic);
100                output.build()
101            };
102            if tmp.message.is_none() {
103                tmp.message = _error_message;
104            }
105            tmp
106        }),
107        "ThrottlingException" => crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::ThrottlingException({
108            #[allow(unused_mut)]
109            let mut tmp = {
110                #[allow(unused_mut)]
111                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
112                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
113                    .map_err(crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::unhandled)?;
114                let output = output.meta(generic);
115                output.build()
116            };
117            if tmp.message.is_none() {
118                tmp.message = _error_message;
119            }
120            tmp
121        }),
122        _ => crate::operation::delete_sync_configuration::DeleteSyncConfigurationError::generic(generic),
123    })
124}
125
126#[allow(clippy::unnecessary_wraps)]
127pub fn de_delete_sync_configuration_http_response(
128    _response_status: u16,
129    _response_headers: &::aws_smithy_runtime_api::http::Headers,
130    _response_body: &[u8],
131) -> std::result::Result<
132    crate::operation::delete_sync_configuration::DeleteSyncConfigurationOutput,
133    crate::operation::delete_sync_configuration::DeleteSyncConfigurationError,
134> {
135    Ok({
136        #[allow(unused_mut)]
137        let mut output = crate::operation::delete_sync_configuration::builders::DeleteSyncConfigurationOutputBuilder::default();
138        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
139        output.build()
140    })
141}
142
143pub fn ser_delete_sync_configuration_input(
144    input: &crate::operation::delete_sync_configuration::DeleteSyncConfigurationInput,
145) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
146    let mut out = String::new();
147    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
148    crate::protocol_serde::shape_delete_sync_configuration_input::ser_delete_sync_configuration_input_input(&mut object, input)?;
149    object.finish();
150    Ok(::aws_smithy_types::body::SdkBody::from(out))
151}