aws_sdk_lambda/operation/
invoke.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `Invoke`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct Invoke;
6impl Invoke {
7    /// Creates a new `Invoke`
8    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        use ::tracing::Instrument;
27        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
28            // Create a parent span for the entire operation. Includes a random, internal-only,
29            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
30            .instrument(::tracing::debug_span!(
31                "lambda.Invoke",
32                "rpc.service" = "lambda",
33                "rpc.method" = "Invoke",
34                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
35                "rpc.system" = "aws-api",
36            ))
37            .await
38            .map_err(map_err)?;
39        let output = context.finalize().map_err(map_err)?;
40        ::std::result::Result::Ok(output.downcast::<crate::operation::invoke::InvokeOutput>().expect("correct output type"))
41    }
42
43    pub(crate) async fn orchestrate_with_stop_point(
44        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
45        input: crate::operation::invoke::InvokeInput,
46        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
47    ) -> ::std::result::Result<
48        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
49        ::aws_smithy_runtime_api::client::result::SdkError<
50            ::aws_smithy_runtime_api::client::interceptors::context::Error,
51            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
52        >,
53    > {
54        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
55        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("lambda", "Invoke", input, runtime_plugins, stop_point).await
56    }
57
58    pub(crate) fn operation_runtime_plugins(
59        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
60        client_config: &crate::config::Config,
61        config_override: ::std::option::Option<crate::config::Builder>,
62    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
63        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
64        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
65            ::aws_runtime::auth::sigv4::SCHEME_ID,
66        ]));
67        if let ::std::option::Option::Some(config_override) = config_override {
68            for plugin in config_override.runtime_plugins.iter().cloned() {
69                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
70            }
71            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
72                config_override,
73                client_config.config.clone(),
74                &client_config.runtime_components,
75            ));
76        }
77        runtime_plugins
78    }
79}
80impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Invoke {
81    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
82        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Invoke");
83
84        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
85            InvokeRequestSerializer,
86        ));
87        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
88            InvokeResponseDeserializer,
89        ));
90
91        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
92            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
93        ));
94
95        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
96        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("Invoke", "lambda"));
97        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
98        signing_options.double_uri_encode = true;
99        signing_options.content_sha256_header = false;
100        signing_options.normalize_uri_path = true;
101        signing_options.payload_override = None;
102
103        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
104            signing_options,
105            ..::std::default::Default::default()
106        });
107
108        ::std::option::Option::Some(cfg.freeze())
109    }
110
111    fn runtime_components(
112        &self,
113        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
114    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
115        #[allow(unused_mut)]
116        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("Invoke")
117            .with_interceptor(InvokeEndpointParamsInterceptor)
118            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
119                crate::operation::invoke::InvokeError,
120            >::new())
121            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
122                crate::operation::invoke::InvokeError,
123            >::new())
124            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
125                crate::operation::invoke::InvokeError,
126            >::new());
127
128        ::std::borrow::Cow::Owned(rcb)
129    }
130}
131
132#[derive(Debug)]
133struct InvokeResponseDeserializer;
134impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InvokeResponseDeserializer {
135    fn deserialize_nonstreaming(
136        &self,
137        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
138    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
139        let (success, status) = (response.status().is_success(), response.status().as_u16());
140        let headers = response.headers();
141        let body = response.body().bytes().expect("body loaded");
142        #[allow(unused_mut)]
143        let mut force_error = false;
144        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
145        let parse_result = if !success && status != 200 || force_error {
146            crate::protocol_serde::shape_invoke::de_invoke_http_error(status, headers, body)
147        } else {
148            crate::protocol_serde::shape_invoke::de_invoke_http_response(status, headers, body)
149        };
150        crate::protocol_serde::type_erase_result(parse_result)
151    }
152}
153#[derive(Debug)]
154struct InvokeRequestSerializer;
155impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InvokeRequestSerializer {
156    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
157    fn serialize_input(
158        &self,
159        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
160        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
161    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
162        let input = input.downcast::<crate::operation::invoke::InvokeInput>().expect("correct type");
163        let _header_serialization_settings = _cfg
164            .load::<crate::serialization_settings::HeaderSerializationSettings>()
165            .cloned()
166            .unwrap_or_default();
167        let mut request_builder = {
168            fn uri_base(
169                _input: &crate::operation::invoke::InvokeInput,
170                output: &mut ::std::string::String,
171            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
172                use ::std::fmt::Write as _;
173                let input_1 = &_input.function_name;
174                let input_1 = input_1
175                    .as_ref()
176                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
177                let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
178                if function_name.is_empty() {
179                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
180                        "function_name",
181                        "cannot be empty or unset",
182                    ));
183                }
184                ::std::write!(output, "/2015-03-31/functions/{FunctionName}/invocations", FunctionName = function_name)
185                    .expect("formatting should succeed");
186                ::std::result::Result::Ok(())
187            }
188            fn uri_query(
189                _input: &crate::operation::invoke::InvokeInput,
190                mut output: &mut ::std::string::String,
191            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
192                let mut query = ::aws_smithy_http::query::Writer::new(output);
193                if let ::std::option::Option::Some(inner_2) = &_input.qualifier {
194                    {
195                        query.push_kv("Qualifier", &::aws_smithy_http::query::fmt_string(inner_2));
196                    }
197                }
198                ::std::result::Result::Ok(())
199            }
200            #[allow(clippy::unnecessary_wraps)]
201            fn update_http_builder(
202                input: &crate::operation::invoke::InvokeInput,
203                builder: ::http::request::Builder,
204            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
205                let mut uri = ::std::string::String::new();
206                uri_base(input, &mut uri)?;
207                uri_query(input, &mut uri)?;
208                let builder = crate::protocol_serde::shape_invoke::ser_invoke_headers(input, builder)?;
209                ::std::result::Result::Ok(builder.method("POST").uri(uri))
210            }
211            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
212            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/octet-stream");
213            builder
214        };
215        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_invoke_input::ser_payload_http_payload(input.payload)?);
216        if let Some(content_length) = body.content_length() {
217            let content_length = content_length.to_string();
218            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
219        }
220        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
221    }
222}
223#[derive(Debug)]
224struct InvokeEndpointParamsInterceptor;
225
226impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeEndpointParamsInterceptor {
227    fn name(&self) -> &'static str {
228        "InvokeEndpointParamsInterceptor"
229    }
230
231    fn read_before_execution(
232        &self,
233        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
234            '_,
235            ::aws_smithy_runtime_api::client::interceptors::context::Input,
236            ::aws_smithy_runtime_api::client::interceptors::context::Output,
237            ::aws_smithy_runtime_api::client::interceptors::context::Error,
238        >,
239        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
240    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
241        let _input = context.input().downcast_ref::<InvokeInput>().ok_or("failed to downcast to InvokeInput")?;
242
243        let params = crate::config::endpoint::Params::builder()
244            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
245            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
246            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
247            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
248            .build()
249            .map_err(|err| {
250                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
251            })?;
252        cfg.interceptor_state()
253            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
254        ::std::result::Result::Ok(())
255    }
256}
257
258// The get_* functions below are generated from JMESPath expressions in the
259// operationContextParams trait. They target the operation's input shape.
260
261/// Error type for the `InvokeError` operation.
262#[non_exhaustive]
263#[derive(::std::fmt::Debug)]
264pub enum InvokeError {
265    /// <p>Need additional permissions to configure VPC settings.</p>
266    Ec2AccessDeniedException(crate::types::error::Ec2AccessDeniedException),
267    /// <p>Amazon EC2 throttled Lambda during Lambda function initialization using the execution role provided for the function.</p>
268    Ec2ThrottledException(crate::types::error::Ec2ThrottledException),
269    /// <p>Lambda received an unexpected Amazon EC2 client exception while setting up for the Lambda function.</p>
270    Ec2UnexpectedException(crate::types::error::Ec2UnexpectedException),
271    /// <p>An error occurred when reading from or writing to a connected file system.</p>
272    EfsioException(crate::types::error::EfsioException),
273    /// <p>The Lambda function couldn't make a network connection to the configured file system.</p>
274    EfsMountConnectivityException(crate::types::error::EfsMountConnectivityException),
275    /// <p>The Lambda function couldn't mount the configured file system due to a permission or configuration issue.</p>
276    EfsMountFailureException(crate::types::error::EfsMountFailureException),
277    /// <p>The Lambda function made a network connection to the configured file system, but the mount operation timed out.</p>
278    EfsMountTimeoutException(crate::types::error::EfsMountTimeoutException),
279    /// <p>Lambda couldn't create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda quotas</a>.</p>
280    EniLimitReachedException(crate::types::error::EniLimitReachedException),
281    /// <p>One of the parameters in the request is not valid.</p>
282    InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
283    /// <p>The request body could not be parsed as JSON, or a request header is invalid. For example, the 'x-amzn-RequestId' header is not a valid UUID string.</p>
284    InvalidRequestContentException(crate::types::error::InvalidRequestContentException),
285    /// <p>The runtime or runtime version specified is not supported.</p>
286    InvalidRuntimeException(crate::types::error::InvalidRuntimeException),
287    /// <p>The security group ID provided in the Lambda function VPC configuration is not valid.</p>
288    InvalidSecurityGroupIdException(crate::types::error::InvalidSecurityGroupIdException),
289    /// <p>The subnet ID provided in the Lambda function VPC configuration is not valid.</p>
290    InvalidSubnetIdException(crate::types::error::InvalidSubnetIdException),
291    /// <p>Lambda could not unzip the deployment package.</p>
292    InvalidZipFileException(crate::types::error::InvalidZipFileException),
293    /// <p>Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.</p>
294    KmsAccessDeniedException(crate::types::error::KmsAccessDeniedException),
295    /// <p>Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.</p>
296    KmsDisabledException(crate::types::error::KmsDisabledException),
297    /// <p>Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.</p>
298    KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
299    /// <p>Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.</p>
300    KmsNotFoundException(crate::types::error::KmsNotFoundException),
301    /// <p>Lambda has detected your function being invoked in a recursive loop with other Amazon Web Services resources and stopped your function's invocation.</p>
302    RecursiveInvocationException(crate::types::error::RecursiveInvocationException),
303    /// <p>The request payload exceeded the <code>Invoke</code> request body JSON input quota. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda quotas</a>.</p>
304    RequestTooLargeException(crate::types::error::RequestTooLargeException),
305    /// <p>The resource already exists, or another operation is in progress.</p>
306    ResourceConflictException(crate::types::error::ResourceConflictException),
307    /// <p>The resource specified in the request does not exist.</p>
308    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
309    /// <p>The function is inactive and its VPC connection is no longer available. Wait for the VPC connection to reestablish and try again.</p>
310    ResourceNotReadyException(crate::types::error::ResourceNotReadyException),
311    /// <p>The Lambda service encountered an internal error.</p>
312    ServiceException(crate::types::error::ServiceException),
313    /// <p>The <code>afterRestore()</code> <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-runtime-hooks.html">runtime hook</a> encountered an error. For more information, check the Amazon CloudWatch logs.</p>
314    SnapStartException(crate::types::error::SnapStartException),
315    /// <p>Lambda is initializing your function. You can invoke the function when the <a href="https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html">function state</a> becomes <code>Active</code>.</p>
316    SnapStartNotReadyException(crate::types::error::SnapStartNotReadyException),
317    /// <p>Lambda couldn't restore the snapshot within the timeout limit.</p>
318    SnapStartTimeoutException(crate::types::error::SnapStartTimeoutException),
319    /// <p>Lambda couldn't set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses.</p>
320    SubnetIpAddressLimitReachedException(crate::types::error::SubnetIpAddressLimitReachedException),
321    /// <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
322    TooManyRequestsException(crate::types::error::TooManyRequestsException),
323    /// <p>The content type of the <code>Invoke</code> request body is not JSON.</p>
324    UnsupportedMediaTypeException(crate::types::error::UnsupportedMediaTypeException),
325    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
326    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
327    variable wildcard pattern and check `.code()`:
328     \
329    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
330     \
331    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeError) for what information is available for the error.")]
332    Unhandled(crate::error::sealed_unhandled::Unhandled),
333}
334impl InvokeError {
335    /// Creates the `InvokeError::Unhandled` variant from any error type.
336    pub fn unhandled(
337        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
338    ) -> Self {
339        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
340            source: err.into(),
341            meta: ::std::default::Default::default(),
342        })
343    }
344
345    /// Creates the `InvokeError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
346    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
347        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
348            source: err.clone().into(),
349            meta: err,
350        })
351    }
352    ///
353    /// Returns error metadata, which includes the error code, message,
354    /// request ID, and potentially additional information.
355    ///
356    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
357        match self {
358            Self::Ec2AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
359            Self::Ec2ThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
360            Self::Ec2UnexpectedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
361            Self::EfsioException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
362            Self::EfsMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
363            Self::EfsMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
364            Self::EfsMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
365            Self::EniLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
366            Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
367            Self::InvalidRequestContentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
368            Self::InvalidRuntimeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
369            Self::InvalidSecurityGroupIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
370            Self::InvalidSubnetIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
371            Self::InvalidZipFileException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
372            Self::KmsAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
373            Self::KmsDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
374            Self::KmsInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
375            Self::KmsNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
376            Self::RecursiveInvocationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
377            Self::RequestTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
378            Self::ResourceConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
379            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
380            Self::ResourceNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
381            Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
382            Self::SnapStartException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
383            Self::SnapStartNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
384            Self::SnapStartTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
385            Self::SubnetIpAddressLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
386            Self::TooManyRequestsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
387            Self::UnsupportedMediaTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
388            Self::Unhandled(e) => &e.meta,
389        }
390    }
391    /// Returns `true` if the error kind is `InvokeError::Ec2AccessDeniedException`.
392    pub fn is_ec2_access_denied_exception(&self) -> bool {
393        matches!(self, Self::Ec2AccessDeniedException(_))
394    }
395    /// Returns `true` if the error kind is `InvokeError::Ec2ThrottledException`.
396    pub fn is_ec2_throttled_exception(&self) -> bool {
397        matches!(self, Self::Ec2ThrottledException(_))
398    }
399    /// Returns `true` if the error kind is `InvokeError::Ec2UnexpectedException`.
400    pub fn is_ec2_unexpected_exception(&self) -> bool {
401        matches!(self, Self::Ec2UnexpectedException(_))
402    }
403    /// Returns `true` if the error kind is `InvokeError::EfsioException`.
404    pub fn is_efsio_exception(&self) -> bool {
405        matches!(self, Self::EfsioException(_))
406    }
407    /// Returns `true` if the error kind is `InvokeError::EfsMountConnectivityException`.
408    pub fn is_efs_mount_connectivity_exception(&self) -> bool {
409        matches!(self, Self::EfsMountConnectivityException(_))
410    }
411    /// Returns `true` if the error kind is `InvokeError::EfsMountFailureException`.
412    pub fn is_efs_mount_failure_exception(&self) -> bool {
413        matches!(self, Self::EfsMountFailureException(_))
414    }
415    /// Returns `true` if the error kind is `InvokeError::EfsMountTimeoutException`.
416    pub fn is_efs_mount_timeout_exception(&self) -> bool {
417        matches!(self, Self::EfsMountTimeoutException(_))
418    }
419    /// Returns `true` if the error kind is `InvokeError::EniLimitReachedException`.
420    pub fn is_eni_limit_reached_exception(&self) -> bool {
421        matches!(self, Self::EniLimitReachedException(_))
422    }
423    /// Returns `true` if the error kind is `InvokeError::InvalidParameterValueException`.
424    pub fn is_invalid_parameter_value_exception(&self) -> bool {
425        matches!(self, Self::InvalidParameterValueException(_))
426    }
427    /// Returns `true` if the error kind is `InvokeError::InvalidRequestContentException`.
428    pub fn is_invalid_request_content_exception(&self) -> bool {
429        matches!(self, Self::InvalidRequestContentException(_))
430    }
431    /// Returns `true` if the error kind is `InvokeError::InvalidRuntimeException`.
432    pub fn is_invalid_runtime_exception(&self) -> bool {
433        matches!(self, Self::InvalidRuntimeException(_))
434    }
435    /// Returns `true` if the error kind is `InvokeError::InvalidSecurityGroupIdException`.
436    pub fn is_invalid_security_group_id_exception(&self) -> bool {
437        matches!(self, Self::InvalidSecurityGroupIdException(_))
438    }
439    /// Returns `true` if the error kind is `InvokeError::InvalidSubnetIdException`.
440    pub fn is_invalid_subnet_id_exception(&self) -> bool {
441        matches!(self, Self::InvalidSubnetIdException(_))
442    }
443    /// Returns `true` if the error kind is `InvokeError::InvalidZipFileException`.
444    pub fn is_invalid_zip_file_exception(&self) -> bool {
445        matches!(self, Self::InvalidZipFileException(_))
446    }
447    /// Returns `true` if the error kind is `InvokeError::KmsAccessDeniedException`.
448    pub fn is_kms_access_denied_exception(&self) -> bool {
449        matches!(self, Self::KmsAccessDeniedException(_))
450    }
451    /// Returns `true` if the error kind is `InvokeError::KmsDisabledException`.
452    pub fn is_kms_disabled_exception(&self) -> bool {
453        matches!(self, Self::KmsDisabledException(_))
454    }
455    /// Returns `true` if the error kind is `InvokeError::KmsInvalidStateException`.
456    pub fn is_kms_invalid_state_exception(&self) -> bool {
457        matches!(self, Self::KmsInvalidStateException(_))
458    }
459    /// Returns `true` if the error kind is `InvokeError::KmsNotFoundException`.
460    pub fn is_kms_not_found_exception(&self) -> bool {
461        matches!(self, Self::KmsNotFoundException(_))
462    }
463    /// Returns `true` if the error kind is `InvokeError::RecursiveInvocationException`.
464    pub fn is_recursive_invocation_exception(&self) -> bool {
465        matches!(self, Self::RecursiveInvocationException(_))
466    }
467    /// Returns `true` if the error kind is `InvokeError::RequestTooLargeException`.
468    pub fn is_request_too_large_exception(&self) -> bool {
469        matches!(self, Self::RequestTooLargeException(_))
470    }
471    /// Returns `true` if the error kind is `InvokeError::ResourceConflictException`.
472    pub fn is_resource_conflict_exception(&self) -> bool {
473        matches!(self, Self::ResourceConflictException(_))
474    }
475    /// Returns `true` if the error kind is `InvokeError::ResourceNotFoundException`.
476    pub fn is_resource_not_found_exception(&self) -> bool {
477        matches!(self, Self::ResourceNotFoundException(_))
478    }
479    /// Returns `true` if the error kind is `InvokeError::ResourceNotReadyException`.
480    pub fn is_resource_not_ready_exception(&self) -> bool {
481        matches!(self, Self::ResourceNotReadyException(_))
482    }
483    /// Returns `true` if the error kind is `InvokeError::ServiceException`.
484    pub fn is_service_exception(&self) -> bool {
485        matches!(self, Self::ServiceException(_))
486    }
487    /// Returns `true` if the error kind is `InvokeError::SnapStartException`.
488    pub fn is_snap_start_exception(&self) -> bool {
489        matches!(self, Self::SnapStartException(_))
490    }
491    /// Returns `true` if the error kind is `InvokeError::SnapStartNotReadyException`.
492    pub fn is_snap_start_not_ready_exception(&self) -> bool {
493        matches!(self, Self::SnapStartNotReadyException(_))
494    }
495    /// Returns `true` if the error kind is `InvokeError::SnapStartTimeoutException`.
496    pub fn is_snap_start_timeout_exception(&self) -> bool {
497        matches!(self, Self::SnapStartTimeoutException(_))
498    }
499    /// Returns `true` if the error kind is `InvokeError::SubnetIpAddressLimitReachedException`.
500    pub fn is_subnet_ip_address_limit_reached_exception(&self) -> bool {
501        matches!(self, Self::SubnetIpAddressLimitReachedException(_))
502    }
503    /// Returns `true` if the error kind is `InvokeError::TooManyRequestsException`.
504    pub fn is_too_many_requests_exception(&self) -> bool {
505        matches!(self, Self::TooManyRequestsException(_))
506    }
507    /// Returns `true` if the error kind is `InvokeError::UnsupportedMediaTypeException`.
508    pub fn is_unsupported_media_type_exception(&self) -> bool {
509        matches!(self, Self::UnsupportedMediaTypeException(_))
510    }
511}
512impl ::std::error::Error for InvokeError {
513    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
514        match self {
515            Self::Ec2AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
516            Self::Ec2ThrottledException(_inner) => ::std::option::Option::Some(_inner),
517            Self::Ec2UnexpectedException(_inner) => ::std::option::Option::Some(_inner),
518            Self::EfsioException(_inner) => ::std::option::Option::Some(_inner),
519            Self::EfsMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
520            Self::EfsMountFailureException(_inner) => ::std::option::Option::Some(_inner),
521            Self::EfsMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
522            Self::EniLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
523            Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner),
524            Self::InvalidRequestContentException(_inner) => ::std::option::Option::Some(_inner),
525            Self::InvalidRuntimeException(_inner) => ::std::option::Option::Some(_inner),
526            Self::InvalidSecurityGroupIdException(_inner) => ::std::option::Option::Some(_inner),
527            Self::InvalidSubnetIdException(_inner) => ::std::option::Option::Some(_inner),
528            Self::InvalidZipFileException(_inner) => ::std::option::Option::Some(_inner),
529            Self::KmsAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
530            Self::KmsDisabledException(_inner) => ::std::option::Option::Some(_inner),
531            Self::KmsInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
532            Self::KmsNotFoundException(_inner) => ::std::option::Option::Some(_inner),
533            Self::RecursiveInvocationException(_inner) => ::std::option::Option::Some(_inner),
534            Self::RequestTooLargeException(_inner) => ::std::option::Option::Some(_inner),
535            Self::ResourceConflictException(_inner) => ::std::option::Option::Some(_inner),
536            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
537            Self::ResourceNotReadyException(_inner) => ::std::option::Option::Some(_inner),
538            Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
539            Self::SnapStartException(_inner) => ::std::option::Option::Some(_inner),
540            Self::SnapStartNotReadyException(_inner) => ::std::option::Option::Some(_inner),
541            Self::SnapStartTimeoutException(_inner) => ::std::option::Option::Some(_inner),
542            Self::SubnetIpAddressLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
543            Self::TooManyRequestsException(_inner) => ::std::option::Option::Some(_inner),
544            Self::UnsupportedMediaTypeException(_inner) => ::std::option::Option::Some(_inner),
545            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
546        }
547    }
548}
549impl ::std::fmt::Display for InvokeError {
550    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
551        match self {
552            Self::Ec2AccessDeniedException(_inner) => _inner.fmt(f),
553            Self::Ec2ThrottledException(_inner) => _inner.fmt(f),
554            Self::Ec2UnexpectedException(_inner) => _inner.fmt(f),
555            Self::EfsioException(_inner) => _inner.fmt(f),
556            Self::EfsMountConnectivityException(_inner) => _inner.fmt(f),
557            Self::EfsMountFailureException(_inner) => _inner.fmt(f),
558            Self::EfsMountTimeoutException(_inner) => _inner.fmt(f),
559            Self::EniLimitReachedException(_inner) => _inner.fmt(f),
560            Self::InvalidParameterValueException(_inner) => _inner.fmt(f),
561            Self::InvalidRequestContentException(_inner) => _inner.fmt(f),
562            Self::InvalidRuntimeException(_inner) => _inner.fmt(f),
563            Self::InvalidSecurityGroupIdException(_inner) => _inner.fmt(f),
564            Self::InvalidSubnetIdException(_inner) => _inner.fmt(f),
565            Self::InvalidZipFileException(_inner) => _inner.fmt(f),
566            Self::KmsAccessDeniedException(_inner) => _inner.fmt(f),
567            Self::KmsDisabledException(_inner) => _inner.fmt(f),
568            Self::KmsInvalidStateException(_inner) => _inner.fmt(f),
569            Self::KmsNotFoundException(_inner) => _inner.fmt(f),
570            Self::RecursiveInvocationException(_inner) => _inner.fmt(f),
571            Self::RequestTooLargeException(_inner) => _inner.fmt(f),
572            Self::ResourceConflictException(_inner) => _inner.fmt(f),
573            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
574            Self::ResourceNotReadyException(_inner) => _inner.fmt(f),
575            Self::ServiceException(_inner) => _inner.fmt(f),
576            Self::SnapStartException(_inner) => _inner.fmt(f),
577            Self::SnapStartNotReadyException(_inner) => _inner.fmt(f),
578            Self::SnapStartTimeoutException(_inner) => _inner.fmt(f),
579            Self::SubnetIpAddressLimitReachedException(_inner) => _inner.fmt(f),
580            Self::TooManyRequestsException(_inner) => _inner.fmt(f),
581            Self::UnsupportedMediaTypeException(_inner) => _inner.fmt(f),
582            Self::Unhandled(_inner) => {
583                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
584                    write!(f, "unhandled error ({code})")
585                } else {
586                    f.write_str("unhandled error")
587                }
588            }
589        }
590    }
591}
592impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeError {
593    fn code(&self) -> ::std::option::Option<&str> {
594        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
595    }
596    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
597        ::std::option::Option::None
598    }
599}
600impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeError {
601    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
602        match self {
603            Self::Ec2AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
604            Self::Ec2ThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
605            Self::Ec2UnexpectedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
606            Self::EfsioException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
607            Self::EfsMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
608            Self::EfsMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
609            Self::EfsMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
610            Self::EniLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
611            Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
612            Self::InvalidRequestContentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
613            Self::InvalidRuntimeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
614            Self::InvalidSecurityGroupIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
615            Self::InvalidSubnetIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
616            Self::InvalidZipFileException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
617            Self::KmsAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
618            Self::KmsDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
619            Self::KmsInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
620            Self::KmsNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
621            Self::RecursiveInvocationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
622            Self::RequestTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
623            Self::ResourceConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
624            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
625            Self::ResourceNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
626            Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
627            Self::SnapStartException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
628            Self::SnapStartNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
629            Self::SnapStartTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
630            Self::SubnetIpAddressLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
631            Self::TooManyRequestsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
632            Self::UnsupportedMediaTypeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
633            Self::Unhandled(_inner) => &_inner.meta,
634        }
635    }
636}
637impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeError {
638    fn create_unhandled_error(
639        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
640        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
641    ) -> Self {
642        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
643            source,
644            meta: meta.unwrap_or_default(),
645        })
646    }
647}
648impl ::aws_types::request_id::RequestId for crate::operation::invoke::InvokeError {
649    fn request_id(&self) -> Option<&str> {
650        self.meta().request_id()
651    }
652}
653
654pub use crate::operation::invoke::_invoke_output::InvokeOutput;
655
656pub use crate::operation::invoke::_invoke_input::InvokeInput;
657
658mod _invoke_input;
659
660mod _invoke_output;
661
662/// Builders
663pub mod builders;