aws_sdk_codecommit/operation/
get_file.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `GetFile`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetFile;
6impl GetFile {
7    /// Creates a new `GetFile`
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::get_file::GetFileInput,
14    ) -> ::std::result::Result<
15        crate::operation::get_file::GetFileOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::get_file::GetFileError,
18            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19        >,
20    > {
21        let map_err =
22            |err: ::aws_smithy_runtime_api::client::result::SdkError<
23                ::aws_smithy_runtime_api::client::interceptors::context::Error,
24                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25            >| { err.map_service_error(|err| err.downcast::<crate::operation::get_file::GetFileError>().expect("correct error type")) };
26        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
27            .await
28            .map_err(map_err)?;
29        let output = context.finalize().map_err(map_err)?;
30        ::std::result::Result::Ok(
31            output
32                .downcast::<crate::operation::get_file::GetFileOutput>()
33                .expect("correct output type"),
34        )
35    }
36
37    pub(crate) async fn orchestrate_with_stop_point(
38        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
39        input: crate::operation::get_file::GetFileInput,
40        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
41    ) -> ::std::result::Result<
42        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
43        ::aws_smithy_runtime_api::client::result::SdkError<
44            ::aws_smithy_runtime_api::client::interceptors::context::Error,
45            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
46        >,
47    > {
48        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
49        use ::tracing::Instrument;
50        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("CodeCommit", "GetFile", input, runtime_plugins, stop_point)
51            // Create a parent span for the entire operation. Includes a random, internal-only,
52            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
53            .instrument(::tracing::debug_span!(
54                "CodeCommit.GetFile",
55                "rpc.service" = "CodeCommit",
56                "rpc.method" = "GetFile",
57                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
58                "rpc.system" = "aws-api",
59            ))
60            .await
61    }
62
63    pub(crate) fn operation_runtime_plugins(
64        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
65        client_config: &crate::config::Config,
66        config_override: ::std::option::Option<crate::config::Builder>,
67    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
68        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
69        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
70            ::aws_runtime::auth::sigv4::SCHEME_ID,
71        ]));
72        if let ::std::option::Option::Some(config_override) = config_override {
73            for plugin in config_override.runtime_plugins.iter().cloned() {
74                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
75            }
76            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
77                config_override,
78                client_config.config.clone(),
79                &client_config.runtime_components,
80            ));
81        }
82        runtime_plugins
83    }
84}
85impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetFile {
86    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
87        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetFile");
88
89        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
90            GetFileRequestSerializer,
91        ));
92        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
93            GetFileResponseDeserializer,
94        ));
95
96        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
97            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
98        ));
99
100        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("GetFile", "CodeCommit"));
101        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
102        signing_options.double_uri_encode = true;
103        signing_options.content_sha256_header = false;
104        signing_options.normalize_uri_path = true;
105        signing_options.payload_override = None;
106
107        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
108            signing_options,
109            ..::std::default::Default::default()
110        });
111
112        ::std::option::Option::Some(cfg.freeze())
113    }
114
115    fn runtime_components(
116        &self,
117        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
118    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
119        #[allow(unused_mut)]
120        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetFile")
121            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
122            .with_interceptor(GetFileEndpointParamsInterceptor)
123            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
124                crate::operation::get_file::GetFileError,
125            >::new())
126            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
127                crate::operation::get_file::GetFileError,
128            >::new())
129            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
130                crate::operation::get_file::GetFileError,
131            >::new());
132
133        ::std::borrow::Cow::Owned(rcb)
134    }
135}
136
137#[derive(Debug)]
138struct GetFileResponseDeserializer;
139impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetFileResponseDeserializer {
140    fn deserialize_nonstreaming(
141        &self,
142        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
143    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
144        let (success, status) = (response.status().is_success(), response.status().as_u16());
145        let headers = response.headers();
146        let body = response.body().bytes().expect("body loaded");
147        #[allow(unused_mut)]
148        let mut force_error = false;
149        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
150        let parse_result = if !success && status != 200 || force_error {
151            crate::protocol_serde::shape_get_file::de_get_file_http_error(status, headers, body)
152        } else {
153            crate::protocol_serde::shape_get_file::de_get_file_http_response(status, headers, body)
154        };
155        crate::protocol_serde::type_erase_result(parse_result)
156    }
157}
158#[derive(Debug)]
159struct GetFileRequestSerializer;
160impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetFileRequestSerializer {
161    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
162    fn serialize_input(
163        &self,
164        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
165        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
166    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
167        let input = input.downcast::<crate::operation::get_file::GetFileInput>().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::get_file::GetFileInput,
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, "/").expect("formatting should succeed");
179                ::std::result::Result::Ok(())
180            }
181            #[allow(clippy::unnecessary_wraps)]
182            fn update_http_builder(
183                input: &crate::operation::get_file::GetFileInput,
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/x-amz-json-1.1");
192            builder = _header_serialization_settings.set_default_header(
193                builder,
194                ::http::header::HeaderName::from_static("x-amz-target"),
195                "CodeCommit_20150413.GetFile",
196            );
197            builder
198        };
199        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_file::ser_get_file_input(&input)?);
200        if let Some(content_length) = body.content_length() {
201            let content_length = content_length.to_string();
202            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
203        }
204        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
205    }
206}
207#[derive(Debug)]
208struct GetFileEndpointParamsInterceptor;
209
210impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetFileEndpointParamsInterceptor {
211    fn name(&self) -> &'static str {
212        "GetFileEndpointParamsInterceptor"
213    }
214
215    fn read_before_execution(
216        &self,
217        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
218            '_,
219            ::aws_smithy_runtime_api::client::interceptors::context::Input,
220            ::aws_smithy_runtime_api::client::interceptors::context::Output,
221            ::aws_smithy_runtime_api::client::interceptors::context::Error,
222        >,
223        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
224    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
225        let _input = context
226            .input()
227            .downcast_ref::<GetFileInput>()
228            .ok_or("failed to downcast to GetFileInput")?;
229
230        let params = crate::config::endpoint::Params::builder()
231            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
232            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
233            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
234            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
235            .build()
236            .map_err(|err| {
237                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
238            })?;
239        cfg.interceptor_state()
240            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
241        ::std::result::Result::Ok(())
242    }
243}
244
245// The get_* functions below are generated from JMESPath expressions in the
246// operationContextParams trait. They target the operation's input shape.
247
248/// Error type for the `GetFileError` operation.
249#[non_exhaustive]
250#[derive(::std::fmt::Debug)]
251pub enum GetFileError {
252    /// <p>The specified commit does not exist or no commit was specified, and the specified repository has no default branch.</p>
253    CommitDoesNotExistException(crate::types::error::CommitDoesNotExistException),
254    /// <p>An encryption integrity check failed.</p>
255    EncryptionIntegrityChecksFailedException(crate::types::error::EncryptionIntegrityChecksFailedException),
256    /// <p>An encryption key could not be accessed.</p>
257    EncryptionKeyAccessDeniedException(crate::types::error::EncryptionKeyAccessDeniedException),
258    /// <p>The encryption key is disabled.</p>
259    EncryptionKeyDisabledException(crate::types::error::EncryptionKeyDisabledException),
260    /// <p>No encryption key was found.</p>
261    EncryptionKeyNotFoundException(crate::types::error::EncryptionKeyNotFoundException),
262    /// <p>The encryption key is not available.</p>
263    EncryptionKeyUnavailableException(crate::types::error::EncryptionKeyUnavailableException),
264    /// <p>The specified file does not exist. Verify that you have used the correct file name, full path, and extension.</p>
265    FileDoesNotExistException(crate::types::error::FileDoesNotExistException),
266    /// <p>The specified file exceeds the file size limit for CodeCommit. For more information about limits in CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">Quotas</a> in the <i>CodeCommit User Guide</i>.</p>
267    FileTooLargeException(crate::types::error::FileTooLargeException),
268    /// <p>The specified commit is not valid.</p>
269    InvalidCommitException(crate::types::error::InvalidCommitException),
270    /// <p>The specified path is not valid.</p>
271    InvalidPathException(crate::types::error::InvalidPathException),
272    /// <p>A specified repository name is not valid.</p><note>
273    /// <p>This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.</p>
274    /// </note>
275    InvalidRepositoryNameException(crate::types::error::InvalidRepositoryNameException),
276    /// <p>The folderPath for a location cannot be null.</p>
277    PathRequiredException(crate::types::error::PathRequiredException),
278    /// <p>The specified repository does not exist.</p>
279    RepositoryDoesNotExistException(crate::types::error::RepositoryDoesNotExistException),
280    /// <p>A repository name is required, but was not specified.</p>
281    RepositoryNameRequiredException(crate::types::error::RepositoryNameRequiredException),
282    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
283    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
284    variable wildcard pattern and check `.code()`:
285     \
286    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
287     \
288    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetFileError) for what information is available for the error.")]
289    Unhandled(crate::error::sealed_unhandled::Unhandled),
290}
291impl GetFileError {
292    /// Creates the `GetFileError::Unhandled` variant from any error type.
293    pub fn unhandled(
294        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
295    ) -> Self {
296        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
297            source: err.into(),
298            meta: ::std::default::Default::default(),
299        })
300    }
301
302    /// Creates the `GetFileError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
303    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
304        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
305            source: err.clone().into(),
306            meta: err,
307        })
308    }
309    ///
310    /// Returns error metadata, which includes the error code, message,
311    /// request ID, and potentially additional information.
312    ///
313    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
314        match self {
315            Self::CommitDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
316            Self::EncryptionIntegrityChecksFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
317            Self::EncryptionKeyAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
318            Self::EncryptionKeyDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
319            Self::EncryptionKeyNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
320            Self::EncryptionKeyUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
321            Self::FileDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
322            Self::FileTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
323            Self::InvalidCommitException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
324            Self::InvalidPathException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
325            Self::InvalidRepositoryNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
326            Self::PathRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
327            Self::RepositoryDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
328            Self::RepositoryNameRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
329            Self::Unhandled(e) => &e.meta,
330        }
331    }
332    /// Returns `true` if the error kind is `GetFileError::CommitDoesNotExistException`.
333    pub fn is_commit_does_not_exist_exception(&self) -> bool {
334        matches!(self, Self::CommitDoesNotExistException(_))
335    }
336    /// Returns `true` if the error kind is `GetFileError::EncryptionIntegrityChecksFailedException`.
337    pub fn is_encryption_integrity_checks_failed_exception(&self) -> bool {
338        matches!(self, Self::EncryptionIntegrityChecksFailedException(_))
339    }
340    /// Returns `true` if the error kind is `GetFileError::EncryptionKeyAccessDeniedException`.
341    pub fn is_encryption_key_access_denied_exception(&self) -> bool {
342        matches!(self, Self::EncryptionKeyAccessDeniedException(_))
343    }
344    /// Returns `true` if the error kind is `GetFileError::EncryptionKeyDisabledException`.
345    pub fn is_encryption_key_disabled_exception(&self) -> bool {
346        matches!(self, Self::EncryptionKeyDisabledException(_))
347    }
348    /// Returns `true` if the error kind is `GetFileError::EncryptionKeyNotFoundException`.
349    pub fn is_encryption_key_not_found_exception(&self) -> bool {
350        matches!(self, Self::EncryptionKeyNotFoundException(_))
351    }
352    /// Returns `true` if the error kind is `GetFileError::EncryptionKeyUnavailableException`.
353    pub fn is_encryption_key_unavailable_exception(&self) -> bool {
354        matches!(self, Self::EncryptionKeyUnavailableException(_))
355    }
356    /// Returns `true` if the error kind is `GetFileError::FileDoesNotExistException`.
357    pub fn is_file_does_not_exist_exception(&self) -> bool {
358        matches!(self, Self::FileDoesNotExistException(_))
359    }
360    /// Returns `true` if the error kind is `GetFileError::FileTooLargeException`.
361    pub fn is_file_too_large_exception(&self) -> bool {
362        matches!(self, Self::FileTooLargeException(_))
363    }
364    /// Returns `true` if the error kind is `GetFileError::InvalidCommitException`.
365    pub fn is_invalid_commit_exception(&self) -> bool {
366        matches!(self, Self::InvalidCommitException(_))
367    }
368    /// Returns `true` if the error kind is `GetFileError::InvalidPathException`.
369    pub fn is_invalid_path_exception(&self) -> bool {
370        matches!(self, Self::InvalidPathException(_))
371    }
372    /// Returns `true` if the error kind is `GetFileError::InvalidRepositoryNameException`.
373    pub fn is_invalid_repository_name_exception(&self) -> bool {
374        matches!(self, Self::InvalidRepositoryNameException(_))
375    }
376    /// Returns `true` if the error kind is `GetFileError::PathRequiredException`.
377    pub fn is_path_required_exception(&self) -> bool {
378        matches!(self, Self::PathRequiredException(_))
379    }
380    /// Returns `true` if the error kind is `GetFileError::RepositoryDoesNotExistException`.
381    pub fn is_repository_does_not_exist_exception(&self) -> bool {
382        matches!(self, Self::RepositoryDoesNotExistException(_))
383    }
384    /// Returns `true` if the error kind is `GetFileError::RepositoryNameRequiredException`.
385    pub fn is_repository_name_required_exception(&self) -> bool {
386        matches!(self, Self::RepositoryNameRequiredException(_))
387    }
388}
389impl ::std::error::Error for GetFileError {
390    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
391        match self {
392            Self::CommitDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
393            Self::EncryptionIntegrityChecksFailedException(_inner) => ::std::option::Option::Some(_inner),
394            Self::EncryptionKeyAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
395            Self::EncryptionKeyDisabledException(_inner) => ::std::option::Option::Some(_inner),
396            Self::EncryptionKeyNotFoundException(_inner) => ::std::option::Option::Some(_inner),
397            Self::EncryptionKeyUnavailableException(_inner) => ::std::option::Option::Some(_inner),
398            Self::FileDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
399            Self::FileTooLargeException(_inner) => ::std::option::Option::Some(_inner),
400            Self::InvalidCommitException(_inner) => ::std::option::Option::Some(_inner),
401            Self::InvalidPathException(_inner) => ::std::option::Option::Some(_inner),
402            Self::InvalidRepositoryNameException(_inner) => ::std::option::Option::Some(_inner),
403            Self::PathRequiredException(_inner) => ::std::option::Option::Some(_inner),
404            Self::RepositoryDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
405            Self::RepositoryNameRequiredException(_inner) => ::std::option::Option::Some(_inner),
406            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
407        }
408    }
409}
410impl ::std::fmt::Display for GetFileError {
411    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
412        match self {
413            Self::CommitDoesNotExistException(_inner) => _inner.fmt(f),
414            Self::EncryptionIntegrityChecksFailedException(_inner) => _inner.fmt(f),
415            Self::EncryptionKeyAccessDeniedException(_inner) => _inner.fmt(f),
416            Self::EncryptionKeyDisabledException(_inner) => _inner.fmt(f),
417            Self::EncryptionKeyNotFoundException(_inner) => _inner.fmt(f),
418            Self::EncryptionKeyUnavailableException(_inner) => _inner.fmt(f),
419            Self::FileDoesNotExistException(_inner) => _inner.fmt(f),
420            Self::FileTooLargeException(_inner) => _inner.fmt(f),
421            Self::InvalidCommitException(_inner) => _inner.fmt(f),
422            Self::InvalidPathException(_inner) => _inner.fmt(f),
423            Self::InvalidRepositoryNameException(_inner) => _inner.fmt(f),
424            Self::PathRequiredException(_inner) => _inner.fmt(f),
425            Self::RepositoryDoesNotExistException(_inner) => _inner.fmt(f),
426            Self::RepositoryNameRequiredException(_inner) => _inner.fmt(f),
427            Self::Unhandled(_inner) => {
428                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
429                    write!(f, "unhandled error ({code})")
430                } else {
431                    f.write_str("unhandled error")
432                }
433            }
434        }
435    }
436}
437impl ::aws_smithy_types::retry::ProvideErrorKind for GetFileError {
438    fn code(&self) -> ::std::option::Option<&str> {
439        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
440    }
441    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
442        ::std::option::Option::None
443    }
444}
445impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetFileError {
446    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
447        match self {
448            Self::CommitDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
449            Self::EncryptionIntegrityChecksFailedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
450            Self::EncryptionKeyAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
451            Self::EncryptionKeyDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
452            Self::EncryptionKeyNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
453            Self::EncryptionKeyUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
454            Self::FileDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
455            Self::FileTooLargeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
456            Self::InvalidCommitException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
457            Self::InvalidPathException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
458            Self::InvalidRepositoryNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
459            Self::PathRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
460            Self::RepositoryDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
461            Self::RepositoryNameRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
462            Self::Unhandled(_inner) => &_inner.meta,
463        }
464    }
465}
466impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetFileError {
467    fn create_unhandled_error(
468        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
469        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
470    ) -> Self {
471        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
472            source,
473            meta: meta.unwrap_or_default(),
474        })
475    }
476}
477impl ::aws_types::request_id::RequestId for crate::operation::get_file::GetFileError {
478    fn request_id(&self) -> Option<&str> {
479        self.meta().request_id()
480    }
481}
482
483pub use crate::operation::get_file::_get_file_output::GetFileOutput;
484
485pub use crate::operation::get_file::_get_file_input::GetFileInput;
486
487mod _get_file_input;
488
489mod _get_file_output;
490
491/// Builders
492pub mod builders;