Skip to main content

aws_sdk_imagebuilder/operation/
create_container_recipe.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateContainerRecipe`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateContainerRecipe;
6impl CreateContainerRecipe {
7    /// Creates a new `CreateContainerRecipe`
8    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_container_recipe::CreateContainerRecipeInput,
14    ) -> ::std::result::Result<
15        crate::operation::create_container_recipe::CreateContainerRecipeOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::create_container_recipe::CreateContainerRecipeError,
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_container_recipe::CreateContainerRecipeError>()
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_container_recipe::CreateContainerRecipeOutput>()
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_container_recipe::CreateContainerRecipeInput,
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            "CreateContainerRecipe",
57            input,
58            runtime_plugins,
59            stop_point,
60        )
61        // Create a parent span for the entire operation. Includes a random, internal-only,
62        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
63        .instrument(::tracing::debug_span!(
64            "imagebuilder.CreateContainerRecipe",
65            "rpc.service" = "imagebuilder",
66            "rpc.method" = "CreateContainerRecipe",
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_container_recipe::CreateContainerRecipeInput = input.downcast_mut().expect("correct type");
82                if input.client_token.is_none() {
83                    input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token());
84                }
85            },
86        ));
87        if let ::std::option::Option::Some(config_override) = config_override {
88            for plugin in config_override.runtime_plugins.iter().cloned() {
89                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
90            }
91            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
92                config_override,
93                client_config.config.clone(),
94                &client_config.runtime_components,
95            ));
96        }
97        runtime_plugins
98    }
99}
100impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateContainerRecipe {
101    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
102        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateContainerRecipe");
103
104        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
105            CreateContainerRecipeRequestSerializer,
106        ));
107        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
108            CreateContainerRecipeResponseDeserializer,
109        ));
110
111        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
112            crate::config::auth::Params::builder()
113                .operation_name("CreateContainerRecipe")
114                .build()
115                .expect("required fields set"),
116        ));
117
118        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
119            "CreateContainerRecipe",
120            "imagebuilder",
121        ));
122        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
123        signing_options.double_uri_encode = true;
124        signing_options.content_sha256_header = false;
125        signing_options.normalize_uri_path = true;
126        signing_options.payload_override = None;
127
128        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
129            signing_options,
130            ..::std::default::Default::default()
131        });
132
133        ::std::option::Option::Some(cfg.freeze())
134    }
135
136    fn runtime_components(
137        &self,
138        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
139    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
140        #[allow(unused_mut)]
141        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateContainerRecipe")
142            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
143                CreateContainerRecipeTelemetryInputCaptureInterceptor,
144            ))
145            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
146                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
147            ))
148            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
149                CreateContainerRecipeEndpointParamsInterceptor,
150            ))
151            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
152                crate::operation::create_container_recipe::CreateContainerRecipeError,
153            >::new())
154            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
155                crate::operation::create_container_recipe::CreateContainerRecipeError,
156            >::new())
157            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
158                crate::operation::create_container_recipe::CreateContainerRecipeError,
159            >::new())
160            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
161                crate::operation::create_container_recipe::CreateContainerRecipeError,
162            >::new());
163
164        ::std::borrow::Cow::Owned(rcb)
165    }
166}
167
168#[derive(Debug)]
169struct CreateContainerRecipeTelemetryInputCaptureInterceptor;
170
171#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
172impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateContainerRecipeTelemetryInputCaptureInterceptor {
173    fn name(&self) -> &'static str {
174        "CreateContainerRecipeTelemetryInputCaptureInterceptor"
175    }
176
177    fn read_before_execution(
178        &self,
179        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
180            '_,
181            ::aws_smithy_runtime_api::client::interceptors::context::Input,
182            ::aws_smithy_runtime_api::client::interceptors::context::Output,
183            ::aws_smithy_runtime_api::client::interceptors::context::Error,
184        >,
185        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
186    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
187        // Nothing to do unless the customer opted in by naming members to record.
188        let ::std::option::Option::Some(requested) = cfg
189            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
190            .filter(|r| !r.is_empty())
191        else {
192            return ::std::result::Result::Ok(());
193        };
194
195        let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateContainerRecipeInput>() else {
196            // A mismatched input is not this interceptor's concern; skip quietly.
197            return ::std::result::Result::Ok(());
198        };
199
200        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
201        if requested.should_capture("name") {
202            if let ::std::option::Option::Some(value) = input.name.as_deref() {
203                captured.insert("name", value);
204            }
205        }
206        if requested.should_capture("description") {
207            if let ::std::option::Option::Some(value) = input.description.as_deref() {
208                captured.insert("description", value);
209            }
210        }
211        if requested.should_capture("semanticVersion") {
212            if let ::std::option::Option::Some(value) = input.semantic_version.as_deref() {
213                captured.insert("semanticVersion", value);
214            }
215        }
216        if requested.should_capture("dockerfileTemplateData") {
217            if let ::std::option::Option::Some(value) = input.dockerfile_template_data.as_deref() {
218                captured.insert("dockerfileTemplateData", value);
219            }
220        }
221        if requested.should_capture("dockerfileTemplateUri") {
222            if let ::std::option::Option::Some(value) = input.dockerfile_template_uri.as_deref() {
223                captured.insert("dockerfileTemplateUri", value);
224            }
225        }
226        if requested.should_capture("imageOsVersionOverride") {
227            if let ::std::option::Option::Some(value) = input.image_os_version_override.as_deref() {
228                captured.insert("imageOsVersionOverride", value);
229            }
230        }
231        if requested.should_capture("parentImage") {
232            if let ::std::option::Option::Some(value) = input.parent_image.as_deref() {
233                captured.insert("parentImage", value);
234            }
235        }
236        if requested.should_capture("workingDirectory") {
237            if let ::std::option::Option::Some(value) = input.working_directory.as_deref() {
238                captured.insert("workingDirectory", value);
239            }
240        }
241        if requested.should_capture("kmsKeyId") {
242            if let ::std::option::Option::Some(value) = input.kms_key_id.as_deref() {
243                captured.insert("kmsKeyId", value);
244            }
245        }
246        if requested.should_capture("clientToken") {
247            if let ::std::option::Option::Some(value) = input.client_token.as_deref() {
248                captured.insert("clientToken", value);
249            }
250        }
251
252        cfg.interceptor_state().store_put(captured);
253        ::std::result::Result::Ok(())
254    }
255}
256#[derive(Debug)]
257struct CreateContainerRecipeResponseDeserializer;
258impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateContainerRecipeResponseDeserializer {
259    fn deserialize_nonstreaming_with_config(
260        &self,
261        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
262        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
263    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
264        let (success, status) = (response.status().is_success(), response.status().as_u16());
265        let headers = response.headers();
266        let body = response.body().bytes().expect("body loaded");
267        #[allow(unused_mut)]
268        let mut force_error = false;
269        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
270        let parse_result = if !success && status != 200 || force_error {
271            crate::protocol_serde::shape_create_container_recipe::de_create_container_recipe_http_error(status, headers, body)
272        } else {
273            crate::protocol_serde::shape_create_container_recipe::de_create_container_recipe_http_response(status, headers, body)
274        };
275        crate::protocol_serde::type_erase_result(parse_result)
276    }
277}
278#[derive(Debug)]
279struct CreateContainerRecipeRequestSerializer;
280impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateContainerRecipeRequestSerializer {
281    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
282    fn serialize_input(
283        &self,
284        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
285        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
286    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
287        let input = input
288            .downcast::<crate::operation::create_container_recipe::CreateContainerRecipeInput>()
289            .expect("correct type");
290        let _header_serialization_settings = _cfg
291            .load::<crate::serialization_settings::HeaderSerializationSettings>()
292            .cloned()
293            .unwrap_or_default();
294        let mut request_builder = {
295            #[allow(clippy::uninlined_format_args)]
296            fn uri_base(
297                _input: &crate::operation::create_container_recipe::CreateContainerRecipeInput,
298                output: &mut ::std::string::String,
299            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
300                use ::std::fmt::Write as _;
301                ::std::write!(output, "/CreateContainerRecipe").expect("formatting should succeed");
302                ::std::result::Result::Ok(())
303            }
304            #[allow(clippy::unnecessary_wraps)]
305            fn update_http_builder(
306                input: &crate::operation::create_container_recipe::CreateContainerRecipeInput,
307                builder: ::http_1x::request::Builder,
308            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
309                let mut uri = ::std::string::String::new();
310                uri_base(input, &mut uri)?;
311                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
312            }
313            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
314            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
315            builder
316        };
317        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_container_recipe::ser_create_container_recipe_input(
318            &input,
319        )?);
320        if let Some(content_length) = body.content_length() {
321            let content_length = content_length.to_string();
322            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
323        }
324        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
325    }
326}
327#[derive(Debug)]
328struct CreateContainerRecipeEndpointParamsInterceptor;
329
330#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
331impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateContainerRecipeEndpointParamsInterceptor {
332    fn name(&self) -> &'static str {
333        "CreateContainerRecipeEndpointParamsInterceptor"
334    }
335
336    fn read_before_execution(
337        &self,
338        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
339            '_,
340            ::aws_smithy_runtime_api::client::interceptors::context::Input,
341            ::aws_smithy_runtime_api::client::interceptors::context::Output,
342            ::aws_smithy_runtime_api::client::interceptors::context::Error,
343        >,
344        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
345    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
346        let _input = context
347            .input()
348            .downcast_ref::<CreateContainerRecipeInput>()
349            .ok_or("failed to downcast to CreateContainerRecipeInput")?;
350
351        let params = crate::config::endpoint::Params::builder()
352            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
353            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
354            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
355            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
356            .build()
357            .map_err(|err| {
358                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
359            })?;
360        cfg.interceptor_state()
361            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
362        ::std::result::Result::Ok(())
363    }
364}
365
366// The get_* functions below are generated from JMESPath expressions in the
367// operationContextParams trait. They target the operation's input shape.
368
369/// Error type for the `CreateContainerRecipeError` operation.
370#[non_exhaustive]
371#[derive(::std::fmt::Debug)]
372pub enum CreateContainerRecipeError {
373    /// <p>You have exceeded the permitted request rate for the specific operation.</p>
374    CallRateLimitExceededException(crate::types::error::CallRateLimitExceededException),
375    /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an invalid resource identifier.</p>
376    ClientException(crate::types::error::ClientException),
377    /// <p>The dry run operation of the resource was successful, and no resources or mutations were actually performed due to the dry run flag in the request.</p>
378    DryRunOperationException(crate::types::error::DryRunOperationException),
379    /// <p>You are not authorized to perform the requested operation.</p>
380    ForbiddenException(crate::types::error::ForbiddenException),
381    /// <p>You have specified a client token for an operation using parameter values that differ from a previous request that used the same client token.</p>
382    IdempotentParameterMismatchException(crate::types::error::IdempotentParameterMismatchException),
383    /// <p>You have requested an action that that the service doesn't support.</p>
384    InvalidRequestException(crate::types::error::InvalidRequestException),
385    /// <p>Your version number is out of bounds or does not follow the required syntax.</p>
386    InvalidVersionNumberException(crate::types::error::InvalidVersionNumberException),
387    /// <p>The resource that you are trying to create already exists.</p>
388    ResourceAlreadyExistsException(crate::types::error::ResourceAlreadyExistsException),
389    /// <p>The resource that you are trying to operate on is currently in use. Review the message details and retry later.</p>
390    ResourceInUseException(crate::types::error::ResourceInUseException),
391    /// <p>This exception is thrown when the service encounters an unrecoverable exception.</p>
392    ServiceException(crate::types::error::ServiceException),
393    /// <p>You have exceeded the number of permitted resources or operations for this service. For service quotas, see <a href="https://docs.aws.amazon.com/general/latest/gr/imagebuilder.html#limits_imagebuilder">EC2 Image Builder endpoints and quotas</a>.</p>
394    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
395    /// <p>The service is unable to process your request at this time.</p>
396    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
397    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
398    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
399    variable wildcard pattern and check `.code()`:
400     \
401    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
402     \
403    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateContainerRecipeError) for what information is available for the error.")]
404    Unhandled(crate::error::sealed_unhandled::Unhandled),
405}
406impl CreateContainerRecipeError {
407    /// Creates the `CreateContainerRecipeError::Unhandled` variant from any error type.
408    pub fn unhandled(
409        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
410    ) -> Self {
411        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
412            source: err.into(),
413            meta: ::std::default::Default::default(),
414        })
415    }
416
417    /// Creates the `CreateContainerRecipeError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
418    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
419        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
420            source: err.clone().into(),
421            meta: err,
422        })
423    }
424    ///
425    /// Returns error metadata, which includes the error code, message,
426    /// request ID, and potentially additional information.
427    ///
428    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
429        match self {
430            Self::CallRateLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
431            Self::ClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
432            Self::DryRunOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
433            Self::ForbiddenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
434            Self::IdempotentParameterMismatchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
435            Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436            Self::InvalidVersionNumberException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
437            Self::ResourceAlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
438            Self::ResourceInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
439            Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440            Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442            Self::Unhandled(e) => &e.meta,
443        }
444    }
445    /// Returns `true` if the error kind is `CreateContainerRecipeError::CallRateLimitExceededException`.
446    pub fn is_call_rate_limit_exceeded_exception(&self) -> bool {
447        matches!(self, Self::CallRateLimitExceededException(_))
448    }
449    /// Returns `true` if the error kind is `CreateContainerRecipeError::ClientException`.
450    pub fn is_client_exception(&self) -> bool {
451        matches!(self, Self::ClientException(_))
452    }
453    /// Returns `true` if the error kind is `CreateContainerRecipeError::DryRunOperationException`.
454    pub fn is_dry_run_operation_exception(&self) -> bool {
455        matches!(self, Self::DryRunOperationException(_))
456    }
457    /// Returns `true` if the error kind is `CreateContainerRecipeError::ForbiddenException`.
458    pub fn is_forbidden_exception(&self) -> bool {
459        matches!(self, Self::ForbiddenException(_))
460    }
461    /// Returns `true` if the error kind is `CreateContainerRecipeError::IdempotentParameterMismatchException`.
462    pub fn is_idempotent_parameter_mismatch_exception(&self) -> bool {
463        matches!(self, Self::IdempotentParameterMismatchException(_))
464    }
465    /// Returns `true` if the error kind is `CreateContainerRecipeError::InvalidRequestException`.
466    pub fn is_invalid_request_exception(&self) -> bool {
467        matches!(self, Self::InvalidRequestException(_))
468    }
469    /// Returns `true` if the error kind is `CreateContainerRecipeError::InvalidVersionNumberException`.
470    pub fn is_invalid_version_number_exception(&self) -> bool {
471        matches!(self, Self::InvalidVersionNumberException(_))
472    }
473    /// Returns `true` if the error kind is `CreateContainerRecipeError::ResourceAlreadyExistsException`.
474    pub fn is_resource_already_exists_exception(&self) -> bool {
475        matches!(self, Self::ResourceAlreadyExistsException(_))
476    }
477    /// Returns `true` if the error kind is `CreateContainerRecipeError::ResourceInUseException`.
478    pub fn is_resource_in_use_exception(&self) -> bool {
479        matches!(self, Self::ResourceInUseException(_))
480    }
481    /// Returns `true` if the error kind is `CreateContainerRecipeError::ServiceException`.
482    pub fn is_service_exception(&self) -> bool {
483        matches!(self, Self::ServiceException(_))
484    }
485    /// Returns `true` if the error kind is `CreateContainerRecipeError::ServiceQuotaExceededException`.
486    pub fn is_service_quota_exceeded_exception(&self) -> bool {
487        matches!(self, Self::ServiceQuotaExceededException(_))
488    }
489    /// Returns `true` if the error kind is `CreateContainerRecipeError::ServiceUnavailableException`.
490    pub fn is_service_unavailable_exception(&self) -> bool {
491        matches!(self, Self::ServiceUnavailableException(_))
492    }
493}
494impl ::std::error::Error for CreateContainerRecipeError {
495    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
496        match self {
497            Self::CallRateLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
498            Self::ClientException(_inner) => ::std::option::Option::Some(_inner),
499            Self::DryRunOperationException(_inner) => ::std::option::Option::Some(_inner),
500            Self::ForbiddenException(_inner) => ::std::option::Option::Some(_inner),
501            Self::IdempotentParameterMismatchException(_inner) => ::std::option::Option::Some(_inner),
502            Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
503            Self::InvalidVersionNumberException(_inner) => ::std::option::Option::Some(_inner),
504            Self::ResourceAlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
505            Self::ResourceInUseException(_inner) => ::std::option::Option::Some(_inner),
506            Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
507            Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
508            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
509            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
510        }
511    }
512}
513impl ::std::fmt::Display for CreateContainerRecipeError {
514    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
515        match self {
516            Self::CallRateLimitExceededException(_inner) => _inner.fmt(f),
517            Self::ClientException(_inner) => _inner.fmt(f),
518            Self::DryRunOperationException(_inner) => _inner.fmt(f),
519            Self::ForbiddenException(_inner) => _inner.fmt(f),
520            Self::IdempotentParameterMismatchException(_inner) => _inner.fmt(f),
521            Self::InvalidRequestException(_inner) => _inner.fmt(f),
522            Self::InvalidVersionNumberException(_inner) => _inner.fmt(f),
523            Self::ResourceAlreadyExistsException(_inner) => _inner.fmt(f),
524            Self::ResourceInUseException(_inner) => _inner.fmt(f),
525            Self::ServiceException(_inner) => _inner.fmt(f),
526            Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
527            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
528            Self::Unhandled(_inner) => {
529                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
530                    write!(f, "unhandled error ({code})")
531                } else {
532                    f.write_str("unhandled error")
533                }
534            }
535        }
536    }
537}
538impl ::aws_smithy_types::retry::ProvideErrorKind for CreateContainerRecipeError {
539    fn code(&self) -> ::std::option::Option<&str> {
540        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
541    }
542    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
543        ::std::option::Option::None
544    }
545}
546impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateContainerRecipeError {
547    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
548        match self {
549            Self::CallRateLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
550            Self::ClientException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
551            Self::DryRunOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
552            Self::ForbiddenException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
553            Self::IdempotentParameterMismatchException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
554            Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
555            Self::InvalidVersionNumberException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
556            Self::ResourceAlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
557            Self::ResourceInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
558            Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
559            Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
560            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
561            Self::Unhandled(_inner) => &_inner.meta,
562        }
563    }
564}
565impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateContainerRecipeError {
566    fn create_unhandled_error(
567        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
568        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
569    ) -> Self {
570        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
571            source,
572            meta: meta.unwrap_or_default(),
573        })
574    }
575}
576impl ::aws_types::request_id::RequestId for crate::operation::create_container_recipe::CreateContainerRecipeError {
577    fn request_id(&self) -> Option<&str> {
578        self.meta().request_id()
579    }
580}
581
582pub use crate::operation::create_container_recipe::_create_container_recipe_input::CreateContainerRecipeInput;
583
584pub use crate::operation::create_container_recipe::_create_container_recipe_output::CreateContainerRecipeOutput;
585
586mod _create_container_recipe_input;
587
588mod _create_container_recipe_output;
589
590/// Builders
591pub mod builders;