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