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