1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_put_subscription_filter_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::put_subscription_filter::PutSubscriptionFilterOutput,
|
9 - | crate::operation::put_subscription_filter::PutSubscriptionFilterError,
|
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::put_subscription_filter::PutSubscriptionFilterError::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 => return Err(crate::operation::put_subscription_filter::PutSubscriptionFilterError::unhandled(generic)),
|
19 - | };
|
20 - |
|
21 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 - | Err(match error_code {
|
23 - | "InvalidOperationException" => crate::operation::put_subscription_filter::PutSubscriptionFilterError::InvalidOperationException({
|
24 - | #[allow(unused_mut)]
|
25 - | let mut tmp = {
|
26 - | #[allow(unused_mut)]
|
27 - | let mut output = crate::types::error::builders::InvalidOperationExceptionBuilder::default();
|
28 - | output = crate::protocol_serde::shape_invalid_operation_exception::de_invalid_operation_exception_json_err(_response_body, output)
|
29 - | .map_err(crate::operation::put_subscription_filter::PutSubscriptionFilterError::unhandled)?;
|
30 - | let output = output.meta(generic);
|
31 - | output.build()
|
32 - | };
|
33 - | if tmp.message.is_none() {
|
34 - | tmp.message = _error_message;
|
35 - | }
|
36 - | tmp
|
37 - | }),
|
38 - | "InvalidParameterException" => crate::operation::put_subscription_filter::PutSubscriptionFilterError::InvalidParameterException({
|
39 - | #[allow(unused_mut)]
|
40 - | let mut tmp = {
|
41 - | #[allow(unused_mut)]
|
42 - | let mut output = crate::types::error::builders::InvalidParameterExceptionBuilder::default();
|
43 - | output = crate::protocol_serde::shape_invalid_parameter_exception::de_invalid_parameter_exception_json_err(_response_body, output)
|
44 - | .map_err(crate::operation::put_subscription_filter::PutSubscriptionFilterError::unhandled)?;
|
45 - | let output = output.meta(generic);
|
46 - | output.build()
|
47 - | };
|
48 - | if tmp.message.is_none() {
|
49 - | tmp.message = _error_message;
|
50 - | }
|
51 - | tmp
|
52 - | }),
|
53 - | "LimitExceededException" => crate::operation::put_subscription_filter::PutSubscriptionFilterError::LimitExceededException({
|
54 - | #[allow(unused_mut)]
|
55 - | let mut tmp = {
|
56 - | #[allow(unused_mut)]
|
57 - | let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
|
58 - | output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
|
59 - | .map_err(crate::operation::put_subscription_filter::PutSubscriptionFilterError::unhandled)?;
|
60 - | let output = output.meta(generic);
|
61 - | output.build()
|
62 - | };
|
63 - | if tmp.message.is_none() {
|
64 - | tmp.message = _error_message;
|
65 - | }
|
66 - | tmp
|
67 - | }),
|
68 - | "OperationAbortedException" => crate::operation::put_subscription_filter::PutSubscriptionFilterError::OperationAbortedException({
|
69 - | #[allow(unused_mut)]
|
70 - | let mut tmp = {
|
71 - | #[allow(unused_mut)]
|
72 - | let mut output = crate::types::error::builders::OperationAbortedExceptionBuilder::default();
|
73 - | output = crate::protocol_serde::shape_operation_aborted_exception::de_operation_aborted_exception_json_err(_response_body, output)
|
74 - | .map_err(crate::operation::put_subscription_filter::PutSubscriptionFilterError::unhandled)?;
|
75 - | let output = output.meta(generic);
|
76 - | output.build()
|
77 - | };
|
78 - | if tmp.message.is_none() {
|
79 - | tmp.message = _error_message;
|
80 - | }
|
81 - | tmp
|
82 - | }),
|
83 - | "ResourceNotFoundException" => crate::operation::put_subscription_filter::PutSubscriptionFilterError::ResourceNotFoundException({
|
84 - | #[allow(unused_mut)]
|
85 - | let mut tmp = {
|
86 - | #[allow(unused_mut)]
|
87 - | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
88 - | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
89 - | .map_err(crate::operation::put_subscription_filter::PutSubscriptionFilterError::unhandled)?;
|
90 - | let output = output.meta(generic);
|
91 - | output.build()
|
92 - | };
|
93 - | if tmp.message.is_none() {
|
94 - | tmp.message = _error_message;
|
95 - | }
|
96 - | tmp
|
97 - | }),
|
98 - | "ServiceUnavailableException" => crate::operation::put_subscription_filter::PutSubscriptionFilterError::ServiceUnavailableException({
|
99 - | #[allow(unused_mut)]
|
100 - | let mut tmp = {
|
101 - | #[allow(unused_mut)]
|
102 - | let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
|
103 - | output =
|
104 - | crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
|
105 - | .map_err(crate::operation::put_subscription_filter::PutSubscriptionFilterError::unhandled)?;
|
106 - | let output = output.meta(generic);
|
107 - | output.build()
|
108 - | };
|
109 - | if tmp.message.is_none() {
|
110 - | tmp.message = _error_message;
|
111 - | }
|
112 - | tmp
|
113 - | }),
|
114 - | _ => crate::operation::put_subscription_filter::PutSubscriptionFilterError::generic(generic),
|
115 - | })
|
116 - | }
|
117 - |
|
118 - | #[allow(clippy::unnecessary_wraps)]
|
119 - | pub fn de_put_subscription_filter_http_response(
|
120 - | _response_status: u16,
|
121 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
122 - | _response_body: &[u8],
|
123 - | ) -> std::result::Result<
|
124 - | crate::operation::put_subscription_filter::PutSubscriptionFilterOutput,
|
125 - | crate::operation::put_subscription_filter::PutSubscriptionFilterError,
|
126 - | > {
|
127 - | Ok({
|
128 - | #[allow(unused_mut)]
|
129 - | let mut output = crate::operation::put_subscription_filter::builders::PutSubscriptionFilterOutputBuilder::default();
|
130 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
131 - | output.build()
|
132 - | })
|
133 - | }
|
134 - |
|
135 - | pub fn ser_put_subscription_filter_input(
|
136 - | input: &crate::operation::put_subscription_filter::PutSubscriptionFilterInput,
|
137 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
138 - | let mut out = String::new();
|
139 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
140 - | crate::protocol_serde::shape_put_subscription_filter_input::ser_put_subscription_filter_input_input(&mut object, input)?;
|
141 - | object.finish();
|
142 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
143 - | }
|