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(InvokeWithResponseStreamEndpointParamsInterceptor)
131 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
132 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
133 >::new())
134 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
135 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
136 >::new())
137 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
138 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
139 >::new());
140
141 ::std::borrow::Cow::Owned(rcb)
142 }
143}
144
145#[derive(Debug)]
146struct InvokeWithResponseStreamResponseDeserializer;
147impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InvokeWithResponseStreamResponseDeserializer {
148 fn deserialize_streaming(
149 &self,
150 response: &mut ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
151 ) -> ::std::option::Option<::aws_smithy_runtime_api::client::interceptors::context::OutputOrError> {
152 #[allow(unused_mut)]
153 let mut force_error = false;
154 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
155
156 if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
158 return ::std::option::Option::None;
159 }
160 ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
161 crate::protocol_serde::shape_invoke_with_response_stream::de_invoke_with_response_stream_http_response(response),
162 ))
163 }
164
165 fn deserialize_nonstreaming(
166 &self,
167 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
168 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
169 let body = response.body().bytes().expect("body loaded");
171 crate::protocol_serde::type_erase_result(
172 crate::protocol_serde::shape_invoke_with_response_stream::de_invoke_with_response_stream_http_error(
173 response.status().as_u16(),
174 response.headers(),
175 body,
176 ),
177 )
178 }
179}
180#[derive(Debug)]
181struct InvokeWithResponseStreamRequestSerializer;
182impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InvokeWithResponseStreamRequestSerializer {
183 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
184 fn serialize_input(
185 &self,
186 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
187 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
188 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
189 let input = input
190 .downcast::<crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput>()
191 .expect("correct type");
192 let _header_serialization_settings = _cfg
193 .load::<crate::serialization_settings::HeaderSerializationSettings>()
194 .cloned()
195 .unwrap_or_default();
196 let mut request_builder = {
197 fn uri_base(
198 _input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
199 output: &mut ::std::string::String,
200 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
201 use ::std::fmt::Write as _;
202 let input_1 = &_input.function_name;
203 let input_1 = input_1
204 .as_ref()
205 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
206 let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
207 if function_name.is_empty() {
208 return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
209 "function_name",
210 "cannot be empty or unset",
211 ));
212 }
213 ::std::write!(
214 output,
215 "/2021-11-15/functions/{FunctionName}/response-streaming-invocations",
216 FunctionName = function_name
217 )
218 .expect("formatting should succeed");
219 ::std::result::Result::Ok(())
220 }
221 fn uri_query(
222 _input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
223 mut output: &mut ::std::string::String,
224 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
225 let mut query = ::aws_smithy_http::query::Writer::new(output);
226 if let ::std::option::Option::Some(inner_2) = &_input.qualifier {
227 {
228 query.push_kv("Qualifier", &::aws_smithy_http::query::fmt_string(inner_2));
229 }
230 }
231 ::std::result::Result::Ok(())
232 }
233 #[allow(clippy::unnecessary_wraps)]
234 fn update_http_builder(
235 input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
236 builder: ::http::request::Builder,
237 ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
238 let mut uri = ::std::string::String::new();
239 uri_base(input, &mut uri)?;
240 uri_query(input, &mut uri)?;
241 let builder = crate::protocol_serde::shape_invoke_with_response_stream::ser_invoke_with_response_stream_headers(input, builder)?;
242 ::std::result::Result::Ok(builder.method("POST").uri(uri))
243 }
244 let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
245 builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/octet-stream");
246 builder
247 };
248 let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_invoke_with_response_stream_input::ser_payload_http_payload(
249 input.payload,
250 )?);
251 if let Some(content_length) = body.content_length() {
252 let content_length = content_length.to_string();
253 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
254 }
255 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
256 }
257}
258#[derive(Debug)]
259struct InvokeWithResponseStreamEndpointParamsInterceptor;
260
261impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeWithResponseStreamEndpointParamsInterceptor {
262 fn name(&self) -> &'static str {
263 "InvokeWithResponseStreamEndpointParamsInterceptor"
264 }
265
266 fn read_before_execution(
267 &self,
268 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
269 '_,
270 ::aws_smithy_runtime_api::client::interceptors::context::Input,
271 ::aws_smithy_runtime_api::client::interceptors::context::Output,
272 ::aws_smithy_runtime_api::client::interceptors::context::Error,
273 >,
274 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
275 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
276 let _input = context
277 .input()
278 .downcast_ref::<InvokeWithResponseStreamInput>()
279 .ok_or("failed to downcast to InvokeWithResponseStreamInput")?;
280
281 let params = crate::config::endpoint::Params::builder()
282 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
283 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
284 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
285 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
286 .build()
287 .map_err(|err| {
288 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
289 })?;
290 cfg.interceptor_state()
291 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
292 ::std::result::Result::Ok(())
293 }
294}
295
296#[non_exhaustive]
301#[derive(::std::fmt::Debug)]
302pub enum InvokeWithResponseStreamError {
303 Ec2AccessDeniedException(crate::types::error::Ec2AccessDeniedException),
305 Ec2ThrottledException(crate::types::error::Ec2ThrottledException),
307 Ec2UnexpectedException(crate::types::error::Ec2UnexpectedException),
309 EfsioException(crate::types::error::EfsioException),
311 EfsMountConnectivityException(crate::types::error::EfsMountConnectivityException),
313 EfsMountFailureException(crate::types::error::EfsMountFailureException),
315 EfsMountTimeoutException(crate::types::error::EfsMountTimeoutException),
317 EniLimitReachedException(crate::types::error::EniLimitReachedException),
319 InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
321 InvalidRequestContentException(crate::types::error::InvalidRequestContentException),
323 InvalidRuntimeException(crate::types::error::InvalidRuntimeException),
325 InvalidSecurityGroupIdException(crate::types::error::InvalidSecurityGroupIdException),
327 InvalidSubnetIdException(crate::types::error::InvalidSubnetIdException),
329 InvalidZipFileException(crate::types::error::InvalidZipFileException),
331 KmsAccessDeniedException(crate::types::error::KmsAccessDeniedException),
333 KmsDisabledException(crate::types::error::KmsDisabledException),
335 KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
337 KmsNotFoundException(crate::types::error::KmsNotFoundException),
339 RecursiveInvocationException(crate::types::error::RecursiveInvocationException),
341 RequestTooLargeException(crate::types::error::RequestTooLargeException),
343 ResourceConflictException(crate::types::error::ResourceConflictException),
345 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
347 ResourceNotReadyException(crate::types::error::ResourceNotReadyException),
349 SerializedRequestEntityTooLargeException(crate::types::error::SerializedRequestEntityTooLargeException),
351 ServiceException(crate::types::error::ServiceException),
353 SnapStartException(crate::types::error::SnapStartException),
355 SnapStartNotReadyException(crate::types::error::SnapStartNotReadyException),
357 SnapStartTimeoutException(crate::types::error::SnapStartTimeoutException),
359 SubnetIpAddressLimitReachedException(crate::types::error::SubnetIpAddressLimitReachedException),
361 TooManyRequestsException(crate::types::error::TooManyRequestsException),
363 UnsupportedMediaTypeException(crate::types::error::UnsupportedMediaTypeException),
365 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
367 variable wildcard pattern and check `.code()`:
368 \
369 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
370 \
371 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeWithResponseStreamError) for what information is available for the error.")]
372 Unhandled(crate::error::sealed_unhandled::Unhandled),
373}
374impl InvokeWithResponseStreamError {
375 pub fn unhandled(
377 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
378 ) -> Self {
379 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
380 source: err.into(),
381 meta: ::std::default::Default::default(),
382 })
383 }
384
385 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
387 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
388 source: err.clone().into(),
389 meta: err,
390 })
391 }
392 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
397 match self {
398 Self::Ec2AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
399 Self::Ec2ThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
400 Self::Ec2UnexpectedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
401 Self::EfsioException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
402 Self::EfsMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
403 Self::EfsMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
404 Self::EfsMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
405 Self::EniLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
406 Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
407 Self::InvalidRequestContentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
408 Self::InvalidRuntimeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
409 Self::InvalidSecurityGroupIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
410 Self::InvalidSubnetIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
411 Self::InvalidZipFileException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
412 Self::KmsAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
413 Self::KmsDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
414 Self::KmsInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
415 Self::KmsNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
416 Self::RecursiveInvocationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417 Self::RequestTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418 Self::ResourceConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420 Self::ResourceNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
421 Self::SerializedRequestEntityTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
422 Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423 Self::SnapStartException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424 Self::SnapStartNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425 Self::SnapStartTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426 Self::SubnetIpAddressLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427 Self::TooManyRequestsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
428 Self::UnsupportedMediaTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
429 Self::Unhandled(e) => &e.meta,
430 }
431 }
432 pub fn is_ec2_access_denied_exception(&self) -> bool {
434 matches!(self, Self::Ec2AccessDeniedException(_))
435 }
436 pub fn is_ec2_throttled_exception(&self) -> bool {
438 matches!(self, Self::Ec2ThrottledException(_))
439 }
440 pub fn is_ec2_unexpected_exception(&self) -> bool {
442 matches!(self, Self::Ec2UnexpectedException(_))
443 }
444 pub fn is_efsio_exception(&self) -> bool {
446 matches!(self, Self::EfsioException(_))
447 }
448 pub fn is_efs_mount_connectivity_exception(&self) -> bool {
450 matches!(self, Self::EfsMountConnectivityException(_))
451 }
452 pub fn is_efs_mount_failure_exception(&self) -> bool {
454 matches!(self, Self::EfsMountFailureException(_))
455 }
456 pub fn is_efs_mount_timeout_exception(&self) -> bool {
458 matches!(self, Self::EfsMountTimeoutException(_))
459 }
460 pub fn is_eni_limit_reached_exception(&self) -> bool {
462 matches!(self, Self::EniLimitReachedException(_))
463 }
464 pub fn is_invalid_parameter_value_exception(&self) -> bool {
466 matches!(self, Self::InvalidParameterValueException(_))
467 }
468 pub fn is_invalid_request_content_exception(&self) -> bool {
470 matches!(self, Self::InvalidRequestContentException(_))
471 }
472 pub fn is_invalid_runtime_exception(&self) -> bool {
474 matches!(self, Self::InvalidRuntimeException(_))
475 }
476 pub fn is_invalid_security_group_id_exception(&self) -> bool {
478 matches!(self, Self::InvalidSecurityGroupIdException(_))
479 }
480 pub fn is_invalid_subnet_id_exception(&self) -> bool {
482 matches!(self, Self::InvalidSubnetIdException(_))
483 }
484 pub fn is_invalid_zip_file_exception(&self) -> bool {
486 matches!(self, Self::InvalidZipFileException(_))
487 }
488 pub fn is_kms_access_denied_exception(&self) -> bool {
490 matches!(self, Self::KmsAccessDeniedException(_))
491 }
492 pub fn is_kms_disabled_exception(&self) -> bool {
494 matches!(self, Self::KmsDisabledException(_))
495 }
496 pub fn is_kms_invalid_state_exception(&self) -> bool {
498 matches!(self, Self::KmsInvalidStateException(_))
499 }
500 pub fn is_kms_not_found_exception(&self) -> bool {
502 matches!(self, Self::KmsNotFoundException(_))
503 }
504 pub fn is_recursive_invocation_exception(&self) -> bool {
506 matches!(self, Self::RecursiveInvocationException(_))
507 }
508 pub fn is_request_too_large_exception(&self) -> bool {
510 matches!(self, Self::RequestTooLargeException(_))
511 }
512 pub fn is_resource_conflict_exception(&self) -> bool {
514 matches!(self, Self::ResourceConflictException(_))
515 }
516 pub fn is_resource_not_found_exception(&self) -> bool {
518 matches!(self, Self::ResourceNotFoundException(_))
519 }
520 pub fn is_resource_not_ready_exception(&self) -> bool {
522 matches!(self, Self::ResourceNotReadyException(_))
523 }
524 pub fn is_serialized_request_entity_too_large_exception(&self) -> bool {
526 matches!(self, Self::SerializedRequestEntityTooLargeException(_))
527 }
528 pub fn is_service_exception(&self) -> bool {
530 matches!(self, Self::ServiceException(_))
531 }
532 pub fn is_snap_start_exception(&self) -> bool {
534 matches!(self, Self::SnapStartException(_))
535 }
536 pub fn is_snap_start_not_ready_exception(&self) -> bool {
538 matches!(self, Self::SnapStartNotReadyException(_))
539 }
540 pub fn is_snap_start_timeout_exception(&self) -> bool {
542 matches!(self, Self::SnapStartTimeoutException(_))
543 }
544 pub fn is_subnet_ip_address_limit_reached_exception(&self) -> bool {
546 matches!(self, Self::SubnetIpAddressLimitReachedException(_))
547 }
548 pub fn is_too_many_requests_exception(&self) -> bool {
550 matches!(self, Self::TooManyRequestsException(_))
551 }
552 pub fn is_unsupported_media_type_exception(&self) -> bool {
554 matches!(self, Self::UnsupportedMediaTypeException(_))
555 }
556}
557impl ::std::error::Error for InvokeWithResponseStreamError {
558 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
559 match self {
560 Self::Ec2AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
561 Self::Ec2ThrottledException(_inner) => ::std::option::Option::Some(_inner),
562 Self::Ec2UnexpectedException(_inner) => ::std::option::Option::Some(_inner),
563 Self::EfsioException(_inner) => ::std::option::Option::Some(_inner),
564 Self::EfsMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
565 Self::EfsMountFailureException(_inner) => ::std::option::Option::Some(_inner),
566 Self::EfsMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
567 Self::EniLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
568 Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner),
569 Self::InvalidRequestContentException(_inner) => ::std::option::Option::Some(_inner),
570 Self::InvalidRuntimeException(_inner) => ::std::option::Option::Some(_inner),
571 Self::InvalidSecurityGroupIdException(_inner) => ::std::option::Option::Some(_inner),
572 Self::InvalidSubnetIdException(_inner) => ::std::option::Option::Some(_inner),
573 Self::InvalidZipFileException(_inner) => ::std::option::Option::Some(_inner),
574 Self::KmsAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
575 Self::KmsDisabledException(_inner) => ::std::option::Option::Some(_inner),
576 Self::KmsInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
577 Self::KmsNotFoundException(_inner) => ::std::option::Option::Some(_inner),
578 Self::RecursiveInvocationException(_inner) => ::std::option::Option::Some(_inner),
579 Self::RequestTooLargeException(_inner) => ::std::option::Option::Some(_inner),
580 Self::ResourceConflictException(_inner) => ::std::option::Option::Some(_inner),
581 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
582 Self::ResourceNotReadyException(_inner) => ::std::option::Option::Some(_inner),
583 Self::SerializedRequestEntityTooLargeException(_inner) => ::std::option::Option::Some(_inner),
584 Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
585 Self::SnapStartException(_inner) => ::std::option::Option::Some(_inner),
586 Self::SnapStartNotReadyException(_inner) => ::std::option::Option::Some(_inner),
587 Self::SnapStartTimeoutException(_inner) => ::std::option::Option::Some(_inner),
588 Self::SubnetIpAddressLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
589 Self::TooManyRequestsException(_inner) => ::std::option::Option::Some(_inner),
590 Self::UnsupportedMediaTypeException(_inner) => ::std::option::Option::Some(_inner),
591 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
592 }
593 }
594}
595impl ::std::fmt::Display for InvokeWithResponseStreamError {
596 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
597 match self {
598 Self::Ec2AccessDeniedException(_inner) => _inner.fmt(f),
599 Self::Ec2ThrottledException(_inner) => _inner.fmt(f),
600 Self::Ec2UnexpectedException(_inner) => _inner.fmt(f),
601 Self::EfsioException(_inner) => _inner.fmt(f),
602 Self::EfsMountConnectivityException(_inner) => _inner.fmt(f),
603 Self::EfsMountFailureException(_inner) => _inner.fmt(f),
604 Self::EfsMountTimeoutException(_inner) => _inner.fmt(f),
605 Self::EniLimitReachedException(_inner) => _inner.fmt(f),
606 Self::InvalidParameterValueException(_inner) => _inner.fmt(f),
607 Self::InvalidRequestContentException(_inner) => _inner.fmt(f),
608 Self::InvalidRuntimeException(_inner) => _inner.fmt(f),
609 Self::InvalidSecurityGroupIdException(_inner) => _inner.fmt(f),
610 Self::InvalidSubnetIdException(_inner) => _inner.fmt(f),
611 Self::InvalidZipFileException(_inner) => _inner.fmt(f),
612 Self::KmsAccessDeniedException(_inner) => _inner.fmt(f),
613 Self::KmsDisabledException(_inner) => _inner.fmt(f),
614 Self::KmsInvalidStateException(_inner) => _inner.fmt(f),
615 Self::KmsNotFoundException(_inner) => _inner.fmt(f),
616 Self::RecursiveInvocationException(_inner) => _inner.fmt(f),
617 Self::RequestTooLargeException(_inner) => _inner.fmt(f),
618 Self::ResourceConflictException(_inner) => _inner.fmt(f),
619 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
620 Self::ResourceNotReadyException(_inner) => _inner.fmt(f),
621 Self::SerializedRequestEntityTooLargeException(_inner) => _inner.fmt(f),
622 Self::ServiceException(_inner) => _inner.fmt(f),
623 Self::SnapStartException(_inner) => _inner.fmt(f),
624 Self::SnapStartNotReadyException(_inner) => _inner.fmt(f),
625 Self::SnapStartTimeoutException(_inner) => _inner.fmt(f),
626 Self::SubnetIpAddressLimitReachedException(_inner) => _inner.fmt(f),
627 Self::TooManyRequestsException(_inner) => _inner.fmt(f),
628 Self::UnsupportedMediaTypeException(_inner) => _inner.fmt(f),
629 Self::Unhandled(_inner) => {
630 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
631 write!(f, "unhandled error ({code})")
632 } else {
633 f.write_str("unhandled error")
634 }
635 }
636 }
637 }
638}
639impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeWithResponseStreamError {
640 fn code(&self) -> ::std::option::Option<&str> {
641 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
642 }
643 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
644 ::std::option::Option::None
645 }
646}
647impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeWithResponseStreamError {
648 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
649 match self {
650 Self::Ec2AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
651 Self::Ec2ThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
652 Self::Ec2UnexpectedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
653 Self::EfsioException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
654 Self::EfsMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
655 Self::EfsMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
656 Self::EfsMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
657 Self::EniLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
658 Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
659 Self::InvalidRequestContentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
660 Self::InvalidRuntimeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
661 Self::InvalidSecurityGroupIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
662 Self::InvalidSubnetIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
663 Self::InvalidZipFileException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
664 Self::KmsAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
665 Self::KmsDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
666 Self::KmsInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
667 Self::KmsNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
668 Self::RecursiveInvocationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
669 Self::RequestTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
670 Self::ResourceConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
671 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
672 Self::ResourceNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
673 Self::SerializedRequestEntityTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
674 Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
675 Self::SnapStartException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
676 Self::SnapStartNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
677 Self::SnapStartTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
678 Self::SubnetIpAddressLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
679 Self::TooManyRequestsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
680 Self::UnsupportedMediaTypeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
681 Self::Unhandled(_inner) => &_inner.meta,
682 }
683 }
684}
685impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeWithResponseStreamError {
686 fn create_unhandled_error(
687 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
688 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
689 ) -> Self {
690 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
691 source,
692 meta: meta.unwrap_or_default(),
693 })
694 }
695}
696impl ::aws_types::request_id::RequestId for crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError {
697 fn request_id(&self) -> Option<&str> {
698 self.meta().request_id()
699 }
700}
701
702pub use crate::operation::invoke_with_response_stream::_invoke_with_response_stream_output::InvokeWithResponseStreamOutput;
703
704pub use crate::operation::invoke_with_response_stream::_invoke_with_response_stream_input::InvokeWithResponseStreamInput;
705
706mod _invoke_with_response_stream_input;
707
708mod _invoke_with_response_stream_output;
709
710pub mod builders;