Skip to main content

aws_sdk_imagebuilder/operation/
create_distribution_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateDistributionConfiguration`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateDistributionConfiguration;
6impl CreateDistributionConfiguration {
7    /// Creates a new `CreateDistributionConfiguration`
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_distribution_configuration::CreateDistributionConfigurationInput,
14    ) -> ::std::result::Result<
15        crate::operation::create_distribution_configuration::CreateDistributionConfigurationOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::create_distribution_configuration::CreateDistributionConfigurationError,
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_distribution_configuration::CreateDistributionConfigurationError>()
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_distribution_configuration::CreateDistributionConfigurationOutput>()
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_distribution_configuration::CreateDistributionConfigurationInput,
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            "CreateDistributionConfiguration",
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.CreateDistributionConfiguration",
65            "rpc.service" = "imagebuilder",
66            "rpc.method" = "CreateDistributionConfiguration",
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_distribution_configuration::CreateDistributionConfigurationInput =
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 CreateDistributionConfiguration {
102    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
103        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateDistributionConfiguration");
104
105        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
106            CreateDistributionConfigurationRequestSerializer,
107        ));
108        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
109            CreateDistributionConfigurationResponseDeserializer,
110        ));
111
112        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
113            crate::config::auth::Params::builder()
114                .operation_name("CreateDistributionConfiguration")
115                .build()
116                .expect("required fields set"),
117        ));
118
119        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
120            "CreateDistributionConfiguration",
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("CreateDistributionConfiguration")
143            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
144                CreateDistributionConfigurationTelemetryInputCaptureInterceptor,
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                CreateDistributionConfigurationEndpointParamsInterceptor,
151            ))
152            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
153                crate::operation::create_distribution_configuration::CreateDistributionConfigurationError,
154            >::new())
155            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
156                crate::operation::create_distribution_configuration::CreateDistributionConfigurationError,
157            >::new())
158            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
159                crate::operation::create_distribution_configuration::CreateDistributionConfigurationError,
160            >::new())
161            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
162                crate::operation::create_distribution_configuration::CreateDistributionConfigurationError,
163            >::new());
164
165        ::std::borrow::Cow::Owned(rcb)
166    }
167}
168
169#[derive(Debug)]
170struct CreateDistributionConfigurationTelemetryInputCaptureInterceptor;
171
172#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
173impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateDistributionConfigurationTelemetryInputCaptureInterceptor {
174    fn name(&self) -> &'static str {
175        "CreateDistributionConfigurationTelemetryInputCaptureInterceptor"
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        // Nothing to do unless the customer opted in by naming members to record.
189        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::<CreateDistributionConfigurationInput>() else {
197            // A mismatched input is not this interceptor's concern; skip quietly.
198            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("clientToken") {
213            if let ::std::option::Option::Some(value) = input.client_token.as_deref() {
214                captured.insert("clientToken", value);
215            }
216        }
217
218        cfg.interceptor_state().store_put(captured);
219        ::std::result::Result::Ok(())
220    }
221}
222#[derive(Debug)]
223struct CreateDistributionConfigurationResponseDeserializer;
224impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateDistributionConfigurationResponseDeserializer {
225    fn deserialize_nonstreaming_with_config(
226        &self,
227        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
228        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
229    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
230        let (success, status) = (response.status().is_success(), response.status().as_u16());
231        let headers = response.headers();
232        let body = response.body().bytes().expect("body loaded");
233        #[allow(unused_mut)]
234        let mut force_error = false;
235        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
236        let parse_result = if !success && status != 200 || force_error {
237            crate::protocol_serde::shape_create_distribution_configuration::de_create_distribution_configuration_http_error(status, headers, body)
238        } else {
239            crate::protocol_serde::shape_create_distribution_configuration::de_create_distribution_configuration_http_response(status, headers, body)
240        };
241        crate::protocol_serde::type_erase_result(parse_result)
242    }
243}
244#[derive(Debug)]
245struct CreateDistributionConfigurationRequestSerializer;
246impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateDistributionConfigurationRequestSerializer {
247    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
248    fn serialize_input(
249        &self,
250        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
251        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
252    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
253        let input = input
254            .downcast::<crate::operation::create_distribution_configuration::CreateDistributionConfigurationInput>()
255            .expect("correct type");
256        let _header_serialization_settings = _cfg
257            .load::<crate::serialization_settings::HeaderSerializationSettings>()
258            .cloned()
259            .unwrap_or_default();
260        let mut request_builder = {
261            #[allow(clippy::uninlined_format_args)]
262            fn uri_base(
263                _input: &crate::operation::create_distribution_configuration::CreateDistributionConfigurationInput,
264                output: &mut ::std::string::String,
265            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
266                use ::std::fmt::Write as _;
267                ::std::write!(output, "/CreateDistributionConfiguration").expect("formatting should succeed");
268                ::std::result::Result::Ok(())
269            }
270            #[allow(clippy::unnecessary_wraps)]
271            fn update_http_builder(
272                input: &crate::operation::create_distribution_configuration::CreateDistributionConfigurationInput,
273                builder: ::http_1x::request::Builder,
274            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
275                let mut uri = ::std::string::String::new();
276                uri_base(input, &mut uri)?;
277                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
278            }
279            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
280            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
281            builder
282        };
283        let body = ::aws_smithy_types::body::SdkBody::from(
284            crate::protocol_serde::shape_create_distribution_configuration::ser_create_distribution_configuration_input(&input)?,
285        );
286        if let Some(content_length) = body.content_length() {
287            let content_length = content_length.to_string();
288            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
289        }
290        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
291    }
292}
293#[derive(Debug)]
294struct CreateDistributionConfigurationEndpointParamsInterceptor;
295
296#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
297impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateDistributionConfigurationEndpointParamsInterceptor {
298    fn name(&self) -> &'static str {
299        "CreateDistributionConfigurationEndpointParamsInterceptor"
300    }
301
302    fn read_before_execution(
303        &self,
304        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
305            '_,
306            ::aws_smithy_runtime_api::client::interceptors::context::Input,
307            ::aws_smithy_runtime_api::client::interceptors::context::Output,
308            ::aws_smithy_runtime_api::client::interceptors::context::Error,
309        >,
310        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
311    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
312        let _input = context
313            .input()
314            .downcast_ref::<CreateDistributionConfigurationInput>()
315            .ok_or("failed to downcast to CreateDistributionConfigurationInput")?;
316
317        let params = crate::config::endpoint::Params::builder()
318            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
319            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
320            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
321            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
322            .build()
323            .map_err(|err| {
324                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
325            })?;
326        cfg.interceptor_state()
327            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
328        ::std::result::Result::Ok(())
329    }
330}
331
332// The get_* functions below are generated from JMESPath expressions in the
333// operationContextParams trait. They target the operation's input shape.
334
335/// Error type for the `CreateDistributionConfigurationError` operation.
336#[non_exhaustive]
337#[derive(::std::fmt::Debug)]
338pub enum CreateDistributionConfigurationError {
339    /// <p>You have exceeded the permitted request rate for the specific operation.</p>
340    CallRateLimitExceededException(crate::types::error::CallRateLimitExceededException),
341    /// <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>
342    ClientException(crate::types::error::ClientException),
343    /// <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>
344    DryRunOperationException(crate::types::error::DryRunOperationException),
345    /// <p>You are not authorized to perform the requested operation.</p>
346    ForbiddenException(crate::types::error::ForbiddenException),
347    /// <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>
348    IdempotentParameterMismatchException(crate::types::error::IdempotentParameterMismatchException),
349    /// <p>You have specified two or more mutually exclusive parameters. Review the error message for details.</p>
350    InvalidParameterCombinationException(crate::types::error::InvalidParameterCombinationException),
351    /// <p>You have requested an action that that the service doesn't support.</p>
352    InvalidRequestException(crate::types::error::InvalidRequestException),
353    /// <p>The resource that you are trying to create already exists.</p>
354    ResourceAlreadyExistsException(crate::types::error::ResourceAlreadyExistsException),
355    /// <p>The resource that you are trying to operate on is currently in use. Review the message details and retry later.</p>
356    ResourceInUseException(crate::types::error::ResourceInUseException),
357    /// <p>This exception is thrown when the service encounters an unrecoverable exception.</p>
358    ServiceException(crate::types::error::ServiceException),
359    /// <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>
360    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
361    /// <p>The service is unable to process your request at this time.</p>
362    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
363    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
364    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
365    variable wildcard pattern and check `.code()`:
366     \
367    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
368     \
369    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateDistributionConfigurationError) for what information is available for the error.")]
370    Unhandled(crate::error::sealed_unhandled::Unhandled),
371}
372impl CreateDistributionConfigurationError {
373    /// Creates the `CreateDistributionConfigurationError::Unhandled` variant from any error type.
374    pub fn unhandled(
375        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
376    ) -> Self {
377        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
378            source: err.into(),
379            meta: ::std::default::Default::default(),
380        })
381    }
382
383    /// Creates the `CreateDistributionConfigurationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
384    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
385        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
386            source: err.clone().into(),
387            meta: err,
388        })
389    }
390    ///
391    /// Returns error metadata, which includes the error code, message,
392    /// request ID, and potentially additional information.
393    ///
394    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
395        match self {
396            Self::CallRateLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
397            Self::ClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
398            Self::DryRunOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
399            Self::ForbiddenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
400            Self::IdempotentParameterMismatchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
401            Self::InvalidParameterCombinationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
402            Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
403            Self::ResourceAlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
404            Self::ResourceInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
405            Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
406            Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
407            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
408            Self::Unhandled(e) => &e.meta,
409        }
410    }
411    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::CallRateLimitExceededException`.
412    pub fn is_call_rate_limit_exceeded_exception(&self) -> bool {
413        matches!(self, Self::CallRateLimitExceededException(_))
414    }
415    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::ClientException`.
416    pub fn is_client_exception(&self) -> bool {
417        matches!(self, Self::ClientException(_))
418    }
419    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::DryRunOperationException`.
420    pub fn is_dry_run_operation_exception(&self) -> bool {
421        matches!(self, Self::DryRunOperationException(_))
422    }
423    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::ForbiddenException`.
424    pub fn is_forbidden_exception(&self) -> bool {
425        matches!(self, Self::ForbiddenException(_))
426    }
427    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::IdempotentParameterMismatchException`.
428    pub fn is_idempotent_parameter_mismatch_exception(&self) -> bool {
429        matches!(self, Self::IdempotentParameterMismatchException(_))
430    }
431    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::InvalidParameterCombinationException`.
432    pub fn is_invalid_parameter_combination_exception(&self) -> bool {
433        matches!(self, Self::InvalidParameterCombinationException(_))
434    }
435    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::InvalidRequestException`.
436    pub fn is_invalid_request_exception(&self) -> bool {
437        matches!(self, Self::InvalidRequestException(_))
438    }
439    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::ResourceAlreadyExistsException`.
440    pub fn is_resource_already_exists_exception(&self) -> bool {
441        matches!(self, Self::ResourceAlreadyExistsException(_))
442    }
443    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::ResourceInUseException`.
444    pub fn is_resource_in_use_exception(&self) -> bool {
445        matches!(self, Self::ResourceInUseException(_))
446    }
447    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::ServiceException`.
448    pub fn is_service_exception(&self) -> bool {
449        matches!(self, Self::ServiceException(_))
450    }
451    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::ServiceQuotaExceededException`.
452    pub fn is_service_quota_exceeded_exception(&self) -> bool {
453        matches!(self, Self::ServiceQuotaExceededException(_))
454    }
455    /// Returns `true` if the error kind is `CreateDistributionConfigurationError::ServiceUnavailableException`.
456    pub fn is_service_unavailable_exception(&self) -> bool {
457        matches!(self, Self::ServiceUnavailableException(_))
458    }
459}
460impl ::std::error::Error for CreateDistributionConfigurationError {
461    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
462        match self {
463            Self::CallRateLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
464            Self::ClientException(_inner) => ::std::option::Option::Some(_inner),
465            Self::DryRunOperationException(_inner) => ::std::option::Option::Some(_inner),
466            Self::ForbiddenException(_inner) => ::std::option::Option::Some(_inner),
467            Self::IdempotentParameterMismatchException(_inner) => ::std::option::Option::Some(_inner),
468            Self::InvalidParameterCombinationException(_inner) => ::std::option::Option::Some(_inner),
469            Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
470            Self::ResourceAlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
471            Self::ResourceInUseException(_inner) => ::std::option::Option::Some(_inner),
472            Self::ServiceException(_inner) => ::std::option::Option::Some(_inner),
473            Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
474            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
475            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
476        }
477    }
478}
479impl ::std::fmt::Display for CreateDistributionConfigurationError {
480    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
481        match self {
482            Self::CallRateLimitExceededException(_inner) => _inner.fmt(f),
483            Self::ClientException(_inner) => _inner.fmt(f),
484            Self::DryRunOperationException(_inner) => _inner.fmt(f),
485            Self::ForbiddenException(_inner) => _inner.fmt(f),
486            Self::IdempotentParameterMismatchException(_inner) => _inner.fmt(f),
487            Self::InvalidParameterCombinationException(_inner) => _inner.fmt(f),
488            Self::InvalidRequestException(_inner) => _inner.fmt(f),
489            Self::ResourceAlreadyExistsException(_inner) => _inner.fmt(f),
490            Self::ResourceInUseException(_inner) => _inner.fmt(f),
491            Self::ServiceException(_inner) => _inner.fmt(f),
492            Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
493            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
494            Self::Unhandled(_inner) => {
495                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
496                    write!(f, "unhandled error ({code})")
497                } else {
498                    f.write_str("unhandled error")
499                }
500            }
501        }
502    }
503}
504impl ::aws_smithy_types::retry::ProvideErrorKind for CreateDistributionConfigurationError {
505    fn code(&self) -> ::std::option::Option<&str> {
506        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
507    }
508    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
509        ::std::option::Option::None
510    }
511}
512impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateDistributionConfigurationError {
513    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
514        match self {
515            Self::CallRateLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
516            Self::ClientException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
517            Self::DryRunOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
518            Self::ForbiddenException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
519            Self::IdempotentParameterMismatchException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
520            Self::InvalidParameterCombinationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
521            Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
522            Self::ResourceAlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
523            Self::ResourceInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
524            Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
525            Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
526            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
527            Self::Unhandled(_inner) => &_inner.meta,
528        }
529    }
530}
531impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateDistributionConfigurationError {
532    fn create_unhandled_error(
533        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
534        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
535    ) -> Self {
536        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
537            source,
538            meta: meta.unwrap_or_default(),
539        })
540    }
541}
542impl ::aws_types::request_id::RequestId for crate::operation::create_distribution_configuration::CreateDistributionConfigurationError {
543    fn request_id(&self) -> Option<&str> {
544        self.meta().request_id()
545    }
546}
547
548pub use crate::operation::create_distribution_configuration::_create_distribution_configuration_input::CreateDistributionConfigurationInput;
549
550pub use crate::operation::create_distribution_configuration::_create_distribution_configuration_output::CreateDistributionConfigurationOutput;
551
552mod _create_distribution_configuration_input;
553
554mod _create_distribution_configuration_output;
555
556/// Builders
557pub mod builders;