AWS SDK

AWS SDK

rev. 2915cec5ef64cb1ed4992565a748d76a11505b3b (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,173 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::get_deployable_patch_snapshot_for_instance::_get_deployable_patch_snapshot_for_instance_input::GetDeployablePatchSnapshotForInstanceInputBuilder;
           3  +
           4  +
pub use crate::operation::get_deployable_patch_snapshot_for_instance::_get_deployable_patch_snapshot_for_instance_output::GetDeployablePatchSnapshotForInstanceOutputBuilder;
           5  +
           6  +
impl crate::operation::get_deployable_patch_snapshot_for_instance::builders::GetDeployablePatchSnapshotForInstanceInputBuilder {
           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::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.get_deployable_patch_snapshot_for_instance();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `GetDeployablePatchSnapshotForInstance`.
          24  +
///
          25  +
/// <p>Retrieves the current snapshot for the patch baseline the managed node uses. This API is primarily used by the <code>AWS-RunPatchBaseline</code> Systems Manager document (SSM document).</p><note>
          26  +
/// <p>If you run the command locally, such as with the Command Line Interface (CLI), the system attempts to use your local Amazon Web Services credentials and the operation fails. To avoid this, you can run the command in the Amazon Web Services Systems Manager console. Use Run Command, a tool in Amazon Web Services Systems Manager, with an SSM document that enables you to target a managed node with a script or command. For example, run the command using the <code>AWS-RunShellScript</code> document or the <code>AWS-RunPowerShellScript</code> document.</p>
          27  +
/// </note>
          28  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          29  +
pub struct GetDeployablePatchSnapshotForInstanceFluentBuilder {
          30  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          31  +
    inner: crate::operation::get_deployable_patch_snapshot_for_instance::builders::GetDeployablePatchSnapshotForInstanceInputBuilder,
          32  +
    config_override: ::std::option::Option<crate::config::Builder>,
          33  +
}
          34  +
impl
          35  +
    crate::client::customize::internal::CustomizableSend<
          36  +
        crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceOutput,
          37  +
        crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceError,
          38  +
    > for GetDeployablePatchSnapshotForInstanceFluentBuilder
          39  +
{
          40  +
    fn send(
          41  +
        self,
          42  +
        config_override: crate::config::Builder,
          43  +
    ) -> crate::client::customize::internal::BoxFuture<
          44  +
        crate::client::customize::internal::SendResult<
          45  +
            crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceOutput,
          46  +
            crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceError,
          47  +
        >,
          48  +
    > {
          49  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          50  +
    }
          51  +
}
          52  +
impl GetDeployablePatchSnapshotForInstanceFluentBuilder {
          53  +
    /// Creates a new `GetDeployablePatchSnapshotForInstanceFluentBuilder`.
          54  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          55  +
        Self {
          56  +
            handle,
          57  +
            inner: ::std::default::Default::default(),
          58  +
            config_override: ::std::option::Option::None,
          59  +
        }
          60  +
    }
          61  +
    /// Access the GetDeployablePatchSnapshotForInstance as a reference.
          62  +
    pub fn as_input(
          63  +
        &self,
          64  +
    ) -> &crate::operation::get_deployable_patch_snapshot_for_instance::builders::GetDeployablePatchSnapshotForInstanceInputBuilder {
          65  +
        &self.inner
          66  +
    }
          67  +
    /// Sends the request and returns the response.
          68  +
    ///
          69  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          70  +
    /// can be matched against.
          71  +
    ///
          72  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          73  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          74  +
    /// set when configuring the client.
          75  +
    pub async fn send(
          76  +
        self,
          77  +
    ) -> ::std::result::Result<
          78  +
        crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceOutput,
          79  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          80  +
            crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceError,
          81  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          82  +
        >,
          83  +
    > {
          84  +
        let input = self
          85  +
            .inner
          86  +
            .build()
          87  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          88  +
        let runtime_plugins =
          89  +
            crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstance::operation_runtime_plugins(
          90  +
                self.handle.runtime_plugins.clone(),
          91  +
                &self.handle.conf,
          92  +
                self.config_override,
          93  +
            );
          94  +
        crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstance::orchestrate(&runtime_plugins, input)
          95  +
            .await
          96  +
    }
          97  +
          98  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          99  +
    pub fn customize(
         100  +
        self,
         101  +
    ) -> crate::client::customize::CustomizableOperation<
         102  +
        crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceOutput,
         103  +
        crate::operation::get_deployable_patch_snapshot_for_instance::GetDeployablePatchSnapshotForInstanceError,
         104  +
        Self,
         105  +
    > {
         106  +
        crate::client::customize::CustomizableOperation::new(self)
         107  +
    }
         108  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         109  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         110  +
        self
         111  +
    }
         112  +
         113  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         114  +
        self.config_override = config_override;
         115  +
        self
         116  +
    }
         117  +
    /// <p>The ID of the managed node for which the appropriate patch snapshot should be retrieved.</p>
         118  +
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         119  +
        self.inner = self.inner.instance_id(input.into());
         120  +
        self
         121  +
    }
         122  +
    /// <p>The ID of the managed node for which the appropriate patch snapshot should be retrieved.</p>
         123  +
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         124  +
        self.inner = self.inner.set_instance_id(input);
         125  +
        self
         126  +
    }
         127  +
    /// <p>The ID of the managed node for which the appropriate patch snapshot should be retrieved.</p>
         128  +
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
         129  +
        self.inner.get_instance_id()
         130  +
    }
         131  +
    /// <p>The snapshot ID provided by the user when running <code>AWS-RunPatchBaseline</code>.</p>
         132  +
    pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         133  +
        self.inner = self.inner.snapshot_id(input.into());
         134  +
        self
         135  +
    }
         136  +
    /// <p>The snapshot ID provided by the user when running <code>AWS-RunPatchBaseline</code>.</p>
         137  +
    pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         138  +
        self.inner = self.inner.set_snapshot_id(input);
         139  +
        self
         140  +
    }
         141  +
    /// <p>The snapshot ID provided by the user when running <code>AWS-RunPatchBaseline</code>.</p>
         142  +
    pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
         143  +
        self.inner.get_snapshot_id()
         144  +
    }
         145  +
    /// <p>Defines the basic information about a patch baseline override.</p>
         146  +
    pub fn baseline_override(mut self, input: crate::types::BaselineOverride) -> Self {
         147  +
        self.inner = self.inner.baseline_override(input);
         148  +
        self
         149  +
    }
         150  +
    /// <p>Defines the basic information about a patch baseline override.</p>
         151  +
    pub fn set_baseline_override(mut self, input: ::std::option::Option<crate::types::BaselineOverride>) -> Self {
         152  +
        self.inner = self.inner.set_baseline_override(input);
         153  +
        self
         154  +
    }
         155  +
    /// <p>Defines the basic information about a patch baseline override.</p>
         156  +
    pub fn get_baseline_override(&self) -> &::std::option::Option<crate::types::BaselineOverride> {
         157  +
        self.inner.get_baseline_override()
         158  +
    }
         159  +
    /// <p>Specifies whether to use S3 dualstack endpoints for the patch snapshot download URL. Set to <code>true</code> to receive a presigned URL that supports both IPv4 and IPv6 connectivity. Set to <code>false</code> to use standard IPv4-only endpoints. Default is <code>false</code>. This parameter is required for managed nodes in IPv6-only environments.</p>
         160  +
    pub fn use_s3_dual_stack_endpoint(mut self, input: bool) -> Self {
         161  +
        self.inner = self.inner.use_s3_dual_stack_endpoint(input);
         162  +
        self
         163  +
    }
         164  +
    /// <p>Specifies whether to use S3 dualstack endpoints for the patch snapshot download URL. Set to <code>true</code> to receive a presigned URL that supports both IPv4 and IPv6 connectivity. Set to <code>false</code> to use standard IPv4-only endpoints. Default is <code>false</code>. This parameter is required for managed nodes in IPv6-only environments.</p>
         165  +
    pub fn set_use_s3_dual_stack_endpoint(mut self, input: ::std::option::Option<bool>) -> Self {
         166  +
        self.inner = self.inner.set_use_s3_dual_stack_endpoint(input);
         167  +
        self
         168  +
    }
         169  +
    /// <p>Specifies whether to use S3 dualstack endpoints for the patch snapshot download URL. Set to <code>true</code> to receive a presigned URL that supports both IPv4 and IPv6 connectivity. Set to <code>false</code> to use standard IPv4-only endpoints. Default is <code>false</code>. This parameter is required for managed nodes in IPv6-only environments.</p>
         170  +
    pub fn get_use_s3_dual_stack_endpoint(&self) -> &::std::option::Option<bool> {
         171  +
        self.inner.get_use_s3_dual_stack_endpoint()
         172  +
    }
         173  +
}

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

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

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

@@ -0,1 +0,260 @@
           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 GetDocumentInput {
           6  +
    /// <p>The name of the SSM document.</p>
           7  +
    pub name: ::std::option::Option<::std::string::String>,
           8  +
    /// <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>
           9  +
    pub version_name: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>The document version for which you want information.</p>
          11  +
    pub document_version: ::std::option::Option<::std::string::String>,
          12  +
    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
          13  +
    pub document_format: ::std::option::Option<crate::types::DocumentFormat>,
          14  +
}
          15  +
impl GetDocumentInput {
          16  +
    /// <p>The name of the SSM document.</p>
          17  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          18  +
        self.name.as_deref()
          19  +
    }
          20  +
    /// <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>
          21  +
    pub fn version_name(&self) -> ::std::option::Option<&str> {
          22  +
        self.version_name.as_deref()
          23  +
    }
          24  +
    /// <p>The document version for which you want information.</p>
          25  +
    pub fn document_version(&self) -> ::std::option::Option<&str> {
          26  +
        self.document_version.as_deref()
          27  +
    }
          28  +
    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
          29  +
    pub fn document_format(&self) -> ::std::option::Option<&crate::types::DocumentFormat> {
          30  +
        self.document_format.as_ref()
          31  +
    }
          32  +
}
          33  +
static GETDOCUMENTINPUT_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#GetDocumentInput$Name",
          36  +
        "com.amazonaws.ssm.synthetic",
          37  +
        "GetDocumentInput",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::String,
          40  +
    "Name",
          41  +
    0,
          42  +
);
          43  +
static GETDOCUMENTINPUT_MEMBER_VERSION_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_parts(
          45  +
        "com.amazonaws.ssm.synthetic#GetDocumentInput$VersionName",
          46  +
        "com.amazonaws.ssm.synthetic",
          47  +
        "GetDocumentInput",
          48  +
    ),
          49  +
    ::aws_smithy_schema::ShapeType::String,
          50  +
    "VersionName",
          51  +
    1,
          52  +
);
          53  +
static GETDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          54  +
    ::aws_smithy_schema::ShapeId::from_parts(
          55  +
        "com.amazonaws.ssm.synthetic#GetDocumentInput$DocumentVersion",
          56  +
        "com.amazonaws.ssm.synthetic",
          57  +
        "GetDocumentInput",
          58  +
    ),
          59  +
    ::aws_smithy_schema::ShapeType::String,
          60  +
    "DocumentVersion",
          61  +
    2,
          62  +
);
          63  +
static GETDOCUMENTINPUT_MEMBER_DOCUMENT_FORMAT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          64  +
    ::aws_smithy_schema::ShapeId::from_parts(
          65  +
        "com.amazonaws.ssm.synthetic#GetDocumentInput$DocumentFormat",
          66  +
        "com.amazonaws.ssm.synthetic",
          67  +
        "GetDocumentInput",
          68  +
    ),
          69  +
    ::aws_smithy_schema::ShapeType::String,
          70  +
    "DocumentFormat",
          71  +
    3,
          72  +
);
          73  +
static GETDOCUMENTINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          74  +
    ::aws_smithy_schema::ShapeId::from_parts(
          75  +
        "com.amazonaws.ssm.synthetic#GetDocumentInput",
          76  +
        "com.amazonaws.ssm.synthetic",
          77  +
        "GetDocumentInput",
          78  +
    ),
          79  +
    ::aws_smithy_schema::ShapeType::Structure,
          80  +
    &[
          81  +
        &GETDOCUMENTINPUT_MEMBER_NAME,
          82  +
        &GETDOCUMENTINPUT_MEMBER_VERSION_NAME,
          83  +
        &GETDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION,
          84  +
        &GETDOCUMENTINPUT_MEMBER_DOCUMENT_FORMAT,
          85  +
    ],
          86  +
)
          87  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          88  +
.with_original_name("GetDocumentRequest");
          89  +
impl GetDocumentInput {
          90  +
    /// The schema for this shape.
          91  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETDOCUMENTINPUT_SCHEMA;
          92  +
}
          93  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetDocumentInput {
          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(&GETDOCUMENTINPUT_MEMBER_NAME, val)?;
         101  +
        }
         102  +
        if let Some(ref val) = self.version_name {
         103  +
            ser.write_string(&GETDOCUMENTINPUT_MEMBER_VERSION_NAME, val)?;
         104  +
        }
         105  +
        if let Some(ref val) = self.document_version {
         106  +
            ser.write_string(&GETDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION, val)?;
         107  +
        }
         108  +
        if let Some(ref val) = self.document_format {
         109  +
            ser.write_string(&GETDOCUMENTINPUT_MEMBER_DOCUMENT_FORMAT, val.as_str())?;
         110  +
        }
         111  +
        Ok(())
         112  +
    }
         113  +
}
         114  +
impl GetDocumentInput {
         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(&GETDOCUMENTINPUT_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.version_name = Some(deser.read_string(member)?);
         142  +
                    }
         143  +
                }
         144  +
                Some(2) => {
         145  +
                    if deser.is_null() {
         146  +
                        deser.read_null()?;
         147  +
                    } else {
         148  +
                        builder.document_version = Some(deser.read_string(member)?);
         149  +
                    }
         150  +
                }
         151  +
                Some(3) => {
         152  +
                    if deser.is_null() {
         153  +
                        deser.read_null()?;
         154  +
                    } else {
         155  +
                        builder.document_format = Some(crate::types::DocumentFormat::from(deser.read_string(member)?.as_str()));
         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 GetDocumentInput {
         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 GetDocumentInput {
         178  +
    /// Creates a new builder-style object to manufacture [`GetDocumentInput`](crate::operation::get_document::GetDocumentInput).
         179  +
    pub fn builder() -> crate::operation::get_document::builders::GetDocumentInputBuilder {
         180  +
        crate::operation::get_document::builders::GetDocumentInputBuilder::default()
         181  +
    }
         182  +
}
         183  +
         184  +
/// A builder for [`GetDocumentInput`](crate::operation::get_document::GetDocumentInput).
         185  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         186  +
#[non_exhaustive]
         187  +
pub struct GetDocumentInputBuilder {
         188  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         189  +
    pub(crate) version_name: ::std::option::Option<::std::string::String>,
         190  +
    pub(crate) document_version: ::std::option::Option<::std::string::String>,
         191  +
    pub(crate) document_format: ::std::option::Option<crate::types::DocumentFormat>,
         192  +
}
         193  +
impl GetDocumentInputBuilder {
         194  +
    /// <p>The name of the SSM document.</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 SSM document.</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 SSM document.</p>
         206  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         207  +
        &self.name
         208  +
    }
         209  +
    /// <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>
         210  +
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         211  +
        self.version_name = ::std::option::Option::Some(input.into());
         212  +
        self
         213  +
    }
         214  +
    /// <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>
         215  +
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         216  +
        self.version_name = input;
         217  +
        self
         218  +
    }
         219  +
    /// <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>
         220  +
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
         221  +
        &self.version_name
         222  +
    }
         223  +
    /// <p>The document version for which you want information.</p>
         224  +
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         225  +
        self.document_version = ::std::option::Option::Some(input.into());
         226  +
        self
         227  +
    }
         228  +
    /// <p>The document version for which you want information.</p>
         229  +
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         230  +
        self.document_version = input;
         231  +
        self
         232  +
    }
         233  +
    /// <p>The document version for which you want information.</p>
         234  +
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
         235  +
        &self.document_version
         236  +
    }
         237  +
    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
         238  +
    pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
         239  +
        self.document_format = ::std::option::Option::Some(input);
         240  +
        self
         241  +
    }
         242  +
    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
         243  +
    pub fn set_document_format(mut self, input: ::std::option::Option<crate::types::DocumentFormat>) -> Self {
         244  +
        self.document_format = input;
         245  +
        self
         246  +
    }
         247  +
    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
         248  +
    pub fn get_document_format(&self) -> &::std::option::Option<crate::types::DocumentFormat> {
         249  +
        &self.document_format
         250  +
    }
         251  +
    /// Consumes the builder and constructs a [`GetDocumentInput`](crate::operation::get_document::GetDocumentInput).
         252  +
    pub fn build(self) -> ::std::result::Result<crate::operation::get_document::GetDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
         253  +
        ::std::result::Result::Ok(crate::operation::get_document::GetDocumentInput {
         254  +
            name: self.name,
         255  +
            version_name: self.version_name,
         256  +
            document_version: self.document_version,
         257  +
            document_format: self.document_format,
         258  +
        })
         259  +
    }
         260  +
}