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