1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_update_service_http_error(
|
4 - | _response_status: u16,
|
5 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 - | _response_body: &[u8],
|
7 - | ) -> std::result::Result<crate::operation::update_service::UpdateServiceOutput, crate::operation::update_service::UpdateServiceError> {
|
8 - | #[allow(unused_mut)]
|
9 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
11 - | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
12 - | let generic = generic_builder.build();
|
13 - | let error_code = match generic.code() {
|
14 - | Some(code) => code,
|
15 - | None => return Err(crate::operation::update_service::UpdateServiceError::unhandled(generic)),
|
16 - | };
|
17 - |
|
18 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
19 - | Err(match error_code {
|
20 - | "AccessDeniedException" => crate::operation::update_service::UpdateServiceError::AccessDeniedException({
|
21 - | #[allow(unused_mut)]
|
22 - | let mut tmp = {
|
23 - | #[allow(unused_mut)]
|
24 - | let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
|
25 - | output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
|
26 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
27 - | let output = output.meta(generic);
|
28 - | output.build()
|
29 - | };
|
30 - | if tmp.message.is_none() {
|
31 - | tmp.message = _error_message;
|
32 - | }
|
33 - | tmp
|
34 - | }),
|
35 - | "ClientException" => crate::operation::update_service::UpdateServiceError::ClientException({
|
36 - | #[allow(unused_mut)]
|
37 - | let mut tmp = {
|
38 - | #[allow(unused_mut)]
|
39 - | let mut output = crate::types::error::builders::ClientExceptionBuilder::default();
|
40 - | output = crate::protocol_serde::shape_client_exception::de_client_exception_json_err(_response_body, output)
|
41 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
42 - | let output = output.meta(generic);
|
43 - | output.build()
|
44 - | };
|
45 - | if tmp.message.is_none() {
|
46 - | tmp.message = _error_message;
|
47 - | }
|
48 - | tmp
|
49 - | }),
|
50 - | "ClusterNotFoundException" => crate::operation::update_service::UpdateServiceError::ClusterNotFoundException({
|
51 - | #[allow(unused_mut)]
|
52 - | let mut tmp = {
|
53 - | #[allow(unused_mut)]
|
54 - | let mut output = crate::types::error::builders::ClusterNotFoundExceptionBuilder::default();
|
55 - | output = crate::protocol_serde::shape_cluster_not_found_exception::de_cluster_not_found_exception_json_err(_response_body, output)
|
56 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
57 - | let output = output.meta(generic);
|
58 - | output.build()
|
59 - | };
|
60 - | if tmp.message.is_none() {
|
61 - | tmp.message = _error_message;
|
62 - | }
|
63 - | tmp
|
64 - | }),
|
65 - | "InvalidParameterException" => crate::operation::update_service::UpdateServiceError::InvalidParameterException({
|
66 - | #[allow(unused_mut)]
|
67 - | let mut tmp = {
|
68 - | #[allow(unused_mut)]
|
69 - | let mut output = crate::types::error::builders::InvalidParameterExceptionBuilder::default();
|
70 - | output = crate::protocol_serde::shape_invalid_parameter_exception::de_invalid_parameter_exception_json_err(_response_body, output)
|
71 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
72 - | let output = output.meta(generic);
|
73 - | output.build()
|
74 - | };
|
75 - | if tmp.message.is_none() {
|
76 - | tmp.message = _error_message;
|
77 - | }
|
78 - | tmp
|
79 - | }),
|
80 - | "NamespaceNotFoundException" => crate::operation::update_service::UpdateServiceError::NamespaceNotFoundException({
|
81 - | #[allow(unused_mut)]
|
82 - | let mut tmp = {
|
83 - | #[allow(unused_mut)]
|
84 - | let mut output = crate::types::error::builders::NamespaceNotFoundExceptionBuilder::default();
|
85 - | output =
|
86 - | crate::protocol_serde::shape_namespace_not_found_exception::de_namespace_not_found_exception_json_err(_response_body, output)
|
87 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
88 - | let output = output.meta(generic);
|
89 - | output.build()
|
90 - | };
|
91 - | if tmp.message.is_none() {
|
92 - | tmp.message = _error_message;
|
93 - | }
|
94 - | tmp
|
95 - | }),
|
96 - | "PlatformTaskDefinitionIncompatibilityException" => {
|
97 - | crate::operation::update_service::UpdateServiceError::PlatformTaskDefinitionIncompatibilityException({
|
98 - | #[allow(unused_mut)]
|
99 - | let mut tmp = {
|
100 - | #[allow(unused_mut)]
|
101 - | let mut output = crate::types::error::builders::PlatformTaskDefinitionIncompatibilityExceptionBuilder::default();
|
102 - | output = crate::protocol_serde::shape_platform_task_definition_incompatibility_exception::de_platform_task_definition_incompatibility_exception_json_err(_response_body, output).map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
103 - | let output = output.meta(generic);
|
104 - | output.build()
|
105 - | };
|
106 - | if tmp.message.is_none() {
|
107 - | tmp.message = _error_message;
|
108 - | }
|
109 - | tmp
|
110 - | })
|
111 - | }
|
112 - | "PlatformUnknownException" => crate::operation::update_service::UpdateServiceError::PlatformUnknownException({
|
113 - | #[allow(unused_mut)]
|
114 - | let mut tmp = {
|
115 - | #[allow(unused_mut)]
|
116 - | let mut output = crate::types::error::builders::PlatformUnknownExceptionBuilder::default();
|
117 - | output = crate::protocol_serde::shape_platform_unknown_exception::de_platform_unknown_exception_json_err(_response_body, output)
|
118 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
119 - | let output = output.meta(generic);
|
120 - | output.build()
|
121 - | };
|
122 - | if tmp.message.is_none() {
|
123 - | tmp.message = _error_message;
|
124 - | }
|
125 - | tmp
|
126 - | }),
|
127 - | "ServerException" => crate::operation::update_service::UpdateServiceError::ServerException({
|
128 - | #[allow(unused_mut)]
|
129 - | let mut tmp = {
|
130 - | #[allow(unused_mut)]
|
131 - | let mut output = crate::types::error::builders::ServerExceptionBuilder::default();
|
132 - | output = crate::protocol_serde::shape_server_exception::de_server_exception_json_err(_response_body, output)
|
133 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
134 - | let output = output.meta(generic);
|
135 - | output.build()
|
136 - | };
|
137 - | if tmp.message.is_none() {
|
138 - | tmp.message = _error_message;
|
139 - | }
|
140 - | tmp
|
141 - | }),
|
142 - | "ServiceNotActiveException" => crate::operation::update_service::UpdateServiceError::ServiceNotActiveException({
|
143 - | #[allow(unused_mut)]
|
144 - | let mut tmp = {
|
145 - | #[allow(unused_mut)]
|
146 - | let mut output = crate::types::error::builders::ServiceNotActiveExceptionBuilder::default();
|
147 - | output = crate::protocol_serde::shape_service_not_active_exception::de_service_not_active_exception_json_err(_response_body, output)
|
148 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
149 - | let output = output.meta(generic);
|
150 - | output.build()
|
151 - | };
|
152 - | if tmp.message.is_none() {
|
153 - | tmp.message = _error_message;
|
154 - | }
|
155 - | tmp
|
156 - | }),
|
157 - | "ServiceNotFoundException" => crate::operation::update_service::UpdateServiceError::ServiceNotFoundException({
|
158 - | #[allow(unused_mut)]
|
159 - | let mut tmp = {
|
160 - | #[allow(unused_mut)]
|
161 - | let mut output = crate::types::error::builders::ServiceNotFoundExceptionBuilder::default();
|
162 - | output = crate::protocol_serde::shape_service_not_found_exception::de_service_not_found_exception_json_err(_response_body, output)
|
163 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
164 - | let output = output.meta(generic);
|
165 - | output.build()
|
166 - | };
|
167 - | if tmp.message.is_none() {
|
168 - | tmp.message = _error_message;
|
169 - | }
|
170 - | tmp
|
171 - | }),
|
172 - | "UnsupportedFeatureException" => crate::operation::update_service::UpdateServiceError::UnsupportedFeatureException({
|
173 - | #[allow(unused_mut)]
|
174 - | let mut tmp = {
|
175 - | #[allow(unused_mut)]
|
176 - | let mut output = crate::types::error::builders::UnsupportedFeatureExceptionBuilder::default();
|
177 - | output =
|
178 - | crate::protocol_serde::shape_unsupported_feature_exception::de_unsupported_feature_exception_json_err(_response_body, output)
|
179 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
180 - | let output = output.meta(generic);
|
181 - | output.build()
|
182 - | };
|
183 - | if tmp.message.is_none() {
|
184 - | tmp.message = _error_message;
|
185 - | }
|
186 - | tmp
|
187 - | }),
|
188 - | _ => crate::operation::update_service::UpdateServiceError::generic(generic),
|
189 - | })
|
190 - | }
|
191 - |
|
192 - | #[allow(clippy::unnecessary_wraps)]
|
193 - | pub fn de_update_service_http_response(
|
194 - | _response_status: u16,
|
195 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
196 - | _response_body: &[u8],
|
197 - | ) -> std::result::Result<crate::operation::update_service::UpdateServiceOutput, crate::operation::update_service::UpdateServiceError> {
|
198 - | Ok({
|
199 - | #[allow(unused_mut)]
|
200 - | let mut output = crate::operation::update_service::builders::UpdateServiceOutputBuilder::default();
|
201 - | output = crate::protocol_serde::shape_update_service::de_update_service(_response_body, output)
|
202 - | .map_err(crate::operation::update_service::UpdateServiceError::unhandled)?;
|
203 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
204 - | output.build()
|
205 - | })
|
206 - | }
|
207 - |
|
208 - | pub fn ser_update_service_input(
|
209 - | input: &crate::operation::update_service::UpdateServiceInput,
|
210 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
211 - | let mut out = String::new();
|
212 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
213 - | crate::protocol_serde::shape_update_service_input::ser_update_service_input_input(&mut object, input)?;
|
214 - | object.finish();
|
215 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
216 - | }
|
217 - |
|
218 - | pub(crate) fn de_update_service(
|
219 - | _value: &[u8],
|
220 - | mut builder: crate::operation::update_service::builders::UpdateServiceOutputBuilder,
|
221 - | ) -> ::std::result::Result<
|
222 - | crate::operation::update_service::builders::UpdateServiceOutputBuilder,
|
223 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
224 - | > {
|
225 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
226 - | let tokens = &mut tokens_owned;
|
227 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
228 - | loop {
|
229 - | match tokens.next().transpose()? {
|
230 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
231 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
232 - | "service" => {
|
233 - | builder = builder.set_service(crate::protocol_serde::shape_service::de_service(tokens, _value)?);
|
234 - | }
|
235 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
236 - | },
|
237 - | other => {
|
238 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
239 - | "expected object key or end object, found: {other:?}"
|
240 - | )))
|
241 - | }
|
242 - | }
|
243 - | }
|
244 - | if tokens.next().is_some() {
|
245 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
246 - | "found more JSON tokens after completing parsing",
|
247 - | ));
|
248 - | }
|
249 - | Ok(builder)
|
250 - | }
|