AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/describe_document/builders.rs

@@ -0,1 +0,159 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::describe_document::_describe_document_input::DescribeDocumentInputBuilder;
           3  +
           4  +
pub use crate::operation::describe_document::_describe_document_output::DescribeDocumentOutputBuilder;
           5  +
           6  +
impl crate::operation::describe_document::builders::DescribeDocumentInputBuilder {
           7  +
    /// Sends a request with this input using the given client.
           8  +
    pub async fn send_with(
           9  +
        self,
          10  +
        client: &crate::Client,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::operation::describe_document::DescribeDocumentOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::describe_document::DescribeDocumentError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.describe_document();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `DescribeDocument`.
          24  +
///
          25  +
/// <p>Describes the specified Amazon Web Services Systems Manager document (SSM document).</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct DescribeDocumentFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::describe_document::builders::DescribeDocumentInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::describe_document::DescribeDocumentOutput,
          35  +
        crate::operation::describe_document::DescribeDocumentError,
          36  +
    > for DescribeDocumentFluentBuilder
          37  +
{
          38  +
    fn send(
          39  +
        self,
          40  +
        config_override: crate::config::Builder,
          41  +
    ) -> crate::client::customize::internal::BoxFuture<
          42  +
        crate::client::customize::internal::SendResult<
          43  +
            crate::operation::describe_document::DescribeDocumentOutput,
          44  +
            crate::operation::describe_document::DescribeDocumentError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl DescribeDocumentFluentBuilder {
          51  +
    /// Creates a new `DescribeDocumentFluentBuilder`.
          52  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          53  +
        Self {
          54  +
            handle,
          55  +
            inner: ::std::default::Default::default(),
          56  +
            config_override: ::std::option::Option::None,
          57  +
        }
          58  +
    }
          59  +
    /// Access the DescribeDocument as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::describe_document::builders::DescribeDocumentInputBuilder {
          61  +
        &self.inner
          62  +
    }
          63  +
    /// Sends the request and returns the response.
          64  +
    ///
          65  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          66  +
    /// can be matched against.
          67  +
    ///
          68  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          69  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          70  +
    /// set when configuring the client.
          71  +
    pub async fn send(
          72  +
        self,
          73  +
    ) -> ::std::result::Result<
          74  +
        crate::operation::describe_document::DescribeDocumentOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::describe_document::DescribeDocumentError,
          77  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          78  +
        >,
          79  +
    > {
          80  +
        let input = self
          81  +
            .inner
          82  +
            .build()
          83  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          84  +
        let runtime_plugins = crate::operation::describe_document::DescribeDocument::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::describe_document::DescribeDocument::orchestrate(&runtime_plugins, input).await
          90  +
    }
          91  +
          92  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          93  +
    pub fn customize(
          94  +
        self,
          95  +
    ) -> crate::client::customize::CustomizableOperation<
          96  +
        crate::operation::describe_document::DescribeDocumentOutput,
          97  +
        crate::operation::describe_document::DescribeDocumentError,
          98  +
        Self,
          99  +
    > {
         100  +
        crate::client::customize::CustomizableOperation::new(self)
         101  +
    }
         102  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         103  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         104  +
        self
         105  +
    }
         106  +
         107  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         108  +
        self.config_override = config_override;
         109  +
        self
         110  +
    }
         111  +
    /// <p>The name of the SSM document.</p><note>
         112  +
    /// <p>If you're calling a shared SSM document from a different Amazon Web Services account, <code>Name</code> is the full Amazon Resource Name (ARN) of the document.</p>
         113  +
    /// </note>
         114  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         115  +
        self.inner = self.inner.name(input.into());
         116  +
        self
         117  +
    }
         118  +
    /// <p>The name of the SSM document.</p><note>
         119  +
    /// <p>If you're calling a shared SSM document from a different Amazon Web Services account, <code>Name</code> is the full Amazon Resource Name (ARN) of the document.</p>
         120  +
    /// </note>
         121  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         122  +
        self.inner = self.inner.set_name(input);
         123  +
        self
         124  +
    }
         125  +
    /// <p>The name of the SSM document.</p><note>
         126  +
    /// <p>If you're calling a shared SSM document from a different Amazon Web Services account, <code>Name</code> is the full Amazon Resource Name (ARN) of the document.</p>
         127  +
    /// </note>
         128  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         129  +
        self.inner.get_name()
         130  +
    }
         131  +
    /// <p>The document version for which you want information. Can be a specific version or the default version.</p>
         132  +
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         133  +
        self.inner = self.inner.document_version(input.into());
         134  +
        self
         135  +
    }
         136  +
    /// <p>The document version for which you want information. Can be a specific version or the default version.</p>
         137  +
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         138  +
        self.inner = self.inner.set_document_version(input);
         139  +
        self
         140  +
    }
         141  +
    /// <p>The document version for which you want information. Can be a specific version or the default version.</p>
         142  +
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
         143  +
        self.inner.get_document_version()
         144  +
    }
         145  +
    /// <p>An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         146  +
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         147  +
        self.inner = self.inner.version_name(input.into());
         148  +
        self
         149  +
    }
         150  +
    /// <p>An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         151  +
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         152  +
        self.inner = self.inner.set_version_name(input);
         153  +
        self
         154  +
    }
         155  +
    /// <p>An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         156  +
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
         157  +
        self.inner.get_version_name()
         158  +
    }
         159  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/describe_document_permission.rs

@@ -0,1 +0,692 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `DescribeDocumentPermission`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct DescribeDocumentPermission;
           6  +
impl DescribeDocumentPermission {
           7  +
    /// Creates a new `DescribeDocumentPermission`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          13  +
        crate::operation::describe_document_permission::DescribeDocumentPermissionInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          16  +
        crate::operation::describe_document_permission::DescribeDocumentPermissionOutput::SCHEMA;
          17  +
    pub(crate) async fn orchestrate(
          18  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          19  +
        input: crate::operation::describe_document_permission::DescribeDocumentPermissionInput,
          20  +
    ) -> ::std::result::Result<
          21  +
        crate::operation::describe_document_permission::DescribeDocumentPermissionOutput,
          22  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          23  +
            crate::operation::describe_document_permission::DescribeDocumentPermissionError,
          24  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          25  +
        >,
          26  +
    > {
          27  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          28  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          29  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          30  +
        >| {
          31  +
            err.map_service_error(|err| {
          32  +
                err.downcast::<crate::operation::describe_document_permission::DescribeDocumentPermissionError>()
          33  +
                    .expect("correct error type")
          34  +
            })
          35  +
        };
          36  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          37  +
            .await
          38  +
            .map_err(map_err)?;
          39  +
        let output = context.finalize().map_err(map_err)?;
          40  +
        ::std::result::Result::Ok(
          41  +
            output
          42  +
                .downcast::<crate::operation::describe_document_permission::DescribeDocumentPermissionOutput>()
          43  +
                .expect("correct output type"),
          44  +
        )
          45  +
    }
          46  +
          47  +
    pub(crate) async fn orchestrate_with_stop_point(
          48  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          49  +
        input: crate::operation::describe_document_permission::DescribeDocumentPermissionInput,
          50  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          51  +
    ) -> ::std::result::Result<
          52  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          53  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          54  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          55  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          56  +
        >,
          57  +
    > {
          58  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          59  +
        use ::tracing::Instrument;
          60  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("SSM", "DescribeDocumentPermission", input, runtime_plugins, stop_point)
          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  +
                "SSM.DescribeDocumentPermission",
          65  +
                "rpc.service" = "SSM",
          66  +
                "rpc.method" = "DescribeDocumentPermission",
          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  +
}
          93  +
/// Per-operation error registry. Contains an entry for every modeled
          94  +
/// error this operation can throw.
          95  +
///
          96  +
/// Used by the schema-serde error path as the operation-scoped lookup
          97  +
/// for registry-backed error reification: an error code that does not
          98  +
/// match one of the operation's modeled errors directly is resolved
          99  +
/// against this registry first, then widened to the service-wide error
         100  +
/// registry.
         101  +
pub(crate) mod error_registry {
         102  +
    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
         103  +
        ::aws_smithy_schema::registry::TypeRegistry::builder()
         104  +
                            .insert_error_shape(
         105  +
                        crate::types::error::InternalServerError::SCHEMA,
         106  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         107  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalServerError::deserialize(d)?))
         108  +
                        },
         109  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         110  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalServerError::deserialize(d)?))
         111  +
                        },
         112  +
                    )
         113  +
.insert_error_shape(
         114  +
                        crate::types::error::InvalidDocument::SCHEMA,
         115  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         116  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidDocument::deserialize(d)?))
         117  +
                        },
         118  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         119  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidDocument::deserialize(d)?))
         120  +
                        },
         121  +
                    )
         122  +
.insert_error_shape(
         123  +
                        crate::types::error::InvalidDocumentOperation::SCHEMA,
         124  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         125  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidDocumentOperation::deserialize(d)?))
         126  +
                        },
         127  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         128  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidDocumentOperation::deserialize(d)?))
         129  +
                        },
         130  +
                    )
         131  +
.insert_error_shape(
         132  +
                        crate::types::error::InvalidNextToken::SCHEMA,
         133  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         134  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidNextToken::deserialize(d)?))
         135  +
                        },
         136  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         137  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidNextToken::deserialize(d)?))
         138  +
                        },
         139  +
                    )
         140  +
.insert_error_shape(
         141  +
                        crate::types::error::InvalidPermissionType::SCHEMA,
         142  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         143  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidPermissionType::deserialize(d)?))
         144  +
                        },
         145  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         146  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidPermissionType::deserialize(d)?))
         147  +
                        },
         148  +
                    )
         149  +
                            .build()
         150  +
    });
         151  +
}
         152  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DescribeDocumentPermission {
         153  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
         154  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DescribeDocumentPermission");
         155  +
         156  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
         157  +
            DescribeDocumentPermissionRequestSerializer,
         158  +
        ));
         159  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         160  +
            DescribeDocumentPermissionResponseDeserializer,
         161  +
        ));
         162  +
         163  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         164  +
            crate::config::auth::Params::builder()
         165  +
                .operation_name("DescribeDocumentPermission")
         166  +
                .build()
         167  +
                .expect("required fields set"),
         168  +
        ));
         169  +
         170  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         171  +
            "DescribeDocumentPermission",
         172  +
            "SSM",
         173  +
        ));
         174  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         175  +
        signing_options.double_uri_encode = true;
         176  +
        signing_options.content_sha256_header = false;
         177  +
        signing_options.normalize_uri_path = true;
         178  +
        signing_options.payload_override = None;
         179  +
         180  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         181  +
            signing_options,
         182  +
            ..::std::default::Default::default()
         183  +
        });
         184  +
         185  +
        ::std::option::Option::Some(cfg.freeze())
         186  +
    }
         187  +
         188  +
    fn runtime_components(
         189  +
        &self,
         190  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         191  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         192  +
        #[allow(unused_mut)]
         193  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DescribeDocumentPermission")
         194  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         195  +
                DescribeDocumentPermissionTelemetryInputCaptureInterceptor,
         196  +
            ))
         197  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         198  +
                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
         199  +
            ))
         200  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         201  +
                DescribeDocumentPermissionEndpointParamsInterceptor,
         202  +
            ))
         203  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         204  +
                crate::operation::describe_document_permission::DescribeDocumentPermissionError,
         205  +
            >::new())
         206  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         207  +
                crate::operation::describe_document_permission::DescribeDocumentPermissionError,
         208  +
            >::new())
         209  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         210  +
                crate::operation::describe_document_permission::DescribeDocumentPermissionError,
         211  +
            >::new())
         212  +
            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
         213  +
                crate::operation::describe_document_permission::DescribeDocumentPermissionError,
         214  +
            >::new());
         215  +
         216  +
        ::std::borrow::Cow::Owned(rcb)
         217  +
    }
         218  +
}
         219  +
         220  +
#[derive(Debug)]
         221  +
struct DescribeDocumentPermissionTelemetryInputCaptureInterceptor;
         222  +
         223  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         224  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeDocumentPermissionTelemetryInputCaptureInterceptor {
         225  +
    fn name(&self) -> &'static str {
         226  +
        "DescribeDocumentPermissionTelemetryInputCaptureInterceptor"
         227  +
    }
         228  +
         229  +
    fn read_before_execution(
         230  +
        &self,
         231  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         232  +
            '_,
         233  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         234  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         235  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         236  +
        >,
         237  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         238  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         239  +
        // Nothing to do unless the customer opted in by naming members to record.
         240  +
        let ::std::option::Option::Some(requested) = cfg
         241  +
            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
         242  +
            .filter(|r| !r.is_empty())
         243  +
        else {
         244  +
            return ::std::result::Result::Ok(());
         245  +
        };
         246  +
         247  +
        let ::std::option::Option::Some(input) = context.input().downcast_ref::<DescribeDocumentPermissionInput>() else {
         248  +
            // A mismatched input is not this interceptor's concern; skip quietly.
         249  +
            return ::std::result::Result::Ok(());
         250  +
        };
         251  +
         252  +
        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
         253  +
        if requested.should_capture("Name") {
         254  +
            if let ::std::option::Option::Some(value) = input.name.as_deref() {
         255  +
                captured.insert("Name", value);
         256  +
            }
         257  +
        }
         258  +
        if requested.should_capture("NextToken") {
         259  +
            if let ::std::option::Option::Some(value) = input.next_token.as_deref() {
         260  +
                captured.insert("NextToken", value);
         261  +
            }
         262  +
        }
         263  +
         264  +
        cfg.interceptor_state().store_put(captured);
         265  +
        ::std::result::Result::Ok(())
         266  +
    }
         267  +
}
         268  +
#[derive(Debug)]
         269  +
struct DescribeDocumentPermissionResponseDeserializer;
         270  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeDocumentPermissionResponseDeserializer {
         271  +
    fn deserialize_nonstreaming_with_config(
         272  +
        &self,
         273  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         274  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
         275  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         276  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         277  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         278  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         279  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         280  +
        // loads `body` before firing this hook.
         281  +
        let body = response.body().bytes().expect("body loaded");
         282  +
        let headers = response.headers();
         283  +
        #[allow(unused_mut)]
         284  +
        let mut force_error = false;
         285  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         286  +
        if !success && status != 200 || force_error {
         287  +
            let protocol = _cfg
         288  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         289  +
                .expect("a SharedClientProtocol is required");
         290  +
            #[allow(unused_mut)]
         291  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         292  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         293  +
            })?;
         294  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         295  +
            let generic = generic_builder.build();
         296  +
            let error_code = match generic.code() {
         297  +
                ::std::option::Option::Some(code) => code,
         298  +
                ::std::option::Option::None => {
         299  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         300  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         301  +
                            crate::operation::describe_document_permission::DescribeDocumentPermissionError::unhandled(generic),
         302  +
                        ),
         303  +
                    ))
         304  +
                }
         305  +
            };
         306  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         307  +
            let err = match error_code {
         308  +
                "InternalServerError" => crate::operation::describe_document_permission::DescribeDocumentPermissionError::InternalServerError({
         309  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         310  +
                        crate::types::error::InternalServerError::deserialize_with_response(
         311  +
                            &mut *deser,
         312  +
                            response.headers(),
         313  +
                            response.status().into(),
         314  +
                            body,
         315  +
                        )
         316  +
                    }) {
         317  +
                        ::std::result::Result::Ok(val) => val,
         318  +
                        ::std::result::Result::Err(e) => {
         319  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         320  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         321  +
                            ))
         322  +
                        }
         323  +
                    };
         324  +
                    tmp.meta = generic;
         325  +
                    if tmp.message.is_none() {
         326  +
                        tmp.message = _error_message;
         327  +
                    }
         328  +
                    tmp
         329  +
                }),
         330  +
                "InvalidDocument" => crate::operation::describe_document_permission::DescribeDocumentPermissionError::InvalidDocument({
         331  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         332  +
                        crate::types::error::InvalidDocument::deserialize_with_response(
         333  +
                            &mut *deser,
         334  +
                            response.headers(),
         335  +
                            response.status().into(),
         336  +
                            body,
         337  +
                        )
         338  +
                    }) {
         339  +
                        ::std::result::Result::Ok(val) => val,
         340  +
                        ::std::result::Result::Err(e) => {
         341  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         342  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         343  +
                            ))
         344  +
                        }
         345  +
                    };
         346  +
                    tmp.meta = generic;
         347  +
                    if tmp.message.is_none() {
         348  +
                        tmp.message = _error_message;
         349  +
                    }
         350  +
                    tmp
         351  +
                }),
         352  +
                "InvalidDocumentOperation" => {
         353  +
                    crate::operation::describe_document_permission::DescribeDocumentPermissionError::InvalidDocumentOperation({
         354  +
                        let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         355  +
                            crate::types::error::InvalidDocumentOperation::deserialize_with_response(
         356  +
                                &mut *deser,
         357  +
                                response.headers(),
         358  +
                                response.status().into(),
         359  +
                                body,
         360  +
                            )
         361  +
                        }) {
         362  +
                            ::std::result::Result::Ok(val) => val,
         363  +
                            ::std::result::Result::Err(e) => {
         364  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         365  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         366  +
                                ))
         367  +
                            }
         368  +
                        };
         369  +
                        tmp.meta = generic;
         370  +
                        if tmp.message.is_none() {
         371  +
                            tmp.message = _error_message;
         372  +
                        }
         373  +
                        tmp
         374  +
                    })
         375  +
                }
         376  +
                "InvalidNextToken" => crate::operation::describe_document_permission::DescribeDocumentPermissionError::InvalidNextToken({
         377  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         378  +
                        crate::types::error::InvalidNextToken::deserialize_with_response(
         379  +
                            &mut *deser,
         380  +
                            response.headers(),
         381  +
                            response.status().into(),
         382  +
                            body,
         383  +
                        )
         384  +
                    }) {
         385  +
                        ::std::result::Result::Ok(val) => val,
         386  +
                        ::std::result::Result::Err(e) => {
         387  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         388  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         389  +
                            ))
         390  +
                        }
         391  +
                    };
         392  +
                    tmp.meta = generic;
         393  +
                    if tmp.message.is_none() {
         394  +
                        tmp.message = _error_message;
         395  +
                    }
         396  +
                    tmp
         397  +
                }),
         398  +
                "InvalidPermissionType" => crate::operation::describe_document_permission::DescribeDocumentPermissionError::InvalidPermissionType({
         399  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         400  +
                        crate::types::error::InvalidPermissionType::deserialize_with_response(
         401  +
                            &mut *deser,
         402  +
                            response.headers(),
         403  +
                            response.status().into(),
         404  +
                            body,
         405  +
                        )
         406  +
                    }) {
         407  +
                        ::std::result::Result::Ok(val) => val,
         408  +
                        ::std::result::Result::Err(e) => {
         409  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         410  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         411  +
                            ))
         412  +
                        }
         413  +
                    };
         414  +
                    tmp.meta = generic;
         415  +
                    if tmp.message.is_none() {
         416  +
                        tmp.message = _error_message;
         417  +
                    }
         418  +
                    tmp
         419  +
                }),
         420  +
                _ => {
         421  +
                    // Registry-backed, operation-scoped reification of an error whose
         422  +
                    // code this operation does not model directly: the operation's own
         423  +
                    // error registry is consulted first, then the lookup widens to the
         424  +
                    // service-wide error registry. On a hit, the reified error is attached
         425  +
                    // as the source of the returned unhandled error while its metadata
         426  +
                    // (code, message, request id) is preserved; on a miss the generic
         427  +
                    // error is returned unchanged.
         428  +
                    match protocol
         429  +
                        .deserialize_error_response(response, _cfg)
         430  +
                        .ok()
         431  +
                        .and_then(|mut deser| {
         432  +
                            ::aws_smithy_schema::registry::reify_error(
         433  +
                                crate::operation::describe_document_permission::error_registry::REGISTRY
         434  +
                                    .or(&crate::error_type_registry::REGISTRY),
         435  +
                                error_code,
         436  +
                                &mut *deser,
         437  +
                            )
         438  +
                        }) {
         439  +
                        ::std::option::Option::Some(source) => <crate::operation::describe_document_permission::DescribeDocumentPermissionError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
         440  +
                        ::std::option::Option::None => crate::operation::describe_document_permission::DescribeDocumentPermissionError::generic(generic),
         441  +
                    }
         442  +
                }
         443  +
            };
         444  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         445  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         446  +
            ))
         447  +
        } else {
         448  +
            let protocol = _cfg
         449  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         450  +
                .expect("a SharedClientProtocol is required");
         451  +
            let mut deser = protocol
         452  +
                .deserialize_response(response, DescribeDocumentPermission::OUTPUT_SCHEMA, _cfg)
         453  +
                .map_err(|e| {
         454  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         455  +
                })?;
         456  +
            // body and headers are already in scope from the top of the function;
         457  +
            // alias `headers` as `_response_headers` so MutateOutput
         458  +
            // customizations have a stable name to read from.
         459  +
            let _response_headers = headers;
         460  +
            #[allow(unused_mut)]
         461  +
            let mut output = crate::operation::describe_document_permission::DescribeDocumentPermissionOutput::deserialize_with_response(
         462  +
                &mut *deser,
         463  +
                _response_headers,
         464  +
                response.status().into(),
         465  +
                body,
         466  +
            )
         467  +
            .map_err(|e| {
         468  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         469  +
            })?;
         470  +
            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
         471  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         472  +
        }
         473  +
    }
         474  +
}
         475  +
#[derive(Debug)]
         476  +
struct DescribeDocumentPermissionRequestSerializer;
         477  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeDocumentPermissionRequestSerializer {
         478  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         479  +
    fn serialize_input(
         480  +
        &self,
         481  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         482  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         483  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         484  +
        let input = input
         485  +
            .downcast::<crate::operation::describe_document_permission::DescribeDocumentPermissionInput>()
         486  +
            .expect("correct type");
         487  +
         488  +
        let protocol = _cfg
         489  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         490  +
            .expect("a SharedClientProtocol is required");
         491  +
        let mut request = protocol
         492  +
            .serialize_request(&input, DescribeDocumentPermission::INPUT_SCHEMA, "/", _cfg)
         493  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         494  +
         495  +
        return ::std::result::Result::Ok(request);
         496  +
    }
         497  +
}
         498  +
#[derive(Debug)]
         499  +
struct DescribeDocumentPermissionEndpointParamsInterceptor;
         500  +
         501  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         502  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeDocumentPermissionEndpointParamsInterceptor {
         503  +
    fn name(&self) -> &'static str {
         504  +
        "DescribeDocumentPermissionEndpointParamsInterceptor"
         505  +
    }
         506  +
         507  +
    fn read_before_execution(
         508  +
        &self,
         509  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         510  +
            '_,
         511  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         512  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         513  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         514  +
        >,
         515  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         516  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         517  +
        let _input = context
         518  +
            .input()
         519  +
            .downcast_ref::<DescribeDocumentPermissionInput>()
         520  +
            .ok_or("failed to downcast to DescribeDocumentPermissionInput")?;
         521  +
         522  +
        let params = crate::config::endpoint::Params::builder()
         523  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         524  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         525  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         526  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         527  +
            .build()
         528  +
            .map_err(|err| {
         529  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         530  +
            })?;
         531  +
        cfg.interceptor_state()
         532  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         533  +
        ::std::result::Result::Ok(())
         534  +
    }
         535  +
}
         536  +
         537  +
// The get_* functions below are generated from JMESPath expressions in the
         538  +
// operationContextParams trait. They target the operation's input shape.
         539  +
         540  +
/// Error type for the `DescribeDocumentPermissionError` operation.
         541  +
#[non_exhaustive]
         542  +
#[derive(::std::fmt::Debug)]
         543  +
pub enum DescribeDocumentPermissionError {
         544  +
    /// <p>An error occurred on the server side.</p>
         545  +
    InternalServerError(crate::types::error::InternalServerError),
         546  +
    /// <p>The specified SSM document doesn't exist.</p>
         547  +
    InvalidDocument(crate::types::error::InvalidDocument),
         548  +
    /// <p>You attempted to delete a document while it is still shared. You must stop sharing the document before you can delete it.</p>
         549  +
    InvalidDocumentOperation(crate::types::error::InvalidDocumentOperation),
         550  +
    /// <p>The specified token isn't valid.</p>
         551  +
    InvalidNextToken(crate::types::error::InvalidNextToken),
         552  +
    /// <p>The permission type isn't supported. <i>Share</i> is the only supported permission type.</p>
         553  +
    InvalidPermissionType(crate::types::error::InvalidPermissionType),
         554  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         555  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         556  +
    variable wildcard pattern and check `.code()`:
         557  +
     \
         558  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         559  +
     \
         560  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DescribeDocumentPermissionError) for what information is available for the error.")]
         561  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         562  +
}
         563  +
impl DescribeDocumentPermissionError {
         564  +
    /// Creates the `DescribeDocumentPermissionError::Unhandled` variant from any error type.
         565  +
    pub fn unhandled(
         566  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         567  +
    ) -> Self {
         568  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         569  +
            source: err.into(),
         570  +
            meta: ::std::default::Default::default(),
         571  +
        })
         572  +
    }
         573  +
         574  +
    /// Creates the `DescribeDocumentPermissionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         575  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         576  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         577  +
            source: err.clone().into(),
         578  +
            meta: err,
         579  +
        })
         580  +
    }
         581  +
    ///
         582  +
    /// Returns error metadata, which includes the error code, message,
         583  +
    /// request ID, and potentially additional information.
         584  +
    ///
         585  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         586  +
        match self {
         587  +
            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         588  +
            Self::InvalidDocument(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         589  +
            Self::InvalidDocumentOperation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         590  +
            Self::InvalidNextToken(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         591  +
            Self::InvalidPermissionType(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         592  +
            Self::Unhandled(e) => &e.meta,
         593  +
        }
         594  +
    }
         595  +
    /// Returns `true` if the error kind is `DescribeDocumentPermissionError::InternalServerError`.
         596  +
    pub fn is_internal_server_error(&self) -> bool {
         597  +
        matches!(self, Self::InternalServerError(_))
         598  +
    }
         599  +
    /// Returns `true` if the error kind is `DescribeDocumentPermissionError::InvalidDocument`.
         600  +
    pub fn is_invalid_document(&self) -> bool {
         601  +
        matches!(self, Self::InvalidDocument(_))
         602  +
    }
         603  +
    /// Returns `true` if the error kind is `DescribeDocumentPermissionError::InvalidDocumentOperation`.
         604  +
    pub fn is_invalid_document_operation(&self) -> bool {
         605  +
        matches!(self, Self::InvalidDocumentOperation(_))
         606  +
    }
         607  +
    /// Returns `true` if the error kind is `DescribeDocumentPermissionError::InvalidNextToken`.
         608  +
    pub fn is_invalid_next_token(&self) -> bool {
         609  +
        matches!(self, Self::InvalidNextToken(_))
         610  +
    }
         611  +
    /// Returns `true` if the error kind is `DescribeDocumentPermissionError::InvalidPermissionType`.
         612  +
    pub fn is_invalid_permission_type(&self) -> bool {
         613  +
        matches!(self, Self::InvalidPermissionType(_))
         614  +
    }
         615  +
}
         616  +
impl ::std::error::Error for DescribeDocumentPermissionError {
         617  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         618  +
        match self {
         619  +
            Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
         620  +
            Self::InvalidDocument(_inner) => ::std::option::Option::Some(_inner),
         621  +
            Self::InvalidDocumentOperation(_inner) => ::std::option::Option::Some(_inner),
         622  +
            Self::InvalidNextToken(_inner) => ::std::option::Option::Some(_inner),
         623  +
            Self::InvalidPermissionType(_inner) => ::std::option::Option::Some(_inner),
         624  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         625  +
        }
         626  +
    }
         627  +
}
         628  +
impl ::std::fmt::Display for DescribeDocumentPermissionError {
         629  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         630  +
        match self {
         631  +
            Self::InternalServerError(_inner) => _inner.fmt(f),
         632  +
            Self::InvalidDocument(_inner) => _inner.fmt(f),
         633  +
            Self::InvalidDocumentOperation(_inner) => _inner.fmt(f),
         634  +
            Self::InvalidNextToken(_inner) => _inner.fmt(f),
         635  +
            Self::InvalidPermissionType(_inner) => _inner.fmt(f),
         636  +
            Self::Unhandled(_inner) => {
         637  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         638  +
                    write!(f, "unhandled error ({code})")
         639  +
                } else {
         640  +
                    f.write_str("unhandled error")
         641  +
                }
         642  +
            }
         643  +
        }
         644  +
    }
         645  +
}
         646  +
impl ::aws_smithy_types::retry::ProvideErrorKind for DescribeDocumentPermissionError {
         647  +
    fn code(&self) -> ::std::option::Option<&str> {
         648  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         649  +
    }
         650  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         651  +
        ::std::option::Option::None
         652  +
    }
         653  +
}
         654  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DescribeDocumentPermissionError {
         655  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         656  +
        match self {
         657  +
            Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         658  +
            Self::InvalidDocument(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         659  +
            Self::InvalidDocumentOperation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         660  +
            Self::InvalidNextToken(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         661  +
            Self::InvalidPermissionType(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         662  +
            Self::Unhandled(_inner) => &_inner.meta,
         663  +
        }
         664  +
    }
         665  +
}
         666  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DescribeDocumentPermissionError {
         667  +
    fn create_unhandled_error(
         668  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         669  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         670  +
    ) -> Self {
         671  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         672  +
            source,
         673  +
            meta: meta.unwrap_or_default(),
         674  +
        })
         675  +
    }
         676  +
}
         677  +
impl ::aws_types::request_id::RequestId for crate::operation::describe_document_permission::DescribeDocumentPermissionError {
         678  +
    fn request_id(&self) -> Option<&str> {
         679  +
        self.meta().request_id()
         680  +
    }
         681  +
}
         682  +
         683  +
pub use crate::operation::describe_document_permission::_describe_document_permission_input::DescribeDocumentPermissionInput;
         684  +
         685  +
pub use crate::operation::describe_document_permission::_describe_document_permission_output::DescribeDocumentPermissionOutput;
         686  +
         687  +
mod _describe_document_permission_input;
         688  +
         689  +
mod _describe_document_permission_output;
         690  +
         691  +
/// Builders
         692  +
pub mod builders;

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/describe_document_permission/_describe_document_permission_input.rs

@@ -0,1 +0,266 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct DescribeDocumentPermissionInput {
           6  +
    /// <p>The name of the document for which you are the owner.</p>
           7  +
    pub name: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The permission type for the document. The permission type can be <i>Share</i>.</p>
           9  +
    pub permission_type: ::std::option::Option<crate::types::DocumentPermissionType>,
          10  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
          11  +
    pub max_results: ::std::option::Option<i32>,
          12  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          13  +
    pub next_token: ::std::option::Option<::std::string::String>,
          14  +
}
          15  +
impl DescribeDocumentPermissionInput {
          16  +
    /// <p>The name of the document for which you are the owner.</p>
          17  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          18  +
        self.name.as_deref()
          19  +
    }
          20  +
    /// <p>The permission type for the document. The permission type can be <i>Share</i>.</p>
          21  +
    pub fn permission_type(&self) -> ::std::option::Option<&crate::types::DocumentPermissionType> {
          22  +
        self.permission_type.as_ref()
          23  +
    }
          24  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
          25  +
    pub fn max_results(&self) -> ::std::option::Option<i32> {
          26  +
        self.max_results
          27  +
    }
          28  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          29  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          30  +
        self.next_token.as_deref()
          31  +
    }
          32  +
}
          33  +
static DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          34  +
    ::aws_smithy_schema::ShapeId::from_parts(
          35  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentPermissionInput$Name",
          36  +
        "com.amazonaws.ssm.synthetic",
          37  +
        "DescribeDocumentPermissionInput",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::String,
          40  +
    "Name",
          41  +
    0,
          42  +
);
          43  +
static DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_PERMISSION_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_parts(
          45  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentPermissionInput$PermissionType",
          46  +
        "com.amazonaws.ssm.synthetic",
          47  +
        "DescribeDocumentPermissionInput",
          48  +
    ),
          49  +
    ::aws_smithy_schema::ShapeType::String,
          50  +
    "PermissionType",
          51  +
    1,
          52  +
);
          53  +
static DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          54  +
    ::aws_smithy_schema::ShapeId::from_parts(
          55  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentPermissionInput$MaxResults",
          56  +
        "com.amazonaws.ssm.synthetic",
          57  +
        "DescribeDocumentPermissionInput",
          58  +
    ),
          59  +
    ::aws_smithy_schema::ShapeType::Integer,
          60  +
    "MaxResults",
          61  +
    2,
          62  +
);
          63  +
static DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          64  +
    ::aws_smithy_schema::ShapeId::from_parts(
          65  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentPermissionInput$NextToken",
          66  +
        "com.amazonaws.ssm.synthetic",
          67  +
        "DescribeDocumentPermissionInput",
          68  +
    ),
          69  +
    ::aws_smithy_schema::ShapeType::String,
          70  +
    "NextToken",
          71  +
    3,
          72  +
);
          73  +
static DESCRIBEDOCUMENTPERMISSIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          74  +
    ::aws_smithy_schema::ShapeId::from_parts(
          75  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentPermissionInput",
          76  +
        "com.amazonaws.ssm.synthetic",
          77  +
        "DescribeDocumentPermissionInput",
          78  +
    ),
          79  +
    ::aws_smithy_schema::ShapeType::Structure,
          80  +
    &[
          81  +
        &DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_NAME,
          82  +
        &DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_PERMISSION_TYPE,
          83  +
        &DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_MAX_RESULTS,
          84  +
        &DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_NEXT_TOKEN,
          85  +
    ],
          86  +
)
          87  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          88  +
.with_original_name("DescribeDocumentPermissionRequest");
          89  +
impl DescribeDocumentPermissionInput {
          90  +
    /// The schema for this shape.
          91  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEDOCUMENTPERMISSIONINPUT_SCHEMA;
          92  +
}
          93  +
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeDocumentPermissionInput {
          94  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          95  +
    fn serialize_members(
          96  +
        &self,
          97  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          98  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          99  +
        if let Some(ref val) = self.name {
         100  +
            ser.write_string(&DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_NAME, val)?;
         101  +
        }
         102  +
        if let Some(ref val) = self.permission_type {
         103  +
            ser.write_string(&DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_PERMISSION_TYPE, val.as_str())?;
         104  +
        }
         105  +
        if let Some(ref val) = self.max_results {
         106  +
            ser.write_integer(&DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_MAX_RESULTS, *val)?;
         107  +
        }
         108  +
        if let Some(ref val) = self.next_token {
         109  +
            ser.write_string(&DESCRIBEDOCUMENTPERMISSIONINPUT_MEMBER_NEXT_TOKEN, val)?;
         110  +
        }
         111  +
        Ok(())
         112  +
    }
         113  +
}
         114  +
impl DescribeDocumentPermissionInput {
         115  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         116  +
    pub fn deserialize(
         117  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         118  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         119  +
        #[allow(unused_variables, unused_mut)]
         120  +
        let mut builder = Self::builder();
         121  +
        #[allow(
         122  +
            unused_variables,
         123  +
            unreachable_code,
         124  +
            clippy::single_match,
         125  +
            clippy::match_single_binding,
         126  +
            clippy::diverging_sub_expression
         127  +
        )]
         128  +
        deserializer.read_struct(&DESCRIBEDOCUMENTPERMISSIONINPUT_SCHEMA, &mut |member, deser| {
         129  +
            match member.member_index() {
         130  +
                Some(0) => {
         131  +
                    if deser.is_null() {
         132  +
                        deser.read_null()?;
         133  +
                    } else {
         134  +
                        builder.name = Some(deser.read_string(member)?);
         135  +
                    }
         136  +
                }
         137  +
                Some(1) => {
         138  +
                    if deser.is_null() {
         139  +
                        deser.read_null()?;
         140  +
                    } else {
         141  +
                        builder.permission_type = Some(crate::types::DocumentPermissionType::from(deser.read_string(member)?.as_str()));
         142  +
                    }
         143  +
                }
         144  +
                Some(2) => {
         145  +
                    if deser.is_null() {
         146  +
                        deser.read_null()?;
         147  +
                    } else {
         148  +
                        builder.max_results = Some(deser.read_integer(member)?);
         149  +
                    }
         150  +
                }
         151  +
                Some(3) => {
         152  +
                    if deser.is_null() {
         153  +
                        deser.read_null()?;
         154  +
                    } else {
         155  +
                        builder.next_token = Some(deser.read_string(member)?);
         156  +
                    }
         157  +
                }
         158  +
                _ => {}
         159  +
            }
         160  +
            Ok(())
         161  +
        })?;
         162  +
        builder.name = builder.name.or(Some(String::new()));
         163  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         164  +
    }
         165  +
}
         166  +
impl DescribeDocumentPermissionInput {
         167  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         168  +
    pub fn deserialize_with_response(
         169  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         170  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         171  +
        _status: u16,
         172  +
        _body: &[u8],
         173  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         174  +
        Self::deserialize(deserializer)
         175  +
    }
         176  +
}
         177  +
impl DescribeDocumentPermissionInput {
         178  +
    /// Creates a new builder-style object to manufacture [`DescribeDocumentPermissionInput`](crate::operation::describe_document_permission::DescribeDocumentPermissionInput).
         179  +
    pub fn builder() -> crate::operation::describe_document_permission::builders::DescribeDocumentPermissionInputBuilder {
         180  +
        crate::operation::describe_document_permission::builders::DescribeDocumentPermissionInputBuilder::default()
         181  +
    }
         182  +
}
         183  +
         184  +
/// A builder for [`DescribeDocumentPermissionInput`](crate::operation::describe_document_permission::DescribeDocumentPermissionInput).
         185  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         186  +
#[non_exhaustive]
         187  +
pub struct DescribeDocumentPermissionInputBuilder {
         188  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         189  +
    pub(crate) permission_type: ::std::option::Option<crate::types::DocumentPermissionType>,
         190  +
    pub(crate) max_results: ::std::option::Option<i32>,
         191  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         192  +
}
         193  +
impl DescribeDocumentPermissionInputBuilder {
         194  +
    /// <p>The name of the document for which you are the owner.</p>
         195  +
    /// This field is required.
         196  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         197  +
        self.name = ::std::option::Option::Some(input.into());
         198  +
        self
         199  +
    }
         200  +
    /// <p>The name of the document for which you are the owner.</p>
         201  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         202  +
        self.name = input;
         203  +
        self
         204  +
    }
         205  +
    /// <p>The name of the document for which you are the owner.</p>
         206  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         207  +
        &self.name
         208  +
    }
         209  +
    /// <p>The permission type for the document. The permission type can be <i>Share</i>.</p>
         210  +
    /// This field is required.
         211  +
    pub fn permission_type(mut self, input: crate::types::DocumentPermissionType) -> Self {
         212  +
        self.permission_type = ::std::option::Option::Some(input);
         213  +
        self
         214  +
    }
         215  +
    /// <p>The permission type for the document. The permission type can be <i>Share</i>.</p>
         216  +
    pub fn set_permission_type(mut self, input: ::std::option::Option<crate::types::DocumentPermissionType>) -> Self {
         217  +
        self.permission_type = input;
         218  +
        self
         219  +
    }
         220  +
    /// <p>The permission type for the document. The permission type can be <i>Share</i>.</p>
         221  +
    pub fn get_permission_type(&self) -> &::std::option::Option<crate::types::DocumentPermissionType> {
         222  +
        &self.permission_type
         223  +
    }
         224  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         225  +
    pub fn max_results(mut self, input: i32) -> Self {
         226  +
        self.max_results = ::std::option::Option::Some(input);
         227  +
        self
         228  +
    }
         229  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         230  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         231  +
        self.max_results = input;
         232  +
        self
         233  +
    }
         234  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         235  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         236  +
        &self.max_results
         237  +
    }
         238  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         239  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         240  +
        self.next_token = ::std::option::Option::Some(input.into());
         241  +
        self
         242  +
    }
         243  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         244  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         245  +
        self.next_token = input;
         246  +
        self
         247  +
    }
         248  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         249  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         250  +
        &self.next_token
         251  +
    }
         252  +
    /// Consumes the builder and constructs a [`DescribeDocumentPermissionInput`](crate::operation::describe_document_permission::DescribeDocumentPermissionInput).
         253  +
    pub fn build(
         254  +
        self,
         255  +
    ) -> ::std::result::Result<
         256  +
        crate::operation::describe_document_permission::DescribeDocumentPermissionInput,
         257  +
        ::aws_smithy_types::error::operation::BuildError,
         258  +
    > {
         259  +
        ::std::result::Result::Ok(crate::operation::describe_document_permission::DescribeDocumentPermissionInput {
         260  +
            name: self.name,
         261  +
            permission_type: self.permission_type,
         262  +
            max_results: self.max_results,
         263  +
            next_token: self.next_token,
         264  +
        })
         265  +
    }
         266  +
}