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