1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct Invoke;
6impl Invoke {
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::InvokeInput,
14 ) -> ::std::result::Result<
15 crate::operation::invoke::InvokeOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::invoke::InvokeError,
18 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19 >,
20 > {
21 let map_err =
22 |err: ::aws_smithy_runtime_api::client::result::SdkError<
23 ::aws_smithy_runtime_api::client::interceptors::context::Error,
24 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25 >| { err.map_service_error(|err| err.downcast::<crate::operation::invoke::InvokeError>().expect("correct error type")) };
26 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
27 .await
28 .map_err(map_err)?;
29 let output = context.finalize().map_err(map_err)?;
30 ::std::result::Result::Ok(output.downcast::<crate::operation::invoke::InvokeOutput>().expect("correct output type"))
31 }
32
33 pub(crate) async fn orchestrate_with_stop_point(
34 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
35 input: crate::operation::invoke::InvokeInput,
36 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
37 ) -> ::std::result::Result<
38 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
39 ::aws_smithy_runtime_api::client::result::SdkError<
40 ::aws_smithy_runtime_api::client::interceptors::context::Error,
41 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
42 >,
43 > {
44 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
45 use ::tracing::Instrument;
46 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Lambda", "Invoke", input, runtime_plugins, stop_point)
47 .instrument(::tracing::debug_span!(
50 "Lambda.Invoke",
51 "rpc.service" = "Lambda",
52 "rpc.method" = "Invoke",
53 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
54 "rpc.system" = "aws-api",
55 ))
56 .await
57 }
58
59 pub(crate) fn operation_runtime_plugins(
60 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
61 client_config: &crate::config::Config,
62 config_override: ::std::option::Option<crate::config::Builder>,
63 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
64 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
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 Invoke {
80 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
81 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Invoke");
82
83 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
84 InvokeRequestSerializer,
85 ));
86 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
87 InvokeResponseDeserializer,
88 ));
89
90 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
91 crate::config::auth::Params::builder()
92 .operation_name("Invoke")
93 .build()
94 .expect("required fields set"),
95 ));
96
97 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
98 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("Invoke", "Lambda"));
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("Invoke")
119 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
120 InvokeTelemetryInputCaptureInterceptor,
121 ))
122 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
123 InvokeEndpointParamsInterceptor,
124 ))
125 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
126 crate::operation::invoke::InvokeError,
127 >::new())
128 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
129 crate::operation::invoke::InvokeError,
130 >::new())
131 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
132 crate::operation::invoke::InvokeError,
133 >::new());
134
135 ::std::borrow::Cow::Owned(rcb)
136 }
137}
138
139#[derive(Debug)]
140struct InvokeTelemetryInputCaptureInterceptor;
141
142#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
143impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeTelemetryInputCaptureInterceptor {
144 fn name(&self) -> &'static str {
145 "InvokeTelemetryInputCaptureInterceptor"
146 }
147
148 fn read_before_execution(
149 &self,
150 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
151 '_,
152 ::aws_smithy_runtime_api::client::interceptors::context::Input,
153 ::aws_smithy_runtime_api::client::interceptors::context::Output,
154 ::aws_smithy_runtime_api::client::interceptors::context::Error,
155 >,
156 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
157 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
158 let ::std::option::Option::Some(requested) = cfg
160 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
161 .filter(|r| !r.is_empty())
162 else {
163 return ::std::result::Result::Ok(());
164 };
165
166 let ::std::option::Option::Some(input) = context.input().downcast_ref::<InvokeInput>() else {
167 return ::std::result::Result::Ok(());
169 };
170
171 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
172 if requested.should_capture("FunctionName") {
173 if let ::std::option::Option::Some(value) = input.function_name.as_deref() {
174 captured.insert("FunctionName", value);
175 }
176 }
177 if requested.should_capture("ClientContext") {
178 if let ::std::option::Option::Some(value) = input.client_context.as_deref() {
179 captured.insert("ClientContext", value);
180 }
181 }
182 if requested.should_capture("DurableExecutionName") {
183 if let ::std::option::Option::Some(value) = input.durable_execution_name.as_deref() {
184 captured.insert("DurableExecutionName", value);
185 }
186 }
187 if requested.should_capture("Qualifier") {
188 if let ::std::option::Option::Some(value) = input.qualifier.as_deref() {
189 captured.insert("Qualifier", value);
190 }
191 }
192 if requested.should_capture("TenantId") {
193 if let ::std::option::Option::Some(value) = input.tenant_id.as_deref() {
194 captured.insert("TenantId", value);
195 }
196 }
197
198 cfg.interceptor_state().store_put(captured);
199 ::std::result::Result::Ok(())
200 }
201}
202#[derive(Debug)]
203struct InvokeResponseDeserializer;
204impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InvokeResponseDeserializer {
205 fn deserialize_nonstreaming_with_config(
206 &self,
207 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
208 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
209 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
210 let (success, status) = (response.status().is_success(), response.status().as_u16());
211 let headers = response.headers();
212 let body = response.body().bytes().expect("body loaded");
213 #[allow(unused_mut)]
214 let mut force_error = false;
215 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
216 let parse_result = if !success && status != 200 || force_error {
217 crate::protocol_serde::shape_invoke::de_invoke_http_error(status, headers, body)
218 } else {
219 crate::protocol_serde::shape_invoke::de_invoke_http_response(status, headers, body)
220 };
221 crate::protocol_serde::type_erase_result(parse_result)
222 }
223}
224#[derive(Debug)]
225struct InvokeRequestSerializer;
226impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InvokeRequestSerializer {
227 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
228 fn serialize_input(
229 &self,
230 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
231 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
232 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
233 let input = input.downcast::<crate::operation::invoke::InvokeInput>().expect("correct type");
234 let _header_serialization_settings = _cfg
235 .load::<crate::serialization_settings::HeaderSerializationSettings>()
236 .cloned()
237 .unwrap_or_default();
238 let mut request_builder = {
239 #[allow(clippy::uninlined_format_args)]
240 fn uri_base(
241 _input: &crate::operation::invoke::InvokeInput,
242 output: &mut ::std::string::String,
243 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
244 use ::std::fmt::Write as _;
245 let input_1 = &_input.function_name;
246 let input_1 = input_1
247 .as_ref()
248 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
249 let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
250 if function_name.is_empty() {
251 return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
252 "function_name",
253 "cannot be empty or unset",
254 ));
255 }
256 ::std::write!(output, "/2015-03-31/functions/{FunctionName}/invocations", FunctionName = function_name)
257 .expect("formatting should succeed");
258 ::std::result::Result::Ok(())
259 }
260 fn uri_query(
261 _input: &crate::operation::invoke::InvokeInput,
262 mut output: &mut ::std::string::String,
263 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
264 let mut query = ::aws_smithy_http::query::Writer::new(output);
265 if let ::std::option::Option::Some(inner_2) = &_input.qualifier {
266 {
267 query.push_kv("Qualifier", &::aws_smithy_http::query::fmt_string(inner_2));
268 }
269 }
270 ::std::result::Result::Ok(())
271 }
272 #[allow(clippy::unnecessary_wraps)]
273 fn update_http_builder(
274 input: &crate::operation::invoke::InvokeInput,
275 builder: ::http_1x::request::Builder,
276 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
277 let mut uri = ::std::string::String::new();
278 uri_base(input, &mut uri)?;
279 uri_query(input, &mut uri)?;
280 let builder = crate::protocol_serde::shape_invoke::ser_invoke_headers(input, builder)?;
281 ::std::result::Result::Ok(builder.method("POST").uri(uri))
282 }
283 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
284 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/octet-stream");
285 builder
286 };
287 let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_invoke_input::ser_payload_http_payload(input.payload)?);
288 if let Some(content_length) = body.content_length() {
289 let content_length = content_length.to_string();
290 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
291 }
292 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
293 }
294}
295#[derive(Debug)]
296struct InvokeEndpointParamsInterceptor;
297
298#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
299impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InvokeEndpointParamsInterceptor {
300 fn name(&self) -> &'static str {
301 "InvokeEndpointParamsInterceptor"
302 }
303
304 fn read_before_execution(
305 &self,
306 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
307 '_,
308 ::aws_smithy_runtime_api::client::interceptors::context::Input,
309 ::aws_smithy_runtime_api::client::interceptors::context::Output,
310 ::aws_smithy_runtime_api::client::interceptors::context::Error,
311 >,
312 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
313 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
314 let _input = context.input().downcast_ref::<InvokeInput>().ok_or("failed to downcast to InvokeInput")?;
315
316 let params = crate::config::endpoint::Params::builder()
317 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
318 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
319 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
320 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
321 .build()
322 .map_err(|err| {
323 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
324 })?;
325 cfg.interceptor_state()
326 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
327 ::std::result::Result::Ok(())
328 }
329}
330
331#[non_exhaustive]
336#[derive(::std::fmt::Debug)]
337pub enum InvokeError {
338 CodeArtifactUserDeletedException(crate::types::error::CodeArtifactUserDeletedException),
340 CodeArtifactUserFailedException(crate::types::error::CodeArtifactUserFailedException),
342 CodeArtifactUserPendingException(crate::types::error::CodeArtifactUserPendingException),
344 DurableExecutionAlreadyStartedException(crate::types::error::DurableExecutionAlreadyStartedException),
346 Ec2AccessDeniedException(crate::types::error::Ec2AccessDeniedException),
348 Ec2ThrottledException(crate::types::error::Ec2ThrottledException),
350 Ec2UnexpectedException(crate::types::error::Ec2UnexpectedException),
352 EfsioException(crate::types::error::EfsioException),
354 EfsMountConnectivityException(crate::types::error::EfsMountConnectivityException),
356 EfsMountFailureException(crate::types::error::EfsMountFailureException),
358 EfsMountTimeoutException(crate::types::error::EfsMountTimeoutException),
360 EniLimitReachedException(crate::types::error::EniLimitReachedException),
362 EniNotReadyException(crate::types::error::EniNotReadyException),
364 InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
366 InvalidRequestContentException(crate::types::error::InvalidRequestContentException),
368 InvalidRuntimeException(crate::types::error::InvalidRuntimeException),
370 InvalidSecurityGroupIdException(crate::types::error::InvalidSecurityGroupIdException),
372 InvalidSubnetIdException(crate::types::error::InvalidSubnetIdException),
374 InvalidZipFileException(crate::types::error::InvalidZipFileException),
376 KmsAccessDeniedException(crate::types::error::KmsAccessDeniedException),
378 KmsDisabledException(crate::types::error::KmsDisabledException),
380 KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
382 KmsNotFoundException(crate::types::error::KmsNotFoundException),
384 ModeNotSupportedException(crate::types::error::ModeNotSupportedException),
386 NoPublishedVersionException(crate::types::error::NoPublishedVersionException),
388 RecursiveInvocationException(crate::types::error::RecursiveInvocationException),
390 RequestTooLargeException(crate::types::error::RequestTooLargeException),
392 ResourceConflictException(crate::types::error::ResourceConflictException),
394 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
396 ResourceNotReadyException(crate::types::error::ResourceNotReadyException),
398 S3FilesMountConnectivityException(crate::types::error::S3FilesMountConnectivityException),
400 S3FilesMountFailureException(crate::types::error::S3FilesMountFailureException),
402 S3FilesMountTimeoutException(crate::types::error::S3FilesMountTimeoutException),
404 SerializedRequestEntityTooLargeException(crate::types::error::SerializedRequestEntityTooLargeException),
406 ServiceException(crate::types::error::ServiceException),
408 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
410 SnapStartException(crate::types::error::SnapStartException),
412 SnapStartNotReadyException(crate::types::error::SnapStartNotReadyException),
414 SnapStartRegenerationFailureException(crate::types::error::SnapStartRegenerationFailureException),
416 SnapStartTimeoutException(crate::types::error::SnapStartTimeoutException),
418 SubnetIpAddressLimitReachedException(crate::types::error::SubnetIpAddressLimitReachedException),
420 TooManyRequestsException(crate::types::error::TooManyRequestsException),
422 UnsupportedMediaTypeException(crate::types::error::UnsupportedMediaTypeException),
424 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
426 variable wildcard pattern and check `.code()`:
427 \
428 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
429 \
430 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeError) for what information is available for the error.")]
431 Unhandled(crate::error::sealed_unhandled::Unhandled),
432}
433impl InvokeError {
434 pub fn unhandled(
436 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
437 ) -> Self {
438 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
439 source: err.into(),
440 meta: ::std::default::Default::default(),
441 })
442 }
443
444 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
446 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
447 source: err.clone().into(),
448 meta: err,
449 })
450 }
451 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
456 match self {
457 Self::CodeArtifactUserDeletedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
458 Self::CodeArtifactUserFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
459 Self::CodeArtifactUserPendingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
460 Self::DurableExecutionAlreadyStartedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
461 Self::Ec2AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
462 Self::Ec2ThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
463 Self::Ec2UnexpectedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
464 Self::EfsioException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
465 Self::EfsMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
466 Self::EfsMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
467 Self::EfsMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
468 Self::EniLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
469 Self::EniNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
470 Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
471 Self::InvalidRequestContentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
472 Self::InvalidRuntimeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
473 Self::InvalidSecurityGroupIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
474 Self::InvalidSubnetIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
475 Self::InvalidZipFileException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
476 Self::KmsAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
477 Self::KmsDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
478 Self::KmsInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
479 Self::KmsNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
480 Self::ModeNotSupportedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
481 Self::NoPublishedVersionException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
482 Self::RecursiveInvocationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
483 Self::RequestTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
484 Self::ResourceConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
485 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
486 Self::ResourceNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
487 Self::S3FilesMountConnectivityException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
488 Self::S3FilesMountFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
489 Self::S3FilesMountTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
490 Self::SerializedRequestEntityTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
491 Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
492 Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
493 Self::SnapStartException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
494 Self::SnapStartNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
495 Self::SnapStartRegenerationFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
496 Self::SnapStartTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
497 Self::SubnetIpAddressLimitReachedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
498 Self::TooManyRequestsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
499 Self::UnsupportedMediaTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
500 Self::Unhandled(e) => &e.meta,
501 }
502 }
503 pub fn is_code_artifact_user_deleted_exception(&self) -> bool {
505 matches!(self, Self::CodeArtifactUserDeletedException(_))
506 }
507 pub fn is_code_artifact_user_failed_exception(&self) -> bool {
509 matches!(self, Self::CodeArtifactUserFailedException(_))
510 }
511 pub fn is_code_artifact_user_pending_exception(&self) -> bool {
513 matches!(self, Self::CodeArtifactUserPendingException(_))
514 }
515 pub fn is_durable_execution_already_started_exception(&self) -> bool {
517 matches!(self, Self::DurableExecutionAlreadyStartedException(_))
518 }
519 pub fn is_ec2_access_denied_exception(&self) -> bool {
521 matches!(self, Self::Ec2AccessDeniedException(_))
522 }
523 pub fn is_ec2_throttled_exception(&self) -> bool {
525 matches!(self, Self::Ec2ThrottledException(_))
526 }
527 pub fn is_ec2_unexpected_exception(&self) -> bool {
529 matches!(self, Self::Ec2UnexpectedException(_))
530 }
531 pub fn is_efsio_exception(&self) -> bool {
533 matches!(self, Self::EfsioException(_))
534 }
535 pub fn is_efs_mount_connectivity_exception(&self) -> bool {
537 matches!(self, Self::EfsMountConnectivityException(_))
538 }
539 pub fn is_efs_mount_failure_exception(&self) -> bool {
541 matches!(self, Self::EfsMountFailureException(_))
542 }
543 pub fn is_efs_mount_timeout_exception(&self) -> bool {
545 matches!(self, Self::EfsMountTimeoutException(_))
546 }
547 pub fn is_eni_limit_reached_exception(&self) -> bool {
549 matches!(self, Self::EniLimitReachedException(_))
550 }
551 pub fn is_eni_not_ready_exception(&self) -> bool {
553 matches!(self, Self::EniNotReadyException(_))
554 }
555 pub fn is_invalid_parameter_value_exception(&self) -> bool {
557 matches!(self, Self::InvalidParameterValueException(_))
558 }
559 pub fn is_invalid_request_content_exception(&self) -> bool {
561 matches!(self, Self::InvalidRequestContentException(_))
562 }
563 pub fn is_invalid_runtime_exception(&self) -> bool {
565 matches!(self, Self::InvalidRuntimeException(_))
566 }
567 pub fn is_invalid_security_group_id_exception(&self) -> bool {
569 matches!(self, Self::InvalidSecurityGroupIdException(_))
570 }
571 pub fn is_invalid_subnet_id_exception(&self) -> bool {
573 matches!(self, Self::InvalidSubnetIdException(_))
574 }
575 pub fn is_invalid_zip_file_exception(&self) -> bool {
577 matches!(self, Self::InvalidZipFileException(_))
578 }
579 pub fn is_kms_access_denied_exception(&self) -> bool {
581 matches!(self, Self::KmsAccessDeniedException(_))
582 }
583 pub fn is_kms_disabled_exception(&self) -> bool {
585 matches!(self, Self::KmsDisabledException(_))
586 }
587 pub fn is_kms_invalid_state_exception(&self) -> bool {
589 matches!(self, Self::KmsInvalidStateException(_))
590 }
591 pub fn is_kms_not_found_exception(&self) -> bool {
593 matches!(self, Self::KmsNotFoundException(_))
594 }
595 pub fn is_mode_not_supported_exception(&self) -> bool {
597 matches!(self, Self::ModeNotSupportedException(_))
598 }
599 pub fn is_no_published_version_exception(&self) -> bool {
601 matches!(self, Self::NoPublishedVersionException(_))
602 }
603 pub fn is_recursive_invocation_exception(&self) -> bool {
605 matches!(self, Self::RecursiveInvocationException(_))
606 }
607 pub fn is_request_too_large_exception(&self) -> bool {
609 matches!(self, Self::RequestTooLargeException(_))
610 }
611 pub fn is_resource_conflict_exception(&self) -> bool {
613 matches!(self, Self::ResourceConflictException(_))
614 }
615 pub fn is_resource_not_found_exception(&self) -> bool {
617 matches!(self, Self::ResourceNotFoundException(_))
618 }
619 pub fn is_resource_not_ready_exception(&self) -> bool {
621 matches!(self, Self::ResourceNotReadyException(_))
622 }
623 pub fn is_s3_files_mount_connectivity_exception(&self) -> bool {
625 matches!(self, Self::S3FilesMountConnectivityException(_))
626 }
627 pub fn is_s3_files_mount_failure_exception(&self) -> bool {
629 matches!(self, Self::S3FilesMountFailureException(_))
630 }
631 pub fn is_s3_files_mount_timeout_exception(&self) -> bool {
633 matches!(self, Self::S3FilesMountTimeoutException(_))
634 }
635 pub fn is_serialized_request_entity_too_large_exception(&self) -> bool {
637 matches!(self, Self::SerializedRequestEntityTooLargeException(_))
638 }
639 pub fn is_service_exception(&self) -> bool {
641 matches!(self, Self::ServiceException(_))
642 }
643 pub fn is_service_quota_exceeded_exception(&self) -> bool {
645 matches!(self, Self::ServiceQuotaExceededException(_))
646 }
647 pub fn is_snap_start_exception(&self) -> bool {
649 matches!(self, Self::SnapStartException(_))
650 }
651 pub fn is_snap_start_not_ready_exception(&self) -> bool {
653 matches!(self, Self::SnapStartNotReadyException(_))
654 }
655 pub fn is_snap_start_regeneration_failure_exception(&self) -> bool {
657 matches!(self, Self::SnapStartRegenerationFailureException(_))
658 }
659 pub fn is_snap_start_timeout_exception(&self) -> bool {
661 matches!(self, Self::SnapStartTimeoutException(_))
662 }
663 pub fn is_subnet_ip_address_limit_reached_exception(&self) -> bool {
665 matches!(self, Self::SubnetIpAddressLimitReachedException(_))
666 }
667 pub fn is_too_many_requests_exception(&self) -> bool {
669 matches!(self, Self::TooManyRequestsException(_))
670 }
671 pub fn is_unsupported_media_type_exception(&self) -> bool {
673 matches!(self, Self::UnsupportedMediaTypeException(_))
674 }
675}
676impl ::std::error::Error for InvokeError {
677 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
678 match self {
679 Self::CodeArtifactUserDeletedException(_inner) => ::std::option::Option::Some(_inner),
680 Self::CodeArtifactUserFailedException(_inner) => ::std::option::Option::Some(_inner),
681 Self::CodeArtifactUserPendingException(_inner) => ::std::option::Option::Some(_inner),
682 Self::DurableExecutionAlreadyStartedException(_inner) => ::std::option::Option::Some(_inner),
683 Self::Ec2AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
684 Self::Ec2ThrottledException(_inner) => ::std::option::Option::Some(_inner),
685 Self::Ec2UnexpectedException(_inner) => ::std::option::Option::Some(_inner),
686 Self::EfsioException(_inner) => ::std::option::Option::Some(_inner),
687 Self::EfsMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
688 Self::EfsMountFailureException(_inner) => ::std::option::Option::Some(_inner),
689 Self::EfsMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
690 Self::EniLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
691 Self::EniNotReadyException(_inner) => ::std::option::Option::Some(_inner),
692 Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner),
693 Self::InvalidRequestContentException(_inner) => ::std::option::Option::Some(_inner),
694 Self::InvalidRuntimeException(_inner) => ::std::option::Option::Some(_inner),
695 Self::InvalidSecurityGroupIdException(_inner) => ::std::option::Option::Some(_inner),
696 Self::InvalidSubnetIdException(_inner) => ::std::option::Option::Some(_inner),
697 Self::InvalidZipFileException(_inner) => ::std::option::Option::Some(_inner),
698 Self::KmsAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
699 Self::KmsDisabledException(_inner) => ::std::option::Option::Some(_inner),
700 Self::KmsInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
701 Self::KmsNotFoundException(_inner) => ::std::option::Option::Some(_inner),
702 Self::ModeNotSupportedException(_inner) => ::std::option::Option::Some(_inner),
703 Self::NoPublishedVersionException(_inner) => ::std::option::Option::Some(_inner),
704 Self::RecursiveInvocationException(_inner) => ::std::option::Option::Some(_inner),
705 Self::RequestTooLargeException(_inner) => ::std::option::Option::Some(_inner),
706 Self::ResourceConflictException(_inner) => ::std::option::Option::Some(_inner),
707 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
708 Self::ResourceNotReadyException(_inner) => ::std::option::Option::Some(_inner),
709 Self::S3FilesMountConnectivityException(_inner) => ::std::option::Option::Some(_inner),
710 Self::S3FilesMountFailureException(_inner) => ::std::option::Option::Some(_inner),
711 Self::S3FilesMountTimeoutException(_inner) => ::std::option::Option::Some(_inner),
712 Self::SerializedRequestEntityTooLargeException(_inner) => ::std::option::Option::Some(_inner),
713 Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
714 Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
715 Self::SnapStartException(_inner) => ::std::option::Option::Some(_inner),
716 Self::SnapStartNotReadyException(_inner) => ::std::option::Option::Some(_inner),
717 Self::SnapStartRegenerationFailureException(_inner) => ::std::option::Option::Some(_inner),
718 Self::SnapStartTimeoutException(_inner) => ::std::option::Option::Some(_inner),
719 Self::SubnetIpAddressLimitReachedException(_inner) => ::std::option::Option::Some(_inner),
720 Self::TooManyRequestsException(_inner) => ::std::option::Option::Some(_inner),
721 Self::UnsupportedMediaTypeException(_inner) => ::std::option::Option::Some(_inner),
722 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
723 }
724 }
725}
726impl ::std::fmt::Display for InvokeError {
727 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
728 match self {
729 Self::CodeArtifactUserDeletedException(_inner) => _inner.fmt(f),
730 Self::CodeArtifactUserFailedException(_inner) => _inner.fmt(f),
731 Self::CodeArtifactUserPendingException(_inner) => _inner.fmt(f),
732 Self::DurableExecutionAlreadyStartedException(_inner) => _inner.fmt(f),
733 Self::Ec2AccessDeniedException(_inner) => _inner.fmt(f),
734 Self::Ec2ThrottledException(_inner) => _inner.fmt(f),
735 Self::Ec2UnexpectedException(_inner) => _inner.fmt(f),
736 Self::EfsioException(_inner) => _inner.fmt(f),
737 Self::EfsMountConnectivityException(_inner) => _inner.fmt(f),
738 Self::EfsMountFailureException(_inner) => _inner.fmt(f),
739 Self::EfsMountTimeoutException(_inner) => _inner.fmt(f),
740 Self::EniLimitReachedException(_inner) => _inner.fmt(f),
741 Self::EniNotReadyException(_inner) => _inner.fmt(f),
742 Self::InvalidParameterValueException(_inner) => _inner.fmt(f),
743 Self::InvalidRequestContentException(_inner) => _inner.fmt(f),
744 Self::InvalidRuntimeException(_inner) => _inner.fmt(f),
745 Self::InvalidSecurityGroupIdException(_inner) => _inner.fmt(f),
746 Self::InvalidSubnetIdException(_inner) => _inner.fmt(f),
747 Self::InvalidZipFileException(_inner) => _inner.fmt(f),
748 Self::KmsAccessDeniedException(_inner) => _inner.fmt(f),
749 Self::KmsDisabledException(_inner) => _inner.fmt(f),
750 Self::KmsInvalidStateException(_inner) => _inner.fmt(f),
751 Self::KmsNotFoundException(_inner) => _inner.fmt(f),
752 Self::ModeNotSupportedException(_inner) => _inner.fmt(f),
753 Self::NoPublishedVersionException(_inner) => _inner.fmt(f),
754 Self::RecursiveInvocationException(_inner) => _inner.fmt(f),
755 Self::RequestTooLargeException(_inner) => _inner.fmt(f),
756 Self::ResourceConflictException(_inner) => _inner.fmt(f),
757 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
758 Self::ResourceNotReadyException(_inner) => _inner.fmt(f),
759 Self::S3FilesMountConnectivityException(_inner) => _inner.fmt(f),
760 Self::S3FilesMountFailureException(_inner) => _inner.fmt(f),
761 Self::S3FilesMountTimeoutException(_inner) => _inner.fmt(f),
762 Self::SerializedRequestEntityTooLargeException(_inner) => _inner.fmt(f),
763 Self::ServiceException(_inner) => _inner.fmt(f),
764 Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
765 Self::SnapStartException(_inner) => _inner.fmt(f),
766 Self::SnapStartNotReadyException(_inner) => _inner.fmt(f),
767 Self::SnapStartRegenerationFailureException(_inner) => _inner.fmt(f),
768 Self::SnapStartTimeoutException(_inner) => _inner.fmt(f),
769 Self::SubnetIpAddressLimitReachedException(_inner) => _inner.fmt(f),
770 Self::TooManyRequestsException(_inner) => _inner.fmt(f),
771 Self::UnsupportedMediaTypeException(_inner) => _inner.fmt(f),
772 Self::Unhandled(_inner) => {
773 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
774 write!(f, "unhandled error ({code})")
775 } else {
776 f.write_str("unhandled error")
777 }
778 }
779 }
780 }
781}
782impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeError {
783 fn code(&self) -> ::std::option::Option<&str> {
784 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
785 }
786 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
787 ::std::option::Option::None
788 }
789}
790impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeError {
791 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
792 match self {
793 Self::CodeArtifactUserDeletedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
794 Self::CodeArtifactUserFailedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
795 Self::CodeArtifactUserPendingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
796 Self::DurableExecutionAlreadyStartedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
797 Self::Ec2AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
798 Self::Ec2ThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
799 Self::Ec2UnexpectedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
800 Self::EfsioException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
801 Self::EfsMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
802 Self::EfsMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
803 Self::EfsMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
804 Self::EniLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
805 Self::EniNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
806 Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
807 Self::InvalidRequestContentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
808 Self::InvalidRuntimeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
809 Self::InvalidSecurityGroupIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
810 Self::InvalidSubnetIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
811 Self::InvalidZipFileException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
812 Self::KmsAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
813 Self::KmsDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
814 Self::KmsInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
815 Self::KmsNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
816 Self::ModeNotSupportedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
817 Self::NoPublishedVersionException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
818 Self::RecursiveInvocationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
819 Self::RequestTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
820 Self::ResourceConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
821 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
822 Self::ResourceNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
823 Self::S3FilesMountConnectivityException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
824 Self::S3FilesMountFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
825 Self::S3FilesMountTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
826 Self::SerializedRequestEntityTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
827 Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
828 Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
829 Self::SnapStartException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
830 Self::SnapStartNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
831 Self::SnapStartRegenerationFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
832 Self::SnapStartTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
833 Self::SubnetIpAddressLimitReachedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
834 Self::TooManyRequestsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
835 Self::UnsupportedMediaTypeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
836 Self::Unhandled(_inner) => &_inner.meta,
837 }
838 }
839}
840impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeError {
841 fn create_unhandled_error(
842 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
843 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
844 ) -> Self {
845 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
846 source,
847 meta: meta.unwrap_or_default(),
848 })
849 }
850}
851impl ::aws_types::request_id::RequestId for crate::operation::invoke::InvokeError {
852 fn request_id(&self) -> Option<&str> {
853 self.meta().request_id()
854 }
855}
856
857pub use crate::operation::invoke::_invoke_input::InvokeInput;
858
859pub use crate::operation::invoke::_invoke_output::InvokeOutput;
860
861mod _invoke_input;
862
863mod _invoke_output;
864
865pub mod builders;