AWS SDK

AWS SDK

rev. 2915cec5ef64cb1ed4992565a748d76a11505b3b (ignoring whitespace)

Files changed:

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

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

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/deregister_patch_baseline_for_patch_group/_deregister_patch_baseline_for_patch_group_input.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 DeregisterPatchBaselineForPatchGroupInput {
           6  +
    /// <p>The ID of the patch baseline to deregister the patch group from.</p>
           7  +
    pub baseline_id: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The name of the patch group that should be deregistered from the patch baseline.</p>
           9  +
    pub patch_group: ::std::option::Option<::std::string::String>,
          10  +
}
          11  +
impl DeregisterPatchBaselineForPatchGroupInput {
          12  +
    /// <p>The ID of the patch baseline to deregister the patch group from.</p>
          13  +
    pub fn baseline_id(&self) -> ::std::option::Option<&str> {
          14  +
        self.baseline_id.as_deref()
          15  +
    }
          16  +
    /// <p>The name of the patch group that should be deregistered from the patch baseline.</p>
          17  +
    pub fn patch_group(&self) -> ::std::option::Option<&str> {
          18  +
        self.patch_group.as_deref()
          19  +
    }
          20  +
}
          21  +
static DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_BASELINE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          22  +
    ::aws_smithy_schema::ShapeId::from_parts(
          23  +
        "com.amazonaws.ssm.synthetic#DeregisterPatchBaselineForPatchGroupInput$BaselineId",
          24  +
        "com.amazonaws.ssm.synthetic",
          25  +
        "DeregisterPatchBaselineForPatchGroupInput",
          26  +
    ),
          27  +
    ::aws_smithy_schema::ShapeType::String,
          28  +
    "BaselineId",
          29  +
    0,
          30  +
);
          31  +
static DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_PATCH_GROUP: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_parts(
          33  +
        "com.amazonaws.ssm.synthetic#DeregisterPatchBaselineForPatchGroupInput$PatchGroup",
          34  +
        "com.amazonaws.ssm.synthetic",
          35  +
        "DeregisterPatchBaselineForPatchGroupInput",
          36  +
    ),
          37  +
    ::aws_smithy_schema::ShapeType::String,
          38  +
    "PatchGroup",
          39  +
    1,
          40  +
);
          41  +
static DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          42  +
    ::aws_smithy_schema::ShapeId::from_parts(
          43  +
        "com.amazonaws.ssm.synthetic#DeregisterPatchBaselineForPatchGroupInput",
          44  +
        "com.amazonaws.ssm.synthetic",
          45  +
        "DeregisterPatchBaselineForPatchGroupInput",
          46  +
    ),
          47  +
    ::aws_smithy_schema::ShapeType::Structure,
          48  +
    &[
          49  +
        &DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_BASELINE_ID,
          50  +
        &DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_PATCH_GROUP,
          51  +
    ],
          52  +
)
          53  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          54  +
.with_original_name("DeregisterPatchBaselineForPatchGroupRequest");
          55  +
impl DeregisterPatchBaselineForPatchGroupInput {
          56  +
    /// The schema for this shape.
          57  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_SCHEMA;
          58  +
}
          59  +
impl ::aws_smithy_schema::serde::SerializableStruct for DeregisterPatchBaselineForPatchGroupInput {
          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.baseline_id {
          66  +
            ser.write_string(&DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_BASELINE_ID, val)?;
          67  +
        }
          68  +
        if let Some(ref val) = self.patch_group {
          69  +
            ser.write_string(&DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_MEMBER_PATCH_GROUP, val)?;
          70  +
        }
          71  +
        Ok(())
          72  +
    }
          73  +
}
          74  +
impl DeregisterPatchBaselineForPatchGroupInput {
          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(&DEREGISTERPATCHBASELINEFORPATCHGROUPINPUT_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.baseline_id = Some(deser.read_string(member)?);
          95  +
                    }
          96  +
                }
          97  +
                Some(1) => {
          98  +
                    if deser.is_null() {
          99  +
                        deser.read_null()?;
         100  +
                    } else {
         101  +
                        builder.patch_group = Some(deser.read_string(member)?);
         102  +
                    }
         103  +
                }
         104  +
                _ => {}
         105  +
            }
         106  +
            Ok(())
         107  +
        })?;
         108  +
        builder.baseline_id = builder.baseline_id.or(Some(String::new()));
         109  +
        builder.patch_group = builder.patch_group.or(Some(String::new()));
         110  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         111  +
    }
         112  +
}
         113  +
impl DeregisterPatchBaselineForPatchGroupInput {
         114  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         115  +
    pub fn deserialize_with_response(
         116  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         117  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         118  +
        _status: u16,
         119  +
        _body: &[u8],
         120  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         121  +
        Self::deserialize(deserializer)
         122  +
    }
         123  +
}
         124  +
impl DeregisterPatchBaselineForPatchGroupInput {
         125  +
    /// Creates a new builder-style object to manufacture [`DeregisterPatchBaselineForPatchGroupInput`](crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupInput).
         126  +
    pub fn builder() -> crate::operation::deregister_patch_baseline_for_patch_group::builders::DeregisterPatchBaselineForPatchGroupInputBuilder {
         127  +
        crate::operation::deregister_patch_baseline_for_patch_group::builders::DeregisterPatchBaselineForPatchGroupInputBuilder::default()
         128  +
    }
         129  +
}
         130  +
         131  +
/// A builder for [`DeregisterPatchBaselineForPatchGroupInput`](crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupInput).
         132  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         133  +
#[non_exhaustive]
         134  +
pub struct DeregisterPatchBaselineForPatchGroupInputBuilder {
         135  +
    pub(crate) baseline_id: ::std::option::Option<::std::string::String>,
         136  +
    pub(crate) patch_group: ::std::option::Option<::std::string::String>,
         137  +
}
         138  +
impl DeregisterPatchBaselineForPatchGroupInputBuilder {
         139  +
    /// <p>The ID of the patch baseline to deregister the patch group from.</p>
         140  +
    /// This field is required.
         141  +
    pub fn baseline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         142  +
        self.baseline_id = ::std::option::Option::Some(input.into());
         143  +
        self
         144  +
    }
         145  +
    /// <p>The ID of the patch baseline to deregister the patch group from.</p>
         146  +
    pub fn set_baseline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         147  +
        self.baseline_id = input;
         148  +
        self
         149  +
    }
         150  +
    /// <p>The ID of the patch baseline to deregister the patch group from.</p>
         151  +
    pub fn get_baseline_id(&self) -> &::std::option::Option<::std::string::String> {
         152  +
        &self.baseline_id
         153  +
    }
         154  +
    /// <p>The name of the patch group that should be deregistered from the patch baseline.</p>
         155  +
    /// This field is required.
         156  +
    pub fn patch_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         157  +
        self.patch_group = ::std::option::Option::Some(input.into());
         158  +
        self
         159  +
    }
         160  +
    /// <p>The name of the patch group that should be deregistered from the patch baseline.</p>
         161  +
    pub fn set_patch_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         162  +
        self.patch_group = input;
         163  +
        self
         164  +
    }
         165  +
    /// <p>The name of the patch group that should be deregistered from the patch baseline.</p>
         166  +
    pub fn get_patch_group(&self) -> &::std::option::Option<::std::string::String> {
         167  +
        &self.patch_group
         168  +
    }
         169  +
    /// Consumes the builder and constructs a [`DeregisterPatchBaselineForPatchGroupInput`](crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupInput).
         170  +
    pub fn build(
         171  +
        self,
         172  +
    ) -> ::std::result::Result<
         173  +
        crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupInput,
         174  +
        ::aws_smithy_types::error::operation::BuildError,
         175  +
    > {
         176  +
        ::std::result::Result::Ok(
         177  +
            crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupInput {
         178  +
                baseline_id: self.baseline_id,
         179  +
                patch_group: self.patch_group,
         180  +
            },
         181  +
        )
         182  +
    }
         183  +
}

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

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

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

@@ -0,1 +0,142 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::deregister_patch_baseline_for_patch_group::_deregister_patch_baseline_for_patch_group_input::DeregisterPatchBaselineForPatchGroupInputBuilder;
           3  +
           4  +
pub use crate::operation::deregister_patch_baseline_for_patch_group::_deregister_patch_baseline_for_patch_group_output::DeregisterPatchBaselineForPatchGroupOutputBuilder;
           5  +
           6  +
impl crate::operation::deregister_patch_baseline_for_patch_group::builders::DeregisterPatchBaselineForPatchGroupInputBuilder {
           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::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.deregister_patch_baseline_for_patch_group();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `DeregisterPatchBaselineForPatchGroup`.
          24  +
///
          25  +
/// <p>Removes a patch group from a patch baseline.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct DeregisterPatchBaselineForPatchGroupFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::deregister_patch_baseline_for_patch_group::builders::DeregisterPatchBaselineForPatchGroupInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupOutput,
          35  +
        crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupError,
          36  +
    > for DeregisterPatchBaselineForPatchGroupFluentBuilder
          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::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupOutput,
          44  +
            crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl DeregisterPatchBaselineForPatchGroupFluentBuilder {
          51  +
    /// Creates a new `DeregisterPatchBaselineForPatchGroupFluentBuilder`.
          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 DeregisterPatchBaselineForPatchGroup as a reference.
          60  +
    pub fn as_input(
          61  +
        &self,
          62  +
    ) -> &crate::operation::deregister_patch_baseline_for_patch_group::builders::DeregisterPatchBaselineForPatchGroupInputBuilder {
          63  +
        &self.inner
          64  +
    }
          65  +
    /// Sends the request and returns the response.
          66  +
    ///
          67  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          68  +
    /// can be matched against.
          69  +
    ///
          70  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          71  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          72  +
    /// set when configuring the client.
          73  +
    pub async fn send(
          74  +
        self,
          75  +
    ) -> ::std::result::Result<
          76  +
        crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupOutput,
          77  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          78  +
            crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupError,
          79  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          80  +
        >,
          81  +
    > {
          82  +
        let input = self
          83  +
            .inner
          84  +
            .build()
          85  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          86  +
        let runtime_plugins =
          87  +
            crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroup::operation_runtime_plugins(
          88  +
                self.handle.runtime_plugins.clone(),
          89  +
                &self.handle.conf,
          90  +
                self.config_override,
          91  +
            );
          92  +
        crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroup::orchestrate(&runtime_plugins, input).await
          93  +
    }
          94  +
          95  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          96  +
    pub fn customize(
          97  +
        self,
          98  +
    ) -> crate::client::customize::CustomizableOperation<
          99  +
        crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupOutput,
         100  +
        crate::operation::deregister_patch_baseline_for_patch_group::DeregisterPatchBaselineForPatchGroupError,
         101  +
        Self,
         102  +
    > {
         103  +
        crate::client::customize::CustomizableOperation::new(self)
         104  +
    }
         105  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         106  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         107  +
        self
         108  +
    }
         109  +
         110  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         111  +
        self.config_override = config_override;
         112  +
        self
         113  +
    }
         114  +
    /// <p>The ID of the patch baseline to deregister the patch group from.</p>
         115  +
    pub fn baseline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         116  +
        self.inner = self.inner.baseline_id(input.into());
         117  +
        self
         118  +
    }
         119  +
    /// <p>The ID of the patch baseline to deregister the patch group from.</p>
         120  +
    pub fn set_baseline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         121  +
        self.inner = self.inner.set_baseline_id(input);
         122  +
        self
         123  +
    }
         124  +
    /// <p>The ID of the patch baseline to deregister the patch group from.</p>
         125  +
    pub fn get_baseline_id(&self) -> &::std::option::Option<::std::string::String> {
         126  +
        self.inner.get_baseline_id()
         127  +
    }
         128  +
    /// <p>The name of the patch group that should be deregistered from the patch baseline.</p>
         129  +
    pub fn patch_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         130  +
        self.inner = self.inner.patch_group(input.into());
         131  +
        self
         132  +
    }
         133  +
    /// <p>The name of the patch group that should be deregistered from the patch baseline.</p>
         134  +
    pub fn set_patch_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         135  +
        self.inner = self.inner.set_patch_group(input);
         136  +
        self
         137  +
    }
         138  +
    /// <p>The name of the patch group that should be deregistered from the patch baseline.</p>
         139  +
    pub fn get_patch_group(&self) -> &::std::option::Option<::std::string::String> {
         140  +
        self.inner.get_patch_group()
         141  +
    }
         142  +
}