AWS SDK

AWS SDK

rev. 97ba95e6039d206ffea5b866ddc214d34f7f88c3

Files changed:

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

@@ -0,1 +0,131 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::get_patch_baseline::_get_patch_baseline_input::GetPatchBaselineInputBuilder;
           3  +
           4  +
pub use crate::operation::get_patch_baseline::_get_patch_baseline_output::GetPatchBaselineOutputBuilder;
           5  +
           6  +
impl crate::operation::get_patch_baseline::builders::GetPatchBaselineInputBuilder {
           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_patch_baseline::GetPatchBaselineOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::get_patch_baseline::GetPatchBaselineError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.get_patch_baseline();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `GetPatchBaseline`.
          24  +
///
          25  +
/// <p>Retrieves information about a patch baseline.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct GetPatchBaselineFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::get_patch_baseline::builders::GetPatchBaselineInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::get_patch_baseline::GetPatchBaselineOutput,
          35  +
        crate::operation::get_patch_baseline::GetPatchBaselineError,
          36  +
    > for GetPatchBaselineFluentBuilder
          37  +
{
          38  +
    fn send(
          39  +
        self,
          40  +
        config_override: crate::config::Builder,
          41  +
    ) -> crate::client::customize::internal::BoxFuture<
          42  +
        crate::client::customize::internal::SendResult<
          43  +
            crate::operation::get_patch_baseline::GetPatchBaselineOutput,
          44  +
            crate::operation::get_patch_baseline::GetPatchBaselineError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl GetPatchBaselineFluentBuilder {
          51  +
    /// Creates a new `GetPatchBaselineFluentBuilder`.
          52  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          53  +
        Self {
          54  +
            handle,
          55  +
            inner: ::std::default::Default::default(),
          56  +
            config_override: ::std::option::Option::None,
          57  +
        }
          58  +
    }
          59  +
    /// Access the GetPatchBaseline as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::get_patch_baseline::builders::GetPatchBaselineInputBuilder {
          61  +
        &self.inner
          62  +
    }
          63  +
    /// Sends the request and returns the response.
          64  +
    ///
          65  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          66  +
    /// can be matched against.
          67  +
    ///
          68  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          69  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          70  +
    /// set when configuring the client.
          71  +
    pub async fn send(
          72  +
        self,
          73  +
    ) -> ::std::result::Result<
          74  +
        crate::operation::get_patch_baseline::GetPatchBaselineOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::get_patch_baseline::GetPatchBaselineError,
          77  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          78  +
        >,
          79  +
    > {
          80  +
        let input = self
          81  +
            .inner
          82  +
            .build()
          83  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          84  +
        let runtime_plugins = crate::operation::get_patch_baseline::GetPatchBaseline::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::get_patch_baseline::GetPatchBaseline::orchestrate(&runtime_plugins, input).await
          90  +
    }
          91  +
          92  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          93  +
    pub fn customize(
          94  +
        self,
          95  +
    ) -> crate::client::customize::CustomizableOperation<
          96  +
        crate::operation::get_patch_baseline::GetPatchBaselineOutput,
          97  +
        crate::operation::get_patch_baseline::GetPatchBaselineError,
          98  +
        Self,
          99  +
    > {
         100  +
        crate::client::customize::CustomizableOperation::new(self)
         101  +
    }
         102  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         103  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         104  +
        self
         105  +
    }
         106  +
         107  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         108  +
        self.config_override = config_override;
         109  +
        self
         110  +
    }
         111  +
    /// <p>The ID of the patch baseline to retrieve.</p><note>
         112  +
    /// <p>To retrieve information about an Amazon Web Services managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline <code>AWS-AmazonLinuxDefaultPatchBaseline</code>, specify <code>arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7</code> instead of <code>pb-0e392de35e7c563b7</code>.</p>
         113  +
    /// </note>
         114  +
    pub fn baseline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         115  +
        self.inner = self.inner.baseline_id(input.into());
         116  +
        self
         117  +
    }
         118  +
    /// <p>The ID of the patch baseline to retrieve.</p><note>
         119  +
    /// <p>To retrieve information about an Amazon Web Services managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline <code>AWS-AmazonLinuxDefaultPatchBaseline</code>, specify <code>arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7</code> instead of <code>pb-0e392de35e7c563b7</code>.</p>
         120  +
    /// </note>
         121  +
    pub fn set_baseline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         122  +
        self.inner = self.inner.set_baseline_id(input);
         123  +
        self
         124  +
    }
         125  +
    /// <p>The ID of the patch baseline to retrieve.</p><note>
         126  +
    /// <p>To retrieve information about an Amazon Web Services managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline <code>AWS-AmazonLinuxDefaultPatchBaseline</code>, specify <code>arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7</code> instead of <code>pb-0e392de35e7c563b7</code>.</p>
         127  +
    /// </note>
         128  +
    pub fn get_baseline_id(&self) -> &::std::option::Option<::std::string::String> {
         129  +
        self.inner.get_baseline_id()
         130  +
    }
         131  +
}

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

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

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

@@ -0,1 +0,179 @@
           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 GetPatchBaselineForPatchGroupInput {
           6  +
    /// <p>The name of the patch group whose patch baseline should be retrieved.</p>
           7  +
    pub patch_group: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>Returns the operating system rule specified for patch groups using the patch baseline. The default value is <code>WINDOWS</code>.</p>
           9  +
    pub operating_system: ::std::option::Option<crate::types::OperatingSystem>,
          10  +
}
          11  +
impl GetPatchBaselineForPatchGroupInput {
          12  +
    /// <p>The name of the patch group whose patch baseline should be retrieved.</p>
          13  +
    pub fn patch_group(&self) -> ::std::option::Option<&str> {
          14  +
        self.patch_group.as_deref()
          15  +
    }
          16  +
    /// <p>Returns the operating system rule specified for patch groups using the patch baseline. The default value is <code>WINDOWS</code>.</p>
          17  +
    pub fn operating_system(&self) -> ::std::option::Option<&crate::types::OperatingSystem> {
          18  +
        self.operating_system.as_ref()
          19  +
    }
          20  +
}
          21  +
static GETPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_PATCH_GROUP: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          22  +
    ::aws_smithy_schema::ShapeId::from_parts(
          23  +
        "com.amazonaws.ssm.synthetic#GetPatchBaselineForPatchGroupInput$PatchGroup",
          24  +
        "com.amazonaws.ssm.synthetic",
          25  +
        "GetPatchBaselineForPatchGroupInput",
          26  +
    ),
          27  +
    ::aws_smithy_schema::ShapeType::String,
          28  +
    "PatchGroup",
          29  +
    0,
          30  +
);
          31  +
static GETPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_OPERATING_SYSTEM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_parts(
          33  +
        "com.amazonaws.ssm.synthetic#GetPatchBaselineForPatchGroupInput$OperatingSystem",
          34  +
        "com.amazonaws.ssm.synthetic",
          35  +
        "GetPatchBaselineForPatchGroupInput",
          36  +
    ),
          37  +
    ::aws_smithy_schema::ShapeType::String,
          38  +
    "OperatingSystem",
          39  +
    1,
          40  +
);
          41  +
static GETPATCHBASELINEFORPATCHGROUPINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          42  +
    ::aws_smithy_schema::ShapeId::from_parts(
          43  +
        "com.amazonaws.ssm.synthetic#GetPatchBaselineForPatchGroupInput",
          44  +
        "com.amazonaws.ssm.synthetic",
          45  +
        "GetPatchBaselineForPatchGroupInput",
          46  +
    ),
          47  +
    ::aws_smithy_schema::ShapeType::Structure,
          48  +
    &[
          49  +
        &GETPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_PATCH_GROUP,
          50  +
        &GETPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_OPERATING_SYSTEM,
          51  +
    ],
          52  +
)
          53  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          54  +
.with_original_name("GetPatchBaselineForPatchGroupRequest");
          55  +
impl GetPatchBaselineForPatchGroupInput {
          56  +
    /// The schema for this shape.
          57  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETPATCHBASELINEFORPATCHGROUPINPUT_SCHEMA;
          58  +
}
          59  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetPatchBaselineForPatchGroupInput {
          60  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          61  +
    fn serialize_members(
          62  +
        &self,
          63  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          64  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          65  +
        if let Some(ref val) = self.patch_group {
          66  +
            ser.write_string(&GETPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_PATCH_GROUP, val)?;
          67  +
        }
          68  +
        if let Some(ref val) = self.operating_system {
          69  +
            ser.write_string(&GETPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_OPERATING_SYSTEM, val.as_str())?;
          70  +
        }
          71  +
        Ok(())
          72  +
    }
          73  +
}
          74  +
impl GetPatchBaselineForPatchGroupInput {
          75  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          76  +
    pub fn deserialize(
          77  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          78  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          79  +
        #[allow(unused_variables, unused_mut)]
          80  +
        let mut builder = Self::builder();
          81  +
        #[allow(
          82  +
            unused_variables,
          83  +
            unreachable_code,
          84  +
            clippy::single_match,
          85  +
            clippy::match_single_binding,
          86  +
            clippy::diverging_sub_expression
          87  +
        )]
          88  +
        deserializer.read_struct(&GETPATCHBASELINEFORPATCHGROUPINPUT_SCHEMA, &mut |member, deser| {
          89  +
            match member.member_index() {
          90  +
                Some(0) => {
          91  +
                    if deser.is_null() {
          92  +
                        deser.read_null()?;
          93  +
                    } else {
          94  +
                        builder.patch_group = Some(deser.read_string(member)?);
          95  +
                    }
          96  +
                }
          97  +
                Some(1) => {
          98  +
                    if deser.is_null() {
          99  +
                        deser.read_null()?;
         100  +
                    } else {
         101  +
                        builder.operating_system = Some(crate::types::OperatingSystem::from(deser.read_string(member)?.as_str()));
         102  +
                    }
         103  +
                }
         104  +
                _ => {}
         105  +
            }
         106  +
            Ok(())
         107  +
        })?;
         108  +
        builder.patch_group = builder.patch_group.or(Some(String::new()));
         109  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         110  +
    }
         111  +
}
         112  +
impl GetPatchBaselineForPatchGroupInput {
         113  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         114  +
    pub fn deserialize_with_response(
         115  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         116  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         117  +
        _status: u16,
         118  +
        _body: &[u8],
         119  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         120  +
        Self::deserialize(deserializer)
         121  +
    }
         122  +
}
         123  +
impl GetPatchBaselineForPatchGroupInput {
         124  +
    /// Creates a new builder-style object to manufacture [`GetPatchBaselineForPatchGroupInput`](crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupInput).
         125  +
    pub fn builder() -> crate::operation::get_patch_baseline_for_patch_group::builders::GetPatchBaselineForPatchGroupInputBuilder {
         126  +
        crate::operation::get_patch_baseline_for_patch_group::builders::GetPatchBaselineForPatchGroupInputBuilder::default()
         127  +
    }
         128  +
}
         129  +
         130  +
/// A builder for [`GetPatchBaselineForPatchGroupInput`](crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupInput).
         131  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         132  +
#[non_exhaustive]
         133  +
pub struct GetPatchBaselineForPatchGroupInputBuilder {
         134  +
    pub(crate) patch_group: ::std::option::Option<::std::string::String>,
         135  +
    pub(crate) operating_system: ::std::option::Option<crate::types::OperatingSystem>,
         136  +
}
         137  +
impl GetPatchBaselineForPatchGroupInputBuilder {
         138  +
    /// <p>The name of the patch group whose patch baseline should be retrieved.</p>
         139  +
    /// This field is required.
         140  +
    pub fn patch_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         141  +
        self.patch_group = ::std::option::Option::Some(input.into());
         142  +
        self
         143  +
    }
         144  +
    /// <p>The name of the patch group whose patch baseline should be retrieved.</p>
         145  +
    pub fn set_patch_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         146  +
        self.patch_group = input;
         147  +
        self
         148  +
    }
         149  +
    /// <p>The name of the patch group whose patch baseline should be retrieved.</p>
         150  +
    pub fn get_patch_group(&self) -> &::std::option::Option<::std::string::String> {
         151  +
        &self.patch_group
         152  +
    }
         153  +
    /// <p>Returns the operating system rule specified for patch groups using the patch baseline. The default value is <code>WINDOWS</code>.</p>
         154  +
    pub fn operating_system(mut self, input: crate::types::OperatingSystem) -> Self {
         155  +
        self.operating_system = ::std::option::Option::Some(input);
         156  +
        self
         157  +
    }
         158  +
    /// <p>Returns the operating system rule specified for patch groups using the patch baseline. The default value is <code>WINDOWS</code>.</p>
         159  +
    pub fn set_operating_system(mut self, input: ::std::option::Option<crate::types::OperatingSystem>) -> Self {
         160  +
        self.operating_system = input;
         161  +
        self
         162  +
    }
         163  +
    /// <p>Returns the operating system rule specified for patch groups using the patch baseline. The default value is <code>WINDOWS</code>.</p>
         164  +
    pub fn get_operating_system(&self) -> &::std::option::Option<crate::types::OperatingSystem> {
         165  +
        &self.operating_system
         166  +
    }
         167  +
    /// Consumes the builder and constructs a [`GetPatchBaselineForPatchGroupInput`](crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupInput).
         168  +
    pub fn build(
         169  +
        self,
         170  +
    ) -> ::std::result::Result<
         171  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupInput,
         172  +
        ::aws_smithy_types::error::operation::BuildError,
         173  +
    > {
         174  +
        ::std::result::Result::Ok(crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupInput {
         175  +
            patch_group: self.patch_group,
         176  +
            operating_system: self.operating_system,
         177  +
        })
         178  +
    }
         179  +
}

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

@@ -0,1 +0,278 @@
           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 GetPatchBaselineForPatchGroupOutput {
           6  +
    /// <p>The ID of the patch baseline that should be used for the patch group.</p>
           7  +
    pub baseline_id: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The name of the patch group.</p>
           9  +
    pub patch_group: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>The operating system rule specified for patch groups using the patch baseline.</p>
          11  +
    pub operating_system: ::std::option::Option<crate::types::OperatingSystem>,
          12  +
    _request_id: Option<String>,
          13  +
}
          14  +
impl GetPatchBaselineForPatchGroupOutput {
          15  +
    /// <p>The ID of the patch baseline that should be used for the patch group.</p>
          16  +
    pub fn baseline_id(&self) -> ::std::option::Option<&str> {
          17  +
        self.baseline_id.as_deref()
          18  +
    }
          19  +
    /// <p>The name of the patch group.</p>
          20  +
    pub fn patch_group(&self) -> ::std::option::Option<&str> {
          21  +
        self.patch_group.as_deref()
          22  +
    }
          23  +
    /// <p>The operating system rule specified for patch groups using the patch baseline.</p>
          24  +
    pub fn operating_system(&self) -> ::std::option::Option<&crate::types::OperatingSystem> {
          25  +
        self.operating_system.as_ref()
          26  +
    }
          27  +
}
          28  +
static GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_BASELINE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          29  +
    ::aws_smithy_schema::ShapeId::from_parts(
          30  +
        "com.amazonaws.ssm.synthetic#GetPatchBaselineForPatchGroupOutput$BaselineId",
          31  +
        "com.amazonaws.ssm.synthetic",
          32  +
        "GetPatchBaselineForPatchGroupOutput",
          33  +
    ),
          34  +
    ::aws_smithy_schema::ShapeType::String,
          35  +
    "BaselineId",
          36  +
    0,
          37  +
);
          38  +
static GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_PATCH_GROUP: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          39  +
    ::aws_smithy_schema::ShapeId::from_parts(
          40  +
        "com.amazonaws.ssm.synthetic#GetPatchBaselineForPatchGroupOutput$PatchGroup",
          41  +
        "com.amazonaws.ssm.synthetic",
          42  +
        "GetPatchBaselineForPatchGroupOutput",
          43  +
    ),
          44  +
    ::aws_smithy_schema::ShapeType::String,
          45  +
    "PatchGroup",
          46  +
    1,
          47  +
);
          48  +
static GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_OPERATING_SYSTEM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          49  +
    ::aws_smithy_schema::ShapeId::from_parts(
          50  +
        "com.amazonaws.ssm.synthetic#GetPatchBaselineForPatchGroupOutput$OperatingSystem",
          51  +
        "com.amazonaws.ssm.synthetic",
          52  +
        "GetPatchBaselineForPatchGroupOutput",
          53  +
    ),
          54  +
    ::aws_smithy_schema::ShapeType::String,
          55  +
    "OperatingSystem",
          56  +
    2,
          57  +
);
          58  +
static GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          59  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          60  +
    ::aws_smithy_schema::ShapeType::String,
          61  +
    "request_id",
          62  +
    3,
          63  +
)
          64  +
.with_http_header("x-amzn-requestid");
          65  +
static GETPATCHBASELINEFORPATCHGROUPOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          66  +
    ::aws_smithy_schema::ShapeId::from_parts(
          67  +
        "com.amazonaws.ssm.synthetic#GetPatchBaselineForPatchGroupOutput",
          68  +
        "com.amazonaws.ssm.synthetic",
          69  +
        "GetPatchBaselineForPatchGroupOutput",
          70  +
    ),
          71  +
    ::aws_smithy_schema::ShapeType::Structure,
          72  +
    &[
          73  +
        &GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_BASELINE_ID,
          74  +
        &GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_PATCH_GROUP,
          75  +
        &GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_OPERATING_SYSTEM,
          76  +
        &GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER__REQUEST_ID,
          77  +
    ],
          78  +
)
          79  +
.with_original_name("GetPatchBaselineForPatchGroupResult");
          80  +
impl GetPatchBaselineForPatchGroupOutput {
          81  +
    /// The schema for this shape.
          82  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETPATCHBASELINEFORPATCHGROUPOUTPUT_SCHEMA;
          83  +
}
          84  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetPatchBaselineForPatchGroupOutput {
          85  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          86  +
    fn serialize_members(
          87  +
        &self,
          88  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          89  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          90  +
        if let Some(ref val) = self.baseline_id {
          91  +
            ser.write_string(&GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_BASELINE_ID, val)?;
          92  +
        }
          93  +
        if let Some(ref val) = self.patch_group {
          94  +
            ser.write_string(&GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_PATCH_GROUP, val)?;
          95  +
        }
          96  +
        if let Some(ref val) = self.operating_system {
          97  +
            ser.write_string(&GETPATCHBASELINEFORPATCHGROUPOUTPUT_MEMBER_OPERATING_SYSTEM, val.as_str())?;
          98  +
        }
          99  +
        Ok(())
         100  +
    }
         101  +
}
         102  +
impl GetPatchBaselineForPatchGroupOutput {
         103  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         104  +
    pub fn deserialize(
         105  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         106  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         107  +
        #[allow(unused_variables, unused_mut)]
         108  +
        let mut builder = Self::builder();
         109  +
        #[allow(
         110  +
            unused_variables,
         111  +
            unreachable_code,
         112  +
            clippy::single_match,
         113  +
            clippy::match_single_binding,
         114  +
            clippy::diverging_sub_expression
         115  +
        )]
         116  +
        deserializer.read_struct(&GETPATCHBASELINEFORPATCHGROUPOUTPUT_SCHEMA, &mut |member, deser| {
         117  +
            match member.member_index() {
         118  +
                Some(0) => {
         119  +
                    if deser.is_null() {
         120  +
                        deser.read_null()?;
         121  +
                    } else {
         122  +
                        builder.baseline_id = Some(deser.read_string(member)?);
         123  +
                    }
         124  +
                }
         125  +
                Some(1) => {
         126  +
                    if deser.is_null() {
         127  +
                        deser.read_null()?;
         128  +
                    } else {
         129  +
                        builder.patch_group = Some(deser.read_string(member)?);
         130  +
                    }
         131  +
                }
         132  +
                Some(2) => {
         133  +
                    if deser.is_null() {
         134  +
                        deser.read_null()?;
         135  +
                    } else {
         136  +
                        builder.operating_system = Some(crate::types::OperatingSystem::from(deser.read_string(member)?.as_str()));
         137  +
                    }
         138  +
                }
         139  +
                Some(3) => {
         140  +
                    builder._request_id = Some(deser.read_string(member)?);
         141  +
                }
         142  +
                _ => {}
         143  +
            }
         144  +
            Ok(())
         145  +
        })?;
         146  +
        Ok(builder.build())
         147  +
    }
         148  +
}
         149  +
impl GetPatchBaselineForPatchGroupOutput {
         150  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         151  +
    /// Header-bound members are read directly from headers, avoiding runtime
         152  +
    /// member iteration overhead. Body members are read via the deserializer.
         153  +
    pub fn deserialize_with_response(
         154  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         155  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         156  +
        _status: u16,
         157  +
        _body: &[u8],
         158  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         159  +
        #[allow(unused_variables, unused_mut)]
         160  +
        let mut builder = Self::builder();
         161  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         162  +
            builder._request_id = Some(val.to_string());
         163  +
        }
         164  +
         165  +
        #[allow(
         166  +
            unused_variables,
         167  +
            unreachable_code,
         168  +
            clippy::single_match,
         169  +
            clippy::match_single_binding,
         170  +
            clippy::diverging_sub_expression
         171  +
        )]
         172  +
        deserializer.read_struct(&GETPATCHBASELINEFORPATCHGROUPOUTPUT_SCHEMA, &mut |member, deser| {
         173  +
            match member.member_index() {
         174  +
                Some(0) => {
         175  +
                    builder.baseline_id = Some(deser.read_string(member)?);
         176  +
                }
         177  +
                Some(1) => {
         178  +
                    builder.patch_group = Some(deser.read_string(member)?);
         179  +
                }
         180  +
                Some(2) => {
         181  +
                    builder.operating_system = Some(crate::types::OperatingSystem::from(deser.read_string(member)?.as_str()));
         182  +
                }
         183  +
                _ => {}
         184  +
            }
         185  +
            Ok(())
         186  +
        })?;
         187  +
        Ok(builder.build())
         188  +
    }
         189  +
}
         190  +
impl ::aws_types::request_id::RequestId for GetPatchBaselineForPatchGroupOutput {
         191  +
    fn request_id(&self) -> Option<&str> {
         192  +
        self._request_id.as_deref()
         193  +
    }
         194  +
}
         195  +
impl GetPatchBaselineForPatchGroupOutput {
         196  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         197  +
        self._request_id = request_id;
         198  +
        self
         199  +
    }
         200  +
}
         201  +
impl GetPatchBaselineForPatchGroupOutput {
         202  +
    /// Creates a new builder-style object to manufacture [`GetPatchBaselineForPatchGroupOutput`](crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput).
         203  +
    pub fn builder() -> crate::operation::get_patch_baseline_for_patch_group::builders::GetPatchBaselineForPatchGroupOutputBuilder {
         204  +
        crate::operation::get_patch_baseline_for_patch_group::builders::GetPatchBaselineForPatchGroupOutputBuilder::default()
         205  +
    }
         206  +
}
         207  +
         208  +
/// A builder for [`GetPatchBaselineForPatchGroupOutput`](crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput).
         209  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         210  +
#[non_exhaustive]
         211  +
pub struct GetPatchBaselineForPatchGroupOutputBuilder {
         212  +
    pub(crate) baseline_id: ::std::option::Option<::std::string::String>,
         213  +
    pub(crate) patch_group: ::std::option::Option<::std::string::String>,
         214  +
    pub(crate) operating_system: ::std::option::Option<crate::types::OperatingSystem>,
         215  +
    _request_id: Option<String>,
         216  +
}
         217  +
impl GetPatchBaselineForPatchGroupOutputBuilder {
         218  +
    /// <p>The ID of the patch baseline that should be used for the patch group.</p>
         219  +
    pub fn baseline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         220  +
        self.baseline_id = ::std::option::Option::Some(input.into());
         221  +
        self
         222  +
    }
         223  +
    /// <p>The ID of the patch baseline that should be used for the patch group.</p>
         224  +
    pub fn set_baseline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         225  +
        self.baseline_id = input;
         226  +
        self
         227  +
    }
         228  +
    /// <p>The ID of the patch baseline that should be used for the patch group.</p>
         229  +
    pub fn get_baseline_id(&self) -> &::std::option::Option<::std::string::String> {
         230  +
        &self.baseline_id
         231  +
    }
         232  +
    /// <p>The name of the patch group.</p>
         233  +
    pub fn patch_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         234  +
        self.patch_group = ::std::option::Option::Some(input.into());
         235  +
        self
         236  +
    }
         237  +
    /// <p>The name of the patch group.</p>
         238  +
    pub fn set_patch_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         239  +
        self.patch_group = input;
         240  +
        self
         241  +
    }
         242  +
    /// <p>The name of the patch group.</p>
         243  +
    pub fn get_patch_group(&self) -> &::std::option::Option<::std::string::String> {
         244  +
        &self.patch_group
         245  +
    }
         246  +
    /// <p>The operating system rule specified for patch groups using the patch baseline.</p>
         247  +
    pub fn operating_system(mut self, input: crate::types::OperatingSystem) -> Self {
         248  +
        self.operating_system = ::std::option::Option::Some(input);
         249  +
        self
         250  +
    }
         251  +
    /// <p>The operating system rule specified for patch groups using the patch baseline.</p>
         252  +
    pub fn set_operating_system(mut self, input: ::std::option::Option<crate::types::OperatingSystem>) -> Self {
         253  +
        self.operating_system = input;
         254  +
        self
         255  +
    }
         256  +
    /// <p>The operating system rule specified for patch groups using the patch baseline.</p>
         257  +
    pub fn get_operating_system(&self) -> &::std::option::Option<crate::types::OperatingSystem> {
         258  +
        &self.operating_system
         259  +
    }
         260  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         261  +
        self._request_id = Some(request_id.into());
         262  +
        self
         263  +
    }
         264  +
         265  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         266  +
        self._request_id = request_id;
         267  +
        self
         268  +
    }
         269  +
    /// Consumes the builder and constructs a [`GetPatchBaselineForPatchGroupOutput`](crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput).
         270  +
    pub fn build(self) -> crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput {
         271  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput {
         272  +
            baseline_id: self.baseline_id,
         273  +
            patch_group: self.patch_group,
         274  +
            operating_system: self.operating_system,
         275  +
            _request_id: self._request_id,
         276  +
        }
         277  +
    }
         278  +
}