158 164 | return ::std::option::Option::None;
|
159 165 | }
|
160 166 | ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
|
161 167 | crate::protocol_serde::shape_invoke_with_response_stream::de_invoke_with_response_stream_http_response(response),
|
162 168 | ))
|
163 169 | }
|
164 170 |
|
165 171 | fn deserialize_nonstreaming(
|
166 172 | &self,
|
167 173 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
174 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
168 175 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
169 176 | // For streaming operations, we only hit this case if its an error
|
170 177 | let body = response.body().bytes().expect("body loaded");
|
171 - | crate::protocol_serde::type_erase_result(
|
172 - | crate::protocol_serde::shape_invoke_with_response_stream::de_invoke_with_response_stream_http_error(
|
173 - | response.status().as_u16(),
|
178 + | let status = response.status().as_u16();
|
179 + | let headers = response.headers();
|
180 + | #[allow(unused_mut)]
|
181 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
182 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
183 + | })?;
|
184 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
185 + | let generic = generic_builder.build();
|
186 + | let error_code = match generic.code() {
|
187 + | ::std::option::Option::Some(code) => code,
|
188 + | ::std::option::Option::None => {
|
189 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
190 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
191 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled(generic),
|
192 + | ),
|
193 + | ))
|
194 + | }
|
195 + | };
|
196 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
197 + | let protocol = _cfg
|
198 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
199 + | .expect("a SharedClientProtocol is required");
|
200 + | let err = match error_code {
|
201 + | "EC2AccessDeniedException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::Ec2AccessDeniedException({
|
202 + | let mut tmp = match protocol
|
203 + | .deserialize_response(response, crate::types::error::Ec2AccessDeniedException::SCHEMA, _cfg)
|
204 + | .and_then(|mut deser| {
|
205 + | crate::types::error::Ec2AccessDeniedException::deserialize_with_response(
|
206 + | &mut *deser,
|
174 207 | response.headers(),
|
208 + | response.status().into(),
|
209 + | body,
|
210 + | )
|
211 + | }) {
|
212 + | ::std::result::Result::Ok(val) => val,
|
213 + | ::std::result::Result::Err(e) => {
|
214 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
215 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
216 + | ))
|
217 + | }
|
218 + | };
|
219 + | tmp.meta = generic;
|
220 + | if tmp.message.is_none() {
|
221 + | tmp.message = _error_message;
|
222 + | }
|
223 + | tmp
|
224 + | }),
|
225 + | "EC2ThrottledException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::Ec2ThrottledException({
|
226 + | let mut tmp = match protocol
|
227 + | .deserialize_response(response, crate::types::error::Ec2ThrottledException::SCHEMA, _cfg)
|
228 + | .and_then(|mut deser| {
|
229 + | crate::types::error::Ec2ThrottledException::deserialize_with_response(
|
230 + | &mut *deser,
|
231 + | response.headers(),
|
232 + | response.status().into(),
|
233 + | body,
|
234 + | )
|
235 + | }) {
|
236 + | ::std::result::Result::Ok(val) => val,
|
237 + | ::std::result::Result::Err(e) => {
|
238 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
239 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
240 + | ))
|
241 + | }
|
242 + | };
|
243 + | tmp.meta = generic;
|
244 + | if tmp.message.is_none() {
|
245 + | tmp.message = _error_message;
|
246 + | }
|
247 + | tmp
|
248 + | }),
|
249 + | "EC2UnexpectedException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::Ec2UnexpectedException({
|
250 + | let mut tmp = match protocol
|
251 + | .deserialize_response(response, crate::types::error::Ec2UnexpectedException::SCHEMA, _cfg)
|
252 + | .and_then(|mut deser| {
|
253 + | crate::types::error::Ec2UnexpectedException::deserialize_with_response(
|
254 + | &mut *deser,
|
255 + | response.headers(),
|
256 + | response.status().into(),
|
257 + | body,
|
258 + | )
|
259 + | }) {
|
260 + | ::std::result::Result::Ok(val) => val,
|
261 + | ::std::result::Result::Err(e) => {
|
262 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
263 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
264 + | ))
|
265 + | }
|
266 + | };
|
267 + | tmp.meta = generic;
|
268 + | if tmp.message.is_none() {
|
269 + | tmp.message = _error_message;
|
270 + | }
|
271 + | tmp
|
272 + | }),
|
273 + | "EFSIOException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EfsioException({
|
274 + | let mut tmp = match protocol
|
275 + | .deserialize_response(response, crate::types::error::EfsioException::SCHEMA, _cfg)
|
276 + | .and_then(|mut deser| {
|
277 + | crate::types::error::EfsioException::deserialize_with_response(
|
278 + | &mut *deser,
|
279 + | response.headers(),
|
280 + | response.status().into(),
|
281 + | body,
|
282 + | )
|
283 + | }) {
|
284 + | ::std::result::Result::Ok(val) => val,
|
285 + | ::std::result::Result::Err(e) => {
|
286 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
287 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
288 + | ))
|
289 + | }
|
290 + | };
|
291 + | tmp.meta = generic;
|
292 + | if tmp.message.is_none() {
|
293 + | tmp.message = _error_message;
|
294 + | }
|
295 + | tmp
|
296 + | }),
|
297 + | "EFSMountConnectivityException" => {
|
298 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EfsMountConnectivityException({
|
299 + | let mut tmp = match protocol
|
300 + | .deserialize_response(response, crate::types::error::EfsMountConnectivityException::SCHEMA, _cfg)
|
301 + | .and_then(|mut deser| {
|
302 + | crate::types::error::EfsMountConnectivityException::deserialize_with_response(
|
303 + | &mut *deser,
|
304 + | response.headers(),
|
305 + | response.status().into(),
|
306 + | body,
|
307 + | )
|
308 + | }) {
|
309 + | ::std::result::Result::Ok(val) => val,
|
310 + | ::std::result::Result::Err(e) => {
|
311 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
312 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
313 + | ))
|
314 + | }
|
315 + | };
|
316 + | tmp.meta = generic;
|
317 + | if tmp.message.is_none() {
|
318 + | tmp.message = _error_message;
|
319 + | }
|
320 + | tmp
|
321 + | })
|
322 + | }
|
323 + | "EFSMountFailureException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EfsMountFailureException({
|
324 + | let mut tmp = match protocol
|
325 + | .deserialize_response(response, crate::types::error::EfsMountFailureException::SCHEMA, _cfg)
|
326 + | .and_then(|mut deser| {
|
327 + | crate::types::error::EfsMountFailureException::deserialize_with_response(
|
328 + | &mut *deser,
|
329 + | response.headers(),
|
330 + | response.status().into(),
|
331 + | body,
|
332 + | )
|
333 + | }) {
|
334 + | ::std::result::Result::Ok(val) => val,
|
335 + | ::std::result::Result::Err(e) => {
|
336 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
337 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
338 + | ))
|
339 + | }
|
340 + | };
|
341 + | tmp.meta = generic;
|
342 + | if tmp.message.is_none() {
|
343 + | tmp.message = _error_message;
|
344 + | }
|
345 + | tmp
|
346 + | }),
|
347 + | "EFSMountTimeoutException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EfsMountTimeoutException({
|
348 + | let mut tmp = match protocol
|
349 + | .deserialize_response(response, crate::types::error::EfsMountTimeoutException::SCHEMA, _cfg)
|
350 + | .and_then(|mut deser| {
|
351 + | crate::types::error::EfsMountTimeoutException::deserialize_with_response(
|
352 + | &mut *deser,
|
353 + | response.headers(),
|
354 + | response.status().into(),
|
355 + | body,
|
356 + | )
|
357 + | }) {
|
358 + | ::std::result::Result::Ok(val) => val,
|
359 + | ::std::result::Result::Err(e) => {
|
360 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
361 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
362 + | ))
|
363 + | }
|
364 + | };
|
365 + | tmp.meta = generic;
|
366 + | if tmp.message.is_none() {
|
367 + | tmp.message = _error_message;
|
368 + | }
|
369 + | tmp
|
370 + | }),
|
371 + | "ENILimitReachedException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EniLimitReachedException({
|
372 + | let mut tmp = match protocol
|
373 + | .deserialize_response(response, crate::types::error::EniLimitReachedException::SCHEMA, _cfg)
|
374 + | .and_then(|mut deser| {
|
375 + | crate::types::error::EniLimitReachedException::deserialize_with_response(
|
376 + | &mut *deser,
|
377 + | response.headers(),
|
378 + | response.status().into(),
|
379 + | body,
|
380 + | )
|
381 + | }) {
|
382 + | ::std::result::Result::Ok(val) => val,
|
383 + | ::std::result::Result::Err(e) => {
|
384 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
385 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
386 + | ))
|
387 + | }
|
388 + | };
|
389 + | tmp.meta = generic;
|
390 + | if tmp.message.is_none() {
|
391 + | tmp.message = _error_message;
|
392 + | }
|
393 + | tmp
|
394 + | }),
|
395 + | "InvalidParameterValueException" => {
|
396 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidParameterValueException({
|
397 + | let mut tmp = match protocol
|
398 + | .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
|
399 + | .and_then(|mut deser| {
|
400 + | crate::types::error::InvalidParameterValueException::deserialize_with_response(
|
401 + | &mut *deser,
|
402 + | response.headers(),
|
403 + | response.status().into(),
|
404 + | body,
|
405 + | )
|
406 + | }) {
|
407 + | ::std::result::Result::Ok(val) => val,
|
408 + | ::std::result::Result::Err(e) => {
|
409 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
410 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
411 + | ))
|
412 + | }
|
413 + | };
|
414 + | tmp.meta = generic;
|
415 + | if tmp.message.is_none() {
|
416 + | tmp.message = _error_message;
|
417 + | }
|
418 + | tmp
|
419 + | })
|
420 + | }
|
421 + | "InvalidRequestContentException" => {
|
422 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidRequestContentException({
|
423 + | let mut tmp = match protocol
|
424 + | .deserialize_response(response, crate::types::error::InvalidRequestContentException::SCHEMA, _cfg)
|
425 + | .and_then(|mut deser| {
|
426 + | crate::types::error::InvalidRequestContentException::deserialize_with_response(
|
427 + | &mut *deser,
|
428 + | response.headers(),
|
429 + | response.status().into(),
|
430 + | body,
|
431 + | )
|
432 + | }) {
|
433 + | ::std::result::Result::Ok(val) => val,
|
434 + | ::std::result::Result::Err(e) => {
|
435 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
436 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
437 + | ))
|
438 + | }
|
439 + | };
|
440 + | tmp.meta = generic;
|
441 + | if tmp.message.is_none() {
|
442 + | tmp.message = _error_message;
|
443 + | }
|
444 + | tmp
|
445 + | })
|
446 + | }
|
447 + | "InvalidRuntimeException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidRuntimeException({
|
448 + | let mut tmp = match protocol
|
449 + | .deserialize_response(response, crate::types::error::InvalidRuntimeException::SCHEMA, _cfg)
|
450 + | .and_then(|mut deser| {
|
451 + | crate::types::error::InvalidRuntimeException::deserialize_with_response(
|
452 + | &mut *deser,
|
453 + | response.headers(),
|
454 + | response.status().into(),
|
175 455 | body,
|
176 - | ),
|
177 456 | )
|
457 + | }) {
|
458 + | ::std::result::Result::Ok(val) => val,
|
459 + | ::std::result::Result::Err(e) => {
|
460 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
461 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
462 + | ))
|
463 + | }
|
464 + | };
|
465 + | tmp.meta = generic;
|
466 + | if tmp.message.is_none() {
|
467 + | tmp.message = _error_message;
|
468 + | }
|
469 + | tmp
|
470 + | }),
|
471 + | "InvalidSecurityGroupIDException" => {
|
472 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidSecurityGroupIdException({
|
473 + | let mut tmp = match protocol
|
474 + | .deserialize_response(response, crate::types::error::InvalidSecurityGroupIdException::SCHEMA, _cfg)
|
475 + | .and_then(|mut deser| {
|
476 + | crate::types::error::InvalidSecurityGroupIdException::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 + | "InvalidSubnetIDException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidSubnetIdException({
|
498 + | let mut tmp = match protocol
|
499 + | .deserialize_response(response, crate::types::error::InvalidSubnetIdException::SCHEMA, _cfg)
|
500 + | .and_then(|mut deser| {
|
501 + | crate::types::error::InvalidSubnetIdException::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 + | "InvalidZipFileException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidZipFileException({
|
522 + | let mut tmp = match protocol
|
523 + | .deserialize_response(response, crate::types::error::InvalidZipFileException::SCHEMA, _cfg)
|
524 + | .and_then(|mut deser| {
|
525 + | crate::types::error::InvalidZipFileException::deserialize_with_response(
|
526 + | &mut *deser,
|
527 + | response.headers(),
|
528 + | response.status().into(),
|
529 + | body,
|
530 + | )
|
531 + | }) {
|
532 + | ::std::result::Result::Ok(val) => val,
|
533 + | ::std::result::Result::Err(e) => {
|
534 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
535 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
536 + | ))
|
537 + | }
|
538 + | };
|
539 + | tmp.meta = generic;
|
540 + | if tmp.message.is_none() {
|
541 + | tmp.message = _error_message;
|
542 + | }
|
543 + | tmp
|
544 + | }),
|
545 + | "KMSAccessDeniedException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::KmsAccessDeniedException({
|
546 + | let mut tmp = match protocol
|
547 + | .deserialize_response(response, crate::types::error::KmsAccessDeniedException::SCHEMA, _cfg)
|
548 + | .and_then(|mut deser| {
|
549 + | crate::types::error::KmsAccessDeniedException::deserialize_with_response(
|
550 + | &mut *deser,
|
551 + | response.headers(),
|
552 + | response.status().into(),
|
553 + | body,
|
554 + | )
|
555 + | }) {
|
556 + | ::std::result::Result::Ok(val) => val,
|
557 + | ::std::result::Result::Err(e) => {
|
558 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
559 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
560 + | ))
|
561 + | }
|
562 + | };
|
563 + | tmp.meta = generic;
|
564 + | if tmp.message.is_none() {
|
565 + | tmp.message = _error_message;
|
566 + | }
|
567 + | tmp
|
568 + | }),
|
569 + | "KMSDisabledException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::KmsDisabledException({
|
570 + | let mut tmp = match protocol
|
571 + | .deserialize_response(response, crate::types::error::KmsDisabledException::SCHEMA, _cfg)
|
572 + | .and_then(|mut deser| {
|
573 + | crate::types::error::KmsDisabledException::deserialize_with_response(
|
574 + | &mut *deser,
|
575 + | response.headers(),
|
576 + | response.status().into(),
|
577 + | body,
|
578 + | )
|
579 + | }) {
|
580 + | ::std::result::Result::Ok(val) => val,
|
581 + | ::std::result::Result::Err(e) => {
|
582 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
583 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
584 + | ))
|
585 + | }
|
586 + | };
|
587 + | tmp.meta = generic;
|
588 + | if tmp.message.is_none() {
|
589 + | tmp.message = _error_message;
|
590 + | }
|
591 + | tmp
|
592 + | }),
|
593 + | "KMSInvalidStateException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::KmsInvalidStateException({
|
594 + | let mut tmp = match protocol
|
595 + | .deserialize_response(response, crate::types::error::KmsInvalidStateException::SCHEMA, _cfg)
|
596 + | .and_then(|mut deser| {
|
597 + | crate::types::error::KmsInvalidStateException::deserialize_with_response(
|
598 + | &mut *deser,
|
599 + | response.headers(),
|
600 + | response.status().into(),
|
601 + | body,
|
602 + | )
|
603 + | }) {
|
604 + | ::std::result::Result::Ok(val) => val,
|
605 + | ::std::result::Result::Err(e) => {
|
606 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
607 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
608 + | ))
|
609 + | }
|
610 + | };
|
611 + | tmp.meta = generic;
|
612 + | if tmp.message.is_none() {
|
613 + | tmp.message = _error_message;
|
614 + | }
|
615 + | tmp
|
616 + | }),
|
617 + | "KMSNotFoundException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::KmsNotFoundException({
|
618 + | let mut tmp = match protocol
|
619 + | .deserialize_response(response, crate::types::error::KmsNotFoundException::SCHEMA, _cfg)
|
620 + | .and_then(|mut deser| {
|
621 + | crate::types::error::KmsNotFoundException::deserialize_with_response(
|
622 + | &mut *deser,
|
623 + | response.headers(),
|
624 + | response.status().into(),
|
625 + | body,
|
626 + | )
|
627 + | }) {
|
628 + | ::std::result::Result::Ok(val) => val,
|
629 + | ::std::result::Result::Err(e) => {
|
630 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
631 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
632 + | ))
|
633 + | }
|
634 + | };
|
635 + | tmp.meta = generic;
|
636 + | if tmp.message.is_none() {
|
637 + | tmp.message = _error_message;
|
638 + | }
|
639 + | tmp
|
640 + | }),
|
641 + | "RecursiveInvocationException" => {
|
642 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::RecursiveInvocationException({
|
643 + | let mut tmp = match protocol
|
644 + | .deserialize_response(response, crate::types::error::RecursiveInvocationException::SCHEMA, _cfg)
|
645 + | .and_then(|mut deser| {
|
646 + | crate::types::error::RecursiveInvocationException::deserialize_with_response(
|
647 + | &mut *deser,
|
648 + | response.headers(),
|
649 + | response.status().into(),
|
650 + | body,
|
651 + | )
|
652 + | }) {
|
653 + | ::std::result::Result::Ok(val) => val,
|
654 + | ::std::result::Result::Err(e) => {
|
655 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
656 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
657 + | ))
|
658 + | }
|
659 + | };
|
660 + | tmp.meta = generic;
|
661 + | if tmp.message.is_none() {
|
662 + | tmp.message = _error_message;
|
663 + | }
|
664 + | tmp
|
665 + | })
|
666 + | }
|
667 + | "RequestTooLargeException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::RequestTooLargeException({
|
668 + | let mut tmp = match protocol
|
669 + | .deserialize_response(response, crate::types::error::RequestTooLargeException::SCHEMA, _cfg)
|
670 + | .and_then(|mut deser| {
|
671 + | crate::types::error::RequestTooLargeException::deserialize_with_response(
|
672 + | &mut *deser,
|
673 + | response.headers(),
|
674 + | response.status().into(),
|
675 + | body,
|
676 + | )
|
677 + | }) {
|
678 + | ::std::result::Result::Ok(val) => val,
|
679 + | ::std::result::Result::Err(e) => {
|
680 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
681 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
682 + | ))
|
683 + | }
|
684 + | };
|
685 + | tmp.meta = generic;
|
686 + | if tmp.message.is_none() {
|
687 + | tmp.message = _error_message;
|
688 + | }
|
689 + | tmp
|
690 + | }),
|
691 + | "ResourceConflictException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::ResourceConflictException({
|
692 + | let mut tmp = match protocol
|
693 + | .deserialize_response(response, crate::types::error::ResourceConflictException::SCHEMA, _cfg)
|
694 + | .and_then(|mut deser| {
|
695 + | crate::types::error::ResourceConflictException::deserialize_with_response(
|
696 + | &mut *deser,
|
697 + | response.headers(),
|
698 + | response.status().into(),
|
699 + | body,
|
700 + | )
|
701 + | }) {
|
702 + | ::std::result::Result::Ok(val) => val,
|
703 + | ::std::result::Result::Err(e) => {
|
704 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
705 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
706 + | ))
|
707 + | }
|
708 + | };
|
709 + | tmp.meta = generic;
|
710 + | if tmp.message.is_none() {
|
711 + | tmp.message = _error_message;
|
712 + | }
|
713 + | tmp
|
714 + | }),
|
715 + | "ResourceNotFoundException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::ResourceNotFoundException({
|
716 + | let mut tmp = match protocol
|
717 + | .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
|
718 + | .and_then(|mut deser| {
|
719 + | crate::types::error::ResourceNotFoundException::deserialize_with_response(
|
720 + | &mut *deser,
|
721 + | response.headers(),
|
722 + | response.status().into(),
|
723 + | body,
|
724 + | )
|
725 + | }) {
|
726 + | ::std::result::Result::Ok(val) => val,
|
727 + | ::std::result::Result::Err(e) => {
|
728 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
729 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
730 + | ))
|
731 + | }
|
732 + | };
|
733 + | tmp.meta = generic;
|
734 + | if tmp.message.is_none() {
|
735 + | tmp.message = _error_message;
|
736 + | }
|
737 + | tmp
|
738 + | }),
|
739 + | "ResourceNotReadyException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::ResourceNotReadyException({
|
740 + | let mut tmp = match protocol
|
741 + | .deserialize_response(response, crate::types::error::ResourceNotReadyException::SCHEMA, _cfg)
|
742 + | .and_then(|mut deser| {
|
743 + | crate::types::error::ResourceNotReadyException::deserialize_with_response(
|
744 + | &mut *deser,
|
745 + | response.headers(),
|
746 + | response.status().into(),
|
747 + | body,
|
748 + | )
|
749 + | }) {
|
750 + | ::std::result::Result::Ok(val) => val,
|
751 + | ::std::result::Result::Err(e) => {
|
752 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
753 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
754 + | ))
|
755 + | }
|
756 + | };
|
757 + | tmp.meta = generic;
|
758 + | if tmp.message.is_none() {
|
759 + | tmp.message = _error_message;
|
760 + | }
|
761 + | tmp
|
762 + | }),
|
763 + | "ServiceException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::ServiceException({
|
764 + | let mut tmp = match protocol
|
765 + | .deserialize_response(response, crate::types::error::ServiceException::SCHEMA, _cfg)
|
766 + | .and_then(|mut deser| {
|
767 + | crate::types::error::ServiceException::deserialize_with_response(
|
768 + | &mut *deser,
|
769 + | response.headers(),
|
770 + | response.status().into(),
|
771 + | body,
|
772 + | )
|
773 + | }) {
|
774 + | ::std::result::Result::Ok(val) => val,
|
775 + | ::std::result::Result::Err(e) => {
|
776 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
777 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
778 + | ))
|
779 + | }
|
780 + | };
|
781 + | tmp.meta = generic;
|
782 + | if tmp.message.is_none() {
|
783 + | tmp.message = _error_message;
|
784 + | }
|
785 + | tmp
|
786 + | }),
|
787 + | "SnapStartException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::SnapStartException({
|
788 + | let mut tmp = match protocol
|
789 + | .deserialize_response(response, crate::types::error::SnapStartException::SCHEMA, _cfg)
|
790 + | .and_then(|mut deser| {
|
791 + | crate::types::error::SnapStartException::deserialize_with_response(
|
792 + | &mut *deser,
|
793 + | response.headers(),
|
794 + | response.status().into(),
|
795 + | body,
|
796 + | )
|
797 + | }) {
|
798 + | ::std::result::Result::Ok(val) => val,
|
799 + | ::std::result::Result::Err(e) => {
|
800 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
801 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
802 + | ))
|
803 + | }
|
804 + | };
|
805 + | tmp.meta = generic;
|
806 + | if tmp.message.is_none() {
|
807 + | tmp.message = _error_message;
|
808 + | }
|
809 + | tmp
|
810 + | }),
|
811 + | "SnapStartNotReadyException" => {
|
812 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::SnapStartNotReadyException({
|
813 + | let mut tmp = match protocol
|
814 + | .deserialize_response(response, crate::types::error::SnapStartNotReadyException::SCHEMA, _cfg)
|
815 + | .and_then(|mut deser| {
|
816 + | crate::types::error::SnapStartNotReadyException::deserialize_with_response(
|
817 + | &mut *deser,
|
818 + | response.headers(),
|
819 + | response.status().into(),
|
820 + | body,
|
821 + | )
|
822 + | }) {
|
823 + | ::std::result::Result::Ok(val) => val,
|
824 + | ::std::result::Result::Err(e) => {
|
825 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
826 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
827 + | ))
|
828 + | }
|
829 + | };
|
830 + | tmp.meta = generic;
|
831 + | if tmp.message.is_none() {
|
832 + | tmp.message = _error_message;
|
833 + | }
|
834 + | tmp
|
835 + | })
|
836 + | }
|
837 + | "SnapStartTimeoutException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::SnapStartTimeoutException({
|
838 + | let mut tmp = match protocol
|
839 + | .deserialize_response(response, crate::types::error::SnapStartTimeoutException::SCHEMA, _cfg)
|
840 + | .and_then(|mut deser| {
|
841 + | crate::types::error::SnapStartTimeoutException::deserialize_with_response(
|
842 + | &mut *deser,
|
843 + | response.headers(),
|
844 + | response.status().into(),
|
845 + | body,
|
846 + | )
|
847 + | }) {
|
848 + | ::std::result::Result::Ok(val) => val,
|
849 + | ::std::result::Result::Err(e) => {
|
850 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
851 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
852 + | ))
|
853 + | }
|
854 + | };
|
855 + | tmp.meta = generic;
|
856 + | if tmp.message.is_none() {
|
857 + | tmp.message = _error_message;
|
858 + | }
|
859 + | tmp
|
860 + | }),
|
861 + | "SubnetIPAddressLimitReachedException" => {
|
862 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::SubnetIpAddressLimitReachedException({
|
863 + | let mut tmp = match protocol
|
864 + | .deserialize_response(response, crate::types::error::SubnetIpAddressLimitReachedException::SCHEMA, _cfg)
|
865 + | .and_then(|mut deser| {
|
866 + | crate::types::error::SubnetIpAddressLimitReachedException::deserialize_with_response(
|
867 + | &mut *deser,
|
868 + | response.headers(),
|
869 + | response.status().into(),
|
870 + | body,
|
871 + | )
|
872 + | }) {
|
873 + | ::std::result::Result::Ok(val) => val,
|
874 + | ::std::result::Result::Err(e) => {
|
875 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
876 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
877 + | ))
|
878 + | }
|
879 + | };
|
880 + | tmp.meta = generic;
|
881 + | if tmp.message.is_none() {
|
882 + | tmp.message = _error_message;
|
883 + | }
|
884 + | tmp
|
885 + | })
|
886 + | }
|
887 + | "TooManyRequestsException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::TooManyRequestsException({
|
888 + | let mut tmp = match protocol
|
889 + | .deserialize_response(response, crate::types::error::TooManyRequestsException::SCHEMA, _cfg)
|
890 + | .and_then(|mut deser| {
|
891 + | crate::types::error::TooManyRequestsException::deserialize_with_response(
|
892 + | &mut *deser,
|
893 + | response.headers(),
|
894 + | response.status().into(),
|
895 + | body,
|
896 + | )
|
897 + | }) {
|
898 + | ::std::result::Result::Ok(val) => val,
|
899 + | ::std::result::Result::Err(e) => {
|
900 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
901 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
902 + | ))
|
903 + | }
|
904 + | };
|
905 + | tmp.meta = generic;
|
906 + | if tmp.message.is_none() {
|
907 + | tmp.message = _error_message;
|
908 + | }
|
909 + | tmp
|
910 + | }),
|
911 + | "UnsupportedMediaTypeException" => {
|
912 + | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::UnsupportedMediaTypeException({
|
913 + | let mut tmp = match protocol
|
914 + | .deserialize_response(response, crate::types::error::UnsupportedMediaTypeException::SCHEMA, _cfg)
|
915 + | .and_then(|mut deser| {
|
916 + | crate::types::error::UnsupportedMediaTypeException::deserialize_with_response(
|
917 + | &mut *deser,
|
918 + | response.headers(),
|
919 + | response.status().into(),
|
920 + | body,
|
921 + | )
|
922 + | }) {
|
923 + | ::std::result::Result::Ok(val) => val,
|
924 + | ::std::result::Result::Err(e) => {
|
925 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
926 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
927 + | ))
|
928 + | }
|
929 + | };
|
930 + | tmp.meta = generic;
|
931 + | if tmp.message.is_none() {
|
932 + | tmp.message = _error_message;
|
933 + | }
|
934 + | tmp
|
935 + | })
|
936 + | }
|
937 + | _ => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::generic(generic),
|
938 + | };
|
939 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
940 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
941 + | ))
|
178 942 | }
|
179 943 | }
|
180 944 | #[derive(Debug)]
|
181 945 | struct InvokeWithResponseStreamRequestSerializer;
|
182 946 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InvokeWithResponseStreamRequestSerializer {
|
183 947 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
184 948 | fn serialize_input(
|
185 949 | &self,
|
186 950 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
187 951 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
188 952 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
189 953 | let input = input
|
190 954 | .downcast::<crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput>()
|
191 955 | .expect("correct type");
|
192 - | let _header_serialization_settings = _cfg
|
193 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
194 - | .cloned()
|
195 - | .unwrap_or_default();
|
196 - | let mut request_builder = {
|
197 - | #[allow(clippy::uninlined_format_args)]
|
198 - | fn uri_base(
|
199 - | _input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
|
200 - | output: &mut ::std::string::String,
|
201 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
202 - | use ::std::fmt::Write as _;
|
203 - | let input_1 = &_input.function_name;
|
204 - | let input_1 = input_1
|
205 - | .as_ref()
|
206 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
|
207 - | let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
|
208 - | if function_name.is_empty() {
|
209 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
210 - | "function_name",
|
211 - | "cannot be empty or unset",
|
212 - | ));
|
956 + | let protocol = _cfg
|
957 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
958 + | .expect("a SharedClientProtocol is required");
|
959 + | if protocol.supports_http_bindings() {
|
960 + | let mut input = input;
|
961 + | let payload = input.payload.take();
|
962 + | let mut request = protocol
|
963 + | .serialize_body(&input, InvokeWithResponseStream::INPUT_SCHEMA, "", _cfg)
|
964 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
965 + | if let ::std::option::Option::Some(payload) = payload {
|
966 + | *request.body_mut() = ::aws_smithy_types::body::SdkBody::from(payload.into_inner());
|
967 + | request.headers_mut().insert("Content-Type", "application/octet-stream");
|
968 + | if let ::std::option::Option::Some(content_length) = request.body().content_length() {
|
969 + | request.headers_mut().insert("Content-Length", content_length.to_string());
|
213 970 | }
|
214 - | ::std::write!(
|
215 - | output,
|
216 - | "/2021-11-15/functions/{FunctionName}/response-streaming-invocations",
|
217 - | FunctionName = function_name
|
218 - | )
|
219 - | .expect("formatting should succeed");
|
220 - | ::std::result::Result::Ok(())
|
221 971 | }
|
222 - | fn uri_query(
|
223 - | _input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
|
224 - | mut output: &mut ::std::string::String,
|
225 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
226 - | let mut query = ::aws_smithy_http::query::Writer::new(output);
|
227 - | if let ::std::option::Option::Some(inner_2) = &_input.qualifier {
|
228 972 | {
|
229 - | query.push_kv("Qualifier", &::aws_smithy_http::query::fmt_string(inner_2));
|
973 + | let mut uri = "/2021-11-15/functions/{FunctionName}/response-streaming-invocations".to_string();
|
974 + | let mut query_params: Vec<(String, String)> = Vec::new();
|
975 + | if let Some(ref val) = input.function_name {
|
976 + | uri = uri.replace("{FunctionName}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
|
977 + | }
|
978 + | if let Some(ref val) = input.invocation_type {
|
979 + | request.headers_mut().insert("X-Amz-Invocation-Type", val.as_str().to_string());
|
980 + | }
|
981 + | if let Some(ref val) = input.log_type {
|
982 + | request.headers_mut().insert("X-Amz-Log-Type", val.as_str().to_string());
|
983 + | }
|
984 + | if let Some(ref val) = input.client_context {
|
985 + | request.headers_mut().insert("X-Amz-Client-Context", val.to_string());
|
986 + | }
|
987 + | if let Some(ref val) = input.qualifier {
|
988 + | query_params.push(("Qualifier".to_string(), val.to_string()));
|
989 + | }
|
990 + | if !query_params.is_empty() {
|
991 + | uri.push(if uri.contains('?') { '&' } else { '?' });
|
992 + | let pairs: Vec<String> = query_params
|
993 + | .iter()
|
994 + | .map(|(k, v)| {
|
995 + | format!(
|
996 + | "{}={}",
|
997 + | ::aws_smithy_schema::http_protocol::percent_encode(k),
|
998 + | ::aws_smithy_schema::http_protocol::percent_encode(v)
|
999 + | )
|
1000 + | })
|
1001 + | .collect();
|
1002 + | uri.push_str(&pairs.join("&"));
|
230 1003 | }
|
1004 + | request.set_uri(uri.as_str()).expect("valid URI");
|
231 1005 | }
|
232 - | ::std::result::Result::Ok(())
|
1006 + |
|
1007 + | return ::std::result::Result::Ok(request);
|
1008 + | } else {
|
1009 + | let mut request = protocol
|
1010 + | .serialize_request(&input, InvokeWithResponseStream::INPUT_SCHEMA, "", _cfg)
|
1011 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
1012 + |
|
1013 + | return ::std::result::Result::Ok(request);
|
233 1014 | }
|
234 - | #[allow(clippy::unnecessary_wraps)]
|
235 - | fn update_http_builder(
|
236 - | input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
|
237 - | builder: ::http_1x::request::Builder,
|
238 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
239 - | let mut uri = ::std::string::String::new();
|
240 - | uri_base(input, &mut uri)?;
|
241 - | uri_query(input, &mut uri)?;
|
242 - | let builder = crate::protocol_serde::shape_invoke_with_response_stream::ser_invoke_with_response_stream_headers(input, builder)?;
|
243 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
244 - | }
|
245 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
246 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/octet-stream");
|
247 - | builder
|
248 - | };
|
249 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_invoke_with_response_stream_input::ser_payload_http_payload(
|
250 - | input.payload,
|
251 - | )?);
|
252 - | if let Some(content_length) = body.content_length() {
|
253 - | let content_length = content_length.to_string();
|
254 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
255 - | }
|
256 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
257 1015 | }
|
258 1016 | }
|
259 1017 | #[derive(Debug)]
|
260 1018 | struct InvokeWithResponseStreamEndpointParamsInterceptor;
|
261 1019 |
|
262 1020 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeWithResponseStreamEndpointParamsInterceptor {
|
263 1021 | fn name(&self) -> &'static str {
|
264 1022 | "InvokeWithResponseStreamEndpointParamsInterceptor"
|
265 1023 | }
|
266 1024 |
|