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