138 144 | crate::operation::describe_service_deployments::DescribeServiceDeploymentsError,
|
139 145 | >::new());
|
140 146 |
|
141 147 | ::std::borrow::Cow::Owned(rcb)
|
142 148 | }
|
143 149 | }
|
144 150 |
|
145 151 | #[derive(Debug)]
|
146 152 | struct DescribeServiceDeploymentsResponseDeserializer;
|
147 153 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeServiceDeploymentsResponseDeserializer {
|
148 - | fn deserialize_nonstreaming(
|
154 + | fn deserialize_nonstreaming_with_config(
|
149 155 | &self,
|
150 156 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
157 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
151 158 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
152 159 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
153 - | let headers = response.headers();
|
154 - | let body = response.body().bytes().expect("body loaded");
|
155 160 | #[allow(unused_mut)]
|
156 161 | let mut force_error = false;
|
157 162 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
158 - | let parse_result = if !success && status != 200 || force_error {
|
159 - | crate::protocol_serde::shape_describe_service_deployments::de_describe_service_deployments_http_error(status, headers, body)
|
163 + | if !success && status != 200 || force_error {
|
164 + | let headers = response.headers();
|
165 + | let body = response.body().bytes().expect("body loaded");
|
166 + | #[allow(unused_mut)]
|
167 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
168 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
169 + | })?;
|
170 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
171 + | let generic = generic_builder.build();
|
172 + | let error_code = match generic.code() {
|
173 + | ::std::option::Option::Some(code) => code,
|
174 + | ::std::option::Option::None => {
|
175 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
176 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
177 + | crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::unhandled(generic),
|
178 + | ),
|
179 + | ))
|
180 + | }
|
181 + | };
|
182 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
183 + | let protocol = _cfg
|
184 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
185 + | .expect("a SharedClientProtocol is required");
|
186 + | let err = match error_code {
|
187 + | "AccessDeniedException" => crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::AccessDeniedException({
|
188 + | let mut tmp = match protocol
|
189 + | .deserialize_response(response, crate::types::error::AccessDeniedException::SCHEMA, _cfg)
|
190 + | .and_then(|mut deser| {
|
191 + | crate::types::error::AccessDeniedException::deserialize_with_response(
|
192 + | &mut *deser,
|
193 + | response.headers(),
|
194 + | response.status().into(),
|
195 + | body,
|
196 + | )
|
197 + | }) {
|
198 + | ::std::result::Result::Ok(val) => val,
|
199 + | ::std::result::Result::Err(e) => {
|
200 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
201 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
202 + | ))
|
203 + | }
|
204 + | };
|
205 + | tmp.meta = generic;
|
206 + | if tmp.message.is_none() {
|
207 + | tmp.message = _error_message;
|
208 + | }
|
209 + | tmp
|
210 + | }),
|
211 + | "ClientException" => crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::ClientException({
|
212 + | let mut tmp = match protocol
|
213 + | .deserialize_response(response, crate::types::error::ClientException::SCHEMA, _cfg)
|
214 + | .and_then(|mut deser| {
|
215 + | crate::types::error::ClientException::deserialize_with_response(
|
216 + | &mut *deser,
|
217 + | response.headers(),
|
218 + | response.status().into(),
|
219 + | body,
|
220 + | )
|
221 + | }) {
|
222 + | ::std::result::Result::Ok(val) => val,
|
223 + | ::std::result::Result::Err(e) => {
|
224 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
225 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
226 + | ))
|
227 + | }
|
228 + | };
|
229 + | tmp.meta = generic;
|
230 + | if tmp.message.is_none() {
|
231 + | tmp.message = _error_message;
|
232 + | }
|
233 + | tmp
|
234 + | }),
|
235 + | "ClusterNotFoundException" => {
|
236 + | crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::ClusterNotFoundException({
|
237 + | let mut tmp = match protocol
|
238 + | .deserialize_response(response, crate::types::error::ClusterNotFoundException::SCHEMA, _cfg)
|
239 + | .and_then(|mut deser| {
|
240 + | crate::types::error::ClusterNotFoundException::deserialize_with_response(
|
241 + | &mut *deser,
|
242 + | response.headers(),
|
243 + | response.status().into(),
|
244 + | body,
|
245 + | )
|
246 + | }) {
|
247 + | ::std::result::Result::Ok(val) => val,
|
248 + | ::std::result::Result::Err(e) => {
|
249 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
250 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
251 + | ))
|
252 + | }
|
253 + | };
|
254 + | tmp.meta = generic;
|
255 + | if tmp.message.is_none() {
|
256 + | tmp.message = _error_message;
|
257 + | }
|
258 + | tmp
|
259 + | })
|
260 + | }
|
261 + | "InvalidParameterException" => {
|
262 + | crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::InvalidParameterException({
|
263 + | let mut tmp = match protocol
|
264 + | .deserialize_response(response, crate::types::error::InvalidParameterException::SCHEMA, _cfg)
|
265 + | .and_then(|mut deser| {
|
266 + | crate::types::error::InvalidParameterException::deserialize_with_response(
|
267 + | &mut *deser,
|
268 + | response.headers(),
|
269 + | response.status().into(),
|
270 + | body,
|
271 + | )
|
272 + | }) {
|
273 + | ::std::result::Result::Ok(val) => val,
|
274 + | ::std::result::Result::Err(e) => {
|
275 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
276 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
277 + | ))
|
278 + | }
|
279 + | };
|
280 + | tmp.meta = generic;
|
281 + | if tmp.message.is_none() {
|
282 + | tmp.message = _error_message;
|
283 + | }
|
284 + | tmp
|
285 + | })
|
286 + | }
|
287 + | "ServerException" => crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::ServerException({
|
288 + | let mut tmp = match protocol
|
289 + | .deserialize_response(response, crate::types::error::ServerException::SCHEMA, _cfg)
|
290 + | .and_then(|mut deser| {
|
291 + | crate::types::error::ServerException::deserialize_with_response(
|
292 + | &mut *deser,
|
293 + | response.headers(),
|
294 + | response.status().into(),
|
295 + | body,
|
296 + | )
|
297 + | }) {
|
298 + | ::std::result::Result::Ok(val) => val,
|
299 + | ::std::result::Result::Err(e) => {
|
300 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
301 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
302 + | ))
|
303 + | }
|
304 + | };
|
305 + | tmp.meta = generic;
|
306 + | if tmp.message.is_none() {
|
307 + | tmp.message = _error_message;
|
308 + | }
|
309 + | tmp
|
310 + | }),
|
311 + | "ServiceNotFoundException" => {
|
312 + | crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::ServiceNotFoundException({
|
313 + | let mut tmp = match protocol
|
314 + | .deserialize_response(response, crate::types::error::ServiceNotFoundException::SCHEMA, _cfg)
|
315 + | .and_then(|mut deser| {
|
316 + | crate::types::error::ServiceNotFoundException::deserialize_with_response(
|
317 + | &mut *deser,
|
318 + | response.headers(),
|
319 + | response.status().into(),
|
320 + | body,
|
321 + | )
|
322 + | }) {
|
323 + | ::std::result::Result::Ok(val) => val,
|
324 + | ::std::result::Result::Err(e) => {
|
325 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
326 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
327 + | ))
|
328 + | }
|
329 + | };
|
330 + | tmp.meta = generic;
|
331 + | if tmp.message.is_none() {
|
332 + | tmp.message = _error_message;
|
333 + | }
|
334 + | tmp
|
335 + | })
|
336 + | }
|
337 + | "UnsupportedFeatureException" => {
|
338 + | crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::UnsupportedFeatureException({
|
339 + | let mut tmp = match protocol
|
340 + | .deserialize_response(response, crate::types::error::UnsupportedFeatureException::SCHEMA, _cfg)
|
341 + | .and_then(|mut deser| {
|
342 + | crate::types::error::UnsupportedFeatureException::deserialize_with_response(
|
343 + | &mut *deser,
|
344 + | response.headers(),
|
345 + | response.status().into(),
|
346 + | body,
|
347 + | )
|
348 + | }) {
|
349 + | ::std::result::Result::Ok(val) => val,
|
350 + | ::std::result::Result::Err(e) => {
|
351 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
352 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
353 + | ))
|
354 + | }
|
355 + | };
|
356 + | tmp.meta = generic;
|
357 + | if tmp.message.is_none() {
|
358 + | tmp.message = _error_message;
|
359 + | }
|
360 + | tmp
|
361 + | })
|
362 + | }
|
363 + | _ => crate::operation::describe_service_deployments::DescribeServiceDeploymentsError::generic(generic),
|
364 + | };
|
365 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
366 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
367 + | ))
|
160 368 | } else {
|
161 - | crate::protocol_serde::shape_describe_service_deployments::de_describe_service_deployments_http_response(status, headers, body)
|
162 - | };
|
163 - | crate::protocol_serde::type_erase_result(parse_result)
|
369 + | let protocol = _cfg
|
370 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
371 + | .expect("a SharedClientProtocol is required");
|
372 + | let mut deser = protocol
|
373 + | .deserialize_response(response, DescribeServiceDeployments::OUTPUT_SCHEMA, _cfg)
|
374 + | .map_err(|e| {
|
375 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
376 + | })?;
|
377 + | let body = response.body().bytes().expect("body loaded");
|
378 + | let output = crate::operation::describe_service_deployments::DescribeServiceDeploymentsOutput::deserialize_with_response(
|
379 + | &mut *deser,
|
380 + | response.headers(),
|
381 + | response.status().into(),
|
382 + | body,
|
383 + | )
|
384 + | .map_err(|e| {
|
385 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
386 + | })?;
|
387 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
388 + | }
|
164 389 | }
|
165 390 | }
|
166 391 | #[derive(Debug)]
|
167 392 | struct DescribeServiceDeploymentsRequestSerializer;
|
168 393 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeServiceDeploymentsRequestSerializer {
|
169 394 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
170 395 | fn serialize_input(
|
171 396 | &self,
|
172 397 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
173 398 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
174 399 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
175 400 | let input = input
|
176 401 | .downcast::<crate::operation::describe_service_deployments::DescribeServiceDeploymentsInput>()
|
177 402 | .expect("correct type");
|
178 - | let _header_serialization_settings = _cfg
|
179 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
180 - | .cloned()
|
181 - | .unwrap_or_default();
|
182 - | let mut request_builder = {
|
183 - | #[allow(clippy::uninlined_format_args)]
|
184 - | fn uri_base(
|
185 - | _input: &crate::operation::describe_service_deployments::DescribeServiceDeploymentsInput,
|
186 - | output: &mut ::std::string::String,
|
187 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
188 - | use ::std::fmt::Write as _;
|
189 - | ::std::write!(output, "/").expect("formatting should succeed");
|
190 - | ::std::result::Result::Ok(())
|
191 - | }
|
192 - | #[allow(clippy::unnecessary_wraps)]
|
193 - | fn update_http_builder(
|
194 - | input: &crate::operation::describe_service_deployments::DescribeServiceDeploymentsInput,
|
195 - | builder: ::http_1x::request::Builder,
|
196 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
197 - | let mut uri = ::std::string::String::new();
|
198 - | uri_base(input, &mut uri)?;
|
199 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
200 - | }
|
201 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
202 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
|
203 - | builder = _header_serialization_settings.set_default_header(
|
204 - | builder,
|
205 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
206 - | "AmazonEC2ContainerServiceV20141113.DescribeServiceDeployments",
|
207 - | );
|
208 - | builder
|
209 - | };
|
210 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
211 - | crate::protocol_serde::shape_describe_service_deployments::ser_describe_service_deployments_input(&input)?,
|
212 - | );
|
213 - | if let Some(content_length) = body.content_length() {
|
214 - | let content_length = content_length.to_string();
|
215 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
216 - | }
|
217 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
403 + | let protocol = _cfg
|
404 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
405 + | .expect("a SharedClientProtocol is required");
|
406 + | let mut request = protocol
|
407 + | .serialize_request(&input, DescribeServiceDeployments::INPUT_SCHEMA, "", _cfg)
|
408 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
409 + |
|
410 + | return ::std::result::Result::Ok(request);
|
218 411 | }
|
219 412 | }
|
220 413 | #[derive(Debug)]
|
221 414 | struct DescribeServiceDeploymentsEndpointParamsInterceptor;
|
222 415 |
|
223 416 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeServiceDeploymentsEndpointParamsInterceptor {
|
224 417 | fn name(&self) -> &'static str {
|
225 418 | "DescribeServiceDeploymentsEndpointParamsInterceptor"
|
226 419 | }
|
227 420 |
|