1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_describe_subscription_filters_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::describe_subscription_filters::DescribeSubscriptionFiltersOutput,
|
9 - | crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError,
|
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::describe_subscription_filters::DescribeSubscriptionFiltersError::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::describe_subscription_filters::DescribeSubscriptionFiltersError::unhandled(generic)),
|
19 - | };
|
20 - |
|
21 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 - | Err(match error_code {
|
23 - | "InvalidParameterException" => {
|
24 - | crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError::InvalidParameterException({
|
25 - | #[allow(unused_mut)]
|
26 - | let mut tmp = {
|
27 - | #[allow(unused_mut)]
|
28 - | let mut output = crate::types::error::builders::InvalidParameterExceptionBuilder::default();
|
29 - | output =
|
30 - | crate::protocol_serde::shape_invalid_parameter_exception::de_invalid_parameter_exception_json_err(_response_body, output)
|
31 - | .map_err(crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError::unhandled)?;
|
32 - | let output = output.meta(generic);
|
33 - | output.build()
|
34 - | };
|
35 - | if tmp.message.is_none() {
|
36 - | tmp.message = _error_message;
|
37 - | }
|
38 - | tmp
|
39 - | })
|
40 - | }
|
41 - | "ResourceNotFoundException" => {
|
42 - | crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError::ResourceNotFoundException({
|
43 - | #[allow(unused_mut)]
|
44 - | let mut tmp = {
|
45 - | #[allow(unused_mut)]
|
46 - | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
47 - | output =
|
48 - | crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
49 - | .map_err(crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError::unhandled)?;
|
50 - | let output = output.meta(generic);
|
51 - | output.build()
|
52 - | };
|
53 - | if tmp.message.is_none() {
|
54 - | tmp.message = _error_message;
|
55 - | }
|
56 - | tmp
|
57 - | })
|
58 - | }
|
59 - | "ServiceUnavailableException" => {
|
60 - | crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError::ServiceUnavailableException({
|
61 - | #[allow(unused_mut)]
|
62 - | let mut tmp = {
|
63 - | #[allow(unused_mut)]
|
64 - | let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
|
65 - | output =
|
66 - | crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
|
67 - | .map_err(crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError::unhandled)?;
|
68 - | let output = output.meta(generic);
|
69 - | output.build()
|
70 - | };
|
71 - | if tmp.message.is_none() {
|
72 - | tmp.message = _error_message;
|
73 - | }
|
74 - | tmp
|
75 - | })
|
76 - | }
|
77 - | _ => crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError::generic(generic),
|
78 - | })
|
79 - | }
|
80 - |
|
81 - | #[allow(clippy::unnecessary_wraps)]
|
82 - | pub fn de_describe_subscription_filters_http_response(
|
83 - | _response_status: u16,
|
84 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
85 - | _response_body: &[u8],
|
86 - | ) -> std::result::Result<
|
87 - | crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersOutput,
|
88 - | crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError,
|
89 - | > {
|
90 - | Ok({
|
91 - | #[allow(unused_mut)]
|
92 - | let mut output = crate::operation::describe_subscription_filters::builders::DescribeSubscriptionFiltersOutputBuilder::default();
|
93 - | output = crate::protocol_serde::shape_describe_subscription_filters::de_describe_subscription_filters(_response_body, output)
|
94 - | .map_err(crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersError::unhandled)?;
|
95 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
96 - | output.build()
|
97 - | })
|
98 - | }
|
99 - |
|
100 - | pub fn ser_describe_subscription_filters_input(
|
101 - | input: &crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersInput,
|
102 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
103 - | let mut out = String::new();
|
104 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
105 - | crate::protocol_serde::shape_describe_subscription_filters_input::ser_describe_subscription_filters_input_input(&mut object, input)?;
|
106 - | object.finish();
|
107 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
108 - | }
|
109 - |
|
110 - | pub(crate) fn de_describe_subscription_filters(
|
111 - | _value: &[u8],
|
112 - | mut builder: crate::operation::describe_subscription_filters::builders::DescribeSubscriptionFiltersOutputBuilder,
|
113 - | ) -> ::std::result::Result<
|
114 - | crate::operation::describe_subscription_filters::builders::DescribeSubscriptionFiltersOutputBuilder,
|
115 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
116 - | > {
|
117 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
118 - | let tokens = &mut tokens_owned;
|
119 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
120 - | loop {
|
121 - | match tokens.next().transpose()? {
|
122 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
123 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
124 - | "subscriptionFilters" => {
|
125 - | builder = builder.set_subscription_filters(crate::protocol_serde::shape_subscription_filters::de_subscription_filters(
|
126 - | tokens, _value,
|
127 - | )?);
|
128 - | }
|
129 - | "nextToken" => {
|
130 - | builder = builder.set_next_token(
|
131 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
132 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
133 - | .transpose()?,
|
134 - | );
|
135 - | }
|
136 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
137 - | },
|
138 - | other => {
|
139 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
140 - | "expected object key or end object, found: {other:?}"
|
141 - | )))
|
142 - | }
|
143 - | }
|
144 - | }
|
145 - | if tokens.next().is_some() {
|
146 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
147 - | "found more JSON tokens after completing parsing",
|
148 - | ));
|
149 - | }
|
150 - | Ok(builder)
|
151 - | }
|