3 3 | pub fn de_delete_delivery_source_http_error(
|
4 4 | _response_status: u16,
|
5 5 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 6 | _response_body: &[u8],
|
7 7 | ) -> std::result::Result<
|
8 8 | crate::operation::delete_delivery_source::DeleteDeliverySourceOutput,
|
9 9 | crate::operation::delete_delivery_source::DeleteDeliverySourceError,
|
10 10 | > {
|
11 11 | #[allow(unused_mut)]
|
12 12 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 13 | .map_err(crate::operation::delete_delivery_source::DeleteDeliverySourceError::unhandled)?;
|
14 14 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 15 | let generic = generic_builder.build();
|
16 16 | let error_code = match generic.code() {
|
17 17 | Some(code) => code,
|
18 18 | None => return Err(crate::operation::delete_delivery_source::DeleteDeliverySourceError::unhandled(generic)),
|
19 19 | };
|
20 20 |
|
21 21 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 22 | Err(match error_code {
|
23 23 | "ThrottlingException" => crate::operation::delete_delivery_source::DeleteDeliverySourceError::ThrottlingException({
|
24 24 | #[allow(unused_mut)]
|
25 25 | let mut tmp = {
|
26 26 | #[allow(unused_mut)]
|
27 27 | let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
|
28 28 | output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
|
29 29 | .map_err(crate::operation::delete_delivery_source::DeleteDeliverySourceError::unhandled)?;
|
30 30 | let output = output.meta(generic);
|
31 31 | output.build()
|
32 32 | };
|
33 - | if tmp.message.is_none() {
|
34 - | tmp.message = _error_message;
|
35 - | }
|
36 33 | tmp
|
37 34 | }),
|
38 35 | "ConflictException" => crate::operation::delete_delivery_source::DeleteDeliverySourceError::ConflictException({
|
39 36 | #[allow(unused_mut)]
|
40 37 | let mut tmp = {
|
41 38 | #[allow(unused_mut)]
|
42 39 | let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
|
43 40 | output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
|
44 41 | .map_err(crate::operation::delete_delivery_source::DeleteDeliverySourceError::unhandled)?;
|
45 42 | let output = output.meta(generic);
|
46 43 | output.build()
|
47 44 | };
|
48 - | if tmp.message.is_none() {
|
49 - | tmp.message = _error_message;
|
50 - | }
|
51 45 | tmp
|
52 46 | }),
|
53 47 | "ValidationException" => crate::operation::delete_delivery_source::DeleteDeliverySourceError::ValidationException({
|
54 48 | #[allow(unused_mut)]
|
55 49 | let mut tmp = {
|
56 50 | #[allow(unused_mut)]
|
57 51 | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
58 52 | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
59 53 | .map_err(crate::operation::delete_delivery_source::DeleteDeliverySourceError::unhandled)?;
|
60 54 | let output = output.meta(generic);
|
61 55 | output.build()
|
62 56 | };
|
63 - | if tmp.message.is_none() {
|
64 - | tmp.message = _error_message;
|
65 - | }
|
66 57 | tmp
|
67 58 | }),
|
68 59 | "ResourceNotFoundException" => crate::operation::delete_delivery_source::DeleteDeliverySourceError::ResourceNotFoundException({
|
69 60 | #[allow(unused_mut)]
|
70 61 | let mut tmp = {
|
71 62 | #[allow(unused_mut)]
|
72 63 | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
73 64 | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
74 65 | .map_err(crate::operation::delete_delivery_source::DeleteDeliverySourceError::unhandled)?;
|
75 66 | let output = output.meta(generic);
|
76 67 | output.build()
|
77 68 | };
|
78 - | if tmp.message.is_none() {
|
79 - | tmp.message = _error_message;
|
80 - | }
|
81 69 | tmp
|
82 70 | }),
|
83 71 | "ServiceUnavailableException" => crate::operation::delete_delivery_source::DeleteDeliverySourceError::ServiceUnavailableException({
|
84 72 | #[allow(unused_mut)]
|
85 73 | let mut tmp = {
|
86 74 | #[allow(unused_mut)]
|
87 75 | let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
|
88 76 | output =
|
89 77 | crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
|
90 78 | .map_err(crate::operation::delete_delivery_source::DeleteDeliverySourceError::unhandled)?;
|
91 79 | let output = output.meta(generic);
|
92 80 | output.build()
|
93 81 | };
|
94 - | if tmp.message.is_none() {
|
95 - | tmp.message = _error_message;
|
96 - | }
|
97 82 | tmp
|
98 83 | }),
|
99 84 | "ServiceQuotaExceededException" => crate::operation::delete_delivery_source::DeleteDeliverySourceError::ServiceQuotaExceededException({
|
100 85 | #[allow(unused_mut)]
|
101 86 | let mut tmp = {
|
102 87 | #[allow(unused_mut)]
|
103 88 | let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
|
104 89 | output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
|
105 90 | _response_body,
|
106 91 | output,
|
107 92 | )
|
108 93 | .map_err(crate::operation::delete_delivery_source::DeleteDeliverySourceError::unhandled)?;
|
109 94 | let output = output.meta(generic);
|
110 95 | output.build()
|
111 96 | };
|
112 - | if tmp.message.is_none() {
|
113 - | tmp.message = _error_message;
|
114 - | }
|
115 97 | tmp
|
116 98 | }),
|
117 99 | _ => crate::operation::delete_delivery_source::DeleteDeliverySourceError::generic(generic),
|
118 100 | })
|
119 101 | }
|
120 102 |
|
121 103 | #[allow(clippy::unnecessary_wraps)]
|
122 104 | pub fn de_delete_delivery_source_http_response(
|
123 105 | _response_status: u16,
|
124 106 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
125 107 | _response_body: &[u8],
|
126 108 | ) -> std::result::Result<
|
127 109 | crate::operation::delete_delivery_source::DeleteDeliverySourceOutput,
|
128 110 | crate::operation::delete_delivery_source::DeleteDeliverySourceError,
|
129 111 | > {
|
130 112 | Ok({
|
131 113 | #[allow(unused_mut)]
|
132 114 | let mut output = crate::operation::delete_delivery_source::builders::DeleteDeliverySourceOutputBuilder::default();
|
133 115 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
134 116 | output.build()
|
135 117 | })
|
136 118 | }
|
137 119 |
|
138 120 | pub fn ser_delete_delivery_source_input(
|
139 121 | input: &crate::operation::delete_delivery_source::DeleteDeliverySourceInput,
|
140 122 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
141 123 | let mut out = String::new();
|
142 124 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
143 125 | crate::protocol_serde::shape_delete_delivery_source_input::ser_delete_delivery_source_input_input(&mut object, input)?;
|
144 126 | object.finish();
|