1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateInfrastructureConfiguration;
6impl CreateInfrastructureConfiguration {
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::create_infrastructure_configuration::CreateInfrastructureConfigurationInput,
14 ) -> ::std::result::Result<
15 crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationError,
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::create_infrastructure_configuration::CreateInfrastructureConfigurationError>()
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::create_infrastructure_configuration::CreateInfrastructureConfigurationOutput>()
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::create_infrastructure_configuration::CreateInfrastructureConfigurationInput,
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(
55 "imagebuilder",
56 "CreateInfrastructureConfiguration",
57 input,
58 runtime_plugins,
59 stop_point,
60 )
61 .instrument(::tracing::debug_span!(
64 "imagebuilder.CreateInfrastructureConfiguration",
65 "rpc.service" = "imagebuilder",
66 "rpc.method" = "CreateInfrastructureConfiguration",
67 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68 "rpc.system" = "aws-api",
69 ))
70 .await
71 }
72
73 pub(crate) fn operation_runtime_plugins(
74 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75 client_config: &crate::config::Config,
76 config_override: ::std::option::Option<crate::config::Builder>,
77 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79 runtime_plugins = runtime_plugins.with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new(
80 |token_provider, input| {
81 let input: &mut crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationInput =
82 input.downcast_mut().expect("correct type");
83 if input.client_token.is_none() {
84 input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token());
85 }
86 },
87 ));
88 if let ::std::option::Option::Some(config_override) = config_override {
89 for plugin in config_override.runtime_plugins.iter().cloned() {
90 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
91 }
92 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
93 config_override,
94 client_config.config.clone(),
95 &client_config.runtime_components,
96 ));
97 }
98 runtime_plugins
99 }
100}
101impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateInfrastructureConfiguration {
102 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
103 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateInfrastructureConfiguration");
104
105 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
106 CreateInfrastructureConfigurationRequestSerializer,
107 ));
108 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
109 CreateInfrastructureConfigurationResponseDeserializer,
110 ));
111
112 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
113 crate::config::auth::Params::builder()
114 .operation_name("CreateInfrastructureConfiguration")
115 .build()
116 .expect("required fields set"),
117 ));
118
119 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
120 "CreateInfrastructureConfiguration",
121 "imagebuilder",
122 ));
123 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
124 signing_options.double_uri_encode = true;
125 signing_options.content_sha256_header = false;
126 signing_options.normalize_uri_path = true;
127 signing_options.payload_override = None;
128
129 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
130 signing_options,
131 ..::std::default::Default::default()
132 });
133
134 ::std::option::Option::Some(cfg.freeze())
135 }
136
137 fn runtime_components(
138 &self,
139 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
140 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
141 #[allow(unused_mut)]
142 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateInfrastructureConfiguration")
143 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
144 CreateInfrastructureConfigurationTelemetryInputCaptureInterceptor,
145 ))
146 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
147 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
148 ))
149 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
150 CreateInfrastructureConfigurationEndpointParamsInterceptor,
151 ))
152 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
153 crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationError,
154 >::new())
155 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
156 crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationError,
157 >::new())
158 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
159 crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationError,
160 >::new())
161 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
162 crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationError,
163 >::new());
164
165 ::std::borrow::Cow::Owned(rcb)
166 }
167}
168
169#[derive(Debug)]
170struct CreateInfrastructureConfigurationTelemetryInputCaptureInterceptor;
171
172#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
173impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateInfrastructureConfigurationTelemetryInputCaptureInterceptor {
174 fn name(&self) -> &'static str {
175 "CreateInfrastructureConfigurationTelemetryInputCaptureInterceptor"
176 }
177
178 fn read_before_execution(
179 &self,
180 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
181 '_,
182 ::aws_smithy_runtime_api::client::interceptors::context::Input,
183 ::aws_smithy_runtime_api::client::interceptors::context::Output,
184 ::aws_smithy_runtime_api::client::interceptors::context::Error,
185 >,
186 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
187 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
188 let ::std::option::Option::Some(requested) = cfg
190 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
191 .filter(|r| !r.is_empty())
192 else {
193 return ::std::result::Result::Ok(());
194 };
195
196 let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateInfrastructureConfigurationInput>() else {
197 return ::std::result::Result::Ok(());
199 };
200
201 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
202 if requested.should_capture("name") {
203 if let ::std::option::Option::Some(value) = input.name.as_deref() {
204 captured.insert("name", value);
205 }
206 }
207 if requested.should_capture("description") {
208 if let ::std::option::Option::Some(value) = input.description.as_deref() {
209 captured.insert("description", value);
210 }
211 }
212 if requested.should_capture("instanceProfileName") {
213 if let ::std::option::Option::Some(value) = input.instance_profile_name.as_deref() {
214 captured.insert("instanceProfileName", value);
215 }
216 }
217 if requested.should_capture("subnetId") {
218 if let ::std::option::Option::Some(value) = input.subnet_id.as_deref() {
219 captured.insert("subnetId", value);
220 }
221 }
222 if requested.should_capture("keyPair") {
223 if let ::std::option::Option::Some(value) = input.key_pair.as_deref() {
224 captured.insert("keyPair", value);
225 }
226 }
227 if requested.should_capture("snsTopicArn") {
228 if let ::std::option::Option::Some(value) = input.sns_topic_arn.as_deref() {
229 captured.insert("snsTopicArn", value);
230 }
231 }
232 if requested.should_capture("clientToken") {
233 if let ::std::option::Option::Some(value) = input.client_token.as_deref() {
234 captured.insert("clientToken", value);
235 }
236 }
237
238 cfg.interceptor_state().store_put(captured);
239 ::std::result::Result::Ok(())
240 }
241}
242#[derive(Debug)]
243struct CreateInfrastructureConfigurationResponseDeserializer;
244impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateInfrastructureConfigurationResponseDeserializer {
245 fn deserialize_nonstreaming_with_config(
246 &self,
247 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
248 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
249 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
250 let (success, status) = (response.status().is_success(), response.status().as_u16());
251 let headers = response.headers();
252 let body = response.body().bytes().expect("body loaded");
253 #[allow(unused_mut)]
254 let mut force_error = false;
255 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
256 let parse_result = if !success && status != 200 || force_error {
257 crate::protocol_serde::shape_create_infrastructure_configuration::de_create_infrastructure_configuration_http_error(status, headers, body)
258 } else {
259 crate::protocol_serde::shape_create_infrastructure_configuration::de_create_infrastructure_configuration_http_response(
260 status, headers, body,
261 )
262 };
263 crate::protocol_serde::type_erase_result(parse_result)
264 }
265}
266#[derive(Debug)]
267struct CreateInfrastructureConfigurationRequestSerializer;
268impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateInfrastructureConfigurationRequestSerializer {
269 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
270 fn serialize_input(
271 &self,
272 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
273 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
274 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
275 let input = input
276 .downcast::<crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationInput>()
277 .expect("correct type");
278 let _header_serialization_settings = _cfg
279 .load::<crate::serialization_settings::HeaderSerializationSettings>()
280 .cloned()
281 .unwrap_or_default();
282 let mut request_builder = {
283 #[allow(clippy::uninlined_format_args)]
284 fn uri_base(
285 _input: &crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationInput,
286 output: &mut ::std::string::String,
287 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
288 use ::std::fmt::Write as _;
289 ::std::write!(output, "/CreateInfrastructureConfiguration").expect("formatting should succeed");
290 ::std::result::Result::Ok(())
291 }
292 #[allow(clippy::unnecessary_wraps)]
293 fn update_http_builder(
294 input: &crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationInput,
295 builder: ::http_1x::request::Builder,
296 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
297 let mut uri = ::std::string::String::new();
298 uri_base(input, &mut uri)?;
299 ::std::result::Result::Ok(builder.method("PUT").uri(uri))
300 }
301 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
302 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
303 builder
304 };
305 let body = ::aws_smithy_types::body::SdkBody::from(
306 crate::protocol_serde::shape_create_infrastructure_configuration::ser_create_infrastructure_configuration_input(&input)?,
307 );
308 if let Some(content_length) = body.content_length() {
309 let content_length = content_length.to_string();
310 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
311 }
312 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
313 }
314}
315#[derive(Debug)]
316struct CreateInfrastructureConfigurationEndpointParamsInterceptor;
317
318#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
319impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateInfrastructureConfigurationEndpointParamsInterceptor {
320 fn name(&self) -> &'static str {
321 "CreateInfrastructureConfigurationEndpointParamsInterceptor"
322 }
323
324 fn read_before_execution(
325 &self,
326 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
327 '_,
328 ::aws_smithy_runtime_api::client::interceptors::context::Input,
329 ::aws_smithy_runtime_api::client::interceptors::context::Output,
330 ::aws_smithy_runtime_api::client::interceptors::context::Error,
331 >,
332 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
333 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
334 let _input = context
335 .input()
336 .downcast_ref::<CreateInfrastructureConfigurationInput>()
337 .ok_or("failed to downcast to CreateInfrastructureConfigurationInput")?;
338
339 let params = crate::config::endpoint::Params::builder()
340 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
341 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
342 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
343 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
344 .build()
345 .map_err(|err| {
346 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
347 })?;
348 cfg.interceptor_state()
349 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
350 ::std::result::Result::Ok(())
351 }
352}
353
354#[non_exhaustive]
359#[derive(::std::fmt::Debug)]
360pub enum CreateInfrastructureConfigurationError {
361 CallRateLimitExceededException(crate::types::error::CallRateLimitExceededException),
363 ClientException(crate::types::error::ClientException),
365 DryRunOperationException(crate::types::error::DryRunOperationException),
367 ForbiddenException(crate::types::error::ForbiddenException),
369 IdempotentParameterMismatchException(crate::types::error::IdempotentParameterMismatchException),
371 InvalidRequestException(crate::types::error::InvalidRequestException),
373 ResourceAlreadyExistsException(crate::types::error::ResourceAlreadyExistsException),
375 ResourceInUseException(crate::types::error::ResourceInUseException),
377 ServiceException(crate::types::error::ServiceException),
379 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
381 ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
383 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
385 variable wildcard pattern and check `.code()`:
386 \
387 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
388 \
389 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateInfrastructureConfigurationError) for what information is available for the error.")]
390 Unhandled(crate::error::sealed_unhandled::Unhandled),
391}
392impl CreateInfrastructureConfigurationError {
393 pub fn unhandled(
395 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
396 ) -> Self {
397 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
398 source: err.into(),
399 meta: ::std::default::Default::default(),
400 })
401 }
402
403 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
405 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
406 source: err.clone().into(),
407 meta: err,
408 })
409 }
410 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
415 match self {
416 Self::CallRateLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417 Self::ClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418 Self::DryRunOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419 Self::ForbiddenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420 Self::IdempotentParameterMismatchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
421 Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
422 Self::ResourceAlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423 Self::ResourceInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424 Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425 Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426 Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427 Self::Unhandled(e) => &e.meta,
428 }
429 }
430 pub fn is_call_rate_limit_exceeded_exception(&self) -> bool {
432 matches!(self, Self::CallRateLimitExceededException(_))
433 }
434 pub fn is_client_exception(&self) -> bool {
436 matches!(self, Self::ClientException(_))
437 }
438 pub fn is_dry_run_operation_exception(&self) -> bool {
440 matches!(self, Self::DryRunOperationException(_))
441 }
442 pub fn is_forbidden_exception(&self) -> bool {
444 matches!(self, Self::ForbiddenException(_))
445 }
446 pub fn is_idempotent_parameter_mismatch_exception(&self) -> bool {
448 matches!(self, Self::IdempotentParameterMismatchException(_))
449 }
450 pub fn is_invalid_request_exception(&self) -> bool {
452 matches!(self, Self::InvalidRequestException(_))
453 }
454 pub fn is_resource_already_exists_exception(&self) -> bool {
456 matches!(self, Self::ResourceAlreadyExistsException(_))
457 }
458 pub fn is_resource_in_use_exception(&self) -> bool {
460 matches!(self, Self::ResourceInUseException(_))
461 }
462 pub fn is_service_exception(&self) -> bool {
464 matches!(self, Self::ServiceException(_))
465 }
466 pub fn is_service_quota_exceeded_exception(&self) -> bool {
468 matches!(self, Self::ServiceQuotaExceededException(_))
469 }
470 pub fn is_service_unavailable_exception(&self) -> bool {
472 matches!(self, Self::ServiceUnavailableException(_))
473 }
474}
475impl ::std::error::Error for CreateInfrastructureConfigurationError {
476 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
477 match self {
478 Self::CallRateLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
479 Self::ClientException(_inner) => ::std::option::Option::Some(_inner),
480 Self::DryRunOperationException(_inner) => ::std::option::Option::Some(_inner),
481 Self::ForbiddenException(_inner) => ::std::option::Option::Some(_inner),
482 Self::IdempotentParameterMismatchException(_inner) => ::std::option::Option::Some(_inner),
483 Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
484 Self::ResourceAlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
485 Self::ResourceInUseException(_inner) => ::std::option::Option::Some(_inner),
486 Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
487 Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
488 Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
489 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
490 }
491 }
492}
493impl ::std::fmt::Display for CreateInfrastructureConfigurationError {
494 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
495 match self {
496 Self::CallRateLimitExceededException(_inner) => _inner.fmt(f),
497 Self::ClientException(_inner) => _inner.fmt(f),
498 Self::DryRunOperationException(_inner) => _inner.fmt(f),
499 Self::ForbiddenException(_inner) => _inner.fmt(f),
500 Self::IdempotentParameterMismatchException(_inner) => _inner.fmt(f),
501 Self::InvalidRequestException(_inner) => _inner.fmt(f),
502 Self::ResourceAlreadyExistsException(_inner) => _inner.fmt(f),
503 Self::ResourceInUseException(_inner) => _inner.fmt(f),
504 Self::ServiceException(_inner) => _inner.fmt(f),
505 Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
506 Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
507 Self::Unhandled(_inner) => {
508 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
509 write!(f, "unhandled error ({code})")
510 } else {
511 f.write_str("unhandled error")
512 }
513 }
514 }
515 }
516}
517impl ::aws_smithy_types::retry::ProvideErrorKind for CreateInfrastructureConfigurationError {
518 fn code(&self) -> ::std::option::Option<&str> {
519 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
520 }
521 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
522 ::std::option::Option::None
523 }
524}
525impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateInfrastructureConfigurationError {
526 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
527 match self {
528 Self::CallRateLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
529 Self::ClientException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
530 Self::DryRunOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
531 Self::ForbiddenException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
532 Self::IdempotentParameterMismatchException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
533 Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
534 Self::ResourceAlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
535 Self::ResourceInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
536 Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
537 Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
538 Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
539 Self::Unhandled(_inner) => &_inner.meta,
540 }
541 }
542}
543impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateInfrastructureConfigurationError {
544 fn create_unhandled_error(
545 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
546 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
547 ) -> Self {
548 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
549 source,
550 meta: meta.unwrap_or_default(),
551 })
552 }
553}
554impl ::aws_types::request_id::RequestId for crate::operation::create_infrastructure_configuration::CreateInfrastructureConfigurationError {
555 fn request_id(&self) -> Option<&str> {
556 self.meta().request_id()
557 }
558}
559
560pub use crate::operation::create_infrastructure_configuration::_create_infrastructure_configuration_input::CreateInfrastructureConfigurationInput;
561
562pub use crate::operation::create_infrastructure_configuration::_create_infrastructure_configuration_output::CreateInfrastructureConfigurationOutput;
563
564mod _create_infrastructure_configuration_input;
565
566mod _create_infrastructure_configuration_output;
567
568pub mod builders;