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