1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct Invoke;
6impl Invoke {
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::InvokeInput,
14 ) -> ::std::result::Result<
15 crate::operation::invoke::InvokeOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::invoke::InvokeError,
18 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19 >,
20 > {
21 let map_err =
22 |err: ::aws_smithy_runtime_api::client::result::SdkError<
23 ::aws_smithy_runtime_api::client::interceptors::context::Error,
24 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25 >| { err.map_service_error(|err| err.downcast::<crate::operation::invoke::InvokeError>().expect("correct error type")) };
26 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
27 .await
28 .map_err(map_err)?;
29 let output = context.finalize().map_err(map_err)?;
30 ::std::result::Result::Ok(output.downcast::<crate::operation::invoke::InvokeOutput>().expect("correct output type"))
31 }
32
33 pub(crate) async fn orchestrate_with_stop_point(
34 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
35 input: crate::operation::invoke::InvokeInput,
36 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
37 ) -> ::std::result::Result<
38 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
39 ::aws_smithy_runtime_api::client::result::SdkError<
40 ::aws_smithy_runtime_api::client::interceptors::context::Error,
41 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
42 >,
43 > {
44 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
45 use ::tracing::Instrument;
46 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Lambda", "Invoke", input, runtime_plugins, stop_point)
47 .instrument(::tracing::debug_span!(
50 "Lambda.Invoke",
51 "rpc.service" = "Lambda",
52 "rpc.method" = "Invoke",
53 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
54 "rpc.system" = "aws-api",
55 ))
56 .await
57 }
58
59 pub(crate) fn operation_runtime_plugins(
60 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
61 client_config: &crate::config::Config,
62 config_override: ::std::option::Option<crate::config::Builder>,
63 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
64 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
65
66 if let ::std::option::Option::Some(config_override) = config_override {
67 for plugin in config_override.runtime_plugins.iter().cloned() {
68 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
69 }
70 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
71 config_override,
72 client_config.config.clone(),
73 &client_config.runtime_components,
74 ));
75 }
76 runtime_plugins
77 }
78}
79impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Invoke {
80 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
81 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Invoke");
82
83 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
84 InvokeRequestSerializer,
85 ));
86 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
87 InvokeResponseDeserializer,
88 ));
89
90 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
91 crate::config::auth::Params::builder()
92 .operation_name("Invoke")
93 .build()
94 .expect("required fields set"),
95 ));
96
97 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
98 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("Invoke", "Lambda"));
99 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
100 signing_options.double_uri_encode = true;
101 signing_options.content_sha256_header = false;
102 signing_options.normalize_uri_path = true;
103 signing_options.payload_override = None;
104
105 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
106 signing_options,
107 ..::std::default::Default::default()
108 });
109
110 ::std::option::Option::Some(cfg.freeze())
111 }
112
113 fn runtime_components(
114 &self,
115 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
116 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
117 #[allow(unused_mut)]
118 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("Invoke")
119 .with_interceptor(InvokeEndpointParamsInterceptor)
120 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
121 crate::operation::invoke::InvokeError,
122 >::new())
123 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
124 crate::operation::invoke::InvokeError,
125 >::new())
126 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
127 crate::operation::invoke::InvokeError,
128 >::new());
129
130 ::std::borrow::Cow::Owned(rcb)
131 }
132}
133
134#[derive(Debug)]
135struct InvokeResponseDeserializer;
136impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InvokeResponseDeserializer {
137 fn deserialize_nonstreaming(
138 &self,
139 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
140 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
141 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 #[allow(unused_mut)]
145 let mut force_error = false;
146 ::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)
151 };
152 crate::protocol_serde::type_erase_result(parse_result)
153 }
154}
155#[derive(Debug)]
156struct InvokeRequestSerializer;
157impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InvokeRequestSerializer {
158 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
159 fn serialize_input(
160 &self,
161 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
162 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
163 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
164 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 ));
186 }
187 ::std::write!(output, "/2015-03-31/functions/{FunctionName}/invocations", FunctionName = function_name)
188 .expect("formatting should succeed");
189 ::std::result::Result::Ok(())
190 }
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 {
198 query.push_kv("Qualifier", &::aws_smithy_http::query::fmt_string(inner_2));
199 }
200 }
201 ::std::result::Result::Ok(())
202 }
203 #[allow(clippy::unnecessary_wraps)]
204 fn update_http_builder(
205 input: &crate::operation::invoke::InvokeInput,
206 builder: ::http::request::Builder,
207 ) -> ::std::result::Result<::http::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::request::Builder::new())?;
215 builder = _header_serialization_settings.set_default_header(builder, ::http::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::header::CONTENT_LENGTH, &content_length);
222 }
223 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
224 }
225}
226#[derive(Debug)]
227struct InvokeEndpointParamsInterceptor;
228
229impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeEndpointParamsInterceptor {
230 fn name(&self) -> &'static str {
231 "InvokeEndpointParamsInterceptor"
232 }
233
234 fn read_before_execution(
235 &self,
236 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
237 '_,
238 ::aws_smithy_runtime_api::client::interceptors::context::Input,
239 ::aws_smithy_runtime_api::client::interceptors::context::Output,
240 ::aws_smithy_runtime_api::client::interceptors::context::Error,
241 >,
242 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
243 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
244 let _input = context.input().downcast_ref::<InvokeInput>().ok_or("failed to downcast to InvokeInput")?;
245
246 let params = crate::config::endpoint::Params::builder()
247 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
248 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
249 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
250 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
251 .build()
252 .map_err(|err| {
253 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
254 })?;
255 cfg.interceptor_state()
256 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
257 ::std::result::Result::Ok(())
258 }
259}
260
261#[non_exhaustive]
266#[derive(::std::fmt::Debug)]
267pub enum InvokeError {
268 DurableExecutionAlreadyStartedException(crate::types::error::DurableExecutionAlreadyStartedException),
270 Ec2AccessDeniedException(crate::types::error::Ec2AccessDeniedException),
272 Ec2ThrottledException(crate::types::error::Ec2ThrottledException),
274 Ec2UnexpectedException(crate::types::error::Ec2UnexpectedException),
276 EfsioException(crate::types::error::EfsioException),
278 EfsMountConnectivityException(crate::types::error::EfsMountConnectivityException),
280 EfsMountFailureException(crate::types::error::EfsMountFailureException),
282 EfsMountTimeoutException(crate::types::error::EfsMountTimeoutException),
284 EniLimitReachedException(crate::types::error::EniLimitReachedException),
286 InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
288 InvalidRequestContentException(crate::types::error::InvalidRequestContentException),
290 InvalidRuntimeException(crate::types::error::InvalidRuntimeException),
292 InvalidSecurityGroupIdException(crate::types::error::InvalidSecurityGroupIdException),
294 InvalidSubnetIdException(crate::types::error::InvalidSubnetIdException),
296 InvalidZipFileException(crate::types::error::InvalidZipFileException),
298 KmsAccessDeniedException(crate::types::error::KmsAccessDeniedException),
300 KmsDisabledException(crate::types::error::KmsDisabledException),
302 KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
304 KmsNotFoundException(crate::types::error::KmsNotFoundException),
306 NoPublishedVersionException(crate::types::error::NoPublishedVersionException),
308 RecursiveInvocationException(crate::types::error::RecursiveInvocationException),
310 RequestTooLargeException(crate::types::error::RequestTooLargeException),
312 ResourceConflictException(crate::types::error::ResourceConflictException),
314 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
316 ResourceNotReadyException(crate::types::error::ResourceNotReadyException),
318 SerializedRequestEntityTooLargeException(crate::types::error::SerializedRequestEntityTooLargeException),
320 ServiceException(crate::types::error::ServiceException),
322 SnapStartException(crate::types::error::SnapStartException),
324 SnapStartNotReadyException(crate::types::error::SnapStartNotReadyException),
326 SnapStartTimeoutException(crate::types::error::SnapStartTimeoutException),
328 SubnetIpAddressLimitReachedException(crate::types::error::SubnetIpAddressLimitReachedException),
330 TooManyRequestsException(crate::types::error::TooManyRequestsException),
332 UnsupportedMediaTypeException(crate::types::error::UnsupportedMediaTypeException),
334 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
336 variable wildcard pattern and check `.code()`:
337 \
338 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
339 \
340 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeError) for what information is available for the error.")]
341 Unhandled(crate::error::sealed_unhandled::Unhandled),
342}
343impl InvokeError {
344 pub fn unhandled(
346 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
347 ) -> Self {
348 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
349 source: err.into(),
350 meta: ::std::default::Default::default(),
351 })
352 }
353
354 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
356 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
357 source: err.clone().into(),
358 meta: err,
359 })
360 }
361 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
366 match self {
367 Self::DurableExecutionAlreadyStartedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
368 Self::Ec2AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
369 Self::Ec2ThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
370 Self::Ec2UnexpectedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
371 Self::EfsioException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
372 Self::EfsMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
373 Self::EfsMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
374 Self::EfsMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
375 Self::EniLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
376 Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
377 Self::InvalidRequestContentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
378 Self::InvalidRuntimeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
379 Self::InvalidSecurityGroupIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
380 Self::InvalidSubnetIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
381 Self::InvalidZipFileException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
382 Self::KmsAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
383 Self::KmsDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
384 Self::KmsInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
385 Self::KmsNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
386 Self::NoPublishedVersionException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
387 Self::RecursiveInvocationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
388 Self::RequestTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
389 Self::ResourceConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
390 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
391 Self::ResourceNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
392 Self::SerializedRequestEntityTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
393 Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
394 Self::SnapStartException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
395 Self::SnapStartNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
396 Self::SnapStartTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
397 Self::SubnetIpAddressLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
398 Self::TooManyRequestsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
399 Self::UnsupportedMediaTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
400 Self::Unhandled(e) => &e.meta,
401 }
402 }
403 pub fn is_durable_execution_already_started_exception(&self) -> bool {
405 matches!(self, Self::DurableExecutionAlreadyStartedException(_))
406 }
407 pub fn is_ec2_access_denied_exception(&self) -> bool {
409 matches!(self, Self::Ec2AccessDeniedException(_))
410 }
411 pub fn is_ec2_throttled_exception(&self) -> bool {
413 matches!(self, Self::Ec2ThrottledException(_))
414 }
415 pub fn is_ec2_unexpected_exception(&self) -> bool {
417 matches!(self, Self::Ec2UnexpectedException(_))
418 }
419 pub fn is_efsio_exception(&self) -> bool {
421 matches!(self, Self::EfsioException(_))
422 }
423 pub fn is_efs_mount_connectivity_exception(&self) -> bool {
425 matches!(self, Self::EfsMountConnectivityException(_))
426 }
427 pub fn is_efs_mount_failure_exception(&self) -> bool {
429 matches!(self, Self::EfsMountFailureException(_))
430 }
431 pub fn is_efs_mount_timeout_exception(&self) -> bool {
433 matches!(self, Self::EfsMountTimeoutException(_))
434 }
435 pub fn is_eni_limit_reached_exception(&self) -> bool {
437 matches!(self, Self::EniLimitReachedException(_))
438 }
439 pub fn is_invalid_parameter_value_exception(&self) -> bool {
441 matches!(self, Self::InvalidParameterValueException(_))
442 }
443 pub fn is_invalid_request_content_exception(&self) -> bool {
445 matches!(self, Self::InvalidRequestContentException(_))
446 }
447 pub fn is_invalid_runtime_exception(&self) -> bool {
449 matches!(self, Self::InvalidRuntimeException(_))
450 }
451 pub fn is_invalid_security_group_id_exception(&self) -> bool {
453 matches!(self, Self::InvalidSecurityGroupIdException(_))
454 }
455 pub fn is_invalid_subnet_id_exception(&self) -> bool {
457 matches!(self, Self::InvalidSubnetIdException(_))
458 }
459 pub fn is_invalid_zip_file_exception(&self) -> bool {
461 matches!(self, Self::InvalidZipFileException(_))
462 }
463 pub fn is_kms_access_denied_exception(&self) -> bool {
465 matches!(self, Self::KmsAccessDeniedException(_))
466 }
467 pub fn is_kms_disabled_exception(&self) -> bool {
469 matches!(self, Self::KmsDisabledException(_))
470 }
471 pub fn is_kms_invalid_state_exception(&self) -> bool {
473 matches!(self, Self::KmsInvalidStateException(_))
474 }
475 pub fn is_kms_not_found_exception(&self) -> bool {
477 matches!(self, Self::KmsNotFoundException(_))
478 }
479 pub fn is_no_published_version_exception(&self) -> bool {
481 matches!(self, Self::NoPublishedVersionException(_))
482 }
483 pub fn is_recursive_invocation_exception(&self) -> bool {
485 matches!(self, Self::RecursiveInvocationException(_))
486 }
487 pub fn is_request_too_large_exception(&self) -> bool {
489 matches!(self, Self::RequestTooLargeException(_))
490 }
491 pub fn is_resource_conflict_exception(&self) -> bool {
493 matches!(self, Self::ResourceConflictException(_))
494 }
495 pub fn is_resource_not_found_exception(&self) -> bool {
497 matches!(self, Self::ResourceNotFoundException(_))
498 }
499 pub fn is_resource_not_ready_exception(&self) -> bool {
501 matches!(self, Self::ResourceNotReadyException(_))
502 }
503 pub fn is_serialized_request_entity_too_large_exception(&self) -> bool {
505 matches!(self, Self::SerializedRequestEntityTooLargeException(_))
506 }
507 pub fn is_service_exception(&self) -> bool {
509 matches!(self, Self::ServiceException(_))
510 }
511 pub fn is_snap_start_exception(&self) -> bool {
513 matches!(self, Self::SnapStartException(_))
514 }
515 pub fn is_snap_start_not_ready_exception(&self) -> bool {
517 matches!(self, Self::SnapStartNotReadyException(_))
518 }
519 pub fn is_snap_start_timeout_exception(&self) -> bool {
521 matches!(self, Self::SnapStartTimeoutException(_))
522 }
523 pub fn is_subnet_ip_address_limit_reached_exception(&self) -> bool {
525 matches!(self, Self::SubnetIpAddressLimitReachedException(_))
526 }
527 pub fn is_too_many_requests_exception(&self) -> bool {
529 matches!(self, Self::TooManyRequestsException(_))
530 }
531 pub fn is_unsupported_media_type_exception(&self) -> bool {
533 matches!(self, Self::UnsupportedMediaTypeException(_))
534 }
535}
536impl ::std::error::Error for InvokeError {
537 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
538 match self {
539 Self::DurableExecutionAlreadyStartedException(_inner) => ::std::option::Option::Some(_inner),
540 Self::Ec2AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
541 Self::Ec2ThrottledException(_inner) => ::std::option::Option::Some(_inner),
542 Self::Ec2UnexpectedException(_inner) => ::std::option::Option::Some(_inner),
543 Self::EfsioException(_inner) => ::std::option::Option::Some(_inner),
544 Self::EfsMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
545 Self::EfsMountFailureException(_inner) => ::std::option::Option::Some(_inner),
546 Self::EfsMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
547 Self::EniLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
548 Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner),
549 Self::InvalidRequestContentException(_inner) => ::std::option::Option::Some(_inner),
550 Self::InvalidRuntimeException(_inner) => ::std::option::Option::Some(_inner),
551 Self::InvalidSecurityGroupIdException(_inner) => ::std::option::Option::Some(_inner),
552 Self::InvalidSubnetIdException(_inner) => ::std::option::Option::Some(_inner),
553 Self::InvalidZipFileException(_inner) => ::std::option::Option::Some(_inner),
554 Self::KmsAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
555 Self::KmsDisabledException(_inner) => ::std::option::Option::Some(_inner),
556 Self::KmsInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
557 Self::KmsNotFoundException(_inner) => ::std::option::Option::Some(_inner),
558 Self::NoPublishedVersionException(_inner) => ::std::option::Option::Some(_inner),
559 Self::RecursiveInvocationException(_inner) => ::std::option::Option::Some(_inner),
560 Self::RequestTooLargeException(_inner) => ::std::option::Option::Some(_inner),
561 Self::ResourceConflictException(_inner) => ::std::option::Option::Some(_inner),
562 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
563 Self::ResourceNotReadyException(_inner) => ::std::option::Option::Some(_inner),
564 Self::SerializedRequestEntityTooLargeException(_inner) => ::std::option::Option::Some(_inner),
565 Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
566 Self::SnapStartException(_inner) => ::std::option::Option::Some(_inner),
567 Self::SnapStartNotReadyException(_inner) => ::std::option::Option::Some(_inner),
568 Self::SnapStartTimeoutException(_inner) => ::std::option::Option::Some(_inner),
569 Self::SubnetIpAddressLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
570 Self::TooManyRequestsException(_inner) => ::std::option::Option::Some(_inner),
571 Self::UnsupportedMediaTypeException(_inner) => ::std::option::Option::Some(_inner),
572 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
573 }
574 }
575}
576impl ::std::fmt::Display for InvokeError {
577 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
578 match self {
579 Self::DurableExecutionAlreadyStartedException(_inner) => _inner.fmt(f),
580 Self::Ec2AccessDeniedException(_inner) => _inner.fmt(f),
581 Self::Ec2ThrottledException(_inner) => _inner.fmt(f),
582 Self::Ec2UnexpectedException(_inner) => _inner.fmt(f),
583 Self::EfsioException(_inner) => _inner.fmt(f),
584 Self::EfsMountConnectivityException(_inner) => _inner.fmt(f),
585 Self::EfsMountFailureException(_inner) => _inner.fmt(f),
586 Self::EfsMountTimeoutException(_inner) => _inner.fmt(f),
587 Self::EniLimitReachedException(_inner) => _inner.fmt(f),
588 Self::InvalidParameterValueException(_inner) => _inner.fmt(f),
589 Self::InvalidRequestContentException(_inner) => _inner.fmt(f),
590 Self::InvalidRuntimeException(_inner) => _inner.fmt(f),
591 Self::InvalidSecurityGroupIdException(_inner) => _inner.fmt(f),
592 Self::InvalidSubnetIdException(_inner) => _inner.fmt(f),
593 Self::InvalidZipFileException(_inner) => _inner.fmt(f),
594 Self::KmsAccessDeniedException(_inner) => _inner.fmt(f),
595 Self::KmsDisabledException(_inner) => _inner.fmt(f),
596 Self::KmsInvalidStateException(_inner) => _inner.fmt(f),
597 Self::KmsNotFoundException(_inner) => _inner.fmt(f),
598 Self::NoPublishedVersionException(_inner) => _inner.fmt(f),
599 Self::RecursiveInvocationException(_inner) => _inner.fmt(f),
600 Self::RequestTooLargeException(_inner) => _inner.fmt(f),
601 Self::ResourceConflictException(_inner) => _inner.fmt(f),
602 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
603 Self::ResourceNotReadyException(_inner) => _inner.fmt(f),
604 Self::SerializedRequestEntityTooLargeException(_inner) => _inner.fmt(f),
605 Self::ServiceException(_inner) => _inner.fmt(f),
606 Self::SnapStartException(_inner) => _inner.fmt(f),
607 Self::SnapStartNotReadyException(_inner) => _inner.fmt(f),
608 Self::SnapStartTimeoutException(_inner) => _inner.fmt(f),
609 Self::SubnetIpAddressLimitReachedException(_inner) => _inner.fmt(f),
610 Self::TooManyRequestsException(_inner) => _inner.fmt(f),
611 Self::UnsupportedMediaTypeException(_inner) => _inner.fmt(f),
612 Self::Unhandled(_inner) => {
613 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
614 write!(f, "unhandled error ({code})")
615 } else {
616 f.write_str("unhandled error")
617 }
618 }
619 }
620 }
621}
622impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeError {
623 fn code(&self) -> ::std::option::Option<&str> {
624 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
625 }
626 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
627 ::std::option::Option::None
628 }
629}
630impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeError {
631 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
632 match self {
633 Self::DurableExecutionAlreadyStartedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
634 Self::Ec2AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
635 Self::Ec2ThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
636 Self::Ec2UnexpectedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
637 Self::EfsioException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
638 Self::EfsMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
639 Self::EfsMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
640 Self::EfsMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
641 Self::EniLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
642 Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
643 Self::InvalidRequestContentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
644 Self::InvalidRuntimeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
645 Self::InvalidSecurityGroupIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
646 Self::InvalidSubnetIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
647 Self::InvalidZipFileException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
648 Self::KmsAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
649 Self::KmsDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
650 Self::KmsInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
651 Self::KmsNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
652 Self::NoPublishedVersionException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
653 Self::RecursiveInvocationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
654 Self::RequestTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
655 Self::ResourceConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
656 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
657 Self::ResourceNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
658 Self::SerializedRequestEntityTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
659 Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
660 Self::SnapStartException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
661 Self::SnapStartNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
662 Self::SnapStartTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
663 Self::SubnetIpAddressLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
664 Self::TooManyRequestsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
665 Self::UnsupportedMediaTypeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
666 Self::Unhandled(_inner) => &_inner.meta,
667 }
668 }
669}
670impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeError {
671 fn create_unhandled_error(
672 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
673 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
674 ) -> Self {
675 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
676 source,
677 meta: meta.unwrap_or_default(),
678 })
679 }
680}
681impl ::aws_types::request_id::RequestId for crate::operation::invoke::InvokeError {
682 fn request_id(&self) -> Option<&str> {
683 self.meta().request_id()
684 }
685}
686
687pub use crate::operation::invoke::_invoke_output::InvokeOutput;
688
689pub use crate::operation::invoke::_invoke_input::InvokeInput;
690
691mod _invoke_input;
692
693mod _invoke_output;
694
695pub mod builders;