1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct InvokeAsync;
6impl InvokeAsync {
7 pub fn new() -> Self {
9 Self
10 }
11 pub(crate) async fn orchestrate(
12 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13 input: crate::operation::invoke_async::InvokeAsyncInput,
14 ) -> ::std::result::Result<
15 crate::operation::invoke_async::InvokeAsyncOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::invoke_async::InvokeAsyncError,
18 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19 >,
20 > {
21 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22 ::aws_smithy_runtime_api::client::interceptors::context::Error,
23 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24 >| {
25 err.map_service_error(|err| {
26 err.downcast::<crate::operation::invoke_async::InvokeAsyncError>()
27 .expect("correct error type")
28 })
29 };
30 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31 .await
32 .map_err(map_err)?;
33 let output = context.finalize().map_err(map_err)?;
34 ::std::result::Result::Ok(
35 output
36 .downcast::<crate::operation::invoke_async::InvokeAsyncOutput>()
37 .expect("correct output type"),
38 )
39 }
40
41 pub(crate) async fn orchestrate_with_stop_point(
42 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43 input: crate::operation::invoke_async::InvokeAsyncInput,
44 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45 ) -> ::std::result::Result<
46 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47 ::aws_smithy_runtime_api::client::result::SdkError<
48 ::aws_smithy_runtime_api::client::interceptors::context::Error,
49 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50 >,
51 > {
52 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53 use ::tracing::Instrument;
54 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Lambda", "InvokeAsync", input, runtime_plugins, stop_point)
55 .instrument(::tracing::debug_span!(
58 "Lambda.InvokeAsync",
59 "rpc.service" = "Lambda",
60 "rpc.method" = "InvokeAsync",
61 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62 "rpc.system" = "aws-api",
63 ))
64 .await
65 }
66
67 pub(crate) fn operation_runtime_plugins(
68 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69 client_config: &crate::config::Config,
70 config_override: ::std::option::Option<crate::config::Builder>,
71 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74 if let ::std::option::Option::Some(config_override) = config_override {
75 for plugin in config_override.runtime_plugins.iter().cloned() {
76 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77 }
78 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79 config_override,
80 client_config.config.clone(),
81 &client_config.runtime_components,
82 ));
83 }
84 runtime_plugins
85 }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for InvokeAsync {
88 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("InvokeAsync");
90
91 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92 InvokeAsyncRequestSerializer,
93 ));
94 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95 InvokeAsyncResponseDeserializer,
96 ));
97
98 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99 crate::config::auth::Params::builder()
100 .operation_name("InvokeAsync")
101 .build()
102 .expect("required fields set"),
103 ));
104
105 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("InvokeAsync", "Lambda"));
106 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
107 signing_options.double_uri_encode = true;
108 signing_options.content_sha256_header = false;
109 signing_options.normalize_uri_path = true;
110 signing_options.payload_override = None;
111
112 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
113 signing_options,
114 ..::std::default::Default::default()
115 });
116
117 ::std::option::Option::Some(cfg.freeze())
118 }
119
120 fn runtime_components(
121 &self,
122 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
123 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
124 #[allow(unused_mut)]
125 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("InvokeAsync")
126 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
127 InvokeAsyncTelemetryInputCaptureInterceptor,
128 ))
129 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
130 InvokeAsyncEndpointParamsInterceptor,
131 ))
132 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
133 crate::operation::invoke_async::InvokeAsyncError,
134 >::new())
135 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
136 crate::operation::invoke_async::InvokeAsyncError,
137 >::new())
138 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
139 crate::operation::invoke_async::InvokeAsyncError,
140 >::new());
141
142 ::std::borrow::Cow::Owned(rcb)
143 }
144}
145
146#[derive(Debug)]
147struct InvokeAsyncTelemetryInputCaptureInterceptor;
148
149#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
150impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeAsyncTelemetryInputCaptureInterceptor {
151 fn name(&self) -> &'static str {
152 "InvokeAsyncTelemetryInputCaptureInterceptor"
153 }
154
155 fn read_before_execution(
156 &self,
157 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
158 '_,
159 ::aws_smithy_runtime_api::client::interceptors::context::Input,
160 ::aws_smithy_runtime_api::client::interceptors::context::Output,
161 ::aws_smithy_runtime_api::client::interceptors::context::Error,
162 >,
163 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
164 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
165 let ::std::option::Option::Some(requested) = cfg
167 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
168 .filter(|r| !r.is_empty())
169 else {
170 return ::std::result::Result::Ok(());
171 };
172
173 let ::std::option::Option::Some(input) = context.input().downcast_ref::<InvokeAsyncInput>() else {
174 return ::std::result::Result::Ok(());
176 };
177
178 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
179 if requested.should_capture("FunctionName") {
180 if let ::std::option::Option::Some(value) = input.function_name.as_deref() {
181 captured.insert("FunctionName", value);
182 }
183 }
184
185 cfg.interceptor_state().store_put(captured);
186 ::std::result::Result::Ok(())
187 }
188}
189#[derive(Debug)]
190struct InvokeAsyncResponseDeserializer;
191impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InvokeAsyncResponseDeserializer {
192 fn deserialize_nonstreaming_with_config(
193 &self,
194 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
195 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
196 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
197 let (success, status) = (response.status().is_success(), response.status().as_u16());
198 let headers = response.headers();
199 let body = response.body().bytes().expect("body loaded");
200 #[allow(unused_mut)]
201 let mut force_error = false;
202 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
203 let parse_result = if !success && status != 202 || force_error {
204 crate::protocol_serde::shape_invoke_async::de_invoke_async_http_error(status, headers, body)
205 } else {
206 crate::protocol_serde::shape_invoke_async::de_invoke_async_http_response(status, headers, body)
207 };
208 crate::protocol_serde::type_erase_result(parse_result)
209 }
210}
211#[derive(Debug)]
212struct InvokeAsyncRequestSerializer;
213impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InvokeAsyncRequestSerializer {
214 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
215 fn serialize_input(
216 &self,
217 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
218 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
219 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
220 let input = input
221 .downcast::<crate::operation::invoke_async::InvokeAsyncInput>()
222 .expect("correct type");
223 let _header_serialization_settings = _cfg
224 .load::<crate::serialization_settings::HeaderSerializationSettings>()
225 .cloned()
226 .unwrap_or_default();
227 let mut request_builder = {
228 #[allow(clippy::uninlined_format_args)]
229 fn uri_base(
230 _input: &crate::operation::invoke_async::InvokeAsyncInput,
231 output: &mut ::std::string::String,
232 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
233 use ::std::fmt::Write as _;
234 let input_1 = &_input.function_name;
235 let input_1 = input_1
236 .as_ref()
237 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
238 let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
239 if function_name.is_empty() {
240 return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
241 "function_name",
242 "cannot be empty or unset",
243 ));
244 }
245 ::std::write!(output, "/2014-11-13/functions/{FunctionName}/invoke-async", FunctionName = function_name)
246 .expect("formatting should succeed");
247 ::std::result::Result::Ok(())
248 }
249 #[allow(clippy::unnecessary_wraps)]
250 fn update_http_builder(
251 input: &crate::operation::invoke_async::InvokeAsyncInput,
252 builder: ::http_1x::request::Builder,
253 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
254 let mut uri = ::std::string::String::new();
255 uri_base(input, &mut uri)?;
256 ::std::result::Result::Ok(builder.method("POST").uri(uri))
257 }
258 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
259 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/octet-stream");
260 builder
261 };
262 let body = crate::protocol_serde::shape_invoke_async_input::ser_invoke_args_http_payload(input.invoke_args)?.into_inner();
263 if let Some(content_length) = body.content_length() {
264 let content_length = content_length.to_string();
265 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
266 }
267 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
268 }
269}
270#[derive(Debug)]
271struct InvokeAsyncEndpointParamsInterceptor;
272
273#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
274impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeAsyncEndpointParamsInterceptor {
275 fn name(&self) -> &'static str {
276 "InvokeAsyncEndpointParamsInterceptor"
277 }
278
279 fn read_before_execution(
280 &self,
281 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
282 '_,
283 ::aws_smithy_runtime_api::client::interceptors::context::Input,
284 ::aws_smithy_runtime_api::client::interceptors::context::Output,
285 ::aws_smithy_runtime_api::client::interceptors::context::Error,
286 >,
287 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
288 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
289 let _input = context
290 .input()
291 .downcast_ref::<InvokeAsyncInput>()
292 .ok_or("failed to downcast to InvokeAsyncInput")?;
293
294 let params = crate::config::endpoint::Params::builder()
295 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
296 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
297 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
298 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
299 .build()
300 .map_err(|err| {
301 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
302 })?;
303 cfg.interceptor_state()
304 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
305 ::std::result::Result::Ok(())
306 }
307}
308
309#[non_exhaustive]
314#[derive(::std::fmt::Debug)]
315pub enum InvokeAsyncError {
316 Ec2AccessDeniedException(crate::types::error::Ec2AccessDeniedException),
318 Ec2ThrottledException(crate::types::error::Ec2ThrottledException),
320 Ec2UnexpectedException(crate::types::error::Ec2UnexpectedException),
322 EfsioException(crate::types::error::EfsioException),
324 EfsMountConnectivityException(crate::types::error::EfsMountConnectivityException),
326 EfsMountFailureException(crate::types::error::EfsMountFailureException),
328 EfsMountTimeoutException(crate::types::error::EfsMountTimeoutException),
330 EniLimitReachedException(crate::types::error::EniLimitReachedException),
332 InvalidRequestContentException(crate::types::error::InvalidRequestContentException),
334 InvalidRuntimeException(crate::types::error::InvalidRuntimeException),
336 InvalidSecurityGroupIdException(crate::types::error::InvalidSecurityGroupIdException),
338 InvalidSubnetIdException(crate::types::error::InvalidSubnetIdException),
340 KmsAccessDeniedException(crate::types::error::KmsAccessDeniedException),
342 KmsDisabledException(crate::types::error::KmsDisabledException),
344 KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
346 KmsNotFoundException(crate::types::error::KmsNotFoundException),
348 ModeNotSupportedException(crate::types::error::ModeNotSupportedException),
350 ResourceConflictException(crate::types::error::ResourceConflictException),
352 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
354 S3FilesMountConnectivityException(crate::types::error::S3FilesMountConnectivityException),
356 S3FilesMountFailureException(crate::types::error::S3FilesMountFailureException),
358 S3FilesMountTimeoutException(crate::types::error::S3FilesMountTimeoutException),
360 ServiceException(crate::types::error::ServiceException),
362 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
364 SnapStartException(crate::types::error::SnapStartException),
366 SnapStartNotReadyException(crate::types::error::SnapStartNotReadyException),
368 SnapStartRegenerationFailureException(crate::types::error::SnapStartRegenerationFailureException),
370 SnapStartTimeoutException(crate::types::error::SnapStartTimeoutException),
372 SubnetIpAddressLimitReachedException(crate::types::error::SubnetIpAddressLimitReachedException),
374 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
376 variable wildcard pattern and check `.code()`:
377 \
378 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
379 \
380 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeAsyncError) for what information is available for the error.")]
381 Unhandled(crate::error::sealed_unhandled::Unhandled),
382}
383impl InvokeAsyncError {
384 pub fn unhandled(
386 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
387 ) -> Self {
388 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
389 source: err.into(),
390 meta: ::std::default::Default::default(),
391 })
392 }
393
394 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
396 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
397 source: err.clone().into(),
398 meta: err,
399 })
400 }
401 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
406 match self {
407 Self::Ec2AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
408 Self::Ec2ThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
409 Self::Ec2UnexpectedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
410 Self::EfsioException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
411 Self::EfsMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
412 Self::EfsMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
413 Self::EfsMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
414 Self::EniLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
415 Self::InvalidRequestContentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
416 Self::InvalidRuntimeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417 Self::InvalidSecurityGroupIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418 Self::InvalidSubnetIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419 Self::KmsAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420 Self::KmsDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
421 Self::KmsInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
422 Self::KmsNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423 Self::ModeNotSupportedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424 Self::ResourceConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426 Self::S3FilesMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427 Self::S3FilesMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
428 Self::S3FilesMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
429 Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
430 Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
431 Self::SnapStartException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
432 Self::SnapStartNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
433 Self::SnapStartRegenerationFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
434 Self::SnapStartTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
435 Self::SubnetIpAddressLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436 Self::Unhandled(e) => &e.meta,
437 }
438 }
439 pub fn is_ec2_access_denied_exception(&self) -> bool {
441 matches!(self, Self::Ec2AccessDeniedException(_))
442 }
443 pub fn is_ec2_throttled_exception(&self) -> bool {
445 matches!(self, Self::Ec2ThrottledException(_))
446 }
447 pub fn is_ec2_unexpected_exception(&self) -> bool {
449 matches!(self, Self::Ec2UnexpectedException(_))
450 }
451 pub fn is_efsio_exception(&self) -> bool {
453 matches!(self, Self::EfsioException(_))
454 }
455 pub fn is_efs_mount_connectivity_exception(&self) -> bool {
457 matches!(self, Self::EfsMountConnectivityException(_))
458 }
459 pub fn is_efs_mount_failure_exception(&self) -> bool {
461 matches!(self, Self::EfsMountFailureException(_))
462 }
463 pub fn is_efs_mount_timeout_exception(&self) -> bool {
465 matches!(self, Self::EfsMountTimeoutException(_))
466 }
467 pub fn is_eni_limit_reached_exception(&self) -> bool {
469 matches!(self, Self::EniLimitReachedException(_))
470 }
471 pub fn is_invalid_request_content_exception(&self) -> bool {
473 matches!(self, Self::InvalidRequestContentException(_))
474 }
475 pub fn is_invalid_runtime_exception(&self) -> bool {
477 matches!(self, Self::InvalidRuntimeException(_))
478 }
479 pub fn is_invalid_security_group_id_exception(&self) -> bool {
481 matches!(self, Self::InvalidSecurityGroupIdException(_))
482 }
483 pub fn is_invalid_subnet_id_exception(&self) -> bool {
485 matches!(self, Self::InvalidSubnetIdException(_))
486 }
487 pub fn is_kms_access_denied_exception(&self) -> bool {
489 matches!(self, Self::KmsAccessDeniedException(_))
490 }
491 pub fn is_kms_disabled_exception(&self) -> bool {
493 matches!(self, Self::KmsDisabledException(_))
494 }
495 pub fn is_kms_invalid_state_exception(&self) -> bool {
497 matches!(self, Self::KmsInvalidStateException(_))
498 }
499 pub fn is_kms_not_found_exception(&self) -> bool {
501 matches!(self, Self::KmsNotFoundException(_))
502 }
503 pub fn is_mode_not_supported_exception(&self) -> bool {
505 matches!(self, Self::ModeNotSupportedException(_))
506 }
507 pub fn is_resource_conflict_exception(&self) -> bool {
509 matches!(self, Self::ResourceConflictException(_))
510 }
511 pub fn is_resource_not_found_exception(&self) -> bool {
513 matches!(self, Self::ResourceNotFoundException(_))
514 }
515 pub fn is_s3_files_mount_connectivity_exception(&self) -> bool {
517 matches!(self, Self::S3FilesMountConnectivityException(_))
518 }
519 pub fn is_s3_files_mount_failure_exception(&self) -> bool {
521 matches!(self, Self::S3FilesMountFailureException(_))
522 }
523 pub fn is_s3_files_mount_timeout_exception(&self) -> bool {
525 matches!(self, Self::S3FilesMountTimeoutException(_))
526 }
527 pub fn is_service_exception(&self) -> bool {
529 matches!(self, Self::ServiceException(_))
530 }
531 pub fn is_service_quota_exceeded_exception(&self) -> bool {
533 matches!(self, Self::ServiceQuotaExceededException(_))
534 }
535 pub fn is_snap_start_exception(&self) -> bool {
537 matches!(self, Self::SnapStartException(_))
538 }
539 pub fn is_snap_start_not_ready_exception(&self) -> bool {
541 matches!(self, Self::SnapStartNotReadyException(_))
542 }
543 pub fn is_snap_start_regeneration_failure_exception(&self) -> bool {
545 matches!(self, Self::SnapStartRegenerationFailureException(_))
546 }
547 pub fn is_snap_start_timeout_exception(&self) -> bool {
549 matches!(self, Self::SnapStartTimeoutException(_))
550 }
551 pub fn is_subnet_ip_address_limit_reached_exception(&self) -> bool {
553 matches!(self, Self::SubnetIpAddressLimitReachedException(_))
554 }
555}
556impl ::std::error::Error for InvokeAsyncError {
557 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
558 match self {
559 Self::Ec2AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
560 Self::Ec2ThrottledException(_inner) => ::std::option::Option::Some(_inner),
561 Self::Ec2UnexpectedException(_inner) => ::std::option::Option::Some(_inner),
562 Self::EfsioException(_inner) => ::std::option::Option::Some(_inner),
563 Self::EfsMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
564 Self::EfsMountFailureException(_inner) => ::std::option::Option::Some(_inner),
565 Self::EfsMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
566 Self::EniLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
567 Self::InvalidRequestContentException(_inner) => ::std::option::Option::Some(_inner),
568 Self::InvalidRuntimeException(_inner) => ::std::option::Option::Some(_inner),
569 Self::InvalidSecurityGroupIdException(_inner) => ::std::option::Option::Some(_inner),
570 Self::InvalidSubnetIdException(_inner) => ::std::option::Option::Some(_inner),
571 Self::KmsAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
572 Self::KmsDisabledException(_inner) => ::std::option::Option::Some(_inner),
573 Self::KmsInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
574 Self::KmsNotFoundException(_inner) => ::std::option::Option::Some(_inner),
575 Self::ModeNotSupportedException(_inner) => ::std::option::Option::Some(_inner),
576 Self::ResourceConflictException(_inner) => ::std::option::Option::Some(_inner),
577 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
578 Self::S3FilesMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
579 Self::S3FilesMountFailureException(_inner) => ::std::option::Option::Some(_inner),
580 Self::S3FilesMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
581 Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
582 Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
583 Self::SnapStartException(_inner) => ::std::option::Option::Some(_inner),
584 Self::SnapStartNotReadyException(_inner) => ::std::option::Option::Some(_inner),
585 Self::SnapStartRegenerationFailureException(_inner) => ::std::option::Option::Some(_inner),
586 Self::SnapStartTimeoutException(_inner) => ::std::option::Option::Some(_inner),
587 Self::SubnetIpAddressLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
588 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
589 }
590 }
591}
592impl ::std::fmt::Display for InvokeAsyncError {
593 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
594 match self {
595 Self::Ec2AccessDeniedException(_inner) => _inner.fmt(f),
596 Self::Ec2ThrottledException(_inner) => _inner.fmt(f),
597 Self::Ec2UnexpectedException(_inner) => _inner.fmt(f),
598 Self::EfsioException(_inner) => _inner.fmt(f),
599 Self::EfsMountConnectivityException(_inner) => _inner.fmt(f),
600 Self::EfsMountFailureException(_inner) => _inner.fmt(f),
601 Self::EfsMountTimeoutException(_inner) => _inner.fmt(f),
602 Self::EniLimitReachedException(_inner) => _inner.fmt(f),
603 Self::InvalidRequestContentException(_inner) => _inner.fmt(f),
604 Self::InvalidRuntimeException(_inner) => _inner.fmt(f),
605 Self::InvalidSecurityGroupIdException(_inner) => _inner.fmt(f),
606 Self::InvalidSubnetIdException(_inner) => _inner.fmt(f),
607 Self::KmsAccessDeniedException(_inner) => _inner.fmt(f),
608 Self::KmsDisabledException(_inner) => _inner.fmt(f),
609 Self::KmsInvalidStateException(_inner) => _inner.fmt(f),
610 Self::KmsNotFoundException(_inner) => _inner.fmt(f),
611 Self::ModeNotSupportedException(_inner) => _inner.fmt(f),
612 Self::ResourceConflictException(_inner) => _inner.fmt(f),
613 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
614 Self::S3FilesMountConnectivityException(_inner) => _inner.fmt(f),
615 Self::S3FilesMountFailureException(_inner) => _inner.fmt(f),
616 Self::S3FilesMountTimeoutException(_inner) => _inner.fmt(f),
617 Self::ServiceException(_inner) => _inner.fmt(f),
618 Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
619 Self::SnapStartException(_inner) => _inner.fmt(f),
620 Self::SnapStartNotReadyException(_inner) => _inner.fmt(f),
621 Self::SnapStartRegenerationFailureException(_inner) => _inner.fmt(f),
622 Self::SnapStartTimeoutException(_inner) => _inner.fmt(f),
623 Self::SubnetIpAddressLimitReachedException(_inner) => _inner.fmt(f),
624 Self::Unhandled(_inner) => {
625 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
626 write!(f, "unhandled error ({code})")
627 } else {
628 f.write_str("unhandled error")
629 }
630 }
631 }
632 }
633}
634impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeAsyncError {
635 fn code(&self) -> ::std::option::Option<&str> {
636 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
637 }
638 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
639 ::std::option::Option::None
640 }
641}
642impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeAsyncError {
643 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
644 match self {
645 Self::Ec2AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
646 Self::Ec2ThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
647 Self::Ec2UnexpectedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
648 Self::EfsioException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
649 Self::EfsMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
650 Self::EfsMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
651 Self::EfsMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
652 Self::EniLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
653 Self::InvalidRequestContentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
654 Self::InvalidRuntimeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
655 Self::InvalidSecurityGroupIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
656 Self::InvalidSubnetIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
657 Self::KmsAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
658 Self::KmsDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
659 Self::KmsInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
660 Self::KmsNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
661 Self::ModeNotSupportedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
662 Self::ResourceConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
663 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
664 Self::S3FilesMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
665 Self::S3FilesMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
666 Self::S3FilesMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
667 Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
668 Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
669 Self::SnapStartException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
670 Self::SnapStartNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
671 Self::SnapStartRegenerationFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
672 Self::SnapStartTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
673 Self::SubnetIpAddressLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
674 Self::Unhandled(_inner) => &_inner.meta,
675 }
676 }
677}
678impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeAsyncError {
679 fn create_unhandled_error(
680 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
681 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
682 ) -> Self {
683 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
684 source,
685 meta: meta.unwrap_or_default(),
686 })
687 }
688}
689impl ::aws_types::request_id::RequestId for crate::operation::invoke_async::InvokeAsyncError {
690 fn request_id(&self) -> Option<&str> {
691 self.meta().request_id()
692 }
693}
694
695pub use crate::operation::invoke_async::_invoke_async_input::InvokeAsyncInput;
696
697pub use crate::operation::invoke_async::_invoke_async_output::InvokeAsyncOutput;
698
699mod _invoke_async_input;
700
701mod _invoke_async_output;
702
703pub mod builders;