135 139 | crate::operation::create_task_set::CreateTaskSetError,
|
136 140 | >::new());
|
137 141 |
|
138 142 | ::std::borrow::Cow::Owned(rcb)
|
139 143 | }
|
140 144 | }
|
141 145 |
|
142 146 | #[derive(Debug)]
|
143 147 | struct CreateTaskSetResponseDeserializer;
|
144 148 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateTaskSetResponseDeserializer {
|
145 - | fn deserialize_nonstreaming(
|
149 + | fn deserialize_nonstreaming_with_config(
|
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_create_task_set::de_create_task_set_http_error(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::create_task_set::CreateTaskSetError::unhandled(
|
172 + | generic,
|
173 + | )),
|
174 + | ))
|
175 + | }
|
176 + | };
|
177 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
178 + | let protocol = _cfg
|
179 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
180 + | .expect("a SharedClientProtocol is required");
|
181 + | let err = match error_code {
|
182 + | "AccessDeniedException" => crate::operation::create_task_set::CreateTaskSetError::AccessDeniedException({
|
183 + | let mut tmp = match protocol
|
184 + | .deserialize_response(response, crate::types::error::AccessDeniedException::SCHEMA, _cfg)
|
185 + | .and_then(|mut deser| {
|
186 + | crate::types::error::AccessDeniedException::deserialize_with_response(
|
187 + | &mut *deser,
|
188 + | response.headers(),
|
189 + | response.status().into(),
|
190 + | body,
|
191 + | )
|
192 + | }) {
|
193 + | ::std::result::Result::Ok(val) => val,
|
194 + | ::std::result::Result::Err(e) => {
|
195 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
196 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
197 + | ))
|
198 + | }
|
199 + | };
|
200 + | tmp.meta = generic;
|
201 + | if tmp.message.is_none() {
|
202 + | tmp.message = _error_message;
|
203 + | }
|
204 + | tmp
|
205 + | }),
|
206 + | "ClientException" => crate::operation::create_task_set::CreateTaskSetError::ClientException({
|
207 + | let mut tmp = match protocol
|
208 + | .deserialize_response(response, crate::types::error::ClientException::SCHEMA, _cfg)
|
209 + | .and_then(|mut deser| {
|
210 + | crate::types::error::ClientException::deserialize_with_response(
|
211 + | &mut *deser,
|
212 + | response.headers(),
|
213 + | response.status().into(),
|
214 + | body,
|
215 + | )
|
216 + | }) {
|
217 + | ::std::result::Result::Ok(val) => val,
|
218 + | ::std::result::Result::Err(e) => {
|
219 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
220 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
221 + | ))
|
222 + | }
|
223 + | };
|
224 + | tmp.meta = generic;
|
225 + | if tmp.message.is_none() {
|
226 + | tmp.message = _error_message;
|
227 + | }
|
228 + | tmp
|
229 + | }),
|
230 + | "ClusterNotFoundException" => crate::operation::create_task_set::CreateTaskSetError::ClusterNotFoundException({
|
231 + | let mut tmp = match protocol
|
232 + | .deserialize_response(response, crate::types::error::ClusterNotFoundException::SCHEMA, _cfg)
|
233 + | .and_then(|mut deser| {
|
234 + | crate::types::error::ClusterNotFoundException::deserialize_with_response(
|
235 + | &mut *deser,
|
236 + | response.headers(),
|
237 + | response.status().into(),
|
238 + | body,
|
239 + | )
|
240 + | }) {
|
241 + | ::std::result::Result::Ok(val) => val,
|
242 + | ::std::result::Result::Err(e) => {
|
243 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
244 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
245 + | ))
|
246 + | }
|
247 + | };
|
248 + | tmp.meta = generic;
|
249 + | if tmp.message.is_none() {
|
250 + | tmp.message = _error_message;
|
251 + | }
|
252 + | tmp
|
253 + | }),
|
254 + | "InvalidParameterException" => crate::operation::create_task_set::CreateTaskSetError::InvalidParameterException({
|
255 + | let mut tmp = match protocol
|
256 + | .deserialize_response(response, crate::types::error::InvalidParameterException::SCHEMA, _cfg)
|
257 + | .and_then(|mut deser| {
|
258 + | crate::types::error::InvalidParameterException::deserialize_with_response(
|
259 + | &mut *deser,
|
260 + | response.headers(),
|
261 + | response.status().into(),
|
262 + | body,
|
263 + | )
|
264 + | }) {
|
265 + | ::std::result::Result::Ok(val) => val,
|
266 + | ::std::result::Result::Err(e) => {
|
267 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
268 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
269 + | ))
|
270 + | }
|
271 + | };
|
272 + | tmp.meta = generic;
|
273 + | if tmp.message.is_none() {
|
274 + | tmp.message = _error_message;
|
275 + | }
|
276 + | tmp
|
277 + | }),
|
278 + | "NamespaceNotFoundException" => crate::operation::create_task_set::CreateTaskSetError::NamespaceNotFoundException({
|
279 + | let mut tmp = match protocol
|
280 + | .deserialize_response(response, crate::types::error::NamespaceNotFoundException::SCHEMA, _cfg)
|
281 + | .and_then(|mut deser| {
|
282 + | crate::types::error::NamespaceNotFoundException::deserialize_with_response(
|
283 + | &mut *deser,
|
284 + | response.headers(),
|
285 + | response.status().into(),
|
286 + | body,
|
287 + | )
|
288 + | }) {
|
289 + | ::std::result::Result::Ok(val) => val,
|
290 + | ::std::result::Result::Err(e) => {
|
291 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
292 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
293 + | ))
|
294 + | }
|
295 + | };
|
296 + | tmp.meta = generic;
|
297 + | if tmp.message.is_none() {
|
298 + | tmp.message = _error_message;
|
299 + | }
|
300 + | tmp
|
301 + | }),
|
302 + | "PlatformTaskDefinitionIncompatibilityException" => {
|
303 + | crate::operation::create_task_set::CreateTaskSetError::PlatformTaskDefinitionIncompatibilityException({
|
304 + | let mut tmp = match protocol
|
305 + | .deserialize_response(
|
306 + | response,
|
307 + | crate::types::error::PlatformTaskDefinitionIncompatibilityException::SCHEMA,
|
308 + | _cfg,
|
309 + | )
|
310 + | .and_then(|mut deser| {
|
311 + | crate::types::error::PlatformTaskDefinitionIncompatibilityException::deserialize_with_response(
|
312 + | &mut *deser,
|
313 + | response.headers(),
|
314 + | response.status().into(),
|
315 + | body,
|
316 + | )
|
317 + | }) {
|
318 + | ::std::result::Result::Ok(val) => val,
|
319 + | ::std::result::Result::Err(e) => {
|
320 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
321 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
322 + | ))
|
323 + | }
|
324 + | };
|
325 + | tmp.meta = generic;
|
326 + | if tmp.message.is_none() {
|
327 + | tmp.message = _error_message;
|
328 + | }
|
329 + | tmp
|
330 + | })
|
331 + | }
|
332 + | "PlatformUnknownException" => crate::operation::create_task_set::CreateTaskSetError::PlatformUnknownException({
|
333 + | let mut tmp = match protocol
|
334 + | .deserialize_response(response, crate::types::error::PlatformUnknownException::SCHEMA, _cfg)
|
335 + | .and_then(|mut deser| {
|
336 + | crate::types::error::PlatformUnknownException::deserialize_with_response(
|
337 + | &mut *deser,
|
338 + | response.headers(),
|
339 + | response.status().into(),
|
340 + | body,
|
341 + | )
|
342 + | }) {
|
343 + | ::std::result::Result::Ok(val) => val,
|
344 + | ::std::result::Result::Err(e) => {
|
345 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
346 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
347 + | ))
|
348 + | }
|
349 + | };
|
350 + | tmp.meta = generic;
|
351 + | if tmp.message.is_none() {
|
352 + | tmp.message = _error_message;
|
353 + | }
|
354 + | tmp
|
355 + | }),
|
356 + | "ServerException" => crate::operation::create_task_set::CreateTaskSetError::ServerException({
|
357 + | let mut tmp = match protocol
|
358 + | .deserialize_response(response, crate::types::error::ServerException::SCHEMA, _cfg)
|
359 + | .and_then(|mut deser| {
|
360 + | crate::types::error::ServerException::deserialize_with_response(
|
361 + | &mut *deser,
|
362 + | response.headers(),
|
363 + | response.status().into(),
|
364 + | body,
|
365 + | )
|
366 + | }) {
|
367 + | ::std::result::Result::Ok(val) => val,
|
368 + | ::std::result::Result::Err(e) => {
|
369 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
370 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
371 + | ))
|
372 + | }
|
373 + | };
|
374 + | tmp.meta = generic;
|
375 + | if tmp.message.is_none() {
|
376 + | tmp.message = _error_message;
|
377 + | }
|
378 + | tmp
|
379 + | }),
|
380 + | "ServiceNotActiveException" => crate::operation::create_task_set::CreateTaskSetError::ServiceNotActiveException({
|
381 + | let mut tmp = match protocol
|
382 + | .deserialize_response(response, crate::types::error::ServiceNotActiveException::SCHEMA, _cfg)
|
383 + | .and_then(|mut deser| {
|
384 + | crate::types::error::ServiceNotActiveException::deserialize_with_response(
|
385 + | &mut *deser,
|
386 + | response.headers(),
|
387 + | response.status().into(),
|
388 + | body,
|
389 + | )
|
390 + | }) {
|
391 + | ::std::result::Result::Ok(val) => val,
|
392 + | ::std::result::Result::Err(e) => {
|
393 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
394 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
395 + | ))
|
396 + | }
|
397 + | };
|
398 + | tmp.meta = generic;
|
399 + | if tmp.message.is_none() {
|
400 + | tmp.message = _error_message;
|
401 + | }
|
402 + | tmp
|
403 + | }),
|
404 + | "ServiceNotFoundException" => crate::operation::create_task_set::CreateTaskSetError::ServiceNotFoundException({
|
405 + | let mut tmp = match protocol
|
406 + | .deserialize_response(response, crate::types::error::ServiceNotFoundException::SCHEMA, _cfg)
|
407 + | .and_then(|mut deser| {
|
408 + | crate::types::error::ServiceNotFoundException::deserialize_with_response(
|
409 + | &mut *deser,
|
410 + | response.headers(),
|
411 + | response.status().into(),
|
412 + | body,
|
413 + | )
|
414 + | }) {
|
415 + | ::std::result::Result::Ok(val) => val,
|
416 + | ::std::result::Result::Err(e) => {
|
417 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
418 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
419 + | ))
|
420 + | }
|
421 + | };
|
422 + | tmp.meta = generic;
|
423 + | if tmp.message.is_none() {
|
424 + | tmp.message = _error_message;
|
425 + | }
|
426 + | tmp
|
427 + | }),
|
428 + | "UnsupportedFeatureException" => crate::operation::create_task_set::CreateTaskSetError::UnsupportedFeatureException({
|
429 + | let mut tmp = match protocol
|
430 + | .deserialize_response(response, crate::types::error::UnsupportedFeatureException::SCHEMA, _cfg)
|
431 + | .and_then(|mut deser| {
|
432 + | crate::types::error::UnsupportedFeatureException::deserialize_with_response(
|
433 + | &mut *deser,
|
434 + | response.headers(),
|
435 + | response.status().into(),
|
436 + | body,
|
437 + | )
|
438 + | }) {
|
439 + | ::std::result::Result::Ok(val) => val,
|
440 + | ::std::result::Result::Err(e) => {
|
441 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
442 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
443 + | ))
|
444 + | }
|
445 + | };
|
446 + | tmp.meta = generic;
|
447 + | if tmp.message.is_none() {
|
448 + | tmp.message = _error_message;
|
449 + | }
|
450 + | tmp
|
451 + | }),
|
452 + | _ => crate::operation::create_task_set::CreateTaskSetError::generic(generic),
|
453 + | };
|
454 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
455 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
456 + | ))
|
157 457 | } else {
|
158 - | crate::protocol_serde::shape_create_task_set::de_create_task_set_http_response(status, headers, body)
|
159 - | };
|
160 - | crate::protocol_serde::type_erase_result(parse_result)
|
458 + | let protocol = _cfg
|
459 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
460 + | .expect("a SharedClientProtocol is required");
|
461 + | let mut deser = protocol.deserialize_response(response, CreateTaskSet::OUTPUT_SCHEMA, _cfg).map_err(|e| {
|
462 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
463 + | })?;
|
464 + | let body = response.body().bytes().expect("body loaded");
|
465 + | let output = crate::operation::create_task_set::CreateTaskSetOutput::deserialize_with_response(
|
466 + | &mut *deser,
|
467 + | response.headers(),
|
468 + | response.status().into(),
|
469 + | body,
|
470 + | )
|
471 + | .map_err(|e| {
|
472 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
473 + | })?;
|
474 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
475 + | }
|
161 476 | }
|
162 477 | }
|
163 478 | #[derive(Debug)]
|
164 479 | struct CreateTaskSetRequestSerializer;
|
165 480 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateTaskSetRequestSerializer {
|
166 481 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
167 482 | fn serialize_input(
|
168 483 | &self,
|
169 484 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
170 485 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
171 486 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
172 487 | let input = input
|
173 488 | .downcast::<crate::operation::create_task_set::CreateTaskSetInput>()
|
174 489 | .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::create_task_set::CreateTaskSetInput,
|
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::create_task_set::CreateTaskSetInput,
|
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.CreateTaskSet",
|
204 - | );
|
205 - | builder
|
206 - | };
|
207 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_task_set::ser_create_task_set_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())
|
490 + | let protocol = _cfg
|
491 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
492 + | .expect("a SharedClientProtocol is required");
|
493 + | let mut request = protocol
|
494 + | .serialize_request(&input, CreateTaskSet::INPUT_SCHEMA, "", _cfg)
|
495 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
496 + |
|
497 + | return ::std::result::Result::Ok(request);
|
213 498 | }
|
214 499 | }
|
215 500 | #[derive(Debug)]
|
216 501 | struct CreateTaskSetEndpointParamsInterceptor;
|
217 502 |
|
218 503 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateTaskSetEndpointParamsInterceptor {
|
219 504 | fn name(&self) -> &'static str {
|
220 505 | "CreateTaskSetEndpointParamsInterceptor"
|
221 506 | }
|
222 507 |
|