1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct InvokeWithResponseStream;
6impl InvokeWithResponseStream {
7 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 .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
74 if let ::std::option::Option::Some(config_override) = config_override {
75 for plugin in config_override.runtime_plugins.iter().cloned() {
76 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77 }
78 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79 config_override,
80 client_config.config.clone(),
81 &client_config.runtime_components,
82 ));
83 }
84 runtime_plugins
85 }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for InvokeWithResponseStream {
88 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("InvokeWithResponseStream");
90
91 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92 InvokeWithResponseStreamRequestSerializer,
93 ));
94 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95 InvokeWithResponseStreamResponseDeserializer,
96 ));
97
98 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99 crate::config::auth::Params::builder()
100 .operation_name("InvokeWithResponseStream")
101 .build()
102 .expect("required fields set"),
103 ));
104
105 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
106 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
107 "InvokeWithResponseStream",
108 "Lambda",
109 ));
110 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
111 signing_options.double_uri_encode = true;
112 signing_options.content_sha256_header = false;
113 signing_options.normalize_uri_path = true;
114 signing_options.payload_override = None;
115
116 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
117 signing_options,
118 ..::std::default::Default::default()
119 });
120
121 ::std::option::Option::Some(cfg.freeze())
122 }
123
124 fn runtime_components(
125 &self,
126 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
127 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
128 #[allow(unused_mut)]
129 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("InvokeWithResponseStream")
130 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
131 InvokeWithResponseStreamEndpointParamsInterceptor,
132 ))
133 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
134 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
135 >::new())
136 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
137 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
138 >::new())
139 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
140 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
141 >::new());
142
143 ::std::borrow::Cow::Owned(rcb)
144 }
145}
146
147#[derive(Debug)]
148struct InvokeWithResponseStreamResponseDeserializer;
149impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InvokeWithResponseStreamResponseDeserializer {
150 fn deserialize_streaming(
151 &self,
152 response: &mut ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
153 ) -> ::std::option::Option<::aws_smithy_runtime_api::client::interceptors::context::OutputOrError> {
154 #[allow(unused_mut)]
155 let mut force_error = false;
156 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
157
158 if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
160 return ::std::option::Option::None;
161 }
162 ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
163 crate::protocol_serde::shape_invoke_with_response_stream::de_invoke_with_response_stream_http_response(response),
164 ))
165 }
166
167 fn deserialize_nonstreaming_with_config(
168 &self,
169 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
170 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
171 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
172 let body = response.body().bytes().expect("body loaded");
174 crate::protocol_serde::type_erase_result(
175 crate::protocol_serde::shape_invoke_with_response_stream::de_invoke_with_response_stream_http_error(
176 response.status().as_u16(),
177 response.headers(),
178 body,
179 ),
180 )
181 }
182}
183#[derive(Debug)]
184struct InvokeWithResponseStreamRequestSerializer;
185impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InvokeWithResponseStreamRequestSerializer {
186 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
187 fn serialize_input(
188 &self,
189 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
190 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
191 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
192 let input = input
193 .downcast::<crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput>()
194 .expect("correct type");
195 let _header_serialization_settings = _cfg
196 .load::<crate::serialization_settings::HeaderSerializationSettings>()
197 .cloned()
198 .unwrap_or_default();
199 let mut request_builder = {
200 #[allow(clippy::uninlined_format_args)]
201 fn uri_base(
202 _input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
203 output: &mut ::std::string::String,
204 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
205 use ::std::fmt::Write as _;
206 let input_1 = &_input.function_name;
207 let input_1 = input_1
208 .as_ref()
209 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
210 let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
211 if function_name.is_empty() {
212 return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
213 "function_name",
214 "cannot be empty or unset",
215 ));
216 }
217 ::std::write!(
218 output,
219 "/2021-11-15/functions/{FunctionName}/response-streaming-invocations",
220 FunctionName = function_name
221 )
222 .expect("formatting should succeed");
223 ::std::result::Result::Ok(())
224 }
225 fn uri_query(
226 _input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
227 mut output: &mut ::std::string::String,
228 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
229 let mut query = ::aws_smithy_http::query::Writer::new(output);
230 if let ::std::option::Option::Some(inner_2) = &_input.qualifier {
231 {
232 query.push_kv("Qualifier", &::aws_smithy_http::query::fmt_string(inner_2));
233 }
234 }
235 ::std::result::Result::Ok(())
236 }
237 #[allow(clippy::unnecessary_wraps)]
238 fn update_http_builder(
239 input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
240 builder: ::http_1x::request::Builder,
241 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
242 let mut uri = ::std::string::String::new();
243 uri_base(input, &mut uri)?;
244 uri_query(input, &mut uri)?;
245 let builder = crate::protocol_serde::shape_invoke_with_response_stream::ser_invoke_with_response_stream_headers(input, builder)?;
246 ::std::result::Result::Ok(builder.method("POST").uri(uri))
247 }
248 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
249 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/octet-stream");
250 builder
251 };
252 let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_invoke_with_response_stream_input::ser_payload_http_payload(
253 input.payload,
254 )?);
255 if let Some(content_length) = body.content_length() {
256 let content_length = content_length.to_string();
257 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
258 }
259 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
260 }
261}
262#[derive(Debug)]
263struct InvokeWithResponseStreamEndpointParamsInterceptor;
264
265#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
266impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeWithResponseStreamEndpointParamsInterceptor {
267 fn name(&self) -> &'static str {
268 "InvokeWithResponseStreamEndpointParamsInterceptor"
269 }
270
271 fn read_before_execution(
272 &self,
273 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
274 '_,
275 ::aws_smithy_runtime_api::client::interceptors::context::Input,
276 ::aws_smithy_runtime_api::client::interceptors::context::Output,
277 ::aws_smithy_runtime_api::client::interceptors::context::Error,
278 >,
279 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
280 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
281 let _input = context
282 .input()
283 .downcast_ref::<InvokeWithResponseStreamInput>()
284 .ok_or("failed to downcast to InvokeWithResponseStreamInput")?;
285
286 let params = crate::config::endpoint::Params::builder()
287 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
288 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
289 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
290 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
291 .build()
292 .map_err(|err| {
293 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
294 })?;
295 cfg.interceptor_state()
296 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
297 ::std::result::Result::Ok(())
298 }
299}
300
301#[non_exhaustive]
306#[derive(::std::fmt::Debug)]
307pub enum InvokeWithResponseStreamError {
308 Ec2AccessDeniedException(crate::types::error::Ec2AccessDeniedException),
310 Ec2ThrottledException(crate::types::error::Ec2ThrottledException),
312 Ec2UnexpectedException(crate::types::error::Ec2UnexpectedException),
314 EfsioException(crate::types::error::EfsioException),
316 EfsMountConnectivityException(crate::types::error::EfsMountConnectivityException),
318 EfsMountFailureException(crate::types::error::EfsMountFailureException),
320 EfsMountTimeoutException(crate::types::error::EfsMountTimeoutException),
322 EniLimitReachedException(crate::types::error::EniLimitReachedException),
324 InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
326 InvalidRequestContentException(crate::types::error::InvalidRequestContentException),
328 InvalidRuntimeException(crate::types::error::InvalidRuntimeException),
330 InvalidSecurityGroupIdException(crate::types::error::InvalidSecurityGroupIdException),
332 InvalidSubnetIdException(crate::types::error::InvalidSubnetIdException),
334 InvalidZipFileException(crate::types::error::InvalidZipFileException),
336 KmsAccessDeniedException(crate::types::error::KmsAccessDeniedException),
338 KmsDisabledException(crate::types::error::KmsDisabledException),
340 KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
342 KmsNotFoundException(crate::types::error::KmsNotFoundException),
344 NoPublishedVersionException(crate::types::error::NoPublishedVersionException),
346 RecursiveInvocationException(crate::types::error::RecursiveInvocationException),
348 RequestTooLargeException(crate::types::error::RequestTooLargeException),
350 ResourceConflictException(crate::types::error::ResourceConflictException),
352 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
354 ResourceNotReadyException(crate::types::error::ResourceNotReadyException),
356 S3FilesMountConnectivityException(crate::types::error::S3FilesMountConnectivityException),
358 S3FilesMountFailureException(crate::types::error::S3FilesMountFailureException),
360 S3FilesMountTimeoutException(crate::types::error::S3FilesMountTimeoutException),
362 SerializedRequestEntityTooLargeException(crate::types::error::SerializedRequestEntityTooLargeException),
364 ServiceException(crate::types::error::ServiceException),
366 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
368 SnapStartException(crate::types::error::SnapStartException),
370 SnapStartNotReadyException(crate::types::error::SnapStartNotReadyException),
372 SnapStartRegenerationFailureException(crate::types::error::SnapStartRegenerationFailureException),
374 SnapStartTimeoutException(crate::types::error::SnapStartTimeoutException),
376 SubnetIpAddressLimitReachedException(crate::types::error::SubnetIpAddressLimitReachedException),
378 TooManyRequestsException(crate::types::error::TooManyRequestsException),
380 UnsupportedMediaTypeException(crate::types::error::UnsupportedMediaTypeException),
382 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
384 variable wildcard pattern and check `.code()`:
385 \
386 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
387 \
388 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeWithResponseStreamError) for what information is available for the error.")]
389 Unhandled(crate::error::sealed_unhandled::Unhandled),
390}
391impl InvokeWithResponseStreamError {
392 pub fn unhandled(
394 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
395 ) -> Self {
396 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
397 source: err.into(),
398 meta: ::std::default::Default::default(),
399 })
400 }
401
402 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
404 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
405 source: err.clone().into(),
406 meta: err,
407 })
408 }
409 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
414 match self {
415 Self::Ec2AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
416 Self::Ec2ThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417 Self::Ec2UnexpectedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418 Self::EfsioException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419 Self::EfsMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420 Self::EfsMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
421 Self::EfsMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
422 Self::EniLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423 Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424 Self::InvalidRequestContentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425 Self::InvalidRuntimeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426 Self::InvalidSecurityGroupIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427 Self::InvalidSubnetIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
428 Self::InvalidZipFileException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
429 Self::KmsAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
430 Self::KmsDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
431 Self::KmsInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
432 Self::KmsNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
433 Self::NoPublishedVersionException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
434 Self::RecursiveInvocationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
435 Self::RequestTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436 Self::ResourceConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
437 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
438 Self::ResourceNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
439 Self::S3FilesMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440 Self::S3FilesMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441 Self::S3FilesMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442 Self::SerializedRequestEntityTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443 Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444 Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
445 Self::SnapStartException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
446 Self::SnapStartNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
447 Self::SnapStartRegenerationFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
448 Self::SnapStartTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
449 Self::SubnetIpAddressLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
450 Self::TooManyRequestsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
451 Self::UnsupportedMediaTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
452 Self::Unhandled(e) => &e.meta,
453 }
454 }
455 pub fn is_ec2_access_denied_exception(&self) -> bool {
457 matches!(self, Self::Ec2AccessDeniedException(_))
458 }
459 pub fn is_ec2_throttled_exception(&self) -> bool {
461 matches!(self, Self::Ec2ThrottledException(_))
462 }
463 pub fn is_ec2_unexpected_exception(&self) -> bool {
465 matches!(self, Self::Ec2UnexpectedException(_))
466 }
467 pub fn is_efsio_exception(&self) -> bool {
469 matches!(self, Self::EfsioException(_))
470 }
471 pub fn is_efs_mount_connectivity_exception(&self) -> bool {
473 matches!(self, Self::EfsMountConnectivityException(_))
474 }
475 pub fn is_efs_mount_failure_exception(&self) -> bool {
477 matches!(self, Self::EfsMountFailureException(_))
478 }
479 pub fn is_efs_mount_timeout_exception(&self) -> bool {
481 matches!(self, Self::EfsMountTimeoutException(_))
482 }
483 pub fn is_eni_limit_reached_exception(&self) -> bool {
485 matches!(self, Self::EniLimitReachedException(_))
486 }
487 pub fn is_invalid_parameter_value_exception(&self) -> bool {
489 matches!(self, Self::InvalidParameterValueException(_))
490 }
491 pub fn is_invalid_request_content_exception(&self) -> bool {
493 matches!(self, Self::InvalidRequestContentException(_))
494 }
495 pub fn is_invalid_runtime_exception(&self) -> bool {
497 matches!(self, Self::InvalidRuntimeException(_))
498 }
499 pub fn is_invalid_security_group_id_exception(&self) -> bool {
501 matches!(self, Self::InvalidSecurityGroupIdException(_))
502 }
503 pub fn is_invalid_subnet_id_exception(&self) -> bool {
505 matches!(self, Self::InvalidSubnetIdException(_))
506 }
507 pub fn is_invalid_zip_file_exception(&self) -> bool {
509 matches!(self, Self::InvalidZipFileException(_))
510 }
511 pub fn is_kms_access_denied_exception(&self) -> bool {
513 matches!(self, Self::KmsAccessDeniedException(_))
514 }
515 pub fn is_kms_disabled_exception(&self) -> bool {
517 matches!(self, Self::KmsDisabledException(_))
518 }
519 pub fn is_kms_invalid_state_exception(&self) -> bool {
521 matches!(self, Self::KmsInvalidStateException(_))
522 }
523 pub fn is_kms_not_found_exception(&self) -> bool {
525 matches!(self, Self::KmsNotFoundException(_))
526 }
527 pub fn is_no_published_version_exception(&self) -> bool {
529 matches!(self, Self::NoPublishedVersionException(_))
530 }
531 pub fn is_recursive_invocation_exception(&self) -> bool {
533 matches!(self, Self::RecursiveInvocationException(_))
534 }
535 pub fn is_request_too_large_exception(&self) -> bool {
537 matches!(self, Self::RequestTooLargeException(_))
538 }
539 pub fn is_resource_conflict_exception(&self) -> bool {
541 matches!(self, Self::ResourceConflictException(_))
542 }
543 pub fn is_resource_not_found_exception(&self) -> bool {
545 matches!(self, Self::ResourceNotFoundException(_))
546 }
547 pub fn is_resource_not_ready_exception(&self) -> bool {
549 matches!(self, Self::ResourceNotReadyException(_))
550 }
551 pub fn is_s3_files_mount_connectivity_exception(&self) -> bool {
553 matches!(self, Self::S3FilesMountConnectivityException(_))
554 }
555 pub fn is_s3_files_mount_failure_exception(&self) -> bool {
557 matches!(self, Self::S3FilesMountFailureException(_))
558 }
559 pub fn is_s3_files_mount_timeout_exception(&self) -> bool {
561 matches!(self, Self::S3FilesMountTimeoutException(_))
562 }
563 pub fn is_serialized_request_entity_too_large_exception(&self) -> bool {
565 matches!(self, Self::SerializedRequestEntityTooLargeException(_))
566 }
567 pub fn is_service_exception(&self) -> bool {
569 matches!(self, Self::ServiceException(_))
570 }
571 pub fn is_service_quota_exceeded_exception(&self) -> bool {
573 matches!(self, Self::ServiceQuotaExceededException(_))
574 }
575 pub fn is_snap_start_exception(&self) -> bool {
577 matches!(self, Self::SnapStartException(_))
578 }
579 pub fn is_snap_start_not_ready_exception(&self) -> bool {
581 matches!(self, Self::SnapStartNotReadyException(_))
582 }
583 pub fn is_snap_start_regeneration_failure_exception(&self) -> bool {
585 matches!(self, Self::SnapStartRegenerationFailureException(_))
586 }
587 pub fn is_snap_start_timeout_exception(&self) -> bool {
589 matches!(self, Self::SnapStartTimeoutException(_))
590 }
591 pub fn is_subnet_ip_address_limit_reached_exception(&self) -> bool {
593 matches!(self, Self::SubnetIpAddressLimitReachedException(_))
594 }
595 pub fn is_too_many_requests_exception(&self) -> bool {
597 matches!(self, Self::TooManyRequestsException(_))
598 }
599 pub fn is_unsupported_media_type_exception(&self) -> bool {
601 matches!(self, Self::UnsupportedMediaTypeException(_))
602 }
603}
604impl ::std::error::Error for InvokeWithResponseStreamError {
605 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
606 match self {
607 Self::Ec2AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
608 Self::Ec2ThrottledException(_inner) => ::std::option::Option::Some(_inner),
609 Self::Ec2UnexpectedException(_inner) => ::std::option::Option::Some(_inner),
610 Self::EfsioException(_inner) => ::std::option::Option::Some(_inner),
611 Self::EfsMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
612 Self::EfsMountFailureException(_inner) => ::std::option::Option::Some(_inner),
613 Self::EfsMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
614 Self::EniLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
615 Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner),
616 Self::InvalidRequestContentException(_inner) => ::std::option::Option::Some(_inner),
617 Self::InvalidRuntimeException(_inner) => ::std::option::Option::Some(_inner),
618 Self::InvalidSecurityGroupIdException(_inner) => ::std::option::Option::Some(_inner),
619 Self::InvalidSubnetIdException(_inner) => ::std::option::Option::Some(_inner),
620 Self::InvalidZipFileException(_inner) => ::std::option::Option::Some(_inner),
621 Self::KmsAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
622 Self::KmsDisabledException(_inner) => ::std::option::Option::Some(_inner),
623 Self::KmsInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
624 Self::KmsNotFoundException(_inner) => ::std::option::Option::Some(_inner),
625 Self::NoPublishedVersionException(_inner) => ::std::option::Option::Some(_inner),
626 Self::RecursiveInvocationException(_inner) => ::std::option::Option::Some(_inner),
627 Self::RequestTooLargeException(_inner) => ::std::option::Option::Some(_inner),
628 Self::ResourceConflictException(_inner) => ::std::option::Option::Some(_inner),
629 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
630 Self::ResourceNotReadyException(_inner) => ::std::option::Option::Some(_inner),
631 Self::S3FilesMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
632 Self::S3FilesMountFailureException(_inner) => ::std::option::Option::Some(_inner),
633 Self::S3FilesMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
634 Self::SerializedRequestEntityTooLargeException(_inner) => ::std::option::Option::Some(_inner),
635 Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
636 Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
637 Self::SnapStartException(_inner) => ::std::option::Option::Some(_inner),
638 Self::SnapStartNotReadyException(_inner) => ::std::option::Option::Some(_inner),
639 Self::SnapStartRegenerationFailureException(_inner) => ::std::option::Option::Some(_inner),
640 Self::SnapStartTimeoutException(_inner) => ::std::option::Option::Some(_inner),
641 Self::SubnetIpAddressLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
642 Self::TooManyRequestsException(_inner) => ::std::option::Option::Some(_inner),
643 Self::UnsupportedMediaTypeException(_inner) => ::std::option::Option::Some(_inner),
644 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
645 }
646 }
647}
648impl ::std::fmt::Display for InvokeWithResponseStreamError {
649 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
650 match self {
651 Self::Ec2AccessDeniedException(_inner) => _inner.fmt(f),
652 Self::Ec2ThrottledException(_inner) => _inner.fmt(f),
653 Self::Ec2UnexpectedException(_inner) => _inner.fmt(f),
654 Self::EfsioException(_inner) => _inner.fmt(f),
655 Self::EfsMountConnectivityException(_inner) => _inner.fmt(f),
656 Self::EfsMountFailureException(_inner) => _inner.fmt(f),
657 Self::EfsMountTimeoutException(_inner) => _inner.fmt(f),
658 Self::EniLimitReachedException(_inner) => _inner.fmt(f),
659 Self::InvalidParameterValueException(_inner) => _inner.fmt(f),
660 Self::InvalidRequestContentException(_inner) => _inner.fmt(f),
661 Self::InvalidRuntimeException(_inner) => _inner.fmt(f),
662 Self::InvalidSecurityGroupIdException(_inner) => _inner.fmt(f),
663 Self::InvalidSubnetIdException(_inner) => _inner.fmt(f),
664 Self::InvalidZipFileException(_inner) => _inner.fmt(f),
665 Self::KmsAccessDeniedException(_inner) => _inner.fmt(f),
666 Self::KmsDisabledException(_inner) => _inner.fmt(f),
667 Self::KmsInvalidStateException(_inner) => _inner.fmt(f),
668 Self::KmsNotFoundException(_inner) => _inner.fmt(f),
669 Self::NoPublishedVersionException(_inner) => _inner.fmt(f),
670 Self::RecursiveInvocationException(_inner) => _inner.fmt(f),
671 Self::RequestTooLargeException(_inner) => _inner.fmt(f),
672 Self::ResourceConflictException(_inner) => _inner.fmt(f),
673 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
674 Self::ResourceNotReadyException(_inner) => _inner.fmt(f),
675 Self::S3FilesMountConnectivityException(_inner) => _inner.fmt(f),
676 Self::S3FilesMountFailureException(_inner) => _inner.fmt(f),
677 Self::S3FilesMountTimeoutException(_inner) => _inner.fmt(f),
678 Self::SerializedRequestEntityTooLargeException(_inner) => _inner.fmt(f),
679 Self::ServiceException(_inner) => _inner.fmt(f),
680 Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
681 Self::SnapStartException(_inner) => _inner.fmt(f),
682 Self::SnapStartNotReadyException(_inner) => _inner.fmt(f),
683 Self::SnapStartRegenerationFailureException(_inner) => _inner.fmt(f),
684 Self::SnapStartTimeoutException(_inner) => _inner.fmt(f),
685 Self::SubnetIpAddressLimitReachedException(_inner) => _inner.fmt(f),
686 Self::TooManyRequestsException(_inner) => _inner.fmt(f),
687 Self::UnsupportedMediaTypeException(_inner) => _inner.fmt(f),
688 Self::Unhandled(_inner) => {
689 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
690 write!(f, "unhandled error ({code})")
691 } else {
692 f.write_str("unhandled error")
693 }
694 }
695 }
696 }
697}
698impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeWithResponseStreamError {
699 fn code(&self) -> ::std::option::Option<&str> {
700 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
701 }
702 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
703 ::std::option::Option::None
704 }
705}
706impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeWithResponseStreamError {
707 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
708 match self {
709 Self::Ec2AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
710 Self::Ec2ThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
711 Self::Ec2UnexpectedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
712 Self::EfsioException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
713 Self::EfsMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
714 Self::EfsMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
715 Self::EfsMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
716 Self::EniLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
717 Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
718 Self::InvalidRequestContentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
719 Self::InvalidRuntimeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
720 Self::InvalidSecurityGroupIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
721 Self::InvalidSubnetIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
722 Self::InvalidZipFileException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
723 Self::KmsAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
724 Self::KmsDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
725 Self::KmsInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
726 Self::KmsNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
727 Self::NoPublishedVersionException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
728 Self::RecursiveInvocationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
729 Self::RequestTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
730 Self::ResourceConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
731 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
732 Self::ResourceNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
733 Self::S3FilesMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
734 Self::S3FilesMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
735 Self::S3FilesMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
736 Self::SerializedRequestEntityTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
737 Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
738 Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
739 Self::SnapStartException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
740 Self::SnapStartNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
741 Self::SnapStartRegenerationFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
742 Self::SnapStartTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
743 Self::SubnetIpAddressLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
744 Self::TooManyRequestsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
745 Self::UnsupportedMediaTypeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
746 Self::Unhandled(_inner) => &_inner.meta,
747 }
748 }
749}
750impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeWithResponseStreamError {
751 fn create_unhandled_error(
752 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
753 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
754 ) -> Self {
755 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
756 source,
757 meta: meta.unwrap_or_default(),
758 })
759 }
760}
761impl ::aws_types::request_id::RequestId for crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError {
762 fn request_id(&self) -> Option<&str> {
763 self.meta().request_id()
764 }
765}
766
767pub use crate::operation::invoke_with_response_stream::_invoke_with_response_stream_input::InvokeWithResponseStreamInput;
768
769pub use crate::operation::invoke_with_response_stream::_invoke_with_response_stream_output::InvokeWithResponseStreamOutput;
770
771mod _invoke_with_response_stream_input;
772
773mod _invoke_with_response_stream_output;
774
775pub mod builders;