Skip to main content

aws_sdk_workdocs/operation/
initiate_document_version_upload.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `InitiateDocumentVersionUpload`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct InitiateDocumentVersionUpload;
6impl InitiateDocumentVersionUpload {
7    /// Creates a new `InitiateDocumentVersionUpload`
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::initiate_document_version_upload::InitiateDocumentVersionUploadInput,
14    ) -> ::std::result::Result<
15        crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadError,
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::initiate_document_version_upload::InitiateDocumentVersionUploadError>()
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::initiate_document_version_upload::InitiateDocumentVersionUploadOutput>()
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::initiate_document_version_upload::InitiateDocumentVersionUploadInput,
44        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45    ) -> ::std::result::Result<
46        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47        ::aws_smithy_runtime_api::client::result::SdkError<
48            ::aws_smithy_runtime_api::client::interceptors::context::Error,
49            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50        >,
51    > {
52        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53        use ::tracing::Instrument;
54        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
55            "WorkDocs",
56            "InitiateDocumentVersionUpload",
57            input,
58            runtime_plugins,
59            stop_point,
60        )
61        // Create a parent span for the entire operation. Includes a random, internal-only,
62        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
63        .instrument(::tracing::debug_span!(
64            "WorkDocs.InitiateDocumentVersionUpload",
65            "rpc.service" = "WorkDocs",
66            "rpc.method" = "InitiateDocumentVersionUpload",
67            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68            "rpc.system" = "aws-api",
69        ))
70        .await
71    }
72
73    pub(crate) fn operation_runtime_plugins(
74        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75        client_config: &crate::config::Config,
76        config_override: ::std::option::Option<crate::config::Builder>,
77    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79
80        if let ::std::option::Option::Some(config_override) = config_override {
81            for plugin in config_override.runtime_plugins.iter().cloned() {
82                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
83            }
84            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
85                config_override,
86                client_config.config.clone(),
87                &client_config.runtime_components,
88            ));
89        }
90        runtime_plugins
91    }
92}
93impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for InitiateDocumentVersionUpload {
94    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
95        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("InitiateDocumentVersionUpload");
96
97        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
98            InitiateDocumentVersionUploadRequestSerializer,
99        ));
100        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
101            InitiateDocumentVersionUploadResponseDeserializer,
102        ));
103
104        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
105            crate::config::auth::Params::builder()
106                .operation_name("InitiateDocumentVersionUpload")
107                .build()
108                .expect("required fields set"),
109        ));
110
111        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
112        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
113            "InitiateDocumentVersionUpload",
114            "WorkDocs",
115        ));
116        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
117        signing_options.double_uri_encode = true;
118        signing_options.content_sha256_header = false;
119        signing_options.normalize_uri_path = true;
120        signing_options.payload_override = None;
121
122        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
123            signing_options,
124            ..::std::default::Default::default()
125        });
126
127        ::std::option::Option::Some(cfg.freeze())
128    }
129
130    fn runtime_components(
131        &self,
132        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
133    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
134        #[allow(unused_mut)]
135        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("InitiateDocumentVersionUpload")
136            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
137                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
138            ))
139            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
140                InitiateDocumentVersionUploadEndpointParamsInterceptor,
141            ))
142            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
143                crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadError,
144            >::new())
145            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
146                crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadError,
147            >::new())
148            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
149                crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadError,
150            >::new());
151
152        ::std::borrow::Cow::Owned(rcb)
153    }
154}
155
156#[derive(Debug)]
157struct InitiateDocumentVersionUploadResponseDeserializer;
158impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InitiateDocumentVersionUploadResponseDeserializer {
159    fn deserialize_nonstreaming(
160        &self,
161        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
162    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
163        let (success, status) = (response.status().is_success(), response.status().as_u16());
164        let headers = response.headers();
165        let body = response.body().bytes().expect("body loaded");
166        #[allow(unused_mut)]
167        let mut force_error = false;
168        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
169        let parse_result = if !success && status != 201 || force_error {
170            crate::protocol_serde::shape_initiate_document_version_upload::de_initiate_document_version_upload_http_error(status, headers, body)
171        } else {
172            crate::protocol_serde::shape_initiate_document_version_upload::de_initiate_document_version_upload_http_response(status, headers, body)
173        };
174        crate::protocol_serde::type_erase_result(parse_result)
175    }
176}
177#[derive(Debug)]
178struct InitiateDocumentVersionUploadRequestSerializer;
179impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InitiateDocumentVersionUploadRequestSerializer {
180    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
181    fn serialize_input(
182        &self,
183        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
184        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
185    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
186        let input = input
187            .downcast::<crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadInput>()
188            .expect("correct type");
189        let _header_serialization_settings = _cfg
190            .load::<crate::serialization_settings::HeaderSerializationSettings>()
191            .cloned()
192            .unwrap_or_default();
193        let mut request_builder = {
194            #[allow(clippy::uninlined_format_args)]
195            fn uri_base(
196                _input: &crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadInput,
197                output: &mut ::std::string::String,
198            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
199                use ::std::fmt::Write as _;
200                ::std::write!(output, "/api/v1/documents").expect("formatting should succeed");
201                ::std::result::Result::Ok(())
202            }
203            #[allow(clippy::unnecessary_wraps)]
204            fn update_http_builder(
205                input: &crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadInput,
206                builder: ::http_1x::request::Builder,
207            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
208                let mut uri = ::std::string::String::new();
209                uri_base(input, &mut uri)?;
210                let builder =
211                    crate::protocol_serde::shape_initiate_document_version_upload::ser_initiate_document_version_upload_headers(input, builder)?;
212                ::std::result::Result::Ok(builder.method("POST").uri(uri))
213            }
214            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
215            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
216            builder
217        };
218        let body = ::aws_smithy_types::body::SdkBody::from(
219            crate::protocol_serde::shape_initiate_document_version_upload::ser_initiate_document_version_upload_input(&input)?,
220        );
221        if let Some(content_length) = body.content_length() {
222            let content_length = content_length.to_string();
223            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
224        }
225        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
226    }
227}
228#[derive(Debug)]
229struct InitiateDocumentVersionUploadEndpointParamsInterceptor;
230
231#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
232impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InitiateDocumentVersionUploadEndpointParamsInterceptor {
233    fn name(&self) -> &'static str {
234        "InitiateDocumentVersionUploadEndpointParamsInterceptor"
235    }
236
237    fn read_before_execution(
238        &self,
239        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
240            '_,
241            ::aws_smithy_runtime_api::client::interceptors::context::Input,
242            ::aws_smithy_runtime_api::client::interceptors::context::Output,
243            ::aws_smithy_runtime_api::client::interceptors::context::Error,
244        >,
245        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
246    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
247        let _input = context
248            .input()
249            .downcast_ref::<InitiateDocumentVersionUploadInput>()
250            .ok_or("failed to downcast to InitiateDocumentVersionUploadInput")?;
251
252        let params = crate::config::endpoint::Params::builder()
253            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
254            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
255            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
256            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
257            .build()
258            .map_err(|err| {
259                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
260            })?;
261        cfg.interceptor_state()
262            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
263        ::std::result::Result::Ok(())
264    }
265}
266
267// The get_* functions below are generated from JMESPath expressions in the
268// operationContextParams trait. They target the operation's input shape.
269
270/// Error type for the `InitiateDocumentVersionUploadError` operation.
271#[non_exhaustive]
272#[derive(::std::fmt::Debug)]
273pub enum InitiateDocumentVersionUploadError {
274    /// <p>This exception is thrown when a valid checkout ID is not presented on document version upload calls for a document that has been checked out from Web client.</p>
275    DraftUploadOutOfSyncException(crate::types::error::DraftUploadOutOfSyncException),
276    /// <p>The resource already exists.</p>
277    EntityAlreadyExistsException(crate::types::error::EntityAlreadyExistsException),
278    /// <p>The resource does not exist.</p>
279    EntityNotExistsException(crate::types::error::EntityNotExistsException),
280    /// <p>The Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.</p>
281    FailedDependencyException(crate::types::error::FailedDependencyException),
282    /// <p>The pagination marker or limit fields are not valid.</p>
283    InvalidArgumentException(crate::types::error::InvalidArgumentException),
284    /// <p>The password is invalid.</p>
285    InvalidPasswordException(crate::types::error::InvalidPasswordException),
286    /// <p>The maximum of 100,000 files and folders under the parent folder has been exceeded.</p>
287    LimitExceededException(crate::types::error::LimitExceededException),
288    /// <p>The specified document version is not in the INITIALIZED state.</p>
289    ProhibitedStateException(crate::types::error::ProhibitedStateException),
290    /// <p>The resource is already checked out.</p>
291    ResourceAlreadyCheckedOutException(crate::types::error::ResourceAlreadyCheckedOutException),
292    /// <p>One or more of the dependencies is unavailable.</p>
293    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
294    /// <p>The storage limit has been exceeded.</p>
295    StorageLimitExceededException(crate::types::error::StorageLimitExceededException),
296    /// <p>The storage limit will be exceeded.</p>
297    StorageLimitWillExceedException(crate::types::error::StorageLimitWillExceedException),
298    /// <p>The operation is not permitted.</p>
299    UnauthorizedOperationException(crate::types::error::UnauthorizedOperationException),
300    /// <p>The caller does not have access to perform the action on the resource.</p>
301    UnauthorizedResourceAccessException(crate::types::error::UnauthorizedResourceAccessException),
302    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
303    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
304    variable wildcard pattern and check `.code()`:
305     \
306    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
307     \
308    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InitiateDocumentVersionUploadError) for what information is available for the error.")]
309    Unhandled(crate::error::sealed_unhandled::Unhandled),
310}
311impl InitiateDocumentVersionUploadError {
312    /// Creates the `InitiateDocumentVersionUploadError::Unhandled` variant from any error type.
313    pub fn unhandled(
314        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
315    ) -> Self {
316        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
317            source: err.into(),
318            meta: ::std::default::Default::default(),
319        })
320    }
321
322    /// Creates the `InitiateDocumentVersionUploadError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
323    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
324        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
325            source: err.clone().into(),
326            meta: err,
327        })
328    }
329    ///
330    /// Returns error metadata, which includes the error code, message,
331    /// request ID, and potentially additional information.
332    ///
333    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
334        match self {
335            Self::DraftUploadOutOfSyncException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
336            Self::EntityAlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
337            Self::EntityNotExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
338            Self::FailedDependencyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
339            Self::InvalidArgumentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
340            Self::InvalidPasswordException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
341            Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
342            Self::ProhibitedStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
343            Self::ResourceAlreadyCheckedOutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
344            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
345            Self::StorageLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
346            Self::StorageLimitWillExceedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
347            Self::UnauthorizedOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
348            Self::UnauthorizedResourceAccessException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
349            Self::Unhandled(e) => &e.meta,
350        }
351    }
352    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::DraftUploadOutOfSyncException`.
353    pub fn is_draft_upload_out_of_sync_exception(&self) -> bool {
354        matches!(self, Self::DraftUploadOutOfSyncException(_))
355    }
356    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::EntityAlreadyExistsException`.
357    pub fn is_entity_already_exists_exception(&self) -> bool {
358        matches!(self, Self::EntityAlreadyExistsException(_))
359    }
360    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::EntityNotExistsException`.
361    pub fn is_entity_not_exists_exception(&self) -> bool {
362        matches!(self, Self::EntityNotExistsException(_))
363    }
364    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::FailedDependencyException`.
365    pub fn is_failed_dependency_exception(&self) -> bool {
366        matches!(self, Self::FailedDependencyException(_))
367    }
368    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::InvalidArgumentException`.
369    pub fn is_invalid_argument_exception(&self) -> bool {
370        matches!(self, Self::InvalidArgumentException(_))
371    }
372    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::InvalidPasswordException`.
373    pub fn is_invalid_password_exception(&self) -> bool {
374        matches!(self, Self::InvalidPasswordException(_))
375    }
376    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::LimitExceededException`.
377    pub fn is_limit_exceeded_exception(&self) -> bool {
378        matches!(self, Self::LimitExceededException(_))
379    }
380    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::ProhibitedStateException`.
381    pub fn is_prohibited_state_exception(&self) -> bool {
382        matches!(self, Self::ProhibitedStateException(_))
383    }
384    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::ResourceAlreadyCheckedOutException`.
385    pub fn is_resource_already_checked_out_exception(&self) -> bool {
386        matches!(self, Self::ResourceAlreadyCheckedOutException(_))
387    }
388    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::ServiceUnavailableException`.
389    pub fn is_service_unavailable_exception(&self) -> bool {
390        matches!(self, Self::ServiceUnavailableException(_))
391    }
392    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::StorageLimitExceededException`.
393    pub fn is_storage_limit_exceeded_exception(&self) -> bool {
394        matches!(self, Self::StorageLimitExceededException(_))
395    }
396    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::StorageLimitWillExceedException`.
397    pub fn is_storage_limit_will_exceed_exception(&self) -> bool {
398        matches!(self, Self::StorageLimitWillExceedException(_))
399    }
400    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::UnauthorizedOperationException`.
401    pub fn is_unauthorized_operation_exception(&self) -> bool {
402        matches!(self, Self::UnauthorizedOperationException(_))
403    }
404    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::UnauthorizedResourceAccessException`.
405    pub fn is_unauthorized_resource_access_exception(&self) -> bool {
406        matches!(self, Self::UnauthorizedResourceAccessException(_))
407    }
408}
409impl ::std::error::Error for InitiateDocumentVersionUploadError {
410    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
411        match self {
412            Self::DraftUploadOutOfSyncException(_inner) => ::std::option::Option::Some(_inner),
413            Self::EntityAlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
414            Self::EntityNotExistsException(_inner) => ::std::option::Option::Some(_inner),
415            Self::FailedDependencyException(_inner) => ::std::option::Option::Some(_inner),
416            Self::InvalidArgumentException(_inner) => ::std::option::Option::Some(_inner),
417            Self::InvalidPasswordException(_inner) => ::std::option::Option::Some(_inner),
418            Self::LimitExceededException(_inner) => ::std::option::Option::Some(_inner),
419            Self::ProhibitedStateException(_inner) => ::std::option::Option::Some(_inner),
420            Self::ResourceAlreadyCheckedOutException(_inner) => ::std::option::Option::Some(_inner),
421            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
422            Self::StorageLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
423            Self::StorageLimitWillExceedException(_inner) => ::std::option::Option::Some(_inner),
424            Self::UnauthorizedOperationException(_inner) => ::std::option::Option::Some(_inner),
425            Self::UnauthorizedResourceAccessException(_inner) => ::std::option::Option::Some(_inner),
426            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
427        }
428    }
429}
430impl ::std::fmt::Display for InitiateDocumentVersionUploadError {
431    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
432        match self {
433            Self::DraftUploadOutOfSyncException(_inner) => _inner.fmt(f),
434            Self::EntityAlreadyExistsException(_inner) => _inner.fmt(f),
435            Self::EntityNotExistsException(_inner) => _inner.fmt(f),
436            Self::FailedDependencyException(_inner) => _inner.fmt(f),
437            Self::InvalidArgumentException(_inner) => _inner.fmt(f),
438            Self::InvalidPasswordException(_inner) => _inner.fmt(f),
439            Self::LimitExceededException(_inner) => _inner.fmt(f),
440            Self::ProhibitedStateException(_inner) => _inner.fmt(f),
441            Self::ResourceAlreadyCheckedOutException(_inner) => _inner.fmt(f),
442            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
443            Self::StorageLimitExceededException(_inner) => _inner.fmt(f),
444            Self::StorageLimitWillExceedException(_inner) => _inner.fmt(f),
445            Self::UnauthorizedOperationException(_inner) => _inner.fmt(f),
446            Self::UnauthorizedResourceAccessException(_inner) => _inner.fmt(f),
447            Self::Unhandled(_inner) => {
448                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
449                    write!(f, "unhandled error ({code})")
450                } else {
451                    f.write_str("unhandled error")
452                }
453            }
454        }
455    }
456}
457impl ::aws_smithy_types::retry::ProvideErrorKind for InitiateDocumentVersionUploadError {
458    fn code(&self) -> ::std::option::Option<&str> {
459        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
460    }
461    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
462        ::std::option::Option::None
463    }
464}
465impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InitiateDocumentVersionUploadError {
466    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
467        match self {
468            Self::DraftUploadOutOfSyncException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
469            Self::EntityAlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
470            Self::EntityNotExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
471            Self::FailedDependencyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
472            Self::InvalidArgumentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
473            Self::InvalidPasswordException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
474            Self::LimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
475            Self::ProhibitedStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
476            Self::ResourceAlreadyCheckedOutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
477            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
478            Self::StorageLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
479            Self::StorageLimitWillExceedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
480            Self::UnauthorizedOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
481            Self::UnauthorizedResourceAccessException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
482            Self::Unhandled(_inner) => &_inner.meta,
483        }
484    }
485}
486impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InitiateDocumentVersionUploadError {
487    fn create_unhandled_error(
488        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
489        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
490    ) -> Self {
491        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
492            source,
493            meta: meta.unwrap_or_default(),
494        })
495    }
496}
497impl ::aws_types::request_id::RequestId for crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadError {
498    fn request_id(&self) -> Option<&str> {
499        self.meta().request_id()
500    }
501}
502
503pub use crate::operation::initiate_document_version_upload::_initiate_document_version_upload_input::InitiateDocumentVersionUploadInput;
504
505pub use crate::operation::initiate_document_version_upload::_initiate_document_version_upload_output::InitiateDocumentVersionUploadOutput;
506
507mod _initiate_document_version_upload_input;
508
509mod _initiate_document_version_upload_output;
510
511/// Builders
512pub mod builders;