1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct DeleteFile;
6impl DeleteFile {
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::delete_file::DeleteFileInput,
14 ) -> ::std::result::Result<
15 crate::operation::delete_file::DeleteFileOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::delete_file::DeleteFileError,
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::delete_file::DeleteFileError>()
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::delete_file::DeleteFileOutput>()
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::delete_file::DeleteFileInput,
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("CodeCommit", "DeleteFile", input, runtime_plugins, stop_point)
55 .instrument(::tracing::debug_span!(
58 "CodeCommit.DeleteFile",
59 "rpc.service" = "CodeCommit",
60 "rpc.method" = "DeleteFile",
61 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62 "rpc.system" = "aws-api",
63 ))
64 .await
65 }
66
67 pub(crate) fn operation_runtime_plugins(
68 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69 client_config: &crate::config::Config,
70 config_override: ::std::option::Option<crate::config::Builder>,
71 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74 if let ::std::option::Option::Some(config_override) = config_override {
75 for plugin in config_override.runtime_plugins.iter().cloned() {
76 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77 }
78 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79 config_override,
80 client_config.config.clone(),
81 &client_config.runtime_components,
82 ));
83 }
84 runtime_plugins
85 }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteFile {
88 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DeleteFile");
90
91 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92 DeleteFileRequestSerializer,
93 ));
94 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95 DeleteFileResponseDeserializer,
96 ));
97
98 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99 crate::config::auth::Params::builder()
100 .operation_name("DeleteFile")
101 .build()
102 .expect("required fields set"),
103 ));
104
105 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("DeleteFile", "CodeCommit"));
106 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
107 signing_options.double_uri_encode = true;
108 signing_options.content_sha256_header = false;
109 signing_options.normalize_uri_path = true;
110 signing_options.payload_override = None;
111
112 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
113 signing_options,
114 ..::std::default::Default::default()
115 });
116
117 ::std::option::Option::Some(cfg.freeze())
118 }
119
120 fn runtime_components(
121 &self,
122 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
123 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
124 #[allow(unused_mut)]
125 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteFile")
126 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
127 DeleteFileTelemetryInputCaptureInterceptor,
128 ))
129 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
130 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
131 ))
132 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
133 DeleteFileEndpointParamsInterceptor,
134 ))
135 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
136 crate::operation::delete_file::DeleteFileError,
137 >::new())
138 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
139 crate::operation::delete_file::DeleteFileError,
140 >::new())
141 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
142 crate::operation::delete_file::DeleteFileError,
143 >::new())
144 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
145 crate::operation::delete_file::DeleteFileError,
146 >::new());
147
148 ::std::borrow::Cow::Owned(rcb)
149 }
150}
151
152#[derive(Debug)]
153struct DeleteFileTelemetryInputCaptureInterceptor;
154
155#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
156impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteFileTelemetryInputCaptureInterceptor {
157 fn name(&self) -> &'static str {
158 "DeleteFileTelemetryInputCaptureInterceptor"
159 }
160
161 fn read_before_execution(
162 &self,
163 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
164 '_,
165 ::aws_smithy_runtime_api::client::interceptors::context::Input,
166 ::aws_smithy_runtime_api::client::interceptors::context::Output,
167 ::aws_smithy_runtime_api::client::interceptors::context::Error,
168 >,
169 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
170 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
171 let ::std::option::Option::Some(requested) = cfg
173 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
174 .filter(|r| !r.is_empty())
175 else {
176 return ::std::result::Result::Ok(());
177 };
178
179 let ::std::option::Option::Some(input) = context.input().downcast_ref::<DeleteFileInput>() else {
180 return ::std::result::Result::Ok(());
182 };
183
184 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
185 if requested.should_capture("repositoryName") {
186 if let ::std::option::Option::Some(value) = input.repository_name.as_deref() {
187 captured.insert("repositoryName", value);
188 }
189 }
190 if requested.should_capture("branchName") {
191 if let ::std::option::Option::Some(value) = input.branch_name.as_deref() {
192 captured.insert("branchName", value);
193 }
194 }
195 if requested.should_capture("filePath") {
196 if let ::std::option::Option::Some(value) = input.file_path.as_deref() {
197 captured.insert("filePath", value);
198 }
199 }
200 if requested.should_capture("parentCommitId") {
201 if let ::std::option::Option::Some(value) = input.parent_commit_id.as_deref() {
202 captured.insert("parentCommitId", value);
203 }
204 }
205 if requested.should_capture("commitMessage") {
206 if let ::std::option::Option::Some(value) = input.commit_message.as_deref() {
207 captured.insert("commitMessage", value);
208 }
209 }
210 if requested.should_capture("name") {
211 if let ::std::option::Option::Some(value) = input.name.as_deref() {
212 captured.insert("name", value);
213 }
214 }
215 if requested.should_capture("email") {
216 if let ::std::option::Option::Some(value) = input.email.as_deref() {
217 captured.insert("email", value);
218 }
219 }
220
221 cfg.interceptor_state().store_put(captured);
222 ::std::result::Result::Ok(())
223 }
224}
225#[derive(Debug)]
226struct DeleteFileResponseDeserializer;
227impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteFileResponseDeserializer {
228 fn deserialize_nonstreaming_with_config(
229 &self,
230 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
231 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
232 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
233 let (success, status) = (response.status().is_success(), response.status().as_u16());
234 let headers = response.headers();
235 let body = response.body().bytes().expect("body loaded");
236 #[allow(unused_mut)]
237 let mut force_error = false;
238 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
239 let parse_result = if !success && status != 200 || force_error {
240 crate::protocol_serde::shape_delete_file::de_delete_file_http_error(status, headers, body)
241 } else {
242 crate::protocol_serde::shape_delete_file::de_delete_file_http_response(status, headers, body)
243 };
244 crate::protocol_serde::type_erase_result(parse_result)
245 }
246}
247#[derive(Debug)]
248struct DeleteFileRequestSerializer;
249impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteFileRequestSerializer {
250 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
251 fn serialize_input(
252 &self,
253 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
254 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
255 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
256 let input = input.downcast::<crate::operation::delete_file::DeleteFileInput>().expect("correct type");
257 let _header_serialization_settings = _cfg
258 .load::<crate::serialization_settings::HeaderSerializationSettings>()
259 .cloned()
260 .unwrap_or_default();
261 let mut request_builder = {
262 #[allow(clippy::uninlined_format_args)]
263 fn uri_base(
264 _input: &crate::operation::delete_file::DeleteFileInput,
265 output: &mut ::std::string::String,
266 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
267 use ::std::fmt::Write as _;
268 ::std::write!(output, "/").expect("formatting should succeed");
269 ::std::result::Result::Ok(())
270 }
271 #[allow(clippy::unnecessary_wraps)]
272 fn update_http_builder(
273 input: &crate::operation::delete_file::DeleteFileInput,
274 builder: ::http_1x::request::Builder,
275 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
276 let mut uri = ::std::string::String::new();
277 uri_base(input, &mut uri)?;
278 ::std::result::Result::Ok(builder.method("POST").uri(uri))
279 }
280 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
281 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
282 builder = _header_serialization_settings.set_default_header(
283 builder,
284 ::http_1x::header::HeaderName::from_static("x-amz-target"),
285 "CodeCommit_20150413.DeleteFile",
286 );
287 builder
288 };
289 let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_delete_file::ser_delete_file_input(&input)?);
290 if let Some(content_length) = body.content_length() {
291 let content_length = content_length.to_string();
292 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
293 }
294 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
295 }
296}
297#[derive(Debug)]
298struct DeleteFileEndpointParamsInterceptor;
299
300#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
301impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteFileEndpointParamsInterceptor {
302 fn name(&self) -> &'static str {
303 "DeleteFileEndpointParamsInterceptor"
304 }
305
306 fn read_before_execution(
307 &self,
308 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
309 '_,
310 ::aws_smithy_runtime_api::client::interceptors::context::Input,
311 ::aws_smithy_runtime_api::client::interceptors::context::Output,
312 ::aws_smithy_runtime_api::client::interceptors::context::Error,
313 >,
314 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
315 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
316 let _input = context
317 .input()
318 .downcast_ref::<DeleteFileInput>()
319 .ok_or("failed to downcast to DeleteFileInput")?;
320
321 let params = crate::config::endpoint::Params::builder()
322 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
323 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
324 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
325 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
326 .build()
327 .map_err(|err| {
328 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
329 })?;
330 cfg.interceptor_state()
331 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
332 ::std::result::Result::Ok(())
333 }
334}
335
336#[non_exhaustive]
341#[derive(::std::fmt::Debug)]
342pub enum DeleteFileError {
343 BranchDoesNotExistException(crate::types::error::BranchDoesNotExistException),
345 BranchNameIsTagNameException(crate::types::error::BranchNameIsTagNameException),
347 BranchNameRequiredException(crate::types::error::BranchNameRequiredException),
349 CommitMessageLengthExceededException(crate::types::error::CommitMessageLengthExceededException),
351 EncryptionIntegrityChecksFailedException(crate::types::error::EncryptionIntegrityChecksFailedException),
353 EncryptionKeyAccessDeniedException(crate::types::error::EncryptionKeyAccessDeniedException),
355 EncryptionKeyDisabledException(crate::types::error::EncryptionKeyDisabledException),
357 EncryptionKeyNotFoundException(crate::types::error::EncryptionKeyNotFoundException),
359 EncryptionKeyUnavailableException(crate::types::error::EncryptionKeyUnavailableException),
361 FileDoesNotExistException(crate::types::error::FileDoesNotExistException),
363 InvalidBranchNameException(crate::types::error::InvalidBranchNameException),
365 InvalidEmailException(crate::types::error::InvalidEmailException),
367 InvalidParentCommitIdException(crate::types::error::InvalidParentCommitIdException),
369 InvalidPathException(crate::types::error::InvalidPathException),
371 InvalidRepositoryNameException(crate::types::error::InvalidRepositoryNameException),
375 NameLengthExceededException(crate::types::error::NameLengthExceededException),
377 ParentCommitDoesNotExistException(crate::types::error::ParentCommitDoesNotExistException),
379 ParentCommitIdOutdatedException(crate::types::error::ParentCommitIdOutdatedException),
381 ParentCommitIdRequiredException(crate::types::error::ParentCommitIdRequiredException),
383 PathRequiredException(crate::types::error::PathRequiredException),
385 RepositoryDoesNotExistException(crate::types::error::RepositoryDoesNotExistException),
387 RepositoryNameRequiredException(crate::types::error::RepositoryNameRequiredException),
389 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
391 variable wildcard pattern and check `.code()`:
392 \
393 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
394 \
395 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DeleteFileError) for what information is available for the error.")]
396 Unhandled(crate::error::sealed_unhandled::Unhandled),
397}
398impl DeleteFileError {
399 pub fn unhandled(
401 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
402 ) -> Self {
403 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
404 source: err.into(),
405 meta: ::std::default::Default::default(),
406 })
407 }
408
409 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
411 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
412 source: err.clone().into(),
413 meta: err,
414 })
415 }
416 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
421 match self {
422 Self::BranchDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423 Self::BranchNameIsTagNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424 Self::BranchNameRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425 Self::CommitMessageLengthExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426 Self::EncryptionIntegrityChecksFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427 Self::EncryptionKeyAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
428 Self::EncryptionKeyDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
429 Self::EncryptionKeyNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
430 Self::EncryptionKeyUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
431 Self::FileDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
432 Self::InvalidBranchNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
433 Self::InvalidEmailException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
434 Self::InvalidParentCommitIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
435 Self::InvalidPathException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436 Self::InvalidRepositoryNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
437 Self::NameLengthExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
438 Self::ParentCommitDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
439 Self::ParentCommitIdOutdatedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440 Self::ParentCommitIdRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441 Self::PathRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442 Self::RepositoryDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443 Self::RepositoryNameRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444 Self::Unhandled(e) => &e.meta,
445 }
446 }
447 pub fn is_branch_does_not_exist_exception(&self) -> bool {
449 matches!(self, Self::BranchDoesNotExistException(_))
450 }
451 pub fn is_branch_name_is_tag_name_exception(&self) -> bool {
453 matches!(self, Self::BranchNameIsTagNameException(_))
454 }
455 pub fn is_branch_name_required_exception(&self) -> bool {
457 matches!(self, Self::BranchNameRequiredException(_))
458 }
459 pub fn is_commit_message_length_exceeded_exception(&self) -> bool {
461 matches!(self, Self::CommitMessageLengthExceededException(_))
462 }
463 pub fn is_encryption_integrity_checks_failed_exception(&self) -> bool {
465 matches!(self, Self::EncryptionIntegrityChecksFailedException(_))
466 }
467 pub fn is_encryption_key_access_denied_exception(&self) -> bool {
469 matches!(self, Self::EncryptionKeyAccessDeniedException(_))
470 }
471 pub fn is_encryption_key_disabled_exception(&self) -> bool {
473 matches!(self, Self::EncryptionKeyDisabledException(_))
474 }
475 pub fn is_encryption_key_not_found_exception(&self) -> bool {
477 matches!(self, Self::EncryptionKeyNotFoundException(_))
478 }
479 pub fn is_encryption_key_unavailable_exception(&self) -> bool {
481 matches!(self, Self::EncryptionKeyUnavailableException(_))
482 }
483 pub fn is_file_does_not_exist_exception(&self) -> bool {
485 matches!(self, Self::FileDoesNotExistException(_))
486 }
487 pub fn is_invalid_branch_name_exception(&self) -> bool {
489 matches!(self, Self::InvalidBranchNameException(_))
490 }
491 pub fn is_invalid_email_exception(&self) -> bool {
493 matches!(self, Self::InvalidEmailException(_))
494 }
495 pub fn is_invalid_parent_commit_id_exception(&self) -> bool {
497 matches!(self, Self::InvalidParentCommitIdException(_))
498 }
499 pub fn is_invalid_path_exception(&self) -> bool {
501 matches!(self, Self::InvalidPathException(_))
502 }
503 pub fn is_invalid_repository_name_exception(&self) -> bool {
505 matches!(self, Self::InvalidRepositoryNameException(_))
506 }
507 pub fn is_name_length_exceeded_exception(&self) -> bool {
509 matches!(self, Self::NameLengthExceededException(_))
510 }
511 pub fn is_parent_commit_does_not_exist_exception(&self) -> bool {
513 matches!(self, Self::ParentCommitDoesNotExistException(_))
514 }
515 pub fn is_parent_commit_id_outdated_exception(&self) -> bool {
517 matches!(self, Self::ParentCommitIdOutdatedException(_))
518 }
519 pub fn is_parent_commit_id_required_exception(&self) -> bool {
521 matches!(self, Self::ParentCommitIdRequiredException(_))
522 }
523 pub fn is_path_required_exception(&self) -> bool {
525 matches!(self, Self::PathRequiredException(_))
526 }
527 pub fn is_repository_does_not_exist_exception(&self) -> bool {
529 matches!(self, Self::RepositoryDoesNotExistException(_))
530 }
531 pub fn is_repository_name_required_exception(&self) -> bool {
533 matches!(self, Self::RepositoryNameRequiredException(_))
534 }
535}
536impl ::std::error::Error for DeleteFileError {
537 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
538 match self {
539 Self::BranchDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
540 Self::BranchNameIsTagNameException(_inner) => ::std::option::Option::Some(_inner),
541 Self::BranchNameRequiredException(_inner) => ::std::option::Option::Some(_inner),
542 Self::CommitMessageLengthExceededException(_inner) => ::std::option::Option::Some(_inner),
543 Self::EncryptionIntegrityChecksFailedException(_inner) => ::std::option::Option::Some(_inner),
544 Self::EncryptionKeyAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
545 Self::EncryptionKeyDisabledException(_inner) => ::std::option::Option::Some(_inner),
546 Self::EncryptionKeyNotFoundException(_inner) => ::std::option::Option::Some(_inner),
547 Self::EncryptionKeyUnavailableException(_inner) => ::std::option::Option::Some(_inner),
548 Self::FileDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
549 Self::InvalidBranchNameException(_inner) => ::std::option::Option::Some(_inner),
550 Self::InvalidEmailException(_inner) => ::std::option::Option::Some(_inner),
551 Self::InvalidParentCommitIdException(_inner) => ::std::option::Option::Some(_inner),
552 Self::InvalidPathException(_inner) => ::std::option::Option::Some(_inner),
553 Self::InvalidRepositoryNameException(_inner) => ::std::option::Option::Some(_inner),
554 Self::NameLengthExceededException(_inner) => ::std::option::Option::Some(_inner),
555 Self::ParentCommitDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
556 Self::ParentCommitIdOutdatedException(_inner) => ::std::option::Option::Some(_inner),
557 Self::ParentCommitIdRequiredException(_inner) => ::std::option::Option::Some(_inner),
558 Self::PathRequiredException(_inner) => ::std::option::Option::Some(_inner),
559 Self::RepositoryDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
560 Self::RepositoryNameRequiredException(_inner) => ::std::option::Option::Some(_inner),
561 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
562 }
563 }
564}
565impl ::std::fmt::Display for DeleteFileError {
566 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
567 match self {
568 Self::BranchDoesNotExistException(_inner) => _inner.fmt(f),
569 Self::BranchNameIsTagNameException(_inner) => _inner.fmt(f),
570 Self::BranchNameRequiredException(_inner) => _inner.fmt(f),
571 Self::CommitMessageLengthExceededException(_inner) => _inner.fmt(f),
572 Self::EncryptionIntegrityChecksFailedException(_inner) => _inner.fmt(f),
573 Self::EncryptionKeyAccessDeniedException(_inner) => _inner.fmt(f),
574 Self::EncryptionKeyDisabledException(_inner) => _inner.fmt(f),
575 Self::EncryptionKeyNotFoundException(_inner) => _inner.fmt(f),
576 Self::EncryptionKeyUnavailableException(_inner) => _inner.fmt(f),
577 Self::FileDoesNotExistException(_inner) => _inner.fmt(f),
578 Self::InvalidBranchNameException(_inner) => _inner.fmt(f),
579 Self::InvalidEmailException(_inner) => _inner.fmt(f),
580 Self::InvalidParentCommitIdException(_inner) => _inner.fmt(f),
581 Self::InvalidPathException(_inner) => _inner.fmt(f),
582 Self::InvalidRepositoryNameException(_inner) => _inner.fmt(f),
583 Self::NameLengthExceededException(_inner) => _inner.fmt(f),
584 Self::ParentCommitDoesNotExistException(_inner) => _inner.fmt(f),
585 Self::ParentCommitIdOutdatedException(_inner) => _inner.fmt(f),
586 Self::ParentCommitIdRequiredException(_inner) => _inner.fmt(f),
587 Self::PathRequiredException(_inner) => _inner.fmt(f),
588 Self::RepositoryDoesNotExistException(_inner) => _inner.fmt(f),
589 Self::RepositoryNameRequiredException(_inner) => _inner.fmt(f),
590 Self::Unhandled(_inner) => {
591 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
592 write!(f, "unhandled error ({code})")
593 } else {
594 f.write_str("unhandled error")
595 }
596 }
597 }
598 }
599}
600impl ::aws_smithy_types::retry::ProvideErrorKind for DeleteFileError {
601 fn code(&self) -> ::std::option::Option<&str> {
602 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
603 }
604 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
605 ::std::option::Option::None
606 }
607}
608impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DeleteFileError {
609 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
610 match self {
611 Self::BranchDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
612 Self::BranchNameIsTagNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
613 Self::BranchNameRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
614 Self::CommitMessageLengthExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
615 Self::EncryptionIntegrityChecksFailedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
616 Self::EncryptionKeyAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
617 Self::EncryptionKeyDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
618 Self::EncryptionKeyNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
619 Self::EncryptionKeyUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
620 Self::FileDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
621 Self::InvalidBranchNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
622 Self::InvalidEmailException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
623 Self::InvalidParentCommitIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
624 Self::InvalidPathException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
625 Self::InvalidRepositoryNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
626 Self::NameLengthExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
627 Self::ParentCommitDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
628 Self::ParentCommitIdOutdatedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
629 Self::ParentCommitIdRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
630 Self::PathRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
631 Self::RepositoryDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
632 Self::RepositoryNameRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
633 Self::Unhandled(_inner) => &_inner.meta,
634 }
635 }
636}
637impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteFileError {
638 fn create_unhandled_error(
639 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
640 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
641 ) -> Self {
642 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
643 source,
644 meta: meta.unwrap_or_default(),
645 })
646 }
647}
648impl ::aws_types::request_id::RequestId for crate::operation::delete_file::DeleteFileError {
649 fn request_id(&self) -> Option<&str> {
650 self.meta().request_id()
651 }
652}
653
654pub use crate::operation::delete_file::_delete_file_input::DeleteFileInput;
655
656pub use crate::operation::delete_file::_delete_file_output::DeleteFileOutput;
657
658mod _delete_file_input;
659
660mod _delete_file_output;
661
662pub mod builders;