AWS SDK

AWS SDK

rev. 18b1dd205ff4335251e6dd0ecb88193de1b1cede (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,624 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `DeregisterTargetFromMaintenanceWindow`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct DeregisterTargetFromMaintenanceWindow;
           6  +
impl DeregisterTargetFromMaintenanceWindow {
           7  +
    /// Creates a new `DeregisterTargetFromMaintenanceWindow`
           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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowInput::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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput::SCHEMA;
          17  +
    pub(crate) async fn orchestrate(
          18  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          19  +
        input: crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowInput,
          20  +
    ) -> ::std::result::Result<
          21  +
        crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput,
          22  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          23  +
            crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
          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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError>()
          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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput>()
          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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowInput,
          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  +
            "DeregisterTargetFromMaintenanceWindow",
          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.DeregisterTargetFromMaintenanceWindow",
          71  +
            "rpc.service" = "SSM",
          72  +
            "rpc.method" = "DeregisterTargetFromMaintenanceWindow",
          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::DoesNotExistException::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::DoesNotExistException::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::DoesNotExistException::deserialize(d)?))
         117  +
                        },
         118  +
                    )
         119  +
.insert_error_shape(
         120  +
                        crate::types::error::InternalServerError::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::InternalServerError::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::InternalServerError::deserialize(d)?))
         126  +
                        },
         127  +
                    )
         128  +
.insert_error_shape(
         129  +
                        crate::types::error::TargetInUseException::SCHEMA,
         130  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         131  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::TargetInUseException::deserialize(d)?))
         132  +
                        },
         133  +
                        |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> {
         134  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::TargetInUseException::deserialize(d)?))
         135  +
                        },
         136  +
                    )
         137  +
                            .build()
         138  +
    });
         139  +
}
         140  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeregisterTargetFromMaintenanceWindow {
         141  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
         142  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DeregisterTargetFromMaintenanceWindow");
         143  +
         144  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
         145  +
            DeregisterTargetFromMaintenanceWindowRequestSerializer,
         146  +
        ));
         147  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         148  +
            DeregisterTargetFromMaintenanceWindowResponseDeserializer,
         149  +
        ));
         150  +
         151  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         152  +
            crate::config::auth::Params::builder()
         153  +
                .operation_name("DeregisterTargetFromMaintenanceWindow")
         154  +
                .build()
         155  +
                .expect("required fields set"),
         156  +
        ));
         157  +
         158  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         159  +
            "DeregisterTargetFromMaintenanceWindow",
         160  +
            "SSM",
         161  +
        ));
         162  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         163  +
        signing_options.double_uri_encode = true;
         164  +
        signing_options.content_sha256_header = false;
         165  +
        signing_options.normalize_uri_path = true;
         166  +
        signing_options.payload_override = None;
         167  +
         168  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         169  +
            signing_options,
         170  +
            ..::std::default::Default::default()
         171  +
        });
         172  +
         173  +
        ::std::option::Option::Some(cfg.freeze())
         174  +
    }
         175  +
         176  +
    fn runtime_components(
         177  +
        &self,
         178  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         179  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         180  +
        #[allow(unused_mut)]
         181  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeregisterTargetFromMaintenanceWindow")
         182  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         183  +
                DeregisterTargetFromMaintenanceWindowTelemetryInputCaptureInterceptor,
         184  +
            ))
         185  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         186  +
                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
         187  +
            ))
         188  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         189  +
                DeregisterTargetFromMaintenanceWindowEndpointParamsInterceptor,
         190  +
            ))
         191  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         192  +
                crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
         193  +
            >::new())
         194  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         195  +
                crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
         196  +
            >::new())
         197  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         198  +
                crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
         199  +
            >::new())
         200  +
            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
         201  +
                crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
         202  +
            >::new());
         203  +
         204  +
        ::std::borrow::Cow::Owned(rcb)
         205  +
    }
         206  +
}
         207  +
         208  +
#[derive(Debug)]
         209  +
struct DeregisterTargetFromMaintenanceWindowTelemetryInputCaptureInterceptor;
         210  +
         211  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         212  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeregisterTargetFromMaintenanceWindowTelemetryInputCaptureInterceptor {
         213  +
    fn name(&self) -> &'static str {
         214  +
        "DeregisterTargetFromMaintenanceWindowTelemetryInputCaptureInterceptor"
         215  +
    }
         216  +
         217  +
    fn read_before_execution(
         218  +
        &self,
         219  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         220  +
            '_,
         221  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         222  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         223  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         224  +
        >,
         225  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         226  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         227  +
        // Nothing to do unless the customer opted in by naming members to record.
         228  +
        let ::std::option::Option::Some(requested) = cfg
         229  +
            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
         230  +
            .filter(|r| !r.is_empty())
         231  +
        else {
         232  +
            return ::std::result::Result::Ok(());
         233  +
        };
         234  +
         235  +
        let ::std::option::Option::Some(input) = context.input().downcast_ref::<DeregisterTargetFromMaintenanceWindowInput>() else {
         236  +
            // A mismatched input is not this interceptor's concern; skip quietly.
         237  +
            return ::std::result::Result::Ok(());
         238  +
        };
         239  +
         240  +
        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
         241  +
        if requested.should_capture("WindowId") {
         242  +
            if let ::std::option::Option::Some(value) = input.window_id.as_deref() {
         243  +
                captured.insert("WindowId", value);
         244  +
            }
         245  +
        }
         246  +
        if requested.should_capture("WindowTargetId") {
         247  +
            if let ::std::option::Option::Some(value) = input.window_target_id.as_deref() {
         248  +
                captured.insert("WindowTargetId", value);
         249  +
            }
         250  +
        }
         251  +
         252  +
        cfg.interceptor_state().store_put(captured);
         253  +
        ::std::result::Result::Ok(())
         254  +
    }
         255  +
}
         256  +
#[derive(Debug)]
         257  +
struct DeregisterTargetFromMaintenanceWindowResponseDeserializer;
         258  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeregisterTargetFromMaintenanceWindowResponseDeserializer {
         259  +
    fn deserialize_nonstreaming_with_config(
         260  +
        &self,
         261  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         262  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
         263  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         264  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         265  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         266  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         267  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         268  +
        // loads `body` before firing this hook.
         269  +
        let body = response.body().bytes().expect("body loaded");
         270  +
        let headers = response.headers();
         271  +
        #[allow(unused_mut)]
         272  +
        let mut force_error = false;
         273  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         274  +
        if !success && status != 200 || force_error {
         275  +
            let protocol = _cfg
         276  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         277  +
                .expect("a SharedClientProtocol is required");
         278  +
            #[allow(unused_mut)]
         279  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         280  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         281  +
            })?;
         282  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         283  +
            let generic = generic_builder.build();
         284  +
            let error_code = match generic.code() {
         285  +
                ::std::option::Option::Some(code) => code,
         286  +
                ::std::option::Option::None => {
         287  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         288  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         289  +
                            crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError::unhandled(
         290  +
                                generic,
         291  +
                            ),
         292  +
                        ),
         293  +
                    ))
         294  +
                }
         295  +
            };
         296  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         297  +
            let err = match error_code {
         298  +
                "DoesNotExistException" => {
         299  +
                    crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError::DoesNotExistException({
         300  +
                        let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         301  +
                            crate::types::error::DoesNotExistException::deserialize_with_response(
         302  +
                                &mut *deser,
         303  +
                                response.headers(),
         304  +
                                response.status().into(),
         305  +
                                body,
         306  +
                            )
         307  +
                        }) {
         308  +
                            ::std::result::Result::Ok(val) => val,
         309  +
                            ::std::result::Result::Err(e) => {
         310  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         311  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         312  +
                                ))
         313  +
                            }
         314  +
                        };
         315  +
                        tmp.meta = generic;
         316  +
                        if tmp.message.is_none() {
         317  +
                            tmp.message = _error_message;
         318  +
                        }
         319  +
                        tmp
         320  +
                    })
         321  +
                }
         322  +
                "InternalServerError" => {
         323  +
                    crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError::InternalServerError({
         324  +
                        let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         325  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         326  +
                                &mut *deser,
         327  +
                                response.headers(),
         328  +
                                response.status().into(),
         329  +
                                body,
         330  +
                            )
         331  +
                        }) {
         332  +
                            ::std::result::Result::Ok(val) => val,
         333  +
                            ::std::result::Result::Err(e) => {
         334  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         335  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         336  +
                                ))
         337  +
                            }
         338  +
                        };
         339  +
                        tmp.meta = generic;
         340  +
                        if tmp.message.is_none() {
         341  +
                            tmp.message = _error_message;
         342  +
                        }
         343  +
                        tmp
         344  +
                    })
         345  +
                }
         346  +
                "TargetInUseException" => {
         347  +
                    crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError::TargetInUseException({
         348  +
                        let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         349  +
                            crate::types::error::TargetInUseException::deserialize_with_response(
         350  +
                                &mut *deser,
         351  +
                                response.headers(),
         352  +
                                response.status().into(),
         353  +
                                body,
         354  +
                            )
         355  +
                        }) {
         356  +
                            ::std::result::Result::Ok(val) => val,
         357  +
                            ::std::result::Result::Err(e) => {
         358  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         359  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         360  +
                                ))
         361  +
                            }
         362  +
                        };
         363  +
                        tmp.meta = generic;
         364  +
                        if tmp.message.is_none() {
         365  +
                            tmp.message = _error_message;
         366  +
                        }
         367  +
                        tmp
         368  +
                    })
         369  +
                }
         370  +
                _ => {
         371  +
                    // Registry-backed, operation-scoped reification of an error whose
         372  +
                    // code this operation does not model directly: the operation's own
         373  +
                    // error registry is consulted first, then the lookup widens to the
         374  +
                    // service-wide error registry. On a hit, the reified error is attached
         375  +
                    // as the source of the returned unhandled error while its metadata
         376  +
                    // (code, message, request id) is preserved; on a miss the generic
         377  +
                    // error is returned unchanged.
         378  +
                    match protocol
         379  +
                        .deserialize_error_response(response, _cfg)
         380  +
                        .ok()
         381  +
                        .and_then(|mut deser| {
         382  +
                            ::aws_smithy_schema::registry::reify_error(
         383  +
                                crate::operation::deregister_target_from_maintenance_window::error_registry::REGISTRY
         384  +
                                    .or(&crate::error_type_registry::REGISTRY),
         385  +
                                error_code,
         386  +
                                &mut *deser,
         387  +
                            )
         388  +
                        }) {
         389  +
                        ::std::option::Option::Some(source) => <crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
         390  +
                        ::std::option::Option::None => crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError::generic(generic),
         391  +
                    }
         392  +
                }
         393  +
            };
         394  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         395  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         396  +
            ))
         397  +
        } else {
         398  +
            let protocol = _cfg
         399  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         400  +
                .expect("a SharedClientProtocol is required");
         401  +
            let mut deser = protocol
         402  +
                .deserialize_response(response, DeregisterTargetFromMaintenanceWindow::OUTPUT_SCHEMA, _cfg)
         403  +
                .map_err(|e| {
         404  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         405  +
                })?;
         406  +
            // body and headers are already in scope from the top of the function;
         407  +
            // alias `headers` as `_response_headers` so MutateOutput
         408  +
            // customizations have a stable name to read from.
         409  +
            let _response_headers = headers;
         410  +
            #[allow(unused_mut)]
         411  +
            let mut output =
         412  +
                crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput::deserialize_with_response(
         413  +
                    &mut *deser,
         414  +
                    _response_headers,
         415  +
                    response.status().into(),
         416  +
                    body,
         417  +
                )
         418  +
                .map_err(|e| {
         419  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         420  +
                })?;
         421  +
            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
         422  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         423  +
        }
         424  +
    }
         425  +
}
         426  +
#[derive(Debug)]
         427  +
struct DeregisterTargetFromMaintenanceWindowRequestSerializer;
         428  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeregisterTargetFromMaintenanceWindowRequestSerializer {
         429  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         430  +
    fn serialize_input(
         431  +
        &self,
         432  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         433  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         434  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         435  +
        let input = input
         436  +
            .downcast::<crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowInput>()
         437  +
            .expect("correct type");
         438  +
         439  +
        let protocol = _cfg
         440  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         441  +
            .expect("a SharedClientProtocol is required");
         442  +
        let mut request = protocol
         443  +
            .serialize_request(&input, DeregisterTargetFromMaintenanceWindow::INPUT_SCHEMA, "/", _cfg)
         444  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         445  +
         446  +
        return ::std::result::Result::Ok(request);
         447  +
    }
         448  +
}
         449  +
#[derive(Debug)]
         450  +
struct DeregisterTargetFromMaintenanceWindowEndpointParamsInterceptor;
         451  +
         452  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         453  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeregisterTargetFromMaintenanceWindowEndpointParamsInterceptor {
         454  +
    fn name(&self) -> &'static str {
         455  +
        "DeregisterTargetFromMaintenanceWindowEndpointParamsInterceptor"
         456  +
    }
         457  +
         458  +
    fn read_before_execution(
         459  +
        &self,
         460  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         461  +
            '_,
         462  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         463  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         464  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         465  +
        >,
         466  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         467  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         468  +
        let _input = context
         469  +
            .input()
         470  +
            .downcast_ref::<DeregisterTargetFromMaintenanceWindowInput>()
         471  +
            .ok_or("failed to downcast to DeregisterTargetFromMaintenanceWindowInput")?;
         472  +
         473  +
        let params = crate::config::endpoint::Params::builder()
         474  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         475  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         476  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         477  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         478  +
            .build()
         479  +
            .map_err(|err| {
         480  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         481  +
            })?;
         482  +
        cfg.interceptor_state()
         483  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         484  +
        ::std::result::Result::Ok(())
         485  +
    }
         486  +
}
         487  +
         488  +
// The get_* functions below are generated from JMESPath expressions in the
         489  +
// operationContextParams trait. They target the operation's input shape.
         490  +
         491  +
/// Error type for the `DeregisterTargetFromMaintenanceWindowError` operation.
         492  +
#[non_exhaustive]
         493  +
#[derive(::std::fmt::Debug)]
         494  +
pub enum DeregisterTargetFromMaintenanceWindowError {
         495  +
    /// <p>Error returned when the ID specified for a resource, such as a maintenance window or patch baseline, doesn't exist.</p>
         496  +
    /// <p>For information about resource quotas in Amazon Web Services Systems Manager, see <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm">Systems Manager service quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
         497  +
    DoesNotExistException(crate::types::error::DoesNotExistException),
         498  +
    /// <p>An error occurred on the server side.</p>
         499  +
    InternalServerError(crate::types::error::InternalServerError),
         500  +
    /// <p>You specified the <code>Safe</code> option for the DeregisterTargetFromMaintenanceWindow operation, but the target is still referenced in a task.</p>
         501  +
    TargetInUseException(crate::types::error::TargetInUseException),
         502  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         503  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         504  +
    variable wildcard pattern and check `.code()`:
         505  +
     \
         506  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         507  +
     \
         508  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DeregisterTargetFromMaintenanceWindowError) for what information is available for the error.")]
         509  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         510  +
}
         511  +
impl DeregisterTargetFromMaintenanceWindowError {
         512  +
    /// Creates the `DeregisterTargetFromMaintenanceWindowError::Unhandled` variant from any error type.
         513  +
    pub fn unhandled(
         514  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         515  +
    ) -> Self {
         516  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         517  +
            source: err.into(),
         518  +
            meta: ::std::default::Default::default(),
         519  +
        })
         520  +
    }
         521  +
         522  +
    /// Creates the `DeregisterTargetFromMaintenanceWindowError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         523  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         524  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         525  +
            source: err.clone().into(),
         526  +
            meta: err,
         527  +
        })
         528  +
    }
         529  +
    ///
         530  +
    /// Returns error metadata, which includes the error code, message,
         531  +
    /// request ID, and potentially additional information.
         532  +
    ///
         533  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         534  +
        match self {
         535  +
            Self::DoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         536  +
            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         537  +
            Self::TargetInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         538  +
            Self::Unhandled(e) => &e.meta,
         539  +
        }
         540  +
    }
         541  +
    /// Returns `true` if the error kind is `DeregisterTargetFromMaintenanceWindowError::DoesNotExistException`.
         542  +
    pub fn is_does_not_exist_exception(&self) -> bool {
         543  +
        matches!(self, Self::DoesNotExistException(_))
         544  +
    }
         545  +
    /// Returns `true` if the error kind is `DeregisterTargetFromMaintenanceWindowError::InternalServerError`.
         546  +
    pub fn is_internal_server_error(&self) -> bool {
         547  +
        matches!(self, Self::InternalServerError(_))
         548  +
    }
         549  +
    /// Returns `true` if the error kind is `DeregisterTargetFromMaintenanceWindowError::TargetInUseException`.
         550  +
    pub fn is_target_in_use_exception(&self) -> bool {
         551  +
        matches!(self, Self::TargetInUseException(_))
         552  +
    }
         553  +
}
         554  +
impl ::std::error::Error for DeregisterTargetFromMaintenanceWindowError {
         555  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         556  +
        match self {
         557  +
            Self::DoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
         558  +
            Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
         559  +
            Self::TargetInUseException(_inner) => ::std::option::Option::Some(_inner),
         560  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         561  +
        }
         562  +
    }
         563  +
}
         564  +
impl ::std::fmt::Display for DeregisterTargetFromMaintenanceWindowError {
         565  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         566  +
        match self {
         567  +
            Self::DoesNotExistException(_inner) => _inner.fmt(f),
         568  +
            Self::InternalServerError(_inner) => _inner.fmt(f),
         569  +
            Self::TargetInUseException(_inner) => _inner.fmt(f),
         570  +
            Self::Unhandled(_inner) => {
         571  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         572  +
                    write!(f, "unhandled error ({code})")
         573  +
                } else {
         574  +
                    f.write_str("unhandled error")
         575  +
                }
         576  +
            }
         577  +
        }
         578  +
    }
         579  +
}
         580  +
impl ::aws_smithy_types::retry::ProvideErrorKind for DeregisterTargetFromMaintenanceWindowError {
         581  +
    fn code(&self) -> ::std::option::Option<&str> {
         582  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         583  +
    }
         584  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         585  +
        ::std::option::Option::None
         586  +
    }
         587  +
}
         588  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DeregisterTargetFromMaintenanceWindowError {
         589  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         590  +
        match self {
         591  +
            Self::DoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         592  +
            Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         593  +
            Self::TargetInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         594  +
            Self::Unhandled(_inner) => &_inner.meta,
         595  +
        }
         596  +
    }
         597  +
}
         598  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeregisterTargetFromMaintenanceWindowError {
         599  +
    fn create_unhandled_error(
         600  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         601  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         602  +
    ) -> Self {
         603  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         604  +
            source,
         605  +
            meta: meta.unwrap_or_default(),
         606  +
        })
         607  +
    }
         608  +
}
         609  +
impl ::aws_types::request_id::RequestId for crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError {
         610  +
    fn request_id(&self) -> Option<&str> {
         611  +
        self.meta().request_id()
         612  +
    }
         613  +
}
         614  +
         615  +
pub use crate::operation::deregister_target_from_maintenance_window::_deregister_target_from_maintenance_window_input::DeregisterTargetFromMaintenanceWindowInput;
         616  +
         617  +
pub use crate::operation::deregister_target_from_maintenance_window::_deregister_target_from_maintenance_window_output::DeregisterTargetFromMaintenanceWindowOutput;
         618  +
         619  +
mod _deregister_target_from_maintenance_window_input;
         620  +
         621  +
mod _deregister_target_from_maintenance_window_output;
         622  +
         623  +
/// Builders
         624  +
pub mod builders;

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

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

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

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