AWS SDK

AWS SDK

rev. 97ba95e6039d206ffea5b866ddc214d34f7f88c3

Files changed:

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

@@ -0,1 +0,156 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::deregister_target_from_maintenance_window::_deregister_target_from_maintenance_window_input::DeregisterTargetFromMaintenanceWindowInputBuilder;
           3  +
           4  +
pub use crate::operation::deregister_target_from_maintenance_window::_deregister_target_from_maintenance_window_output::DeregisterTargetFromMaintenanceWindowOutputBuilder;
           5  +
           6  +
impl crate::operation::deregister_target_from_maintenance_window::builders::DeregisterTargetFromMaintenanceWindowInputBuilder {
           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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.deregister_target_from_maintenance_window();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `DeregisterTargetFromMaintenanceWindow`.
          24  +
///
          25  +
/// <p>Removes a target from a maintenance window.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct DeregisterTargetFromMaintenanceWindowFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::deregister_target_from_maintenance_window::builders::DeregisterTargetFromMaintenanceWindowInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput,
          35  +
        crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
          36  +
    > for DeregisterTargetFromMaintenanceWindowFluentBuilder
          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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput,
          44  +
            crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl DeregisterTargetFromMaintenanceWindowFluentBuilder {
          51  +
    /// Creates a new `DeregisterTargetFromMaintenanceWindowFluentBuilder`.
          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 DeregisterTargetFromMaintenanceWindow as a reference.
          60  +
    pub fn as_input(
          61  +
        &self,
          62  +
    ) -> &crate::operation::deregister_target_from_maintenance_window::builders::DeregisterTargetFromMaintenanceWindowInputBuilder {
          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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput,
          77  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          78  +
            crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
          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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindow::operation_runtime_plugins(
          88  +
                self.handle.runtime_plugins.clone(),
          89  +
                &self.handle.conf,
          90  +
                self.config_override,
          91  +
            );
          92  +
        crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindow::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_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowOutput,
         100  +
        crate::operation::deregister_target_from_maintenance_window::DeregisterTargetFromMaintenanceWindowError,
         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 maintenance window the target should be removed from.</p>
         115  +
    pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         116  +
        self.inner = self.inner.window_id(input.into());
         117  +
        self
         118  +
    }
         119  +
    /// <p>The ID of the maintenance window the target should be removed from.</p>
         120  +
    pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         121  +
        self.inner = self.inner.set_window_id(input);
         122  +
        self
         123  +
    }
         124  +
    /// <p>The ID of the maintenance window the target should be removed from.</p>
         125  +
    pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
         126  +
        self.inner.get_window_id()
         127  +
    }
         128  +
    /// <p>The ID of the target definition to remove.</p>
         129  +
    pub fn window_target_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         130  +
        self.inner = self.inner.window_target_id(input.into());
         131  +
        self
         132  +
    }
         133  +
    /// <p>The ID of the target definition to remove.</p>
         134  +
    pub fn set_window_target_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         135  +
        self.inner = self.inner.set_window_target_id(input);
         136  +
        self
         137  +
    }
         138  +
    /// <p>The ID of the target definition to remove.</p>
         139  +
    pub fn get_window_target_id(&self) -> &::std::option::Option<::std::string::String> {
         140  +
        self.inner.get_window_target_id()
         141  +
    }
         142  +
    /// <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>
         143  +
    pub fn safe(mut self, input: bool) -> Self {
         144  +
        self.inner = self.inner.safe(input);
         145  +
        self
         146  +
    }
         147  +
    /// <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>
         148  +
    pub fn set_safe(mut self, input: ::std::option::Option<bool>) -> Self {
         149  +
        self.inner = self.inner.set_safe(input);
         150  +
        self
         151  +
    }
         152  +
    /// <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>
         153  +
    pub fn get_safe(&self) -> &::std::option::Option<bool> {
         154  +
        self.inner.get_safe()
         155  +
    }
         156  +
}

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

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

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/deregister_task_from_maintenance_window/_deregister_task_from_maintenance_window_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 DeregisterTaskFromMaintenanceWindowInput {
           6  +
    /// <p>The ID of the maintenance window the task should be removed from.</p>
           7  +
    pub window_id: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The ID of the task to remove from the maintenance window.</p>
           9  +
    pub window_task_id: ::std::option::Option<::std::string::String>,
          10  +
}
          11  +
impl DeregisterTaskFromMaintenanceWindowInput {
          12  +
    /// <p>The ID of the maintenance window the task should be removed from.</p>
          13  +
    pub fn window_id(&self) -> ::std::option::Option<&str> {
          14  +
        self.window_id.as_deref()
          15  +
    }
          16  +
    /// <p>The ID of the task to remove from the maintenance window.</p>
          17  +
    pub fn window_task_id(&self) -> ::std::option::Option<&str> {
          18  +
        self.window_task_id.as_deref()
          19  +
    }
          20  +
}
          21  +
static DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_MEMBER_WINDOW_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          22  +
    ::aws_smithy_schema::ShapeId::from_parts(
          23  +
        "com.amazonaws.ssm.synthetic#DeregisterTaskFromMaintenanceWindowInput$WindowId",
          24  +
        "com.amazonaws.ssm.synthetic",
          25  +
        "DeregisterTaskFromMaintenanceWindowInput",
          26  +
    ),
          27  +
    ::aws_smithy_schema::ShapeType::String,
          28  +
    "WindowId",
          29  +
    0,
          30  +
);
          31  +
static DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_MEMBER_WINDOW_TASK_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_parts(
          33  +
        "com.amazonaws.ssm.synthetic#DeregisterTaskFromMaintenanceWindowInput$WindowTaskId",
          34  +
        "com.amazonaws.ssm.synthetic",
          35  +
        "DeregisterTaskFromMaintenanceWindowInput",
          36  +
    ),
          37  +
    ::aws_smithy_schema::ShapeType::String,
          38  +
    "WindowTaskId",
          39  +
    1,
          40  +
);
          41  +
static DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          42  +
    ::aws_smithy_schema::ShapeId::from_parts(
          43  +
        "com.amazonaws.ssm.synthetic#DeregisterTaskFromMaintenanceWindowInput",
          44  +
        "com.amazonaws.ssm.synthetic",
          45  +
        "DeregisterTaskFromMaintenanceWindowInput",
          46  +
    ),
          47  +
    ::aws_smithy_schema::ShapeType::Structure,
          48  +
    &[
          49  +
        &DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_MEMBER_WINDOW_ID,
          50  +
        &DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_MEMBER_WINDOW_TASK_ID,
          51  +
    ],
          52  +
)
          53  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          54  +
.with_original_name("DeregisterTaskFromMaintenanceWindowRequest");
          55  +
impl DeregisterTaskFromMaintenanceWindowInput {
          56  +
    /// The schema for this shape.
          57  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_SCHEMA;
          58  +
}
          59  +
impl ::aws_smithy_schema::serde::SerializableStruct for DeregisterTaskFromMaintenanceWindowInput {
          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.window_id {
          66  +
            ser.write_string(&DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_MEMBER_WINDOW_ID, val)?;
          67  +
        }
          68  +
        if let Some(ref val) = self.window_task_id {
          69  +
            ser.write_string(&DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_MEMBER_WINDOW_TASK_ID, val)?;
          70  +
        }
          71  +
        Ok(())
          72  +
    }
          73  +
}
          74  +
impl DeregisterTaskFromMaintenanceWindowInput {
          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(&DEREGISTERTASKFROMMAINTENANCEWINDOWINPUT_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.window_id = Some(deser.read_string(member)?);
          95  +
                    }
          96  +
                }
          97  +
                Some(1) => {
          98  +
                    if deser.is_null() {
          99  +
                        deser.read_null()?;
         100  +
                    } else {
         101  +
                        builder.window_task_id = Some(deser.read_string(member)?);
         102  +
                    }
         103  +
                }
         104  +
                _ => {}
         105  +
            }
         106  +
            Ok(())
         107  +
        })?;
         108  +
        builder.window_id = builder.window_id.or(Some(String::new()));
         109  +
        builder.window_task_id = builder.window_task_id.or(Some(String::new()));
         110  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         111  +
    }
         112  +
}
         113  +
impl DeregisterTaskFromMaintenanceWindowInput {
         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 DeregisterTaskFromMaintenanceWindowInput {
         125  +
    /// Creates a new builder-style object to manufacture [`DeregisterTaskFromMaintenanceWindowInput`](crate::operation::deregister_task_from_maintenance_window::DeregisterTaskFromMaintenanceWindowInput).
         126  +
    pub fn builder() -> crate::operation::deregister_task_from_maintenance_window::builders::DeregisterTaskFromMaintenanceWindowInputBuilder {
         127  +
        crate::operation::deregister_task_from_maintenance_window::builders::DeregisterTaskFromMaintenanceWindowInputBuilder::default()
         128  +
    }
         129  +
}
         130  +
         131  +
/// A builder for [`DeregisterTaskFromMaintenanceWindowInput`](crate::operation::deregister_task_from_maintenance_window::DeregisterTaskFromMaintenanceWindowInput).
         132  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         133  +
#[non_exhaustive]
         134  +
pub struct DeregisterTaskFromMaintenanceWindowInputBuilder {
         135  +
    pub(crate) window_id: ::std::option::Option<::std::string::String>,
         136  +
    pub(crate) window_task_id: ::std::option::Option<::std::string::String>,
         137  +
}
         138  +
impl DeregisterTaskFromMaintenanceWindowInputBuilder {
         139  +
    /// <p>The ID of the maintenance window the task should be removed from.</p>
         140  +
    /// This field is required.
         141  +
    pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         142  +
        self.window_id = ::std::option::Option::Some(input.into());
         143  +
        self
         144  +
    }
         145  +
    /// <p>The ID of the maintenance window the task should be removed from.</p>
         146  +
    pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         147  +
        self.window_id = input;
         148  +
        self
         149  +
    }
         150  +
    /// <p>The ID of the maintenance window the task should be removed from.</p>
         151  +
    pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
         152  +
        &self.window_id
         153  +
    }
         154  +
    /// <p>The ID of the task to remove from the maintenance window.</p>
         155  +
    /// This field is required.
         156  +
    pub fn window_task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         157  +
        self.window_task_id = ::std::option::Option::Some(input.into());
         158  +
        self
         159  +
    }
         160  +
    /// <p>The ID of the task to remove from the maintenance window.</p>
         161  +
    pub fn set_window_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         162  +
        self.window_task_id = input;
         163  +
        self
         164  +
    }
         165  +
    /// <p>The ID of the task to remove from the maintenance window.</p>
         166  +
    pub fn get_window_task_id(&self) -> &::std::option::Option<::std::string::String> {
         167  +
        &self.window_task_id
         168  +
    }
         169  +
    /// Consumes the builder and constructs a [`DeregisterTaskFromMaintenanceWindowInput`](crate::operation::deregister_task_from_maintenance_window::DeregisterTaskFromMaintenanceWindowInput).
         170  +
    pub fn build(
         171  +
        self,
         172  +
    ) -> ::std::result::Result<
         173  +
        crate::operation::deregister_task_from_maintenance_window::DeregisterTaskFromMaintenanceWindowInput,
         174  +
        ::aws_smithy_types::error::operation::BuildError,
         175  +
    > {
         176  +
        ::std::result::Result::Ok(
         177  +
            crate::operation::deregister_task_from_maintenance_window::DeregisterTaskFromMaintenanceWindowInput {
         178  +
                window_id: self.window_id,
         179  +
                window_task_id: self.window_task_id,
         180  +
            },
         181  +
        )
         182  +
    }
         183  +
}

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

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