141 145 | ::std::borrow::Cow::Owned(rcb)
|
142 146 | }
|
143 147 | }
|
144 148 |
|
145 149 | #[derive(Debug)]
|
146 150 | struct CreateCustomKeyStoreResponseDeserializer;
|
147 151 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateCustomKeyStoreResponseDeserializer {
|
148 152 | fn deserialize_nonstreaming(
|
149 153 | &self,
|
150 154 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
155 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
151 156 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
152 157 | 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 158 | #[allow(unused_mut)]
|
156 159 | let mut force_error = false;
|
157 160 | ::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_create_custom_key_store::de_create_custom_key_store_http_error(status, headers, body)
|
160 - | } else {
|
161 - | crate::protocol_serde::shape_create_custom_key_store::de_create_custom_key_store_http_response(status, headers, body)
|
161 + | if !success && status != 200 || force_error {
|
162 + | let headers = response.headers();
|
163 + | let body = response.body().bytes().expect("body loaded");
|
164 + | #[allow(unused_mut)]
|
165 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
166 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
167 + | })?;
|
168 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
169 + | let generic = generic_builder.build();
|
170 + | let error_code = match generic.code() {
|
171 + | ::std::option::Option::Some(code) => code,
|
172 + | ::std::option::Option::None => {
|
173 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
174 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
175 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled(generic),
|
176 + | ),
|
177 + | ))
|
178 + | }
|
179 + | };
|
180 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
181 + | let protocol = _cfg
|
182 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
183 + | .expect("a SharedClientProtocol is required");
|
184 + | let err = match error_code {
|
185 + | "CloudHsmClusterInUseException" => {
|
186 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterInUseException({
|
187 + | let mut tmp = match protocol
|
188 + | .deserialize_response(response, crate::types::error::CloudHsmClusterInUseException::SCHEMA, _cfg)
|
189 + | .and_then(|mut deser| {
|
190 + | crate::types::error::CloudHsmClusterInUseException::deserialize_with_response(
|
191 + | &mut *deser,
|
192 + | response.headers(),
|
193 + | response.status().into(),
|
194 + | body,
|
195 + | )
|
196 + | }) {
|
197 + | ::std::result::Result::Ok(val) => val,
|
198 + | ::std::result::Result::Err(e) => {
|
199 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
200 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
201 + | ))
|
202 + | }
|
203 + | };
|
204 + | tmp.meta = generic;
|
205 + | if tmp.message.is_none() {
|
206 + | tmp.message = _error_message;
|
207 + | }
|
208 + | tmp
|
209 + | })
|
210 + | }
|
211 + | "CloudHsmClusterInvalidConfigurationException" => {
|
212 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterInvalidConfigurationException({
|
213 + | let mut tmp = match protocol
|
214 + | .deserialize_response(response, crate::types::error::CloudHsmClusterInvalidConfigurationException::SCHEMA, _cfg)
|
215 + | .and_then(|mut deser| {
|
216 + | crate::types::error::CloudHsmClusterInvalidConfigurationException::deserialize_with_response(
|
217 + | &mut *deser,
|
218 + | response.headers(),
|
219 + | response.status().into(),
|
220 + | body,
|
221 + | )
|
222 + | }) {
|
223 + | ::std::result::Result::Ok(val) => val,
|
224 + | ::std::result::Result::Err(e) => {
|
225 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
226 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
227 + | ))
|
228 + | }
|
229 + | };
|
230 + | tmp.meta = generic;
|
231 + | if tmp.message.is_none() {
|
232 + | tmp.message = _error_message;
|
233 + | }
|
234 + | tmp
|
235 + | })
|
236 + | }
|
237 + | "CloudHsmClusterNotActiveException" => {
|
238 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterNotActiveException({
|
239 + | let mut tmp = match protocol
|
240 + | .deserialize_response(response, crate::types::error::CloudHsmClusterNotActiveException::SCHEMA, _cfg)
|
241 + | .and_then(|mut deser| {
|
242 + | crate::types::error::CloudHsmClusterNotActiveException::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 + | "CloudHsmClusterNotFoundException" => {
|
264 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterNotFoundException({
|
265 + | let mut tmp = match protocol
|
266 + | .deserialize_response(response, crate::types::error::CloudHsmClusterNotFoundException::SCHEMA, _cfg)
|
267 + | .and_then(|mut deser| {
|
268 + | crate::types::error::CloudHsmClusterNotFoundException::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 + | }
|
162 281 | };
|
163 - | crate::protocol_serde::type_erase_result(parse_result)
|
282 + | tmp.meta = generic;
|
283 + | if tmp.message.is_none() {
|
284 + | tmp.message = _error_message;
|
285 + | }
|
286 + | tmp
|
287 + | })
|
288 + | }
|
289 + | "CustomKeyStoreNameInUseException" => {
|
290 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CustomKeyStoreNameInUseException({
|
291 + | let mut tmp = match protocol
|
292 + | .deserialize_response(response, crate::types::error::CustomKeyStoreNameInUseException::SCHEMA, _cfg)
|
293 + | .and_then(|mut deser| {
|
294 + | crate::types::error::CustomKeyStoreNameInUseException::deserialize_with_response(
|
295 + | &mut *deser,
|
296 + | response.headers(),
|
297 + | response.status().into(),
|
298 + | body,
|
299 + | )
|
300 + | }) {
|
301 + | ::std::result::Result::Ok(val) => val,
|
302 + | ::std::result::Result::Err(e) => {
|
303 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
304 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
305 + | ))
|
306 + | }
|
307 + | };
|
308 + | tmp.meta = generic;
|
309 + | if tmp.message.is_none() {
|
310 + | tmp.message = _error_message;
|
311 + | }
|
312 + | tmp
|
313 + | })
|
314 + | }
|
315 + | "IncorrectTrustAnchorException" => {
|
316 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::IncorrectTrustAnchorException({
|
317 + | let mut tmp = match protocol
|
318 + | .deserialize_response(response, crate::types::error::IncorrectTrustAnchorException::SCHEMA, _cfg)
|
319 + | .and_then(|mut deser| {
|
320 + | crate::types::error::IncorrectTrustAnchorException::deserialize_with_response(
|
321 + | &mut *deser,
|
322 + | response.headers(),
|
323 + | response.status().into(),
|
324 + | body,
|
325 + | )
|
326 + | }) {
|
327 + | ::std::result::Result::Ok(val) => val,
|
328 + | ::std::result::Result::Err(e) => {
|
329 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
330 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
331 + | ))
|
332 + | }
|
333 + | };
|
334 + | tmp.meta = generic;
|
335 + | if tmp.message.is_none() {
|
336 + | tmp.message = _error_message;
|
337 + | }
|
338 + | tmp
|
339 + | })
|
340 + | }
|
341 + | "KMSInternalException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::KmsInternalException({
|
342 + | let mut tmp = match protocol
|
343 + | .deserialize_response(response, crate::types::error::KmsInternalException::SCHEMA, _cfg)
|
344 + | .and_then(|mut deser| {
|
345 + | crate::types::error::KmsInternalException::deserialize_with_response(
|
346 + | &mut *deser,
|
347 + | response.headers(),
|
348 + | response.status().into(),
|
349 + | body,
|
350 + | )
|
351 + | }) {
|
352 + | ::std::result::Result::Ok(val) => val,
|
353 + | ::std::result::Result::Err(e) => {
|
354 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
355 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
356 + | ))
|
357 + | }
|
358 + | };
|
359 + | tmp.meta = generic;
|
360 + | if tmp.message.is_none() {
|
361 + | tmp.message = _error_message;
|
362 + | }
|
363 + | tmp
|
364 + | }),
|
365 + | "LimitExceededException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::LimitExceededException({
|
366 + | let mut tmp = match protocol
|
367 + | .deserialize_response(response, crate::types::error::LimitExceededException::SCHEMA, _cfg)
|
368 + | .and_then(|mut deser| {
|
369 + | crate::types::error::LimitExceededException::deserialize_with_response(
|
370 + | &mut *deser,
|
371 + | response.headers(),
|
372 + | response.status().into(),
|
373 + | body,
|
374 + | )
|
375 + | }) {
|
376 + | ::std::result::Result::Ok(val) => val,
|
377 + | ::std::result::Result::Err(e) => {
|
378 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
379 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
380 + | ))
|
381 + | }
|
382 + | };
|
383 + | tmp.meta = generic;
|
384 + | if tmp.message.is_none() {
|
385 + | tmp.message = _error_message;
|
386 + | }
|
387 + | tmp
|
388 + | }),
|
389 + | "XksProxyIncorrectAuthenticationCredentialException" => {
|
390 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyIncorrectAuthenticationCredentialException({
|
391 + | let mut tmp = match protocol
|
392 + | .deserialize_response(
|
393 + | response,
|
394 + | crate::types::error::XksProxyIncorrectAuthenticationCredentialException::SCHEMA,
|
395 + | _cfg,
|
396 + | )
|
397 + | .and_then(|mut deser| {
|
398 + | crate::types::error::XksProxyIncorrectAuthenticationCredentialException::deserialize_with_response(
|
399 + | &mut *deser,
|
400 + | response.headers(),
|
401 + | response.status().into(),
|
402 + | body,
|
403 + | )
|
404 + | }) {
|
405 + | ::std::result::Result::Ok(val) => val,
|
406 + | ::std::result::Result::Err(e) => {
|
407 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
408 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
409 + | ))
|
410 + | }
|
411 + | };
|
412 + | tmp.meta = generic;
|
413 + | if tmp.message.is_none() {
|
414 + | tmp.message = _error_message;
|
415 + | }
|
416 + | tmp
|
417 + | })
|
418 + | }
|
419 + | "XksProxyInvalidConfigurationException" => {
|
420 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyInvalidConfigurationException({
|
421 + | let mut tmp = match protocol
|
422 + | .deserialize_response(response, crate::types::error::XksProxyInvalidConfigurationException::SCHEMA, _cfg)
|
423 + | .and_then(|mut deser| {
|
424 + | crate::types::error::XksProxyInvalidConfigurationException::deserialize_with_response(
|
425 + | &mut *deser,
|
426 + | response.headers(),
|
427 + | response.status().into(),
|
428 + | body,
|
429 + | )
|
430 + | }) {
|
431 + | ::std::result::Result::Ok(val) => val,
|
432 + | ::std::result::Result::Err(e) => {
|
433 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
434 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
435 + | ))
|
436 + | }
|
437 + | };
|
438 + | tmp.meta = generic;
|
439 + | if tmp.message.is_none() {
|
440 + | tmp.message = _error_message;
|
441 + | }
|
442 + | tmp
|
443 + | })
|
444 + | }
|
445 + | "XksProxyInvalidResponseException" => {
|
446 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyInvalidResponseException({
|
447 + | let mut tmp = match protocol
|
448 + | .deserialize_response(response, crate::types::error::XksProxyInvalidResponseException::SCHEMA, _cfg)
|
449 + | .and_then(|mut deser| {
|
450 + | crate::types::error::XksProxyInvalidResponseException::deserialize_with_response(
|
451 + | &mut *deser,
|
452 + | response.headers(),
|
453 + | response.status().into(),
|
454 + | body,
|
455 + | )
|
456 + | }) {
|
457 + | ::std::result::Result::Ok(val) => val,
|
458 + | ::std::result::Result::Err(e) => {
|
459 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
460 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
461 + | ))
|
462 + | }
|
463 + | };
|
464 + | tmp.meta = generic;
|
465 + | if tmp.message.is_none() {
|
466 + | tmp.message = _error_message;
|
467 + | }
|
468 + | tmp
|
469 + | })
|
470 + | }
|
471 + | "XksProxyUriEndpointInUseException" => {
|
472 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriEndpointInUseException({
|
473 + | let mut tmp = match protocol
|
474 + | .deserialize_response(response, crate::types::error::XksProxyUriEndpointInUseException::SCHEMA, _cfg)
|
475 + | .and_then(|mut deser| {
|
476 + | crate::types::error::XksProxyUriEndpointInUseException::deserialize_with_response(
|
477 + | &mut *deser,
|
478 + | response.headers(),
|
479 + | response.status().into(),
|
480 + | body,
|
481 + | )
|
482 + | }) {
|
483 + | ::std::result::Result::Ok(val) => val,
|
484 + | ::std::result::Result::Err(e) => {
|
485 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
486 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
487 + | ))
|
488 + | }
|
489 + | };
|
490 + | tmp.meta = generic;
|
491 + | if tmp.message.is_none() {
|
492 + | tmp.message = _error_message;
|
493 + | }
|
494 + | tmp
|
495 + | })
|
496 + | }
|
497 + | "XksProxyUriInUseException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriInUseException({
|
498 + | let mut tmp = match protocol
|
499 + | .deserialize_response(response, crate::types::error::XksProxyUriInUseException::SCHEMA, _cfg)
|
500 + | .and_then(|mut deser| {
|
501 + | crate::types::error::XksProxyUriInUseException::deserialize_with_response(
|
502 + | &mut *deser,
|
503 + | response.headers(),
|
504 + | response.status().into(),
|
505 + | body,
|
506 + | )
|
507 + | }) {
|
508 + | ::std::result::Result::Ok(val) => val,
|
509 + | ::std::result::Result::Err(e) => {
|
510 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
511 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
512 + | ))
|
513 + | }
|
514 + | };
|
515 + | tmp.meta = generic;
|
516 + | if tmp.message.is_none() {
|
517 + | tmp.message = _error_message;
|
518 + | }
|
519 + | tmp
|
520 + | }),
|
521 + | "XksProxyUriUnreachableException" => {
|
522 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriUnreachableException({
|
523 + | let mut tmp = match protocol
|
524 + | .deserialize_response(response, crate::types::error::XksProxyUriUnreachableException::SCHEMA, _cfg)
|
525 + | .and_then(|mut deser| {
|
526 + | crate::types::error::XksProxyUriUnreachableException::deserialize_with_response(
|
527 + | &mut *deser,
|
528 + | response.headers(),
|
529 + | response.status().into(),
|
530 + | body,
|
531 + | )
|
532 + | }) {
|
533 + | ::std::result::Result::Ok(val) => val,
|
534 + | ::std::result::Result::Err(e) => {
|
535 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
536 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
537 + | ))
|
538 + | }
|
539 + | };
|
540 + | tmp.meta = generic;
|
541 + | if tmp.message.is_none() {
|
542 + | tmp.message = _error_message;
|
543 + | }
|
544 + | tmp
|
545 + | })
|
546 + | }
|
547 + | "XksProxyVpcEndpointServiceInUseException" => {
|
548 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceInUseException({
|
549 + | let mut tmp = match protocol
|
550 + | .deserialize_response(response, crate::types::error::XksProxyVpcEndpointServiceInUseException::SCHEMA, _cfg)
|
551 + | .and_then(|mut deser| {
|
552 + | crate::types::error::XksProxyVpcEndpointServiceInUseException::deserialize_with_response(
|
553 + | &mut *deser,
|
554 + | response.headers(),
|
555 + | response.status().into(),
|
556 + | body,
|
557 + | )
|
558 + | }) {
|
559 + | ::std::result::Result::Ok(val) => val,
|
560 + | ::std::result::Result::Err(e) => {
|
561 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
562 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
563 + | ))
|
564 + | }
|
565 + | };
|
566 + | tmp.meta = generic;
|
567 + | if tmp.message.is_none() {
|
568 + | tmp.message = _error_message;
|
569 + | }
|
570 + | tmp
|
571 + | })
|
572 + | }
|
573 + | "XksProxyVpcEndpointServiceInvalidConfigurationException" => {
|
574 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceInvalidConfigurationException({
|
575 + | let mut tmp = match protocol
|
576 + | .deserialize_response(
|
577 + | response,
|
578 + | crate::types::error::XksProxyVpcEndpointServiceInvalidConfigurationException::SCHEMA,
|
579 + | _cfg,
|
580 + | )
|
581 + | .and_then(|mut deser| {
|
582 + | crate::types::error::XksProxyVpcEndpointServiceInvalidConfigurationException::deserialize_with_response(
|
583 + | &mut *deser,
|
584 + | response.headers(),
|
585 + | response.status().into(),
|
586 + | body,
|
587 + | )
|
588 + | }) {
|
589 + | ::std::result::Result::Ok(val) => val,
|
590 + | ::std::result::Result::Err(e) => {
|
591 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
592 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
593 + | ))
|
594 + | }
|
595 + | };
|
596 + | tmp.meta = generic;
|
597 + | if tmp.message.is_none() {
|
598 + | tmp.message = _error_message;
|
599 + | }
|
600 + | tmp
|
601 + | })
|
602 + | }
|
603 + | "XksProxyVpcEndpointServiceNotFoundException" => {
|
604 + | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceNotFoundException({
|
605 + | let mut tmp = match protocol
|
606 + | .deserialize_response(response, crate::types::error::XksProxyVpcEndpointServiceNotFoundException::SCHEMA, _cfg)
|
607 + | .and_then(|mut deser| {
|
608 + | crate::types::error::XksProxyVpcEndpointServiceNotFoundException::deserialize_with_response(
|
609 + | &mut *deser,
|
610 + | response.headers(),
|
611 + | response.status().into(),
|
612 + | body,
|
613 + | )
|
614 + | }) {
|
615 + | ::std::result::Result::Ok(val) => val,
|
616 + | ::std::result::Result::Err(e) => {
|
617 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
618 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
619 + | ))
|
620 + | }
|
621 + | };
|
622 + | tmp.meta = generic;
|
623 + | if tmp.message.is_none() {
|
624 + | tmp.message = _error_message;
|
625 + | }
|
626 + | tmp
|
627 + | })
|
628 + | }
|
629 + | _ => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::generic(generic),
|
630 + | };
|
631 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
632 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
633 + | ))
|
634 + | } else {
|
635 + | let protocol = _cfg
|
636 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
637 + | .expect("a SharedClientProtocol is required");
|
638 + | let mut deser = protocol
|
639 + | .deserialize_response(response, CreateCustomKeyStore::OUTPUT_SCHEMA, _cfg)
|
640 + | .map_err(|e| {
|
641 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
642 + | })?;
|
643 + | let body = response.body().bytes().expect("body loaded");
|
644 + | let output = crate::operation::create_custom_key_store::CreateCustomKeyStoreOutput::deserialize_with_response(
|
645 + | &mut *deser,
|
646 + | response.headers(),
|
647 + | response.status().into(),
|
648 + | body,
|
649 + | )
|
650 + | .map_err(|e| {
|
651 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
652 + | })?;
|
653 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
654 + | }
|
164 655 | }
|
165 656 | }
|
166 657 | #[derive(Debug)]
|
167 658 | struct CreateCustomKeyStoreRequestSerializer;
|
168 659 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateCustomKeyStoreRequestSerializer {
|
169 660 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
170 661 | fn serialize_input(
|
171 662 | &self,
|
172 663 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
173 664 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
174 665 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
175 666 | let input = input
|
176 667 | .downcast::<crate::operation::create_custom_key_store::CreateCustomKeyStoreInput>()
|
177 668 | .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::create_custom_key_store::CreateCustomKeyStoreInput,
|
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::create_custom_key_store::CreateCustomKeyStoreInput,
|
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 - | "TrentService.CreateCustomKeyStore",
|
207 - | );
|
208 - | builder
|
209 - | };
|
210 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_custom_key_store::ser_create_custom_key_store_input(
|
211 - | &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())
|
669 + | let protocol = _cfg
|
670 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
671 + | .expect("a SharedClientProtocol is required");
|
672 + | let mut request = protocol
|
673 + | .serialize_request(&input, CreateCustomKeyStore::INPUT_SCHEMA, "", _cfg)
|
674 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
675 + |
|
676 + | return ::std::result::Result::Ok(request);
|
218 677 | }
|
219 678 | }
|
220 679 | #[derive(Debug)]
|
221 680 | struct CreateCustomKeyStoreEndpointParamsInterceptor;
|
222 681 |
|
223 682 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateCustomKeyStoreEndpointParamsInterceptor {
|
224 683 | fn name(&self) -> &'static str {
|
225 684 | "CreateCustomKeyStoreEndpointParamsInterceptor"
|
226 685 | }
|
227 686 |
|