1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateResource;
6impl CreateResource {
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_resource::CreateResourceInput,
14 ) -> ::std::result::Result<
15 crate::operation::create_resource::CreateResourceOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::create_resource::CreateResourceError,
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_resource::CreateResourceError>()
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_resource::CreateResourceOutput>()
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_resource::CreateResourceInput,
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("CloudControl", "CreateResource", input, runtime_plugins, stop_point)
55 .instrument(::tracing::debug_span!(
58 "CloudControl.CreateResource",
59 "rpc.service" = "CloudControl",
60 "rpc.method" = "CreateResource",
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 runtime_plugins = runtime_plugins.with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new(
74 |token_provider, input| {
75 let input: &mut crate::operation::create_resource::CreateResourceInput = input.downcast_mut().expect("correct type");
76 if input.client_token.is_none() {
77 input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token());
78 }
79 },
80 ));
81 if let ::std::option::Option::Some(config_override) = config_override {
82 for plugin in config_override.runtime_plugins.iter().cloned() {
83 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
84 }
85 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
86 config_override,
87 client_config.config.clone(),
88 &client_config.runtime_components,
89 ));
90 }
91 runtime_plugins
92 }
93}
94impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateResource {
95 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
96 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateResource");
97
98 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
99 CreateResourceRequestSerializer,
100 ));
101 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
102 CreateResourceResponseDeserializer,
103 ));
104
105 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
106 crate::config::auth::Params::builder()
107 .operation_name("CreateResource")
108 .build()
109 .expect("required fields set"),
110 ));
111
112 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
113 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
114 "CreateResource",
115 "CloudControl",
116 ));
117 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
118 signing_options.double_uri_encode = true;
119 signing_options.content_sha256_header = false;
120 signing_options.normalize_uri_path = true;
121 signing_options.payload_override = None;
122
123 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
124 signing_options,
125 ..::std::default::Default::default()
126 });
127
128 ::std::option::Option::Some(cfg.freeze())
129 }
130
131 fn runtime_components(
132 &self,
133 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
134 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
135 #[allow(unused_mut)]
136 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateResource")
137 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
138 CreateResourceTelemetryInputCaptureInterceptor,
139 ))
140 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
141 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
142 ))
143 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
144 CreateResourceEndpointParamsInterceptor,
145 ))
146 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
147 crate::operation::create_resource::CreateResourceError,
148 >::new())
149 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
150 crate::operation::create_resource::CreateResourceError,
151 >::new())
152 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
153 crate::operation::create_resource::CreateResourceError,
154 >::new())
155 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
156 crate::operation::create_resource::CreateResourceError,
157 >::new());
158
159 ::std::borrow::Cow::Owned(rcb)
160 }
161}
162
163#[derive(Debug)]
164struct CreateResourceTelemetryInputCaptureInterceptor;
165
166#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
167impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateResourceTelemetryInputCaptureInterceptor {
168 fn name(&self) -> &'static str {
169 "CreateResourceTelemetryInputCaptureInterceptor"
170 }
171
172 fn read_before_execution(
173 &self,
174 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
175 '_,
176 ::aws_smithy_runtime_api::client::interceptors::context::Input,
177 ::aws_smithy_runtime_api::client::interceptors::context::Output,
178 ::aws_smithy_runtime_api::client::interceptors::context::Error,
179 >,
180 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
181 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
182 let ::std::option::Option::Some(requested) = cfg
184 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
185 .filter(|r| !r.is_empty())
186 else {
187 return ::std::result::Result::Ok(());
188 };
189
190 let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateResourceInput>() else {
191 return ::std::result::Result::Ok(());
193 };
194
195 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
196 if requested.should_capture("TypeName") {
197 if let ::std::option::Option::Some(value) = input.type_name.as_deref() {
198 captured.insert("TypeName", value);
199 }
200 }
201 if requested.should_capture("TypeVersionId") {
202 if let ::std::option::Option::Some(value) = input.type_version_id.as_deref() {
203 captured.insert("TypeVersionId", value);
204 }
205 }
206 if requested.should_capture("RoleArn") {
207 if let ::std::option::Option::Some(value) = input.role_arn.as_deref() {
208 captured.insert("RoleArn", value);
209 }
210 }
211 if requested.should_capture("ClientToken") {
212 if let ::std::option::Option::Some(value) = input.client_token.as_deref() {
213 captured.insert("ClientToken", value);
214 }
215 }
216
217 cfg.interceptor_state().store_put(captured);
218 ::std::result::Result::Ok(())
219 }
220}
221#[derive(Debug)]
222struct CreateResourceResponseDeserializer;
223impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateResourceResponseDeserializer {
224 fn deserialize_nonstreaming_with_config(
225 &self,
226 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
227 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
228 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
229 let (success, status) = (response.status().is_success(), response.status().as_u16());
230 let headers = response.headers();
231 let body = response.body().bytes().expect("body loaded");
232 #[allow(unused_mut)]
233 let mut force_error = false;
234 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
235 let parse_result = if !success && status != 200 || force_error {
236 crate::protocol_serde::shape_create_resource::de_create_resource_http_error(status, headers, body)
237 } else {
238 crate::protocol_serde::shape_create_resource::de_create_resource_http_response(status, headers, body)
239 };
240 crate::protocol_serde::type_erase_result(parse_result)
241 }
242}
243#[derive(Debug)]
244struct CreateResourceRequestSerializer;
245impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateResourceRequestSerializer {
246 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
247 fn serialize_input(
248 &self,
249 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
250 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
251 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
252 let input = input
253 .downcast::<crate::operation::create_resource::CreateResourceInput>()
254 .expect("correct type");
255 let _header_serialization_settings = _cfg
256 .load::<crate::serialization_settings::HeaderSerializationSettings>()
257 .cloned()
258 .unwrap_or_default();
259 let mut request_builder = {
260 #[allow(clippy::uninlined_format_args)]
261 fn uri_base(
262 _input: &crate::operation::create_resource::CreateResourceInput,
263 output: &mut ::std::string::String,
264 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
265 use ::std::fmt::Write as _;
266 ::std::write!(output, "/").expect("formatting should succeed");
267 ::std::result::Result::Ok(())
268 }
269 #[allow(clippy::unnecessary_wraps)]
270 fn update_http_builder(
271 input: &crate::operation::create_resource::CreateResourceInput,
272 builder: ::http_1x::request::Builder,
273 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
274 let mut uri = ::std::string::String::new();
275 uri_base(input, &mut uri)?;
276 ::std::result::Result::Ok(builder.method("POST").uri(uri))
277 }
278 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
279 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
280 builder = _header_serialization_settings.set_default_header(
281 builder,
282 ::http_1x::header::HeaderName::from_static("x-amz-target"),
283 "CloudApiService.CreateResource",
284 );
285 builder
286 };
287 let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_resource::ser_create_resource_input(&input)?);
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 CreateResourceEndpointParamsInterceptor;
297
298#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
299impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateResourceEndpointParamsInterceptor {
300 fn name(&self) -> &'static str {
301 "CreateResourceEndpointParamsInterceptor"
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
315 .input()
316 .downcast_ref::<CreateResourceInput>()
317 .ok_or("failed to downcast to CreateResourceInput")?;
318
319 let params = crate::config::endpoint::Params::builder()
320 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
321 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
322 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
323 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
324 .build()
325 .map_err(|err| {
326 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
327 })?;
328 cfg.interceptor_state()
329 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
330 ::std::result::Result::Ok(())
331 }
332}
333
334#[non_exhaustive]
339#[derive(::std::fmt::Debug)]
340pub enum CreateResourceError {
341 AlreadyExistsException(crate::types::error::AlreadyExistsException),
343 ClientTokenConflictException(crate::types::error::ClientTokenConflictException),
346 ConcurrentOperationException(crate::types::error::ConcurrentOperationException),
348 GeneralServiceException(crate::types::error::GeneralServiceException),
350 HandlerFailureException(crate::types::error::HandlerFailureException),
352 HandlerInternalFailureException(crate::types::error::HandlerInternalFailureException),
354 InvalidCredentialsException(crate::types::error::InvalidCredentialsException),
356 InvalidRequestException(crate::types::error::InvalidRequestException),
358 NetworkFailureException(crate::types::error::NetworkFailureException),
360 NotStabilizedException(crate::types::error::NotStabilizedException),
362 NotUpdatableException(crate::types::error::NotUpdatableException),
364 PrivateTypeException(crate::types::error::PrivateTypeException),
366 ResourceConflictException(crate::types::error::ResourceConflictException),
368 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
370 ServiceInternalErrorException(crate::types::error::ServiceInternalErrorException),
372 ServiceLimitExceededException(crate::types::error::ServiceLimitExceededException),
374 ThrottlingException(crate::types::error::ThrottlingException),
376 TypeNotFoundException(crate::types::error::TypeNotFoundException),
378 UnsupportedActionException(crate::types::error::UnsupportedActionException),
380 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
382 variable wildcard pattern and check `.code()`:
383 \
384 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
385 \
386 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateResourceError) for what information is available for the error.")]
387 Unhandled(crate::error::sealed_unhandled::Unhandled),
388}
389impl CreateResourceError {
390 pub fn unhandled(
392 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
393 ) -> Self {
394 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
395 source: err.into(),
396 meta: ::std::default::Default::default(),
397 })
398 }
399
400 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
402 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
403 source: err.clone().into(),
404 meta: err,
405 })
406 }
407 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
412 match self {
413 Self::AlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
414 Self::ClientTokenConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
415 Self::ConcurrentOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
416 Self::GeneralServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417 Self::HandlerFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418 Self::HandlerInternalFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419 Self::InvalidCredentialsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420 Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
421 Self::NetworkFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
422 Self::NotStabilizedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423 Self::NotUpdatableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424 Self::PrivateTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425 Self::ResourceConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427 Self::ServiceInternalErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
428 Self::ServiceLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
429 Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
430 Self::TypeNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
431 Self::UnsupportedActionException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
432 Self::Unhandled(e) => &e.meta,
433 }
434 }
435 pub fn is_already_exists_exception(&self) -> bool {
437 matches!(self, Self::AlreadyExistsException(_))
438 }
439 pub fn is_client_token_conflict_exception(&self) -> bool {
441 matches!(self, Self::ClientTokenConflictException(_))
442 }
443 pub fn is_concurrent_operation_exception(&self) -> bool {
445 matches!(self, Self::ConcurrentOperationException(_))
446 }
447 pub fn is_general_service_exception(&self) -> bool {
449 matches!(self, Self::GeneralServiceException(_))
450 }
451 pub fn is_handler_failure_exception(&self) -> bool {
453 matches!(self, Self::HandlerFailureException(_))
454 }
455 pub fn is_handler_internal_failure_exception(&self) -> bool {
457 matches!(self, Self::HandlerInternalFailureException(_))
458 }
459 pub fn is_invalid_credentials_exception(&self) -> bool {
461 matches!(self, Self::InvalidCredentialsException(_))
462 }
463 pub fn is_invalid_request_exception(&self) -> bool {
465 matches!(self, Self::InvalidRequestException(_))
466 }
467 pub fn is_network_failure_exception(&self) -> bool {
469 matches!(self, Self::NetworkFailureException(_))
470 }
471 pub fn is_not_stabilized_exception(&self) -> bool {
473 matches!(self, Self::NotStabilizedException(_))
474 }
475 pub fn is_not_updatable_exception(&self) -> bool {
477 matches!(self, Self::NotUpdatableException(_))
478 }
479 pub fn is_private_type_exception(&self) -> bool {
481 matches!(self, Self::PrivateTypeException(_))
482 }
483 pub fn is_resource_conflict_exception(&self) -> bool {
485 matches!(self, Self::ResourceConflictException(_))
486 }
487 pub fn is_resource_not_found_exception(&self) -> bool {
489 matches!(self, Self::ResourceNotFoundException(_))
490 }
491 pub fn is_service_internal_error_exception(&self) -> bool {
493 matches!(self, Self::ServiceInternalErrorException(_))
494 }
495 pub fn is_service_limit_exceeded_exception(&self) -> bool {
497 matches!(self, Self::ServiceLimitExceededException(_))
498 }
499 pub fn is_throttling_exception(&self) -> bool {
501 matches!(self, Self::ThrottlingException(_))
502 }
503 pub fn is_type_not_found_exception(&self) -> bool {
505 matches!(self, Self::TypeNotFoundException(_))
506 }
507 pub fn is_unsupported_action_exception(&self) -> bool {
509 matches!(self, Self::UnsupportedActionException(_))
510 }
511}
512impl ::std::error::Error for CreateResourceError {
513 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
514 match self {
515 Self::AlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
516 Self::ClientTokenConflictException(_inner) => ::std::option::Option::Some(_inner),
517 Self::ConcurrentOperationException(_inner) => ::std::option::Option::Some(_inner),
518 Self::GeneralServiceException(_inner) => ::std::option::Option::Some(_inner),
519 Self::HandlerFailureException(_inner) => ::std::option::Option::Some(_inner),
520 Self::HandlerInternalFailureException(_inner) => ::std::option::Option::Some(_inner),
521 Self::InvalidCredentialsException(_inner) => ::std::option::Option::Some(_inner),
522 Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
523 Self::NetworkFailureException(_inner) => ::std::option::Option::Some(_inner),
524 Self::NotStabilizedException(_inner) => ::std::option::Option::Some(_inner),
525 Self::NotUpdatableException(_inner) => ::std::option::Option::Some(_inner),
526 Self::PrivateTypeException(_inner) => ::std::option::Option::Some(_inner),
527 Self::ResourceConflictException(_inner) => ::std::option::Option::Some(_inner),
528 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
529 Self::ServiceInternalErrorException(_inner) => ::std::option::Option::Some(_inner),
530 Self::ServiceLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
531 Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
532 Self::TypeNotFoundException(_inner) => ::std::option::Option::Some(_inner),
533 Self::UnsupportedActionException(_inner) => ::std::option::Option::Some(_inner),
534 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
535 }
536 }
537}
538impl ::std::fmt::Display for CreateResourceError {
539 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
540 match self {
541 Self::AlreadyExistsException(_inner) => _inner.fmt(f),
542 Self::ClientTokenConflictException(_inner) => _inner.fmt(f),
543 Self::ConcurrentOperationException(_inner) => _inner.fmt(f),
544 Self::GeneralServiceException(_inner) => _inner.fmt(f),
545 Self::HandlerFailureException(_inner) => _inner.fmt(f),
546 Self::HandlerInternalFailureException(_inner) => _inner.fmt(f),
547 Self::InvalidCredentialsException(_inner) => _inner.fmt(f),
548 Self::InvalidRequestException(_inner) => _inner.fmt(f),
549 Self::NetworkFailureException(_inner) => _inner.fmt(f),
550 Self::NotStabilizedException(_inner) => _inner.fmt(f),
551 Self::NotUpdatableException(_inner) => _inner.fmt(f),
552 Self::PrivateTypeException(_inner) => _inner.fmt(f),
553 Self::ResourceConflictException(_inner) => _inner.fmt(f),
554 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
555 Self::ServiceInternalErrorException(_inner) => _inner.fmt(f),
556 Self::ServiceLimitExceededException(_inner) => _inner.fmt(f),
557 Self::ThrottlingException(_inner) => _inner.fmt(f),
558 Self::TypeNotFoundException(_inner) => _inner.fmt(f),
559 Self::UnsupportedActionException(_inner) => _inner.fmt(f),
560 Self::Unhandled(_inner) => {
561 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
562 write!(f, "unhandled error ({code})")
563 } else {
564 f.write_str("unhandled error")
565 }
566 }
567 }
568 }
569}
570impl ::aws_smithy_types::retry::ProvideErrorKind for CreateResourceError {
571 fn code(&self) -> ::std::option::Option<&str> {
572 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
573 }
574 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
575 ::std::option::Option::None
576 }
577}
578impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateResourceError {
579 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
580 match self {
581 Self::AlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
582 Self::ClientTokenConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
583 Self::ConcurrentOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
584 Self::GeneralServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
585 Self::HandlerFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
586 Self::HandlerInternalFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
587 Self::InvalidCredentialsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
588 Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
589 Self::NetworkFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
590 Self::NotStabilizedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
591 Self::NotUpdatableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
592 Self::PrivateTypeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
593 Self::ResourceConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
594 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
595 Self::ServiceInternalErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
596 Self::ServiceLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
597 Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
598 Self::TypeNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
599 Self::UnsupportedActionException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
600 Self::Unhandled(_inner) => &_inner.meta,
601 }
602 }
603}
604impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateResourceError {
605 fn create_unhandled_error(
606 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
607 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
608 ) -> Self {
609 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
610 source,
611 meta: meta.unwrap_or_default(),
612 })
613 }
614}
615impl ::aws_types::request_id::RequestId for crate::operation::create_resource::CreateResourceError {
616 fn request_id(&self) -> Option<&str> {
617 self.meta().request_id()
618 }
619}
620
621pub use crate::operation::create_resource::_create_resource_input::CreateResourceInput;
622
623pub use crate::operation::create_resource::_create_resource_output::CreateResourceOutput;
624
625mod _create_resource_input;
626
627mod _create_resource_output;
628
629pub mod builders;