AWS SDK

AWS SDK

rev. 18b1dd205ff4335251e6dd0ecb88193de1b1cede (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,150 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Paginator for [`DescribeAvailablePatches`](crate::operation::describe_available_patches::DescribeAvailablePatches)
           3  +
pub struct DescribeAvailablePatchesPaginator {
           4  +
    handle: std::sync::Arc<crate::client::Handle>,
           5  +
    builder: crate::operation::describe_available_patches::builders::DescribeAvailablePatchesInputBuilder,
           6  +
    stop_on_duplicate_token: bool,
           7  +
}
           8  +
           9  +
impl DescribeAvailablePatchesPaginator {
          10  +
    /// Create a new paginator-wrapper
          11  +
    pub(crate) fn new(
          12  +
        handle: std::sync::Arc<crate::client::Handle>,
          13  +
        builder: crate::operation::describe_available_patches::builders::DescribeAvailablePatchesInputBuilder,
          14  +
    ) -> Self {
          15  +
        Self {
          16  +
            handle,
          17  +
            builder,
          18  +
            stop_on_duplicate_token: true,
          19  +
        }
          20  +
    }
          21  +
          22  +
    /// Set the page size
          23  +
    ///
          24  +
    /// _Note: this method will override any previously set value for `max_results`_
          25  +
    pub fn page_size(mut self, limit: i32) -> Self {
          26  +
        self.builder.max_results = ::std::option::Option::Some(limit);
          27  +
        self
          28  +
    }
          29  +
          30  +
    /// Create a flattened paginator
          31  +
    ///
          32  +
    /// This paginator automatically flattens results using `patches`. Queries to the underlying service
          33  +
    /// are dispatched lazily.
          34  +
    pub fn items(self) -> crate::operation::describe_available_patches::paginator::DescribeAvailablePatchesPaginatorItems {
          35  +
        crate::operation::describe_available_patches::paginator::DescribeAvailablePatchesPaginatorItems(self)
          36  +
    }
          37  +
          38  +
    /// Stop paginating when the service returns the same pagination token twice in a row.
          39  +
    ///
          40  +
    /// Defaults to true.
          41  +
    ///
          42  +
    /// For certain operations, it may be useful to continue on duplicate token. For example,
          43  +
    /// if an operation is for tailing a log file in real-time, then continuing may be desired.
          44  +
    /// This option can be set to `false` to accommodate these use cases.
          45  +
    pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
          46  +
        self.stop_on_duplicate_token = stop_on_duplicate_token;
          47  +
        self
          48  +
    }
          49  +
          50  +
    /// Create the pagination stream
          51  +
    ///
          52  +
    /// _Note:_ No requests will be dispatched until the stream is used
          53  +
    /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method).
          54  +
    pub fn send(
          55  +
        self,
          56  +
    ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream<
          57  +
        ::std::result::Result<
          58  +
            crate::operation::describe_available_patches::DescribeAvailablePatchesOutput,
          59  +
            ::aws_smithy_runtime_api::client::result::SdkError<
          60  +
                crate::operation::describe_available_patches::DescribeAvailablePatchesError,
          61  +
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          62  +
            >,
          63  +
        >,
          64  +
    > {
          65  +
        // Move individual fields out of self for the borrow checker
          66  +
        let builder = self.builder;
          67  +
        let handle = self.handle;
          68  +
        let runtime_plugins = crate::operation::describe_available_patches::DescribeAvailablePatches::operation_runtime_plugins(
          69  +
            handle.runtime_plugins.clone(),
          70  +
            &handle.conf,
          71  +
            ::std::option::Option::None,
          72  +
        )
          73  +
        .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new());
          74  +
        ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new(
          75  +
            move |tx| {
          76  +
                ::std::boxed::Box::pin(async move {
          77  +
                    // Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
          78  +
                    let mut input = match builder
          79  +
                        .build()
          80  +
                        .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)
          81  +
                    {
          82  +
                        ::std::result::Result::Ok(input) => input,
          83  +
                        ::std::result::Result::Err(e) => {
          84  +
                            let _ = tx.send(::std::result::Result::Err(e)).await;
          85  +
                            return;
          86  +
                        }
          87  +
                    };
          88  +
                    loop {
          89  +
                        let resp =
          90  +
                            crate::operation::describe_available_patches::DescribeAvailablePatches::orchestrate(&runtime_plugins, input.clone())
          91  +
                                .await;
          92  +
                        // If the input member is None or it was an error
          93  +
                        let done = match resp {
          94  +
                            ::std::result::Result::Ok(ref resp) => {
          95  +
                                let new_token = crate::lens::reflens_describe_available_patches_output_output_next_token(resp);
          96  +
                                // Pagination is exhausted when the next token is an empty string
          97  +
                                let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
          98  +
                                if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token {
          99  +
                                    true
         100  +
                                } else {
         101  +
                                    input.next_token = new_token.cloned();
         102  +
                                    is_empty
         103  +
                                }
         104  +
                            }
         105  +
                            ::std::result::Result::Err(_) => true,
         106  +
                        };
         107  +
                        if tx.send(resp).await.is_err() {
         108  +
                            // receiving end was dropped
         109  +
                            return;
         110  +
                        }
         111  +
                        if done {
         112  +
                            return;
         113  +
                        }
         114  +
                    }
         115  +
                })
         116  +
            },
         117  +
        ))
         118  +
    }
         119  +
}
         120  +
         121  +
/// Flattened paginator for `DescribeAvailablePatchesPaginator`
         122  +
///
         123  +
/// This is created with [`.items()`](DescribeAvailablePatchesPaginator::items)
         124  +
pub struct DescribeAvailablePatchesPaginatorItems(DescribeAvailablePatchesPaginator);
         125  +
         126  +
impl DescribeAvailablePatchesPaginatorItems {
         127  +
    /// Create the pagination stream
         128  +
    ///
         129  +
    /// _Note_: No requests will be dispatched until the stream is used
         130  +
    /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method).
         131  +
    ///
         132  +
    /// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect).
         133  +
    pub fn send(
         134  +
        self,
         135  +
    ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream<
         136  +
        ::std::result::Result<
         137  +
            crate::types::Patch,
         138  +
            ::aws_smithy_runtime_api::client::result::SdkError<
         139  +
                crate::operation::describe_available_patches::DescribeAvailablePatchesError,
         140  +
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
            >,
         142  +
        >,
         143  +
    > {
         144  +
        ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
         145  +
            crate::lens::lens_describe_available_patches_output_output_patches(page)
         146  +
                .unwrap_or_default()
         147  +
                .into_iter()
         148  +
        })
         149  +
    }
         150  +
}

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

@@ -0,1 +0,608 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `DescribeDocument`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct DescribeDocument;
           6  +
impl DescribeDocument {
           7  +
    /// Creates a new `DescribeDocument`
           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::describe_document::DescribeDocumentInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::describe_document::DescribeDocumentOutput::SCHEMA;
          15  +
    pub(crate) async fn orchestrate(
          16  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          17  +
        input: crate::operation::describe_document::DescribeDocumentInput,
          18  +
    ) -> ::std::result::Result<
          19  +
        crate::operation::describe_document::DescribeDocumentOutput,
          20  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          21  +
            crate::operation::describe_document::DescribeDocumentError,
          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::describe_document::DescribeDocumentError>()
          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::describe_document::DescribeDocumentOutput>()
          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::describe_document::DescribeDocumentInput,
          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", "DescribeDocument", 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.DescribeDocument",
          63  +
                "rpc.service" = "SSM",
          64  +
                "rpc.method" = "DescribeDocument",
          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 DescribeDocument {
         133  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
         134  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DescribeDocument");
         135  +
         136  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
         137  +
            DescribeDocumentRequestSerializer,
         138  +
        ));
         139  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         140  +
            DescribeDocumentResponseDeserializer,
         141  +
        ));
         142  +
         143  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         144  +
            crate::config::auth::Params::builder()
         145  +
                .operation_name("DescribeDocument")
         146  +
                .build()
         147  +
                .expect("required fields set"),
         148  +
        ));
         149  +
         150  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("DescribeDocument", "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("DescribeDocument")
         171  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         172  +
                DescribeDocumentTelemetryInputCaptureInterceptor,
         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  +
                DescribeDocumentEndpointParamsInterceptor,
         179  +
            ))
         180  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         181  +
                crate::operation::describe_document::DescribeDocumentError,
         182  +
            >::new())
         183  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         184  +
                crate::operation::describe_document::DescribeDocumentError,
         185  +
            >::new())
         186  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         187  +
                crate::operation::describe_document::DescribeDocumentError,
         188  +
            >::new())
         189  +
            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
         190  +
                crate::operation::describe_document::DescribeDocumentError,
         191  +
            >::new());
         192  +
         193  +
        ::std::borrow::Cow::Owned(rcb)
         194  +
    }
         195  +
}
         196  +
         197  +
#[derive(Debug)]
         198  +
struct DescribeDocumentTelemetryInputCaptureInterceptor;
         199  +
         200  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         201  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeDocumentTelemetryInputCaptureInterceptor {
         202  +
    fn name(&self) -> &'static str {
         203  +
        "DescribeDocumentTelemetryInputCaptureInterceptor"
         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::<DescribeDocumentInput>() 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("DocumentVersion") {
         236  +
            if let ::std::option::Option::Some(value) = input.document_version.as_deref() {
         237  +
                captured.insert("DocumentVersion", value);
         238  +
            }
         239  +
        }
         240  +
        if requested.should_capture("VersionName") {
         241  +
            if let ::std::option::Option::Some(value) = input.version_name.as_deref() {
         242  +
                captured.insert("VersionName", value);
         243  +
            }
         244  +
        }
         245  +
         246  +
        cfg.interceptor_state().store_put(captured);
         247  +
        ::std::result::Result::Ok(())
         248  +
    }
         249  +
}
         250  +
#[derive(Debug)]
         251  +
struct DescribeDocumentResponseDeserializer;
         252  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeDocumentResponseDeserializer {
         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::describe_document::DescribeDocumentError::unhandled(
         283  +
                            generic,
         284  +
                        )),
         285  +
                    ))
         286  +
                }
         287  +
            };
         288  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         289  +
            let err = match error_code {
         290  +
                "InternalServerError" => crate::operation::describe_document::DescribeDocumentError::InternalServerError({
         291  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         292  +
                        crate::types::error::InternalServerError::deserialize_with_response(
         293  +
                            &mut *deser,
         294  +
                            response.headers(),
         295  +
                            response.status().into(),
         296  +
                            body,
         297  +
                        )
         298  +
                    }) {
         299  +
                        ::std::result::Result::Ok(val) => val,
         300  +
                        ::std::result::Result::Err(e) => {
         301  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         302  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         303  +
                            ))
         304  +
                        }
         305  +
                    };
         306  +
                    tmp.meta = generic;
         307  +
                    if tmp.message.is_none() {
         308  +
                        tmp.message = _error_message;
         309  +
                    }
         310  +
                    tmp
         311  +
                }),
         312  +
                "InvalidDocument" => crate::operation::describe_document::DescribeDocumentError::InvalidDocument({
         313  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         314  +
                        crate::types::error::InvalidDocument::deserialize_with_response(
         315  +
                            &mut *deser,
         316  +
                            response.headers(),
         317  +
                            response.status().into(),
         318  +
                            body,
         319  +
                        )
         320  +
                    }) {
         321  +
                        ::std::result::Result::Ok(val) => val,
         322  +
                        ::std::result::Result::Err(e) => {
         323  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         324  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         325  +
                            ))
         326  +
                        }
         327  +
                    };
         328  +
                    tmp.meta = generic;
         329  +
                    if tmp.message.is_none() {
         330  +
                        tmp.message = _error_message;
         331  +
                    }
         332  +
                    tmp
         333  +
                }),
         334  +
                "InvalidDocumentVersion" => crate::operation::describe_document::DescribeDocumentError::InvalidDocumentVersion({
         335  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         336  +
                        crate::types::error::InvalidDocumentVersion::deserialize_with_response(
         337  +
                            &mut *deser,
         338  +
                            response.headers(),
         339  +
                            response.status().into(),
         340  +
                            body,
         341  +
                        )
         342  +
                    }) {
         343  +
                        ::std::result::Result::Ok(val) => val,
         344  +
                        ::std::result::Result::Err(e) => {
         345  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         346  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         347  +
                            ))
         348  +
                        }
         349  +
                    };
         350  +
                    tmp.meta = generic;
         351  +
                    if tmp.message.is_none() {
         352  +
                        tmp.message = _error_message;
         353  +
                    }
         354  +
                    tmp
         355  +
                }),
         356  +
                _ => {
         357  +
                    // Registry-backed, operation-scoped reification of an error whose
         358  +
                    // code this operation does not model directly: the operation's own
         359  +
                    // error registry is consulted first, then the lookup widens to the
         360  +
                    // service-wide error registry. On a hit, the reified error is attached
         361  +
                    // as the source of the returned unhandled error while its metadata
         362  +
                    // (code, message, request id) is preserved; on a miss the generic
         363  +
                    // error is returned unchanged.
         364  +
                    match protocol
         365  +
                        .deserialize_error_response(response, _cfg)
         366  +
                        .ok()
         367  +
                        .and_then(|mut deser| {
         368  +
                            ::aws_smithy_schema::registry::reify_error(
         369  +
                                crate::operation::describe_document::error_registry::REGISTRY
         370  +
                                    .or(&crate::error_type_registry::REGISTRY),
         371  +
                                error_code,
         372  +
                                &mut *deser,
         373  +
                            )
         374  +
                        }) {
         375  +
                        ::std::option::Option::Some(source) => <crate::operation::describe_document::DescribeDocumentError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
         376  +
                        ::std::option::Option::None => crate::operation::describe_document::DescribeDocumentError::generic(generic),
         377  +
                    }
         378  +
                }
         379  +
            };
         380  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         381  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         382  +
            ))
         383  +
        } else {
         384  +
            let protocol = _cfg
         385  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         386  +
                .expect("a SharedClientProtocol is required");
         387  +
            let mut deser = protocol
         388  +
                .deserialize_response(response, DescribeDocument::OUTPUT_SCHEMA, _cfg)
         389  +
                .map_err(|e| {
         390  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         391  +
                })?;
         392  +
            // body and headers are already in scope from the top of the function;
         393  +
            // alias `headers` as `_response_headers` so MutateOutput
         394  +
            // customizations have a stable name to read from.
         395  +
            let _response_headers = headers;
         396  +
            #[allow(unused_mut)]
         397  +
            let mut output = crate::operation::describe_document::DescribeDocumentOutput::deserialize_with_response(
         398  +
                &mut *deser,
         399  +
                _response_headers,
         400  +
                response.status().into(),
         401  +
                body,
         402  +
            )
         403  +
            .map_err(|e| {
         404  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         405  +
            })?;
         406  +
            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
         407  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         408  +
        }
         409  +
    }
         410  +
}
         411  +
#[derive(Debug)]
         412  +
struct DescribeDocumentRequestSerializer;
         413  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeDocumentRequestSerializer {
         414  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         415  +
    fn serialize_input(
         416  +
        &self,
         417  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         418  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         419  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         420  +
        let input = input
         421  +
            .downcast::<crate::operation::describe_document::DescribeDocumentInput>()
         422  +
            .expect("correct type");
         423  +
         424  +
        let protocol = _cfg
         425  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         426  +
            .expect("a SharedClientProtocol is required");
         427  +
        let mut request = protocol
         428  +
            .serialize_request(&input, DescribeDocument::INPUT_SCHEMA, "/", _cfg)
         429  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         430  +
         431  +
        return ::std::result::Result::Ok(request);
         432  +
    }
         433  +
}
         434  +
#[derive(Debug)]
         435  +
struct DescribeDocumentEndpointParamsInterceptor;
         436  +
         437  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         438  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeDocumentEndpointParamsInterceptor {
         439  +
    fn name(&self) -> &'static str {
         440  +
        "DescribeDocumentEndpointParamsInterceptor"
         441  +
    }
         442  +
         443  +
    fn read_before_execution(
         444  +
        &self,
         445  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         446  +
            '_,
         447  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         448  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         449  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         450  +
        >,
         451  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         452  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         453  +
        let _input = context
         454  +
            .input()
         455  +
            .downcast_ref::<DescribeDocumentInput>()
         456  +
            .ok_or("failed to downcast to DescribeDocumentInput")?;
         457  +
         458  +
        let params = crate::config::endpoint::Params::builder()
         459  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         460  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         461  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         462  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         463  +
            .build()
         464  +
            .map_err(|err| {
         465  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         466  +
            })?;
         467  +
        cfg.interceptor_state()
         468  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         469  +
        ::std::result::Result::Ok(())
         470  +
    }
         471  +
}
         472  +
         473  +
// The get_* functions below are generated from JMESPath expressions in the
         474  +
// operationContextParams trait. They target the operation's input shape.
         475  +
         476  +
/// Error type for the `DescribeDocumentError` operation.
         477  +
#[non_exhaustive]
         478  +
#[derive(::std::fmt::Debug)]
         479  +
pub enum DescribeDocumentError {
         480  +
    /// <p>An error occurred on the server side.</p>
         481  +
    InternalServerError(crate::types::error::InternalServerError),
         482  +
    /// <p>The specified SSM document doesn't exist.</p>
         483  +
    InvalidDocument(crate::types::error::InvalidDocument),
         484  +
    /// <p>The document version isn't valid or doesn't exist.</p>
         485  +
    InvalidDocumentVersion(crate::types::error::InvalidDocumentVersion),
         486  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         487  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         488  +
    variable wildcard pattern and check `.code()`:
         489  +
     \
         490  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         491  +
     \
         492  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DescribeDocumentError) for what information is available for the error.")]
         493  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         494  +
}
         495  +
impl DescribeDocumentError {
         496  +
    /// Creates the `DescribeDocumentError::Unhandled` variant from any error type.
         497  +
    pub fn unhandled(
         498  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         499  +
    ) -> Self {
         500  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         501  +
            source: err.into(),
         502  +
            meta: ::std::default::Default::default(),
         503  +
        })
         504  +
    }
         505  +
         506  +
    /// Creates the `DescribeDocumentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         507  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         508  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         509  +
            source: err.clone().into(),
         510  +
            meta: err,
         511  +
        })
         512  +
    }
         513  +
    ///
         514  +
    /// Returns error metadata, which includes the error code, message,
         515  +
    /// request ID, and potentially additional information.
         516  +
    ///
         517  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         518  +
        match self {
         519  +
            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         520  +
            Self::InvalidDocument(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         521  +
            Self::InvalidDocumentVersion(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         522  +
            Self::Unhandled(e) => &e.meta,
         523  +
        }
         524  +
    }
         525  +
    /// Returns `true` if the error kind is `DescribeDocumentError::InternalServerError`.
         526  +
    pub fn is_internal_server_error(&self) -> bool {
         527  +
        matches!(self, Self::InternalServerError(_))
         528  +
    }
         529  +
    /// Returns `true` if the error kind is `DescribeDocumentError::InvalidDocument`.
         530  +
    pub fn is_invalid_document(&self) -> bool {
         531  +
        matches!(self, Self::InvalidDocument(_))
         532  +
    }
         533  +
    /// Returns `true` if the error kind is `DescribeDocumentError::InvalidDocumentVersion`.
         534  +
    pub fn is_invalid_document_version(&self) -> bool {
         535  +
        matches!(self, Self::InvalidDocumentVersion(_))
         536  +
    }
         537  +
}
         538  +
impl ::std::error::Error for DescribeDocumentError {
         539  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         540  +
        match self {
         541  +
            Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
         542  +
            Self::InvalidDocument(_inner) => ::std::option::Option::Some(_inner),
         543  +
            Self::InvalidDocumentVersion(_inner) => ::std::option::Option::Some(_inner),
         544  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         545  +
        }
         546  +
    }
         547  +
}
         548  +
impl ::std::fmt::Display for DescribeDocumentError {
         549  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         550  +
        match self {
         551  +
            Self::InternalServerError(_inner) => _inner.fmt(f),
         552  +
            Self::InvalidDocument(_inner) => _inner.fmt(f),
         553  +
            Self::InvalidDocumentVersion(_inner) => _inner.fmt(f),
         554  +
            Self::Unhandled(_inner) => {
         555  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         556  +
                    write!(f, "unhandled error ({code})")
         557  +
                } else {
         558  +
                    f.write_str("unhandled error")
         559  +
                }
         560  +
            }
         561  +
        }
         562  +
    }
         563  +
}
         564  +
impl ::aws_smithy_types::retry::ProvideErrorKind for DescribeDocumentError {
         565  +
    fn code(&self) -> ::std::option::Option<&str> {
         566  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         567  +
    }
         568  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         569  +
        ::std::option::Option::None
         570  +
    }
         571  +
}
         572  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DescribeDocumentError {
         573  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         574  +
        match self {
         575  +
            Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         576  +
            Self::InvalidDocument(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         577  +
            Self::InvalidDocumentVersion(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         578  +
            Self::Unhandled(_inner) => &_inner.meta,
         579  +
        }
         580  +
    }
         581  +
}
         582  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DescribeDocumentError {
         583  +
    fn create_unhandled_error(
         584  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         585  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         586  +
    ) -> Self {
         587  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         588  +
            source,
         589  +
            meta: meta.unwrap_or_default(),
         590  +
        })
         591  +
    }
         592  +
}
         593  +
impl ::aws_types::request_id::RequestId for crate::operation::describe_document::DescribeDocumentError {
         594  +
    fn request_id(&self) -> Option<&str> {
         595  +
        self.meta().request_id()
         596  +
    }
         597  +
}
         598  +
         599  +
pub use crate::operation::describe_document::_describe_document_input::DescribeDocumentInput;
         600  +
         601  +
pub use crate::operation::describe_document::_describe_document_output::DescribeDocumentOutput;
         602  +
         603  +
mod _describe_document_input;
         604  +
         605  +
mod _describe_document_output;
         606  +
         607  +
/// Builders
         608  +
pub mod builders;

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

@@ -0,1 +0,229 @@
           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 DescribeDocumentInput {
           6  +
    /// <p>The name of the SSM document.</p><note>
           7  +
    /// <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>
           8  +
    /// </note>
           9  +
    pub name: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>The document version for which you want information. Can be a specific version or the default version.</p>
          11  +
    pub document_version: ::std::option::Option<::std::string::String>,
          12  +
    /// <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>
          13  +
    pub version_name: ::std::option::Option<::std::string::String>,
          14  +
}
          15  +
impl DescribeDocumentInput {
          16  +
    /// <p>The name of the SSM document.</p><note>
          17  +
    /// <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>
          18  +
    /// </note>
          19  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          20  +
        self.name.as_deref()
          21  +
    }
          22  +
    /// <p>The document version for which you want information. Can be a specific version or the default version.</p>
          23  +
    pub fn document_version(&self) -> ::std::option::Option<&str> {
          24  +
        self.document_version.as_deref()
          25  +
    }
          26  +
    /// <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>
          27  +
    pub fn version_name(&self) -> ::std::option::Option<&str> {
          28  +
        self.version_name.as_deref()
          29  +
    }
          30  +
}
          31  +
static DESCRIBEDOCUMENTINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_parts(
          33  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentInput$Name",
          34  +
        "com.amazonaws.ssm.synthetic",
          35  +
        "DescribeDocumentInput",
          36  +
    ),
          37  +
    ::aws_smithy_schema::ShapeType::String,
          38  +
    "Name",
          39  +
    0,
          40  +
);
          41  +
static DESCRIBEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          42  +
    ::aws_smithy_schema::ShapeId::from_parts(
          43  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentInput$DocumentVersion",
          44  +
        "com.amazonaws.ssm.synthetic",
          45  +
        "DescribeDocumentInput",
          46  +
    ),
          47  +
    ::aws_smithy_schema::ShapeType::String,
          48  +
    "DocumentVersion",
          49  +
    1,
          50  +
);
          51  +
static DESCRIBEDOCUMENTINPUT_MEMBER_VERSION_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          52  +
    ::aws_smithy_schema::ShapeId::from_parts(
          53  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentInput$VersionName",
          54  +
        "com.amazonaws.ssm.synthetic",
          55  +
        "DescribeDocumentInput",
          56  +
    ),
          57  +
    ::aws_smithy_schema::ShapeType::String,
          58  +
    "VersionName",
          59  +
    2,
          60  +
);
          61  +
static DESCRIBEDOCUMENTINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          62  +
    ::aws_smithy_schema::ShapeId::from_parts(
          63  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentInput",
          64  +
        "com.amazonaws.ssm.synthetic",
          65  +
        "DescribeDocumentInput",
          66  +
    ),
          67  +
    ::aws_smithy_schema::ShapeType::Structure,
          68  +
    &[
          69  +
        &DESCRIBEDOCUMENTINPUT_MEMBER_NAME,
          70  +
        &DESCRIBEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION,
          71  +
        &DESCRIBEDOCUMENTINPUT_MEMBER_VERSION_NAME,
          72  +
    ],
          73  +
)
          74  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          75  +
.with_original_name("DescribeDocumentRequest");
          76  +
impl DescribeDocumentInput {
          77  +
    /// The schema for this shape.
          78  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEDOCUMENTINPUT_SCHEMA;
          79  +
}
          80  +
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeDocumentInput {
          81  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          82  +
    fn serialize_members(
          83  +
        &self,
          84  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          85  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          86  +
        if let Some(ref val) = self.name {
          87  +
            ser.write_string(&DESCRIBEDOCUMENTINPUT_MEMBER_NAME, val)?;
          88  +
        }
          89  +
        if let Some(ref val) = self.document_version {
          90  +
            ser.write_string(&DESCRIBEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION, val)?;
          91  +
        }
          92  +
        if let Some(ref val) = self.version_name {
          93  +
            ser.write_string(&DESCRIBEDOCUMENTINPUT_MEMBER_VERSION_NAME, val)?;
          94  +
        }
          95  +
        Ok(())
          96  +
    }
          97  +
}
          98  +
impl DescribeDocumentInput {
          99  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         100  +
    pub fn deserialize(
         101  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         102  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         103  +
        #[allow(unused_variables, unused_mut)]
         104  +
        let mut builder = Self::builder();
         105  +
        #[allow(
         106  +
            unused_variables,
         107  +
            unreachable_code,
         108  +
            clippy::single_match,
         109  +
            clippy::match_single_binding,
         110  +
            clippy::diverging_sub_expression
         111  +
        )]
         112  +
        deserializer.read_struct(&DESCRIBEDOCUMENTINPUT_SCHEMA, &mut |member, deser| {
         113  +
            match member.member_index() {
         114  +
                Some(0) => {
         115  +
                    if deser.is_null() {
         116  +
                        deser.read_null()?;
         117  +
                    } else {
         118  +
                        builder.name = Some(deser.read_string(member)?);
         119  +
                    }
         120  +
                }
         121  +
                Some(1) => {
         122  +
                    if deser.is_null() {
         123  +
                        deser.read_null()?;
         124  +
                    } else {
         125  +
                        builder.document_version = Some(deser.read_string(member)?);
         126  +
                    }
         127  +
                }
         128  +
                Some(2) => {
         129  +
                    if deser.is_null() {
         130  +
                        deser.read_null()?;
         131  +
                    } else {
         132  +
                        builder.version_name = Some(deser.read_string(member)?);
         133  +
                    }
         134  +
                }
         135  +
                _ => {}
         136  +
            }
         137  +
            Ok(())
         138  +
        })?;
         139  +
        builder.name = builder.name.or(Some(String::new()));
         140  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         141  +
    }
         142  +
}
         143  +
impl DescribeDocumentInput {
         144  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         145  +
    pub fn deserialize_with_response(
         146  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         147  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         148  +
        _status: u16,
         149  +
        _body: &[u8],
         150  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         151  +
        Self::deserialize(deserializer)
         152  +
    }
         153  +
}
         154  +
impl DescribeDocumentInput {
         155  +
    /// Creates a new builder-style object to manufacture [`DescribeDocumentInput`](crate::operation::describe_document::DescribeDocumentInput).
         156  +
    pub fn builder() -> crate::operation::describe_document::builders::DescribeDocumentInputBuilder {
         157  +
        crate::operation::describe_document::builders::DescribeDocumentInputBuilder::default()
         158  +
    }
         159  +
}
         160  +
         161  +
/// A builder for [`DescribeDocumentInput`](crate::operation::describe_document::DescribeDocumentInput).
         162  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         163  +
#[non_exhaustive]
         164  +
pub struct DescribeDocumentInputBuilder {
         165  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         166  +
    pub(crate) document_version: ::std::option::Option<::std::string::String>,
         167  +
    pub(crate) version_name: ::std::option::Option<::std::string::String>,
         168  +
}
         169  +
impl DescribeDocumentInputBuilder {
         170  +
    /// <p>The name of the SSM document.</p><note>
         171  +
    /// <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>
         172  +
    /// </note>
         173  +
    /// This field is required.
         174  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         175  +
        self.name = ::std::option::Option::Some(input.into());
         176  +
        self
         177  +
    }
         178  +
    /// <p>The name of the SSM document.</p><note>
         179  +
    /// <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>
         180  +
    /// </note>
         181  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         182  +
        self.name = input;
         183  +
        self
         184  +
    }
         185  +
    /// <p>The name of the SSM document.</p><note>
         186  +
    /// <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>
         187  +
    /// </note>
         188  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         189  +
        &self.name
         190  +
    }
         191  +
    /// <p>The document version for which you want information. Can be a specific version or the default version.</p>
         192  +
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         193  +
        self.document_version = ::std::option::Option::Some(input.into());
         194  +
        self
         195  +
    }
         196  +
    /// <p>The document version for which you want information. Can be a specific version or the default version.</p>
         197  +
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         198  +
        self.document_version = input;
         199  +
        self
         200  +
    }
         201  +
    /// <p>The document version for which you want information. Can be a specific version or the default version.</p>
         202  +
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
         203  +
        &self.document_version
         204  +
    }
         205  +
    /// <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>
         206  +
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         207  +
        self.version_name = ::std::option::Option::Some(input.into());
         208  +
        self
         209  +
    }
         210  +
    /// <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>
         211  +
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         212  +
        self.version_name = input;
         213  +
        self
         214  +
    }
         215  +
    /// <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>
         216  +
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
         217  +
        &self.version_name
         218  +
    }
         219  +
    /// Consumes the builder and constructs a [`DescribeDocumentInput`](crate::operation::describe_document::DescribeDocumentInput).
         220  +
    pub fn build(
         221  +
        self,
         222  +
    ) -> ::std::result::Result<crate::operation::describe_document::DescribeDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
         223  +
        ::std::result::Result::Ok(crate::operation::describe_document::DescribeDocumentInput {
         224  +
            name: self.name,
         225  +
            document_version: self.document_version,
         226  +
            version_name: self.version_name,
         227  +
        })
         228  +
    }
         229  +
}

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

@@ -0,1 +0,183 @@
           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 DescribeDocumentOutput {
           6  +
    /// <p>Information about the SSM document.</p>
           7  +
    pub document: ::std::option::Option<crate::types::DocumentDescription>,
           8  +
    _request_id: Option<String>,
           9  +
}
          10  +
impl DescribeDocumentOutput {
          11  +
    /// <p>Information about the SSM document.</p>
          12  +
    pub fn document(&self) -> ::std::option::Option<&crate::types::DocumentDescription> {
          13  +
        self.document.as_ref()
          14  +
    }
          15  +
}
          16  +
static DESCRIBEDOCUMENTOUTPUT_MEMBER_DOCUMENT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          17  +
    ::aws_smithy_schema::ShapeId::from_parts(
          18  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentOutput$Document",
          19  +
        "com.amazonaws.ssm.synthetic",
          20  +
        "DescribeDocumentOutput",
          21  +
    ),
          22  +
    ::aws_smithy_schema::ShapeType::Structure,
          23  +
    "Document",
          24  +
    0,
          25  +
);
          26  +
static DESCRIBEDOCUMENTOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          27  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          28  +
    ::aws_smithy_schema::ShapeType::String,
          29  +
    "request_id",
          30  +
    1,
          31  +
)
          32  +
.with_http_header("x-amzn-requestid");
          33  +
static DESCRIBEDOCUMENTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          34  +
    ::aws_smithy_schema::ShapeId::from_parts(
          35  +
        "com.amazonaws.ssm.synthetic#DescribeDocumentOutput",
          36  +
        "com.amazonaws.ssm.synthetic",
          37  +
        "DescribeDocumentOutput",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::Structure,
          40  +
    &[&DESCRIBEDOCUMENTOUTPUT_MEMBER_DOCUMENT, &DESCRIBEDOCUMENTOUTPUT_MEMBER__REQUEST_ID],
          41  +
)
          42  +
.with_original_name("DescribeDocumentResult");
          43  +
impl DescribeDocumentOutput {
          44  +
    /// The schema for this shape.
          45  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEDOCUMENTOUTPUT_SCHEMA;
          46  +
}
          47  +
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeDocumentOutput {
          48  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          49  +
    fn serialize_members(
          50  +
        &self,
          51  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          52  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          53  +
        if let Some(ref val) = self.document {
          54  +
            ser.write_struct(&DESCRIBEDOCUMENTOUTPUT_MEMBER_DOCUMENT, val)?;
          55  +
        }
          56  +
        Ok(())
          57  +
    }
          58  +
}
          59  +
impl DescribeDocumentOutput {
          60  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          61  +
    pub fn deserialize(
          62  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          63  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          64  +
        #[allow(unused_variables, unused_mut)]
          65  +
        let mut builder = Self::builder();
          66  +
        #[allow(
          67  +
            unused_variables,
          68  +
            unreachable_code,
          69  +
            clippy::single_match,
          70  +
            clippy::match_single_binding,
          71  +
            clippy::diverging_sub_expression
          72  +
        )]
          73  +
        deserializer.read_struct(&DESCRIBEDOCUMENTOUTPUT_SCHEMA, &mut |member, deser| {
          74  +
            match member.member_index() {
          75  +
                Some(0) => {
          76  +
                    if deser.is_null() {
          77  +
                        deser.read_null()?;
          78  +
                    } else {
          79  +
                        builder.document = Some(crate::types::DocumentDescription::deserialize(deser)?);
          80  +
                    }
          81  +
                }
          82  +
                Some(1) => {
          83  +
                    builder._request_id = Some(deser.read_string(member)?);
          84  +
                }
          85  +
                _ => {}
          86  +
            }
          87  +
            Ok(())
          88  +
        })?;
          89  +
        Ok(builder.build())
          90  +
    }
          91  +
}
          92  +
impl DescribeDocumentOutput {
          93  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          94  +
    /// Header-bound members are read directly from headers, avoiding runtime
          95  +
    /// member iteration overhead. Body members are read via the deserializer.
          96  +
    pub fn deserialize_with_response(
          97  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          98  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          99  +
        _status: u16,
         100  +
        _body: &[u8],
         101  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         102  +
        #[allow(unused_variables, unused_mut)]
         103  +
        let mut builder = Self::builder();
         104  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         105  +
            builder._request_id = Some(val.to_string());
         106  +
        }
         107  +
         108  +
        #[allow(
         109  +
            unused_variables,
         110  +
            unreachable_code,
         111  +
            clippy::single_match,
         112  +
            clippy::match_single_binding,
         113  +
            clippy::diverging_sub_expression
         114  +
        )]
         115  +
        deserializer.read_struct(&DESCRIBEDOCUMENTOUTPUT_SCHEMA, &mut |member, deser| {
         116  +
            match member.member_index() {
         117  +
                Some(0) => {
         118  +
                    builder.document = Some(crate::types::DocumentDescription::deserialize(deser)?);
         119  +
                }
         120  +
                _ => {}
         121  +
            }
         122  +
            Ok(())
         123  +
        })?;
         124  +
        Ok(builder.build())
         125  +
    }
         126  +
}
         127  +
impl ::aws_types::request_id::RequestId for DescribeDocumentOutput {
         128  +
    fn request_id(&self) -> Option<&str> {
         129  +
        self._request_id.as_deref()
         130  +
    }
         131  +
}
         132  +
impl DescribeDocumentOutput {
         133  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         134  +
        self._request_id = request_id;
         135  +
        self
         136  +
    }
         137  +
}
         138  +
impl DescribeDocumentOutput {
         139  +
    /// Creates a new builder-style object to manufacture [`DescribeDocumentOutput`](crate::operation::describe_document::DescribeDocumentOutput).
         140  +
    pub fn builder() -> crate::operation::describe_document::builders::DescribeDocumentOutputBuilder {
         141  +
        crate::operation::describe_document::builders::DescribeDocumentOutputBuilder::default()
         142  +
    }
         143  +
}
         144  +
         145  +
/// A builder for [`DescribeDocumentOutput`](crate::operation::describe_document::DescribeDocumentOutput).
         146  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         147  +
#[non_exhaustive]
         148  +
pub struct DescribeDocumentOutputBuilder {
         149  +
    pub(crate) document: ::std::option::Option<crate::types::DocumentDescription>,
         150  +
    _request_id: Option<String>,
         151  +
}
         152  +
impl DescribeDocumentOutputBuilder {
         153  +
    /// <p>Information about the SSM document.</p>
         154  +
    pub fn document(mut self, input: crate::types::DocumentDescription) -> Self {
         155  +
        self.document = ::std::option::Option::Some(input);
         156  +
        self
         157  +
    }
         158  +
    /// <p>Information about the SSM document.</p>
         159  +
    pub fn set_document(mut self, input: ::std::option::Option<crate::types::DocumentDescription>) -> Self {
         160  +
        self.document = input;
         161  +
        self
         162  +
    }
         163  +
    /// <p>Information about the SSM document.</p>
         164  +
    pub fn get_document(&self) -> &::std::option::Option<crate::types::DocumentDescription> {
         165  +
        &self.document
         166  +
    }
         167  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         168  +
        self._request_id = Some(request_id.into());
         169  +
        self
         170  +
    }
         171  +
         172  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         173  +
        self._request_id = request_id;
         174  +
        self
         175  +
    }
         176  +
    /// Consumes the builder and constructs a [`DescribeDocumentOutput`](crate::operation::describe_document::DescribeDocumentOutput).
         177  +
    pub fn build(self) -> crate::operation::describe_document::DescribeDocumentOutput {
         178  +
        crate::operation::describe_document::DescribeDocumentOutput {
         179  +
            document: self.document,
         180  +
            _request_id: self._request_id,
         181  +
        }
         182  +
    }
         183  +
}