aws_sdk_lambda/operation/
invoke_with_response_stream.rs

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