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_with_config(
160        &self,
161        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
162        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
163    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
164        let (success, status) = (response.status().is_success(), response.status().as_u16());
165        let headers = response.headers();
166        let body = response.body().bytes().expect("body loaded");
167        #[allow(unused_mut)]
168        let mut force_error = false;
169        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
170        let parse_result = if !success && status != 201 || force_error {
171            crate::protocol_serde::shape_initiate_document_version_upload::de_initiate_document_version_upload_http_error(status, headers, body)
172        } else {
173            crate::protocol_serde::shape_initiate_document_version_upload::de_initiate_document_version_upload_http_response(status, headers, body)
174        };
175        crate::protocol_serde::type_erase_result(parse_result)
176    }
177}
178#[derive(Debug)]
179struct InitiateDocumentVersionUploadRequestSerializer;
180impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InitiateDocumentVersionUploadRequestSerializer {
181    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
182    fn serialize_input(
183        &self,
184        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
185        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
186    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
187        let input = input
188            .downcast::<crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadInput>()
189            .expect("correct type");
190        let _header_serialization_settings = _cfg
191            .load::<crate::serialization_settings::HeaderSerializationSettings>()
192            .cloned()
193            .unwrap_or_default();
194        let mut request_builder = {
195            #[allow(clippy::uninlined_format_args)]
196            fn uri_base(
197                _input: &crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadInput,
198                output: &mut ::std::string::String,
199            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
200                use ::std::fmt::Write as _;
201                ::std::write!(output, "/api/v1/documents").expect("formatting should succeed");
202                ::std::result::Result::Ok(())
203            }
204            #[allow(clippy::unnecessary_wraps)]
205            fn update_http_builder(
206                input: &crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadInput,
207                builder: ::http_1x::request::Builder,
208            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
209                let mut uri = ::std::string::String::new();
210                uri_base(input, &mut uri)?;
211                let builder =
212                    crate::protocol_serde::shape_initiate_document_version_upload::ser_initiate_document_version_upload_headers(input, builder)?;
213                ::std::result::Result::Ok(builder.method("POST").uri(uri))
214            }
215            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
216            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
217            builder
218        };
219        let body = ::aws_smithy_types::body::SdkBody::from(
220            crate::protocol_serde::shape_initiate_document_version_upload::ser_initiate_document_version_upload_input(&input)?,
221        );
222        if let Some(content_length) = body.content_length() {
223            let content_length = content_length.to_string();
224            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
225        }
226        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
227    }
228}
229#[derive(Debug)]
230struct InitiateDocumentVersionUploadEndpointParamsInterceptor;
231
232#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
233impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InitiateDocumentVersionUploadEndpointParamsInterceptor {
234    fn name(&self) -> &'static str {
235        "InitiateDocumentVersionUploadEndpointParamsInterceptor"
236    }
237
238    fn read_before_execution(
239        &self,
240        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
241            '_,
242            ::aws_smithy_runtime_api::client::interceptors::context::Input,
243            ::aws_smithy_runtime_api::client::interceptors::context::Output,
244            ::aws_smithy_runtime_api::client::interceptors::context::Error,
245        >,
246        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
247    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
248        let _input = context
249            .input()
250            .downcast_ref::<InitiateDocumentVersionUploadInput>()
251            .ok_or("failed to downcast to InitiateDocumentVersionUploadInput")?;
252
253        let params = crate::config::endpoint::Params::builder()
254            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
255            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
256            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
257            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
258            .build()
259            .map_err(|err| {
260                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
261            })?;
262        cfg.interceptor_state()
263            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
264        ::std::result::Result::Ok(())
265    }
266}
267
268// The get_* functions below are generated from JMESPath expressions in the
269// operationContextParams trait. They target the operation's input shape.
270
271/// Error type for the `InitiateDocumentVersionUploadError` operation.
272#[non_exhaustive]
273#[derive(::std::fmt::Debug)]
274pub enum InitiateDocumentVersionUploadError {
275    /// <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>
276    DraftUploadOutOfSyncException(crate::types::error::DraftUploadOutOfSyncException),
277    /// <p>The resource already exists.</p>
278    EntityAlreadyExistsException(crate::types::error::EntityAlreadyExistsException),
279    /// <p>The resource does not exist.</p>
280    EntityNotExistsException(crate::types::error::EntityNotExistsException),
281    /// <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>
282    FailedDependencyException(crate::types::error::FailedDependencyException),
283    /// <p>The pagination marker or limit fields are not valid.</p>
284    InvalidArgumentException(crate::types::error::InvalidArgumentException),
285    /// <p>The password is invalid.</p>
286    InvalidPasswordException(crate::types::error::InvalidPasswordException),
287    /// <p>The maximum of 100,000 files and folders under the parent folder has been exceeded.</p>
288    LimitExceededException(crate::types::error::LimitExceededException),
289    /// <p>The specified document version is not in the INITIALIZED state.</p>
290    ProhibitedStateException(crate::types::error::ProhibitedStateException),
291    /// <p>The resource is already checked out.</p>
292    ResourceAlreadyCheckedOutException(crate::types::error::ResourceAlreadyCheckedOutException),
293    /// <p>One or more of the dependencies is unavailable.</p>
294    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
295    /// <p>The storage limit has been exceeded.</p>
296    StorageLimitExceededException(crate::types::error::StorageLimitExceededException),
297    /// <p>The storage limit will be exceeded.</p>
298    StorageLimitWillExceedException(crate::types::error::StorageLimitWillExceedException),
299    /// <p>The operation is not permitted.</p>
300    UnauthorizedOperationException(crate::types::error::UnauthorizedOperationException),
301    /// <p>The caller does not have access to perform the action on the resource.</p>
302    UnauthorizedResourceAccessException(crate::types::error::UnauthorizedResourceAccessException),
303    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
304    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
305    variable wildcard pattern and check `.code()`:
306     \
307    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
308     \
309    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InitiateDocumentVersionUploadError) for what information is available for the error.")]
310    Unhandled(crate::error::sealed_unhandled::Unhandled),
311}
312impl InitiateDocumentVersionUploadError {
313    /// Creates the `InitiateDocumentVersionUploadError::Unhandled` variant from any error type.
314    pub fn unhandled(
315        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
316    ) -> Self {
317        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
318            source: err.into(),
319            meta: ::std::default::Default::default(),
320        })
321    }
322
323    /// Creates the `InitiateDocumentVersionUploadError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
324    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
325        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
326            source: err.clone().into(),
327            meta: err,
328        })
329    }
330    ///
331    /// Returns error metadata, which includes the error code, message,
332    /// request ID, and potentially additional information.
333    ///
334    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
335        match self {
336            Self::DraftUploadOutOfSyncException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
337            Self::EntityAlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
338            Self::EntityNotExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
339            Self::FailedDependencyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
340            Self::InvalidArgumentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
341            Self::InvalidPasswordException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
342            Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
343            Self::ProhibitedStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
344            Self::ResourceAlreadyCheckedOutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
345            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
346            Self::StorageLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
347            Self::StorageLimitWillExceedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
348            Self::UnauthorizedOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
349            Self::UnauthorizedResourceAccessException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
350            Self::Unhandled(e) => &e.meta,
351        }
352    }
353    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::DraftUploadOutOfSyncException`.
354    pub fn is_draft_upload_out_of_sync_exception(&self) -> bool {
355        matches!(self, Self::DraftUploadOutOfSyncException(_))
356    }
357    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::EntityAlreadyExistsException`.
358    pub fn is_entity_already_exists_exception(&self) -> bool {
359        matches!(self, Self::EntityAlreadyExistsException(_))
360    }
361    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::EntityNotExistsException`.
362    pub fn is_entity_not_exists_exception(&self) -> bool {
363        matches!(self, Self::EntityNotExistsException(_))
364    }
365    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::FailedDependencyException`.
366    pub fn is_failed_dependency_exception(&self) -> bool {
367        matches!(self, Self::FailedDependencyException(_))
368    }
369    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::InvalidArgumentException`.
370    pub fn is_invalid_argument_exception(&self) -> bool {
371        matches!(self, Self::InvalidArgumentException(_))
372    }
373    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::InvalidPasswordException`.
374    pub fn is_invalid_password_exception(&self) -> bool {
375        matches!(self, Self::InvalidPasswordException(_))
376    }
377    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::LimitExceededException`.
378    pub fn is_limit_exceeded_exception(&self) -> bool {
379        matches!(self, Self::LimitExceededException(_))
380    }
381    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::ProhibitedStateException`.
382    pub fn is_prohibited_state_exception(&self) -> bool {
383        matches!(self, Self::ProhibitedStateException(_))
384    }
385    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::ResourceAlreadyCheckedOutException`.
386    pub fn is_resource_already_checked_out_exception(&self) -> bool {
387        matches!(self, Self::ResourceAlreadyCheckedOutException(_))
388    }
389    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::ServiceUnavailableException`.
390    pub fn is_service_unavailable_exception(&self) -> bool {
391        matches!(self, Self::ServiceUnavailableException(_))
392    }
393    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::StorageLimitExceededException`.
394    pub fn is_storage_limit_exceeded_exception(&self) -> bool {
395        matches!(self, Self::StorageLimitExceededException(_))
396    }
397    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::StorageLimitWillExceedException`.
398    pub fn is_storage_limit_will_exceed_exception(&self) -> bool {
399        matches!(self, Self::StorageLimitWillExceedException(_))
400    }
401    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::UnauthorizedOperationException`.
402    pub fn is_unauthorized_operation_exception(&self) -> bool {
403        matches!(self, Self::UnauthorizedOperationException(_))
404    }
405    /// Returns `true` if the error kind is `InitiateDocumentVersionUploadError::UnauthorizedResourceAccessException`.
406    pub fn is_unauthorized_resource_access_exception(&self) -> bool {
407        matches!(self, Self::UnauthorizedResourceAccessException(_))
408    }
409}
410impl ::std::error::Error for InitiateDocumentVersionUploadError {
411    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
412        match self {
413            Self::DraftUploadOutOfSyncException(_inner) => ::std::option::Option::Some(_inner),
414            Self::EntityAlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
415            Self::EntityNotExistsException(_inner) => ::std::option::Option::Some(_inner),
416            Self::FailedDependencyException(_inner) => ::std::option::Option::Some(_inner),
417            Self::InvalidArgumentException(_inner) => ::std::option::Option::Some(_inner),
418            Self::InvalidPasswordException(_inner) => ::std::option::Option::Some(_inner),
419            Self::LimitExceededException(_inner) => ::std::option::Option::Some(_inner),
420            Self::ProhibitedStateException(_inner) => ::std::option::Option::Some(_inner),
421            Self::ResourceAlreadyCheckedOutException(_inner) => ::std::option::Option::Some(_inner),
422            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
423            Self::StorageLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
424            Self::StorageLimitWillExceedException(_inner) => ::std::option::Option::Some(_inner),
425            Self::UnauthorizedOperationException(_inner) => ::std::option::Option::Some(_inner),
426            Self::UnauthorizedResourceAccessException(_inner) => ::std::option::Option::Some(_inner),
427            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
428        }
429    }
430}
431impl ::std::fmt::Display for InitiateDocumentVersionUploadError {
432    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
433        match self {
434            Self::DraftUploadOutOfSyncException(_inner) => _inner.fmt(f),
435            Self::EntityAlreadyExistsException(_inner) => _inner.fmt(f),
436            Self::EntityNotExistsException(_inner) => _inner.fmt(f),
437            Self::FailedDependencyException(_inner) => _inner.fmt(f),
438            Self::InvalidArgumentException(_inner) => _inner.fmt(f),
439            Self::InvalidPasswordException(_inner) => _inner.fmt(f),
440            Self::LimitExceededException(_inner) => _inner.fmt(f),
441            Self::ProhibitedStateException(_inner) => _inner.fmt(f),
442            Self::ResourceAlreadyCheckedOutException(_inner) => _inner.fmt(f),
443            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
444            Self::StorageLimitExceededException(_inner) => _inner.fmt(f),
445            Self::StorageLimitWillExceedException(_inner) => _inner.fmt(f),
446            Self::UnauthorizedOperationException(_inner) => _inner.fmt(f),
447            Self::UnauthorizedResourceAccessException(_inner) => _inner.fmt(f),
448            Self::Unhandled(_inner) => {
449                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
450                    write!(f, "unhandled error ({code})")
451                } else {
452                    f.write_str("unhandled error")
453                }
454            }
455        }
456    }
457}
458impl ::aws_smithy_types::retry::ProvideErrorKind for InitiateDocumentVersionUploadError {
459    fn code(&self) -> ::std::option::Option<&str> {
460        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
461    }
462    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
463        ::std::option::Option::None
464    }
465}
466impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InitiateDocumentVersionUploadError {
467    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
468        match self {
469            Self::DraftUploadOutOfSyncException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
470            Self::EntityAlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
471            Self::EntityNotExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
472            Self::FailedDependencyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
473            Self::InvalidArgumentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
474            Self::InvalidPasswordException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
475            Self::LimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
476            Self::ProhibitedStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
477            Self::ResourceAlreadyCheckedOutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
478            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
479            Self::StorageLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
480            Self::StorageLimitWillExceedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
481            Self::UnauthorizedOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
482            Self::UnauthorizedResourceAccessException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
483            Self::Unhandled(_inner) => &_inner.meta,
484        }
485    }
486}
487impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InitiateDocumentVersionUploadError {
488    fn create_unhandled_error(
489        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
490        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
491    ) -> Self {
492        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
493            source,
494            meta: meta.unwrap_or_default(),
495        })
496    }
497}
498impl ::aws_types::request_id::RequestId for crate::operation::initiate_document_version_upload::InitiateDocumentVersionUploadError {
499    fn request_id(&self) -> Option<&str> {
500        self.meta().request_id()
501    }
502}
503
504pub use crate::operation::initiate_document_version_upload::_initiate_document_version_upload_input::InitiateDocumentVersionUploadInput;
505
506pub use crate::operation::initiate_document_version_upload::_initiate_document_version_upload_output::InitiateDocumentVersionUploadOutput;
507
508mod _initiate_document_version_upload_input;
509
510mod _initiate_document_version_upload_output;
511
512/// Builders
513pub mod builders;