1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateDistribution;
6impl CreateDistribution {
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_distribution::CreateDistributionInput,
14 ) -> ::std::result::Result<
15 crate::operation::create_distribution::CreateDistributionOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::create_distribution::CreateDistributionError,
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::CreateDistributionError>()
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::CreateDistributionOutput>()
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::CreateDistributionInput,
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 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("cloudfront", "CreateDistribution", input, runtime_plugins, stop_point)
54 .await
55 }
56
57 pub(crate) fn operation_runtime_plugins(
58 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
59 client_config: &crate::config::Config,
60 config_override: ::std::option::Option<crate::config::Builder>,
61 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
62 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
63 runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
64 ::aws_runtime::auth::sigv4::SCHEME_ID,
65 ]));
66 if let ::std::option::Option::Some(config_override) = config_override {
67 for plugin in config_override.runtime_plugins.iter().cloned() {
68 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
69 }
70 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
71 config_override,
72 client_config.config.clone(),
73 &client_config.runtime_components,
74 ));
75 }
76 runtime_plugins
77 }
78}
79impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateDistribution {
80 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
81 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateDistribution");
82
83 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
84 CreateDistributionRequestSerializer,
85 ));
86 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
87 CreateDistributionResponseDeserializer,
88 ));
89
90 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
91 ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
92 ));
93
94 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
95 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
96 "CreateDistribution",
97 "cloudfront",
98 ));
99 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
100 signing_options.double_uri_encode = true;
101 signing_options.content_sha256_header = false;
102 signing_options.normalize_uri_path = true;
103 signing_options.payload_override = None;
104
105 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
106 signing_options,
107 ..::std::default::Default::default()
108 });
109
110 ::std::option::Option::Some(cfg.freeze())
111 }
112
113 fn runtime_components(
114 &self,
115 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
116 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
117 #[allow(unused_mut)]
118 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateDistribution")
119 .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
120 .with_interceptor(CreateDistributionEndpointParamsInterceptor)
121 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
122 crate::operation::create_distribution::CreateDistributionError,
123 >::new())
124 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
125 crate::operation::create_distribution::CreateDistributionError,
126 >::new())
127 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
128 crate::operation::create_distribution::CreateDistributionError,
129 >::new());
130
131 ::std::borrow::Cow::Owned(rcb)
132 }
133}
134
135#[derive(Debug)]
136struct CreateDistributionResponseDeserializer;
137impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateDistributionResponseDeserializer {
138 fn deserialize_nonstreaming(
139 &self,
140 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
141 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
142 let (success, status) = (response.status().is_success(), response.status().as_u16());
143 let headers = response.headers();
144 let body = response.body().bytes().expect("body loaded");
145 #[allow(unused_mut)]
146 let mut force_error = false;
147 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
148 let parse_result = if !success && status != 201 || force_error {
149 crate::protocol_serde::shape_create_distribution::de_create_distribution_http_error(status, headers, body)
150 } else {
151 crate::protocol_serde::shape_create_distribution::de_create_distribution_http_response(status, headers, body)
152 };
153 crate::protocol_serde::type_erase_result(parse_result)
154 }
155}
156#[derive(Debug)]
157struct CreateDistributionRequestSerializer;
158impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateDistributionRequestSerializer {
159 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
160 fn serialize_input(
161 &self,
162 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
163 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
164 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
165 let input = input
166 .downcast::<crate::operation::create_distribution::CreateDistributionInput>()
167 .expect("correct type");
168 let _header_serialization_settings = _cfg
169 .load::<crate::serialization_settings::HeaderSerializationSettings>()
170 .cloned()
171 .unwrap_or_default();
172 let mut request_builder = {
173 fn uri_base(
174 _input: &crate::operation::create_distribution::CreateDistributionInput,
175 output: &mut ::std::string::String,
176 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
177 use ::std::fmt::Write as _;
178 ::std::write!(output, "/2020-05-31/distribution").expect("formatting should succeed");
179 ::std::result::Result::Ok(())
180 }
181 #[allow(clippy::unnecessary_wraps)]
182 fn update_http_builder(
183 input: &crate::operation::create_distribution::CreateDistributionInput,
184 builder: ::http::request::Builder,
185 ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
186 let mut uri = ::std::string::String::new();
187 uri_base(input, &mut uri)?;
188 ::std::result::Result::Ok(builder.method("POST").uri(uri))
189 }
190 let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
191 builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
192 builder
193 };
194 let body = ::aws_smithy_types::body::SdkBody::from(
195 crate::protocol_serde::shape_create_distribution_input::ser_distribution_config_http_payload(&input.distribution_config)?,
196 );
197 if let Some(content_length) = body.content_length() {
198 let content_length = content_length.to_string();
199 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
200 }
201 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
202 }
203}
204#[derive(Debug)]
205struct CreateDistributionEndpointParamsInterceptor;
206
207impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateDistributionEndpointParamsInterceptor {
208 fn name(&self) -> &'static str {
209 "CreateDistributionEndpointParamsInterceptor"
210 }
211
212 fn read_before_execution(
213 &self,
214 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
215 '_,
216 ::aws_smithy_runtime_api::client::interceptors::context::Input,
217 ::aws_smithy_runtime_api::client::interceptors::context::Output,
218 ::aws_smithy_runtime_api::client::interceptors::context::Error,
219 >,
220 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
221 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
222 let _input = context
223 .input()
224 .downcast_ref::<CreateDistributionInput>()
225 .ok_or("failed to downcast to CreateDistributionInput")?;
226
227 let params = crate::config::endpoint::Params::builder()
228 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
229 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
230 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
231 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
232 .build()
233 .map_err(|err| {
234 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
235 })?;
236 cfg.interceptor_state()
237 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
238 ::std::result::Result::Ok(())
239 }
240}
241
242#[non_exhaustive]
247#[derive(::std::fmt::Debug)]
248pub enum CreateDistributionError {
249 AccessDenied(crate::types::error::AccessDenied),
251 CnameAlreadyExists(crate::types::error::CnameAlreadyExists),
253 ContinuousDeploymentPolicyInUse(crate::types::error::ContinuousDeploymentPolicyInUse),
255 DistributionAlreadyExists(crate::types::error::DistributionAlreadyExists),
257 EntityNotFound(crate::types::error::EntityNotFound),
259 IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(crate::types::error::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior),
261 IllegalOriginAccessConfiguration(crate::types::error::IllegalOriginAccessConfiguration),
263 InconsistentQuantities(crate::types::error::InconsistentQuantities),
265 InvalidArgument(crate::types::error::InvalidArgument),
267 InvalidDefaultRootObject(crate::types::error::InvalidDefaultRootObject),
269 InvalidDomainNameForOriginAccessControl(crate::types::error::InvalidDomainNameForOriginAccessControl),
271 InvalidErrorCode(crate::types::error::InvalidErrorCode),
273 InvalidForwardCookies(crate::types::error::InvalidForwardCookies),
275 InvalidFunctionAssociation(crate::types::error::InvalidFunctionAssociation),
277 InvalidGeoRestrictionParameter(crate::types::error::InvalidGeoRestrictionParameter),
279 InvalidHeadersForS3Origin(crate::types::error::InvalidHeadersForS3Origin),
281 InvalidLambdaFunctionAssociation(crate::types::error::InvalidLambdaFunctionAssociation),
283 InvalidLocationCode(crate::types::error::InvalidLocationCode),
285 InvalidMinimumProtocolVersion(crate::types::error::InvalidMinimumProtocolVersion),
287 InvalidOrigin(crate::types::error::InvalidOrigin),
289 InvalidOriginAccessControl(crate::types::error::InvalidOriginAccessControl),
291 InvalidOriginAccessIdentity(crate::types::error::InvalidOriginAccessIdentity),
293 InvalidOriginKeepaliveTimeout(crate::types::error::InvalidOriginKeepaliveTimeout),
295 InvalidOriginReadTimeout(crate::types::error::InvalidOriginReadTimeout),
297 InvalidProtocolSettings(crate::types::error::InvalidProtocolSettings),
299 InvalidQueryStringParameters(crate::types::error::InvalidQueryStringParameters),
301 InvalidRelativePath(crate::types::error::InvalidRelativePath),
303 InvalidRequiredProtocol(crate::types::error::InvalidRequiredProtocol),
305 InvalidResponseCode(crate::types::error::InvalidResponseCode),
307 InvalidTtlOrder(crate::types::error::InvalidTtlOrder),
309 InvalidViewerCertificate(crate::types::error::InvalidViewerCertificate),
311 InvalidWebAclId(crate::types::error::InvalidWebAclId),
313 MissingBody(crate::types::error::MissingBody),
315 NoSuchCachePolicy(crate::types::error::NoSuchCachePolicy),
317 NoSuchContinuousDeploymentPolicy(crate::types::error::NoSuchContinuousDeploymentPolicy),
319 NoSuchFieldLevelEncryptionConfig(crate::types::error::NoSuchFieldLevelEncryptionConfig),
321 NoSuchOrigin(crate::types::error::NoSuchOrigin),
323 NoSuchOriginRequestPolicy(crate::types::error::NoSuchOriginRequestPolicy),
325 NoSuchRealtimeLogConfig(crate::types::error::NoSuchRealtimeLogConfig),
327 NoSuchResponseHeadersPolicy(crate::types::error::NoSuchResponseHeadersPolicy),
329 RealtimeLogConfigOwnerMismatch(crate::types::error::RealtimeLogConfigOwnerMismatch),
331 TooManyCacheBehaviors(crate::types::error::TooManyCacheBehaviors),
333 TooManyCertificates(crate::types::error::TooManyCertificates),
335 TooManyCookieNamesInWhiteList(crate::types::error::TooManyCookieNamesInWhiteList),
337 TooManyDistributionCnamEs(crate::types::error::TooManyDistributionCnamEs),
339 TooManyDistributions(crate::types::error::TooManyDistributions),
341 TooManyDistributionsAssociatedToCachePolicy(crate::types::error::TooManyDistributionsAssociatedToCachePolicy),
343 TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(crate::types::error::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig),
345 TooManyDistributionsAssociatedToKeyGroup(crate::types::error::TooManyDistributionsAssociatedToKeyGroup),
347 TooManyDistributionsAssociatedToOriginAccessControl(crate::types::error::TooManyDistributionsAssociatedToOriginAccessControl),
350 TooManyDistributionsAssociatedToOriginRequestPolicy(crate::types::error::TooManyDistributionsAssociatedToOriginRequestPolicy),
352 TooManyDistributionsAssociatedToResponseHeadersPolicy(crate::types::error::TooManyDistributionsAssociatedToResponseHeadersPolicy),
355 TooManyDistributionsWithFunctionAssociations(crate::types::error::TooManyDistributionsWithFunctionAssociations),
357 TooManyDistributionsWithLambdaAssociations(crate::types::error::TooManyDistributionsWithLambdaAssociations),
359 TooManyDistributionsWithSingleFunctionArn(crate::types::error::TooManyDistributionsWithSingleFunctionArn),
361 TooManyFunctionAssociations(crate::types::error::TooManyFunctionAssociations),
363 TooManyHeadersInForwardedValues(crate::types::error::TooManyHeadersInForwardedValues),
365 TooManyKeyGroupsAssociatedToDistribution(crate::types::error::TooManyKeyGroupsAssociatedToDistribution),
367 TooManyLambdaFunctionAssociations(crate::types::error::TooManyLambdaFunctionAssociations),
369 TooManyOriginCustomHeaders(crate::types::error::TooManyOriginCustomHeaders),
371 TooManyOriginGroupsPerDistribution(crate::types::error::TooManyOriginGroupsPerDistribution),
373 TooManyOrigins(crate::types::error::TooManyOrigins),
375 TooManyQueryStringParameters(crate::types::error::TooManyQueryStringParameters),
377 TooManyTrustedSigners(crate::types::error::TooManyTrustedSigners),
379 TrustedKeyGroupDoesNotExist(crate::types::error::TrustedKeyGroupDoesNotExist),
381 TrustedSignerDoesNotExist(crate::types::error::TrustedSignerDoesNotExist),
383 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
385 variable wildcard pattern and check `.code()`:
386 \
387 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
388 \
389 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateDistributionError) for what information is available for the error.")]
390 Unhandled(crate::error::sealed_unhandled::Unhandled),
391}
392impl CreateDistributionError {
393 pub fn unhandled(
395 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
396 ) -> Self {
397 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
398 source: err.into(),
399 meta: ::std::default::Default::default(),
400 })
401 }
402
403 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
405 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
406 source: err.clone().into(),
407 meta: err,
408 })
409 }
410 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
415 match self {
416 Self::AccessDenied(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417 Self::CnameAlreadyExists(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418 Self::ContinuousDeploymentPolicyInUse(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419 Self::DistributionAlreadyExists(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420 Self::EntityNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
421 Self::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(e) => {
422 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e)
423 }
424 Self::IllegalOriginAccessConfiguration(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425 Self::InconsistentQuantities(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426 Self::InvalidArgument(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427 Self::InvalidDefaultRootObject(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
428 Self::InvalidDomainNameForOriginAccessControl(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
429 Self::InvalidErrorCode(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
430 Self::InvalidForwardCookies(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
431 Self::InvalidFunctionAssociation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
432 Self::InvalidGeoRestrictionParameter(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
433 Self::InvalidHeadersForS3Origin(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
434 Self::InvalidLambdaFunctionAssociation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
435 Self::InvalidLocationCode(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436 Self::InvalidMinimumProtocolVersion(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
437 Self::InvalidOrigin(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
438 Self::InvalidOriginAccessControl(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
439 Self::InvalidOriginAccessIdentity(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440 Self::InvalidOriginKeepaliveTimeout(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441 Self::InvalidOriginReadTimeout(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442 Self::InvalidProtocolSettings(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443 Self::InvalidQueryStringParameters(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444 Self::InvalidRelativePath(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
445 Self::InvalidRequiredProtocol(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
446 Self::InvalidResponseCode(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
447 Self::InvalidTtlOrder(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
448 Self::InvalidViewerCertificate(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
449 Self::InvalidWebAclId(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
450 Self::MissingBody(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
451 Self::NoSuchCachePolicy(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
452 Self::NoSuchContinuousDeploymentPolicy(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
453 Self::NoSuchFieldLevelEncryptionConfig(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
454 Self::NoSuchOrigin(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
455 Self::NoSuchOriginRequestPolicy(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
456 Self::NoSuchRealtimeLogConfig(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
457 Self::NoSuchResponseHeadersPolicy(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
458 Self::RealtimeLogConfigOwnerMismatch(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
459 Self::TooManyCacheBehaviors(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
460 Self::TooManyCertificates(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
461 Self::TooManyCookieNamesInWhiteList(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
462 Self::TooManyDistributionCnamEs(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
463 Self::TooManyDistributions(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
464 Self::TooManyDistributionsAssociatedToCachePolicy(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
465 Self::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
466 Self::TooManyDistributionsAssociatedToKeyGroup(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
467 Self::TooManyDistributionsAssociatedToOriginAccessControl(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
468 Self::TooManyDistributionsAssociatedToOriginRequestPolicy(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
469 Self::TooManyDistributionsAssociatedToResponseHeadersPolicy(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
470 Self::TooManyDistributionsWithFunctionAssociations(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
471 Self::TooManyDistributionsWithLambdaAssociations(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
472 Self::TooManyDistributionsWithSingleFunctionArn(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
473 Self::TooManyFunctionAssociations(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
474 Self::TooManyHeadersInForwardedValues(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
475 Self::TooManyKeyGroupsAssociatedToDistribution(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
476 Self::TooManyLambdaFunctionAssociations(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
477 Self::TooManyOriginCustomHeaders(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
478 Self::TooManyOriginGroupsPerDistribution(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
479 Self::TooManyOrigins(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
480 Self::TooManyQueryStringParameters(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
481 Self::TooManyTrustedSigners(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
482 Self::TrustedKeyGroupDoesNotExist(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
483 Self::TrustedSignerDoesNotExist(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
484 Self::Unhandled(e) => &e.meta,
485 }
486 }
487 pub fn is_access_denied(&self) -> bool {
489 matches!(self, Self::AccessDenied(_))
490 }
491 pub fn is_cname_already_exists(&self) -> bool {
493 matches!(self, Self::CnameAlreadyExists(_))
494 }
495 pub fn is_continuous_deployment_policy_in_use(&self) -> bool {
497 matches!(self, Self::ContinuousDeploymentPolicyInUse(_))
498 }
499 pub fn is_distribution_already_exists(&self) -> bool {
501 matches!(self, Self::DistributionAlreadyExists(_))
502 }
503 pub fn is_entity_not_found(&self) -> bool {
505 matches!(self, Self::EntityNotFound(_))
506 }
507 pub fn is_illegal_field_level_encryption_config_association_with_cache_behavior(&self) -> bool {
509 matches!(self, Self::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(_))
510 }
511 pub fn is_illegal_origin_access_configuration(&self) -> bool {
513 matches!(self, Self::IllegalOriginAccessConfiguration(_))
514 }
515 pub fn is_inconsistent_quantities(&self) -> bool {
517 matches!(self, Self::InconsistentQuantities(_))
518 }
519 pub fn is_invalid_argument(&self) -> bool {
521 matches!(self, Self::InvalidArgument(_))
522 }
523 pub fn is_invalid_default_root_object(&self) -> bool {
525 matches!(self, Self::InvalidDefaultRootObject(_))
526 }
527 pub fn is_invalid_domain_name_for_origin_access_control(&self) -> bool {
529 matches!(self, Self::InvalidDomainNameForOriginAccessControl(_))
530 }
531 pub fn is_invalid_error_code(&self) -> bool {
533 matches!(self, Self::InvalidErrorCode(_))
534 }
535 pub fn is_invalid_forward_cookies(&self) -> bool {
537 matches!(self, Self::InvalidForwardCookies(_))
538 }
539 pub fn is_invalid_function_association(&self) -> bool {
541 matches!(self, Self::InvalidFunctionAssociation(_))
542 }
543 pub fn is_invalid_geo_restriction_parameter(&self) -> bool {
545 matches!(self, Self::InvalidGeoRestrictionParameter(_))
546 }
547 pub fn is_invalid_headers_for_s3_origin(&self) -> bool {
549 matches!(self, Self::InvalidHeadersForS3Origin(_))
550 }
551 pub fn is_invalid_lambda_function_association(&self) -> bool {
553 matches!(self, Self::InvalidLambdaFunctionAssociation(_))
554 }
555 pub fn is_invalid_location_code(&self) -> bool {
557 matches!(self, Self::InvalidLocationCode(_))
558 }
559 pub fn is_invalid_minimum_protocol_version(&self) -> bool {
561 matches!(self, Self::InvalidMinimumProtocolVersion(_))
562 }
563 pub fn is_invalid_origin(&self) -> bool {
565 matches!(self, Self::InvalidOrigin(_))
566 }
567 pub fn is_invalid_origin_access_control(&self) -> bool {
569 matches!(self, Self::InvalidOriginAccessControl(_))
570 }
571 pub fn is_invalid_origin_access_identity(&self) -> bool {
573 matches!(self, Self::InvalidOriginAccessIdentity(_))
574 }
575 pub fn is_invalid_origin_keepalive_timeout(&self) -> bool {
577 matches!(self, Self::InvalidOriginKeepaliveTimeout(_))
578 }
579 pub fn is_invalid_origin_read_timeout(&self) -> bool {
581 matches!(self, Self::InvalidOriginReadTimeout(_))
582 }
583 pub fn is_invalid_protocol_settings(&self) -> bool {
585 matches!(self, Self::InvalidProtocolSettings(_))
586 }
587 pub fn is_invalid_query_string_parameters(&self) -> bool {
589 matches!(self, Self::InvalidQueryStringParameters(_))
590 }
591 pub fn is_invalid_relative_path(&self) -> bool {
593 matches!(self, Self::InvalidRelativePath(_))
594 }
595 pub fn is_invalid_required_protocol(&self) -> bool {
597 matches!(self, Self::InvalidRequiredProtocol(_))
598 }
599 pub fn is_invalid_response_code(&self) -> bool {
601 matches!(self, Self::InvalidResponseCode(_))
602 }
603 pub fn is_invalid_ttl_order(&self) -> bool {
605 matches!(self, Self::InvalidTtlOrder(_))
606 }
607 pub fn is_invalid_viewer_certificate(&self) -> bool {
609 matches!(self, Self::InvalidViewerCertificate(_))
610 }
611 pub fn is_invalid_web_acl_id(&self) -> bool {
613 matches!(self, Self::InvalidWebAclId(_))
614 }
615 pub fn is_missing_body(&self) -> bool {
617 matches!(self, Self::MissingBody(_))
618 }
619 pub fn is_no_such_cache_policy(&self) -> bool {
621 matches!(self, Self::NoSuchCachePolicy(_))
622 }
623 pub fn is_no_such_continuous_deployment_policy(&self) -> bool {
625 matches!(self, Self::NoSuchContinuousDeploymentPolicy(_))
626 }
627 pub fn is_no_such_field_level_encryption_config(&self) -> bool {
629 matches!(self, Self::NoSuchFieldLevelEncryptionConfig(_))
630 }
631 pub fn is_no_such_origin(&self) -> bool {
633 matches!(self, Self::NoSuchOrigin(_))
634 }
635 pub fn is_no_such_origin_request_policy(&self) -> bool {
637 matches!(self, Self::NoSuchOriginRequestPolicy(_))
638 }
639 pub fn is_no_such_realtime_log_config(&self) -> bool {
641 matches!(self, Self::NoSuchRealtimeLogConfig(_))
642 }
643 pub fn is_no_such_response_headers_policy(&self) -> bool {
645 matches!(self, Self::NoSuchResponseHeadersPolicy(_))
646 }
647 pub fn is_realtime_log_config_owner_mismatch(&self) -> bool {
649 matches!(self, Self::RealtimeLogConfigOwnerMismatch(_))
650 }
651 pub fn is_too_many_cache_behaviors(&self) -> bool {
653 matches!(self, Self::TooManyCacheBehaviors(_))
654 }
655 pub fn is_too_many_certificates(&self) -> bool {
657 matches!(self, Self::TooManyCertificates(_))
658 }
659 pub fn is_too_many_cookie_names_in_white_list(&self) -> bool {
661 matches!(self, Self::TooManyCookieNamesInWhiteList(_))
662 }
663 pub fn is_too_many_distribution_cnam_es(&self) -> bool {
665 matches!(self, Self::TooManyDistributionCnamEs(_))
666 }
667 pub fn is_too_many_distributions(&self) -> bool {
669 matches!(self, Self::TooManyDistributions(_))
670 }
671 pub fn is_too_many_distributions_associated_to_cache_policy(&self) -> bool {
673 matches!(self, Self::TooManyDistributionsAssociatedToCachePolicy(_))
674 }
675 pub fn is_too_many_distributions_associated_to_field_level_encryption_config(&self) -> bool {
677 matches!(self, Self::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(_))
678 }
679 pub fn is_too_many_distributions_associated_to_key_group(&self) -> bool {
681 matches!(self, Self::TooManyDistributionsAssociatedToKeyGroup(_))
682 }
683 pub fn is_too_many_distributions_associated_to_origin_access_control(&self) -> bool {
685 matches!(self, Self::TooManyDistributionsAssociatedToOriginAccessControl(_))
686 }
687 pub fn is_too_many_distributions_associated_to_origin_request_policy(&self) -> bool {
689 matches!(self, Self::TooManyDistributionsAssociatedToOriginRequestPolicy(_))
690 }
691 pub fn is_too_many_distributions_associated_to_response_headers_policy(&self) -> bool {
693 matches!(self, Self::TooManyDistributionsAssociatedToResponseHeadersPolicy(_))
694 }
695 pub fn is_too_many_distributions_with_function_associations(&self) -> bool {
697 matches!(self, Self::TooManyDistributionsWithFunctionAssociations(_))
698 }
699 pub fn is_too_many_distributions_with_lambda_associations(&self) -> bool {
701 matches!(self, Self::TooManyDistributionsWithLambdaAssociations(_))
702 }
703 pub fn is_too_many_distributions_with_single_function_arn(&self) -> bool {
705 matches!(self, Self::TooManyDistributionsWithSingleFunctionArn(_))
706 }
707 pub fn is_too_many_function_associations(&self) -> bool {
709 matches!(self, Self::TooManyFunctionAssociations(_))
710 }
711 pub fn is_too_many_headers_in_forwarded_values(&self) -> bool {
713 matches!(self, Self::TooManyHeadersInForwardedValues(_))
714 }
715 pub fn is_too_many_key_groups_associated_to_distribution(&self) -> bool {
717 matches!(self, Self::TooManyKeyGroupsAssociatedToDistribution(_))
718 }
719 pub fn is_too_many_lambda_function_associations(&self) -> bool {
721 matches!(self, Self::TooManyLambdaFunctionAssociations(_))
722 }
723 pub fn is_too_many_origin_custom_headers(&self) -> bool {
725 matches!(self, Self::TooManyOriginCustomHeaders(_))
726 }
727 pub fn is_too_many_origin_groups_per_distribution(&self) -> bool {
729 matches!(self, Self::TooManyOriginGroupsPerDistribution(_))
730 }
731 pub fn is_too_many_origins(&self) -> bool {
733 matches!(self, Self::TooManyOrigins(_))
734 }
735 pub fn is_too_many_query_string_parameters(&self) -> bool {
737 matches!(self, Self::TooManyQueryStringParameters(_))
738 }
739 pub fn is_too_many_trusted_signers(&self) -> bool {
741 matches!(self, Self::TooManyTrustedSigners(_))
742 }
743 pub fn is_trusted_key_group_does_not_exist(&self) -> bool {
745 matches!(self, Self::TrustedKeyGroupDoesNotExist(_))
746 }
747 pub fn is_trusted_signer_does_not_exist(&self) -> bool {
749 matches!(self, Self::TrustedSignerDoesNotExist(_))
750 }
751}
752impl ::std::error::Error for CreateDistributionError {
753 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
754 match self {
755 Self::AccessDenied(_inner) => ::std::option::Option::Some(_inner),
756 Self::CnameAlreadyExists(_inner) => ::std::option::Option::Some(_inner),
757 Self::ContinuousDeploymentPolicyInUse(_inner) => ::std::option::Option::Some(_inner),
758 Self::DistributionAlreadyExists(_inner) => ::std::option::Option::Some(_inner),
759 Self::EntityNotFound(_inner) => ::std::option::Option::Some(_inner),
760 Self::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(_inner) => ::std::option::Option::Some(_inner),
761 Self::IllegalOriginAccessConfiguration(_inner) => ::std::option::Option::Some(_inner),
762 Self::InconsistentQuantities(_inner) => ::std::option::Option::Some(_inner),
763 Self::InvalidArgument(_inner) => ::std::option::Option::Some(_inner),
764 Self::InvalidDefaultRootObject(_inner) => ::std::option::Option::Some(_inner),
765 Self::InvalidDomainNameForOriginAccessControl(_inner) => ::std::option::Option::Some(_inner),
766 Self::InvalidErrorCode(_inner) => ::std::option::Option::Some(_inner),
767 Self::InvalidForwardCookies(_inner) => ::std::option::Option::Some(_inner),
768 Self::InvalidFunctionAssociation(_inner) => ::std::option::Option::Some(_inner),
769 Self::InvalidGeoRestrictionParameter(_inner) => ::std::option::Option::Some(_inner),
770 Self::InvalidHeadersForS3Origin(_inner) => ::std::option::Option::Some(_inner),
771 Self::InvalidLambdaFunctionAssociation(_inner) => ::std::option::Option::Some(_inner),
772 Self::InvalidLocationCode(_inner) => ::std::option::Option::Some(_inner),
773 Self::InvalidMinimumProtocolVersion(_inner) => ::std::option::Option::Some(_inner),
774 Self::InvalidOrigin(_inner) => ::std::option::Option::Some(_inner),
775 Self::InvalidOriginAccessControl(_inner) => ::std::option::Option::Some(_inner),
776 Self::InvalidOriginAccessIdentity(_inner) => ::std::option::Option::Some(_inner),
777 Self::InvalidOriginKeepaliveTimeout(_inner) => ::std::option::Option::Some(_inner),
778 Self::InvalidOriginReadTimeout(_inner) => ::std::option::Option::Some(_inner),
779 Self::InvalidProtocolSettings(_inner) => ::std::option::Option::Some(_inner),
780 Self::InvalidQueryStringParameters(_inner) => ::std::option::Option::Some(_inner),
781 Self::InvalidRelativePath(_inner) => ::std::option::Option::Some(_inner),
782 Self::InvalidRequiredProtocol(_inner) => ::std::option::Option::Some(_inner),
783 Self::InvalidResponseCode(_inner) => ::std::option::Option::Some(_inner),
784 Self::InvalidTtlOrder(_inner) => ::std::option::Option::Some(_inner),
785 Self::InvalidViewerCertificate(_inner) => ::std::option::Option::Some(_inner),
786 Self::InvalidWebAclId(_inner) => ::std::option::Option::Some(_inner),
787 Self::MissingBody(_inner) => ::std::option::Option::Some(_inner),
788 Self::NoSuchCachePolicy(_inner) => ::std::option::Option::Some(_inner),
789 Self::NoSuchContinuousDeploymentPolicy(_inner) => ::std::option::Option::Some(_inner),
790 Self::NoSuchFieldLevelEncryptionConfig(_inner) => ::std::option::Option::Some(_inner),
791 Self::NoSuchOrigin(_inner) => ::std::option::Option::Some(_inner),
792 Self::NoSuchOriginRequestPolicy(_inner) => ::std::option::Option::Some(_inner),
793 Self::NoSuchRealtimeLogConfig(_inner) => ::std::option::Option::Some(_inner),
794 Self::NoSuchResponseHeadersPolicy(_inner) => ::std::option::Option::Some(_inner),
795 Self::RealtimeLogConfigOwnerMismatch(_inner) => ::std::option::Option::Some(_inner),
796 Self::TooManyCacheBehaviors(_inner) => ::std::option::Option::Some(_inner),
797 Self::TooManyCertificates(_inner) => ::std::option::Option::Some(_inner),
798 Self::TooManyCookieNamesInWhiteList(_inner) => ::std::option::Option::Some(_inner),
799 Self::TooManyDistributionCnamEs(_inner) => ::std::option::Option::Some(_inner),
800 Self::TooManyDistributions(_inner) => ::std::option::Option::Some(_inner),
801 Self::TooManyDistributionsAssociatedToCachePolicy(_inner) => ::std::option::Option::Some(_inner),
802 Self::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(_inner) => ::std::option::Option::Some(_inner),
803 Self::TooManyDistributionsAssociatedToKeyGroup(_inner) => ::std::option::Option::Some(_inner),
804 Self::TooManyDistributionsAssociatedToOriginAccessControl(_inner) => ::std::option::Option::Some(_inner),
805 Self::TooManyDistributionsAssociatedToOriginRequestPolicy(_inner) => ::std::option::Option::Some(_inner),
806 Self::TooManyDistributionsAssociatedToResponseHeadersPolicy(_inner) => ::std::option::Option::Some(_inner),
807 Self::TooManyDistributionsWithFunctionAssociations(_inner) => ::std::option::Option::Some(_inner),
808 Self::TooManyDistributionsWithLambdaAssociations(_inner) => ::std::option::Option::Some(_inner),
809 Self::TooManyDistributionsWithSingleFunctionArn(_inner) => ::std::option::Option::Some(_inner),
810 Self::TooManyFunctionAssociations(_inner) => ::std::option::Option::Some(_inner),
811 Self::TooManyHeadersInForwardedValues(_inner) => ::std::option::Option::Some(_inner),
812 Self::TooManyKeyGroupsAssociatedToDistribution(_inner) => ::std::option::Option::Some(_inner),
813 Self::TooManyLambdaFunctionAssociations(_inner) => ::std::option::Option::Some(_inner),
814 Self::TooManyOriginCustomHeaders(_inner) => ::std::option::Option::Some(_inner),
815 Self::TooManyOriginGroupsPerDistribution(_inner) => ::std::option::Option::Some(_inner),
816 Self::TooManyOrigins(_inner) => ::std::option::Option::Some(_inner),
817 Self::TooManyQueryStringParameters(_inner) => ::std::option::Option::Some(_inner),
818 Self::TooManyTrustedSigners(_inner) => ::std::option::Option::Some(_inner),
819 Self::TrustedKeyGroupDoesNotExist(_inner) => ::std::option::Option::Some(_inner),
820 Self::TrustedSignerDoesNotExist(_inner) => ::std::option::Option::Some(_inner),
821 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
822 }
823 }
824}
825impl ::std::fmt::Display for CreateDistributionError {
826 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
827 match self {
828 Self::AccessDenied(_inner) => _inner.fmt(f),
829 Self::CnameAlreadyExists(_inner) => _inner.fmt(f),
830 Self::ContinuousDeploymentPolicyInUse(_inner) => _inner.fmt(f),
831 Self::DistributionAlreadyExists(_inner) => _inner.fmt(f),
832 Self::EntityNotFound(_inner) => _inner.fmt(f),
833 Self::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(_inner) => _inner.fmt(f),
834 Self::IllegalOriginAccessConfiguration(_inner) => _inner.fmt(f),
835 Self::InconsistentQuantities(_inner) => _inner.fmt(f),
836 Self::InvalidArgument(_inner) => _inner.fmt(f),
837 Self::InvalidDefaultRootObject(_inner) => _inner.fmt(f),
838 Self::InvalidDomainNameForOriginAccessControl(_inner) => _inner.fmt(f),
839 Self::InvalidErrorCode(_inner) => _inner.fmt(f),
840 Self::InvalidForwardCookies(_inner) => _inner.fmt(f),
841 Self::InvalidFunctionAssociation(_inner) => _inner.fmt(f),
842 Self::InvalidGeoRestrictionParameter(_inner) => _inner.fmt(f),
843 Self::InvalidHeadersForS3Origin(_inner) => _inner.fmt(f),
844 Self::InvalidLambdaFunctionAssociation(_inner) => _inner.fmt(f),
845 Self::InvalidLocationCode(_inner) => _inner.fmt(f),
846 Self::InvalidMinimumProtocolVersion(_inner) => _inner.fmt(f),
847 Self::InvalidOrigin(_inner) => _inner.fmt(f),
848 Self::InvalidOriginAccessControl(_inner) => _inner.fmt(f),
849 Self::InvalidOriginAccessIdentity(_inner) => _inner.fmt(f),
850 Self::InvalidOriginKeepaliveTimeout(_inner) => _inner.fmt(f),
851 Self::InvalidOriginReadTimeout(_inner) => _inner.fmt(f),
852 Self::InvalidProtocolSettings(_inner) => _inner.fmt(f),
853 Self::InvalidQueryStringParameters(_inner) => _inner.fmt(f),
854 Self::InvalidRelativePath(_inner) => _inner.fmt(f),
855 Self::InvalidRequiredProtocol(_inner) => _inner.fmt(f),
856 Self::InvalidResponseCode(_inner) => _inner.fmt(f),
857 Self::InvalidTtlOrder(_inner) => _inner.fmt(f),
858 Self::InvalidViewerCertificate(_inner) => _inner.fmt(f),
859 Self::InvalidWebAclId(_inner) => _inner.fmt(f),
860 Self::MissingBody(_inner) => _inner.fmt(f),
861 Self::NoSuchCachePolicy(_inner) => _inner.fmt(f),
862 Self::NoSuchContinuousDeploymentPolicy(_inner) => _inner.fmt(f),
863 Self::NoSuchFieldLevelEncryptionConfig(_inner) => _inner.fmt(f),
864 Self::NoSuchOrigin(_inner) => _inner.fmt(f),
865 Self::NoSuchOriginRequestPolicy(_inner) => _inner.fmt(f),
866 Self::NoSuchRealtimeLogConfig(_inner) => _inner.fmt(f),
867 Self::NoSuchResponseHeadersPolicy(_inner) => _inner.fmt(f),
868 Self::RealtimeLogConfigOwnerMismatch(_inner) => _inner.fmt(f),
869 Self::TooManyCacheBehaviors(_inner) => _inner.fmt(f),
870 Self::TooManyCertificates(_inner) => _inner.fmt(f),
871 Self::TooManyCookieNamesInWhiteList(_inner) => _inner.fmt(f),
872 Self::TooManyDistributionCnamEs(_inner) => _inner.fmt(f),
873 Self::TooManyDistributions(_inner) => _inner.fmt(f),
874 Self::TooManyDistributionsAssociatedToCachePolicy(_inner) => _inner.fmt(f),
875 Self::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(_inner) => _inner.fmt(f),
876 Self::TooManyDistributionsAssociatedToKeyGroup(_inner) => _inner.fmt(f),
877 Self::TooManyDistributionsAssociatedToOriginAccessControl(_inner) => _inner.fmt(f),
878 Self::TooManyDistributionsAssociatedToOriginRequestPolicy(_inner) => _inner.fmt(f),
879 Self::TooManyDistributionsAssociatedToResponseHeadersPolicy(_inner) => _inner.fmt(f),
880 Self::TooManyDistributionsWithFunctionAssociations(_inner) => _inner.fmt(f),
881 Self::TooManyDistributionsWithLambdaAssociations(_inner) => _inner.fmt(f),
882 Self::TooManyDistributionsWithSingleFunctionArn(_inner) => _inner.fmt(f),
883 Self::TooManyFunctionAssociations(_inner) => _inner.fmt(f),
884 Self::TooManyHeadersInForwardedValues(_inner) => _inner.fmt(f),
885 Self::TooManyKeyGroupsAssociatedToDistribution(_inner) => _inner.fmt(f),
886 Self::TooManyLambdaFunctionAssociations(_inner) => _inner.fmt(f),
887 Self::TooManyOriginCustomHeaders(_inner) => _inner.fmt(f),
888 Self::TooManyOriginGroupsPerDistribution(_inner) => _inner.fmt(f),
889 Self::TooManyOrigins(_inner) => _inner.fmt(f),
890 Self::TooManyQueryStringParameters(_inner) => _inner.fmt(f),
891 Self::TooManyTrustedSigners(_inner) => _inner.fmt(f),
892 Self::TrustedKeyGroupDoesNotExist(_inner) => _inner.fmt(f),
893 Self::TrustedSignerDoesNotExist(_inner) => _inner.fmt(f),
894 Self::Unhandled(_inner) => {
895 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
896 write!(f, "unhandled error ({code})")
897 } else {
898 f.write_str("unhandled error")
899 }
900 }
901 }
902 }
903}
904impl ::aws_smithy_types::retry::ProvideErrorKind for CreateDistributionError {
905 fn code(&self) -> ::std::option::Option<&str> {
906 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
907 }
908 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
909 ::std::option::Option::None
910 }
911}
912impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateDistributionError {
913 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
914 match self {
915 Self::AccessDenied(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
916 Self::CnameAlreadyExists(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
917 Self::ContinuousDeploymentPolicyInUse(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
918 Self::DistributionAlreadyExists(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
919 Self::EntityNotFound(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
920 Self::IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(_inner) => {
921 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
922 }
923 Self::IllegalOriginAccessConfiguration(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
924 Self::InconsistentQuantities(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
925 Self::InvalidArgument(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
926 Self::InvalidDefaultRootObject(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
927 Self::InvalidDomainNameForOriginAccessControl(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
928 Self::InvalidErrorCode(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
929 Self::InvalidForwardCookies(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
930 Self::InvalidFunctionAssociation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
931 Self::InvalidGeoRestrictionParameter(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
932 Self::InvalidHeadersForS3Origin(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
933 Self::InvalidLambdaFunctionAssociation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
934 Self::InvalidLocationCode(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
935 Self::InvalidMinimumProtocolVersion(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
936 Self::InvalidOrigin(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
937 Self::InvalidOriginAccessControl(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
938 Self::InvalidOriginAccessIdentity(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
939 Self::InvalidOriginKeepaliveTimeout(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
940 Self::InvalidOriginReadTimeout(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
941 Self::InvalidProtocolSettings(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
942 Self::InvalidQueryStringParameters(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
943 Self::InvalidRelativePath(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
944 Self::InvalidRequiredProtocol(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
945 Self::InvalidResponseCode(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
946 Self::InvalidTtlOrder(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
947 Self::InvalidViewerCertificate(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
948 Self::InvalidWebAclId(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
949 Self::MissingBody(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
950 Self::NoSuchCachePolicy(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
951 Self::NoSuchContinuousDeploymentPolicy(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
952 Self::NoSuchFieldLevelEncryptionConfig(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
953 Self::NoSuchOrigin(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
954 Self::NoSuchOriginRequestPolicy(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
955 Self::NoSuchRealtimeLogConfig(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
956 Self::NoSuchResponseHeadersPolicy(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
957 Self::RealtimeLogConfigOwnerMismatch(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
958 Self::TooManyCacheBehaviors(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
959 Self::TooManyCertificates(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
960 Self::TooManyCookieNamesInWhiteList(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
961 Self::TooManyDistributionCnamEs(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
962 Self::TooManyDistributions(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
963 Self::TooManyDistributionsAssociatedToCachePolicy(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
964 Self::TooManyDistributionsAssociatedToFieldLevelEncryptionConfig(_inner) => {
965 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
966 }
967 Self::TooManyDistributionsAssociatedToKeyGroup(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
968 Self::TooManyDistributionsAssociatedToOriginAccessControl(_inner) => {
969 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
970 }
971 Self::TooManyDistributionsAssociatedToOriginRequestPolicy(_inner) => {
972 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
973 }
974 Self::TooManyDistributionsAssociatedToResponseHeadersPolicy(_inner) => {
975 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
976 }
977 Self::TooManyDistributionsWithFunctionAssociations(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
978 Self::TooManyDistributionsWithLambdaAssociations(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
979 Self::TooManyDistributionsWithSingleFunctionArn(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
980 Self::TooManyFunctionAssociations(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
981 Self::TooManyHeadersInForwardedValues(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
982 Self::TooManyKeyGroupsAssociatedToDistribution(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
983 Self::TooManyLambdaFunctionAssociations(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
984 Self::TooManyOriginCustomHeaders(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
985 Self::TooManyOriginGroupsPerDistribution(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
986 Self::TooManyOrigins(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
987 Self::TooManyQueryStringParameters(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
988 Self::TooManyTrustedSigners(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
989 Self::TrustedKeyGroupDoesNotExist(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
990 Self::TrustedSignerDoesNotExist(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
991 Self::Unhandled(_inner) => &_inner.meta,
992 }
993 }
994}
995impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateDistributionError {
996 fn create_unhandled_error(
997 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
998 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
999 ) -> Self {
1000 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
1001 source,
1002 meta: meta.unwrap_or_default(),
1003 })
1004 }
1005}
1006impl ::aws_types::request_id::RequestId for crate::operation::create_distribution::CreateDistributionError {
1007 fn request_id(&self) -> Option<&str> {
1008 self.meta().request_id()
1009 }
1010}
1011
1012pub use crate::operation::create_distribution::_create_distribution_output::CreateDistributionOutput;
1013
1014pub use crate::operation::create_distribution::_create_distribution_input::CreateDistributionInput;
1015
1016mod _create_distribution_input;
1017
1018mod _create_distribution_output;
1019
1020pub mod builders;