AWS SDK

AWS SDK

rev. 18b1dd205ff4335251e6dd0ecb88193de1b1cede (ignoring whitespace)

Files changed:

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

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

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

@@ -0,1 +0,763 @@
           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)]
           5  +
pub struct CreateMaintenanceWindowInput {
           6  +
    /// <p>The name of the maintenance window.</p>
           7  +
    pub name: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.</p>
           9  +
    pub description: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active. <code>StartDate</code> allows you to delay activation of the maintenance window until the specified future date.</p><note>
          11  +
    /// <p>When using a rate schedule, if you provide a start date that occurs in the past, the current date and time are used as the start date.</p>
          12  +
    /// </note>
          13  +
    pub start_date: ::std::option::Option<::std::string::String>,
          14  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive. <code>EndDate</code> allows you to set a date and time in the future when the maintenance window will no longer run.</p>
          15  +
    pub end_date: ::std::option::Option<::std::string::String>,
          16  +
    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
          17  +
    pub schedule: ::std::option::Option<::std::string::String>,
          18  +
    /// <p>The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the <a href="https://www.iana.org/time-zones">Time Zone Database</a> on the IANA website.</p>
          19  +
    pub schedule_timezone: ::std::option::Option<::std::string::String>,
          20  +
    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
          21  +
    /// <p>For example, the following cron expression schedules a maintenance window to run on the third Tuesday of every month at 11:30 PM.</p>
          22  +
    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
          23  +
    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
          24  +
    pub schedule_offset: ::std::option::Option<i32>,
          25  +
    /// <p>The duration of the maintenance window in hours.</p>
          26  +
    pub duration: ::std::option::Option<i32>,
          27  +
    /// <p>The number of hours before the end of the maintenance window that Amazon Web Services Systems Manager stops scheduling new tasks for execution.</p>
          28  +
    pub cutoff: ::std::option::Option<i32>,
          29  +
    /// <p>Enables a maintenance window task to run on managed nodes, even if you haven't registered those nodes as targets. If enabled, then you must specify the unregistered managed nodes (by node ID) when you register a task with the maintenance window.</p>
          30  +
    /// <p>If you don't enable this option, then you must specify previously-registered targets when you register a task with the maintenance window.</p>
          31  +
    pub allow_unassociated_targets: ::std::option::Option<bool>,
          32  +
    /// <p>User-provided idempotency token.</p>
          33  +
    pub client_token: ::std::option::Option<::std::string::String>,
          34  +
    /// <p>Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a maintenance window to identify the type of tasks it will run, the types of targets, and the environment it will run in. In this case, you could specify the following key-value pairs:</p>
          35  +
    /// <ul>
          36  +
    /// <li>
          37  +
    /// <p><code>Key=TaskType,Value=AgentUpdate</code></p></li>
          38  +
    /// <li>
          39  +
    /// <p><code>Key=OS,Value=Windows</code></p></li>
          40  +
    /// <li>
          41  +
    /// <p><code>Key=Environment,Value=Production</code></p></li>
          42  +
    /// </ul><note>
          43  +
    /// <p>To add tags to an existing maintenance window, use the <code>AddTagsToResource</code> operation.</p>
          44  +
    /// </note>
          45  +
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
          46  +
}
          47  +
impl CreateMaintenanceWindowInput {
          48  +
    /// <p>The name of the maintenance window.</p>
          49  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          50  +
        self.name.as_deref()
          51  +
    }
          52  +
    /// <p>An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.</p>
          53  +
    pub fn description(&self) -> ::std::option::Option<&str> {
          54  +
        self.description.as_deref()
          55  +
    }
          56  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active. <code>StartDate</code> allows you to delay activation of the maintenance window until the specified future date.</p><note>
          57  +
    /// <p>When using a rate schedule, if you provide a start date that occurs in the past, the current date and time are used as the start date.</p>
          58  +
    /// </note>
          59  +
    pub fn start_date(&self) -> ::std::option::Option<&str> {
          60  +
        self.start_date.as_deref()
          61  +
    }
          62  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive. <code>EndDate</code> allows you to set a date and time in the future when the maintenance window will no longer run.</p>
          63  +
    pub fn end_date(&self) -> ::std::option::Option<&str> {
          64  +
        self.end_date.as_deref()
          65  +
    }
          66  +
    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
          67  +
    pub fn schedule(&self) -> ::std::option::Option<&str> {
          68  +
        self.schedule.as_deref()
          69  +
    }
          70  +
    /// <p>The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the <a href="https://www.iana.org/time-zones">Time Zone Database</a> on the IANA website.</p>
          71  +
    pub fn schedule_timezone(&self) -> ::std::option::Option<&str> {
          72  +
        self.schedule_timezone.as_deref()
          73  +
    }
          74  +
    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
          75  +
    /// <p>For example, the following cron expression schedules a maintenance window to run on the third Tuesday of every month at 11:30 PM.</p>
          76  +
    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
          77  +
    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
          78  +
    pub fn schedule_offset(&self) -> ::std::option::Option<i32> {
          79  +
        self.schedule_offset
          80  +
    }
          81  +
    /// <p>The duration of the maintenance window in hours.</p>
          82  +
    pub fn duration(&self) -> ::std::option::Option<i32> {
          83  +
        self.duration
          84  +
    }
          85  +
    /// <p>The number of hours before the end of the maintenance window that Amazon Web Services Systems Manager stops scheduling new tasks for execution.</p>
          86  +
    pub fn cutoff(&self) -> ::std::option::Option<i32> {
          87  +
        self.cutoff
          88  +
    }
          89  +
    /// <p>Enables a maintenance window task to run on managed nodes, even if you haven't registered those nodes as targets. If enabled, then you must specify the unregistered managed nodes (by node ID) when you register a task with the maintenance window.</p>
          90  +
    /// <p>If you don't enable this option, then you must specify previously-registered targets when you register a task with the maintenance window.</p>
          91  +
    pub fn allow_unassociated_targets(&self) -> ::std::option::Option<bool> {
          92  +
        self.allow_unassociated_targets
          93  +
    }
          94  +
    /// <p>User-provided idempotency token.</p>
          95  +
    pub fn client_token(&self) -> ::std::option::Option<&str> {
          96  +
        self.client_token.as_deref()
          97  +
    }
          98  +
    /// <p>Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a maintenance window to identify the type of tasks it will run, the types of targets, and the environment it will run in. In this case, you could specify the following key-value pairs:</p>
          99  +
    /// <ul>
         100  +
    /// <li>
         101  +
    /// <p><code>Key=TaskType,Value=AgentUpdate</code></p></li>
         102  +
    /// <li>
         103  +
    /// <p><code>Key=OS,Value=Windows</code></p></li>
         104  +
    /// <li>
         105  +
    /// <p><code>Key=Environment,Value=Production</code></p></li>
         106  +
    /// </ul><note>
         107  +
    /// <p>To add tags to an existing maintenance window, use the <code>AddTagsToResource</code> operation.</p>
         108  +
    /// </note>
         109  +
    ///
         110  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
         111  +
    pub fn tags(&self) -> &[crate::types::Tag] {
         112  +
        self.tags.as_deref().unwrap_or_default()
         113  +
    }
         114  +
}
         115  +
impl ::std::fmt::Debug for CreateMaintenanceWindowInput {
         116  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         117  +
        let mut formatter = f.debug_struct("CreateMaintenanceWindowInput");
         118  +
        formatter.field("name", &self.name);
         119  +
        formatter.field("description", &"*** Sensitive Data Redacted ***");
         120  +
        formatter.field("start_date", &self.start_date);
         121  +
        formatter.field("end_date", &self.end_date);
         122  +
        formatter.field("schedule", &self.schedule);
         123  +
        formatter.field("schedule_timezone", &self.schedule_timezone);
         124  +
        formatter.field("schedule_offset", &self.schedule_offset);
         125  +
        formatter.field("duration", &self.duration);
         126  +
        formatter.field("cutoff", &self.cutoff);
         127  +
        formatter.field("allow_unassociated_targets", &self.allow_unassociated_targets);
         128  +
        formatter.field("client_token", &self.client_token);
         129  +
        formatter.field("tags", &self.tags);
         130  +
        formatter.finish()
         131  +
    }
         132  +
}
         133  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         134  +
    ::aws_smithy_schema::ShapeId::from_parts(
         135  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$Name",
         136  +
        "com.amazonaws.ssm.synthetic",
         137  +
        "CreateMaintenanceWindowInput",
         138  +
    ),
         139  +
    ::aws_smithy_schema::ShapeType::String,
         140  +
    "Name",
         141  +
    0,
         142  +
);
         143  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         144  +
    ::aws_smithy_schema::ShapeId::from_parts(
         145  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$Description",
         146  +
        "com.amazonaws.ssm.synthetic",
         147  +
        "CreateMaintenanceWindowInput",
         148  +
    ),
         149  +
    ::aws_smithy_schema::ShapeType::String,
         150  +
    "Description",
         151  +
    1,
         152  +
);
         153  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_START_DATE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         154  +
    ::aws_smithy_schema::ShapeId::from_parts(
         155  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$StartDate",
         156  +
        "com.amazonaws.ssm.synthetic",
         157  +
        "CreateMaintenanceWindowInput",
         158  +
    ),
         159  +
    ::aws_smithy_schema::ShapeType::String,
         160  +
    "StartDate",
         161  +
    2,
         162  +
);
         163  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_END_DATE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         164  +
    ::aws_smithy_schema::ShapeId::from_parts(
         165  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$EndDate",
         166  +
        "com.amazonaws.ssm.synthetic",
         167  +
        "CreateMaintenanceWindowInput",
         168  +
    ),
         169  +
    ::aws_smithy_schema::ShapeType::String,
         170  +
    "EndDate",
         171  +
    3,
         172  +
);
         173  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         174  +
    ::aws_smithy_schema::ShapeId::from_parts(
         175  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$Schedule",
         176  +
        "com.amazonaws.ssm.synthetic",
         177  +
        "CreateMaintenanceWindowInput",
         178  +
    ),
         179  +
    ::aws_smithy_schema::ShapeType::String,
         180  +
    "Schedule",
         181  +
    4,
         182  +
);
         183  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE_TIMEZONE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         184  +
    ::aws_smithy_schema::ShapeId::from_parts(
         185  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$ScheduleTimezone",
         186  +
        "com.amazonaws.ssm.synthetic",
         187  +
        "CreateMaintenanceWindowInput",
         188  +
    ),
         189  +
    ::aws_smithy_schema::ShapeType::String,
         190  +
    "ScheduleTimezone",
         191  +
    5,
         192  +
);
         193  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE_OFFSET: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         194  +
    ::aws_smithy_schema::ShapeId::from_parts(
         195  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$ScheduleOffset",
         196  +
        "com.amazonaws.ssm.synthetic",
         197  +
        "CreateMaintenanceWindowInput",
         198  +
    ),
         199  +
    ::aws_smithy_schema::ShapeType::Integer,
         200  +
    "ScheduleOffset",
         201  +
    6,
         202  +
);
         203  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_DURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         204  +
    ::aws_smithy_schema::ShapeId::from_parts(
         205  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$Duration",
         206  +
        "com.amazonaws.ssm.synthetic",
         207  +
        "CreateMaintenanceWindowInput",
         208  +
    ),
         209  +
    ::aws_smithy_schema::ShapeType::Integer,
         210  +
    "Duration",
         211  +
    7,
         212  +
);
         213  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_CUTOFF: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         214  +
    ::aws_smithy_schema::ShapeId::from_parts(
         215  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$Cutoff",
         216  +
        "com.amazonaws.ssm.synthetic",
         217  +
        "CreateMaintenanceWindowInput",
         218  +
    ),
         219  +
    ::aws_smithy_schema::ShapeType::Integer,
         220  +
    "Cutoff",
         221  +
    8,
         222  +
);
         223  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_ALLOW_UNASSOCIATED_TARGETS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         224  +
    ::aws_smithy_schema::ShapeId::from_parts(
         225  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$AllowUnassociatedTargets",
         226  +
        "com.amazonaws.ssm.synthetic",
         227  +
        "CreateMaintenanceWindowInput",
         228  +
    ),
         229  +
    ::aws_smithy_schema::ShapeType::Boolean,
         230  +
    "AllowUnassociatedTargets",
         231  +
    9,
         232  +
);
         233  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_CLIENT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         234  +
    ::aws_smithy_schema::ShapeId::from_parts(
         235  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$ClientToken",
         236  +
        "com.amazonaws.ssm.synthetic",
         237  +
        "CreateMaintenanceWindowInput",
         238  +
    ),
         239  +
    ::aws_smithy_schema::ShapeType::String,
         240  +
    "ClientToken",
         241  +
    10,
         242  +
);
         243  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_TAGS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         244  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#TagList$member", "com.amazonaws.ssm", "TagList"),
         245  +
    ::aws_smithy_schema::ShapeType::Structure,
         246  +
    "member",
         247  +
    0,
         248  +
);
         249  +
static CREATEMAINTENANCEWINDOWINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         250  +
    ::aws_smithy_schema::ShapeId::from_parts(
         251  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput$Tags",
         252  +
        "com.amazonaws.ssm.synthetic",
         253  +
        "CreateMaintenanceWindowInput",
         254  +
    ),
         255  +
    ::aws_smithy_schema::ShapeType::List,
         256  +
    "Tags",
         257  +
    11,
         258  +
)
         259  +
.with_list_member(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_TAGS_MEMBER);
         260  +
static CREATEMAINTENANCEWINDOWINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         261  +
    ::aws_smithy_schema::ShapeId::from_parts(
         262  +
        "com.amazonaws.ssm.synthetic#CreateMaintenanceWindowInput",
         263  +
        "com.amazonaws.ssm.synthetic",
         264  +
        "CreateMaintenanceWindowInput",
         265  +
    ),
         266  +
    ::aws_smithy_schema::ShapeType::Structure,
         267  +
    &[
         268  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_NAME,
         269  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_DESCRIPTION,
         270  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_START_DATE,
         271  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_END_DATE,
         272  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE,
         273  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE_TIMEZONE,
         274  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE_OFFSET,
         275  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_DURATION,
         276  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_CUTOFF,
         277  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_ALLOW_UNASSOCIATED_TARGETS,
         278  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_CLIENT_TOKEN,
         279  +
        &CREATEMAINTENANCEWINDOWINPUT_MEMBER_TAGS,
         280  +
    ],
         281  +
)
         282  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         283  +
.with_original_name("CreateMaintenanceWindowRequest");
         284  +
impl CreateMaintenanceWindowInput {
         285  +
    /// The schema for this shape.
         286  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CREATEMAINTENANCEWINDOWINPUT_SCHEMA;
         287  +
}
         288  +
impl ::aws_smithy_schema::serde::SerializableStruct for CreateMaintenanceWindowInput {
         289  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         290  +
    fn serialize_members(
         291  +
        &self,
         292  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         293  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         294  +
        if let Some(ref val) = self.name {
         295  +
            ser.write_string(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_NAME, val)?;
         296  +
        }
         297  +
        if let Some(ref val) = self.description {
         298  +
            ser.write_string(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_DESCRIPTION, val)?;
         299  +
        }
         300  +
        if let Some(ref val) = self.start_date {
         301  +
            ser.write_string(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_START_DATE, val)?;
         302  +
        }
         303  +
        if let Some(ref val) = self.end_date {
         304  +
            ser.write_string(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_END_DATE, val)?;
         305  +
        }
         306  +
        if let Some(ref val) = self.schedule {
         307  +
            ser.write_string(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE, val)?;
         308  +
        }
         309  +
        if let Some(ref val) = self.schedule_timezone {
         310  +
            ser.write_string(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE_TIMEZONE, val)?;
         311  +
        }
         312  +
        if let Some(ref val) = self.schedule_offset {
         313  +
            ser.write_integer(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_SCHEDULE_OFFSET, *val)?;
         314  +
        }
         315  +
        if let Some(ref val) = self.duration {
         316  +
            ser.write_integer(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_DURATION, *val)?;
         317  +
        }
         318  +
        if let Some(ref val) = self.cutoff {
         319  +
            ser.write_integer(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_CUTOFF, *val)?;
         320  +
        }
         321  +
        if let Some(ref val) = self.allow_unassociated_targets {
         322  +
            ser.write_boolean(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_ALLOW_UNASSOCIATED_TARGETS, *val)?;
         323  +
        }
         324  +
        if let Some(ref val) = self.client_token {
         325  +
            ser.write_string(&CREATEMAINTENANCEWINDOWINPUT_MEMBER_CLIENT_TOKEN, val)?;
         326  +
        }
         327  +
        if let Some(ref val) = self.tags {
         328  +
            ser.write_list(
         329  +
                &CREATEMAINTENANCEWINDOWINPUT_MEMBER_TAGS,
         330  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         331  +
                    for item in val {
         332  +
                        ser.write_struct(crate::types::Tag::SCHEMA, item)?;
         333  +
                    }
         334  +
                    Ok(())
         335  +
                },
         336  +
            )?;
         337  +
        }
         338  +
        Ok(())
         339  +
    }
         340  +
}
         341  +
impl CreateMaintenanceWindowInput {
         342  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         343  +
    pub fn deserialize(
         344  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         345  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         346  +
        #[allow(unused_variables, unused_mut)]
         347  +
        let mut builder = Self::builder();
         348  +
        #[allow(
         349  +
            unused_variables,
         350  +
            unreachable_code,
         351  +
            clippy::single_match,
         352  +
            clippy::match_single_binding,
         353  +
            clippy::diverging_sub_expression
         354  +
        )]
         355  +
        deserializer.read_struct(&CREATEMAINTENANCEWINDOWINPUT_SCHEMA, &mut |member, deser| {
         356  +
            match member.member_index() {
         357  +
                Some(0) => {
         358  +
                    if deser.is_null() {
         359  +
                        deser.read_null()?;
         360  +
                    } else {
         361  +
                        builder.name = Some(deser.read_string(member)?);
         362  +
                    }
         363  +
                }
         364  +
                Some(1) => {
         365  +
                    if deser.is_null() {
         366  +
                        deser.read_null()?;
         367  +
                    } else {
         368  +
                        builder.description = Some(deser.read_string(member)?);
         369  +
                    }
         370  +
                }
         371  +
                Some(2) => {
         372  +
                    if deser.is_null() {
         373  +
                        deser.read_null()?;
         374  +
                    } else {
         375  +
                        builder.start_date = Some(deser.read_string(member)?);
         376  +
                    }
         377  +
                }
         378  +
                Some(3) => {
         379  +
                    if deser.is_null() {
         380  +
                        deser.read_null()?;
         381  +
                    } else {
         382  +
                        builder.end_date = Some(deser.read_string(member)?);
         383  +
                    }
         384  +
                }
         385  +
                Some(4) => {
         386  +
                    if deser.is_null() {
         387  +
                        deser.read_null()?;
         388  +
                    } else {
         389  +
                        builder.schedule = Some(deser.read_string(member)?);
         390  +
                    }
         391  +
                }
         392  +
                Some(5) => {
         393  +
                    if deser.is_null() {
         394  +
                        deser.read_null()?;
         395  +
                    } else {
         396  +
                        builder.schedule_timezone = Some(deser.read_string(member)?);
         397  +
                    }
         398  +
                }
         399  +
                Some(6) => {
         400  +
                    if deser.is_null() {
         401  +
                        deser.read_null()?;
         402  +
                    } else {
         403  +
                        builder.schedule_offset = Some(deser.read_integer(member)?);
         404  +
                    }
         405  +
                }
         406  +
                Some(7) => {
         407  +
                    if deser.is_null() {
         408  +
                        deser.read_null()?;
         409  +
                    } else {
         410  +
                        builder.duration = Some(deser.read_integer(member)?);
         411  +
                    }
         412  +
                }
         413  +
                Some(8) => {
         414  +
                    if deser.is_null() {
         415  +
                        deser.read_null()?;
         416  +
                    } else {
         417  +
                        builder.cutoff = Some(deser.read_integer(member)?);
         418  +
                    }
         419  +
                }
         420  +
                Some(9) => {
         421  +
                    if deser.is_null() {
         422  +
                        deser.read_null()?;
         423  +
                    } else {
         424  +
                        builder.allow_unassociated_targets = Some(deser.read_boolean(member)?);
         425  +
                    }
         426  +
                }
         427  +
                Some(10) => {
         428  +
                    if deser.is_null() {
         429  +
                        deser.read_null()?;
         430  +
                    } else {
         431  +
                        builder.client_token = Some(deser.read_string(member)?);
         432  +
                    }
         433  +
                }
         434  +
                Some(11) => {
         435  +
                    if deser.is_null() {
         436  +
                        deser.read_null()?;
         437  +
                    } else {
         438  +
                        builder.tags = Some({
         439  +
                            let mut container = Vec::new();
         440  +
                            deser.read_list(member, &mut |deser| {
         441  +
                                container.push(crate::types::Tag::deserialize(deser)?);
         442  +
                                Ok(())
         443  +
                            })?;
         444  +
                            container
         445  +
                        });
         446  +
                    }
         447  +
                }
         448  +
                _ => {}
         449  +
            }
         450  +
            Ok(())
         451  +
        })?;
         452  +
        builder.name = builder.name.or(Some(String::new()));
         453  +
        builder.schedule = builder.schedule.or(Some(String::new()));
         454  +
        builder.duration = builder.duration.or(Some(0i32));
         455  +
        builder.cutoff = builder.cutoff.or(Some(0i32));
         456  +
        builder.allow_unassociated_targets = builder.allow_unassociated_targets.or(Some(false));
         457  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         458  +
    }
         459  +
}
         460  +
impl CreateMaintenanceWindowInput {
         461  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         462  +
    pub fn deserialize_with_response(
         463  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         464  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         465  +
        _status: u16,
         466  +
        _body: &[u8],
         467  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         468  +
        Self::deserialize(deserializer)
         469  +
    }
         470  +
}
         471  +
impl CreateMaintenanceWindowInput {
         472  +
    /// Creates a new builder-style object to manufacture [`CreateMaintenanceWindowInput`](crate::operation::create_maintenance_window::CreateMaintenanceWindowInput).
         473  +
    pub fn builder() -> crate::operation::create_maintenance_window::builders::CreateMaintenanceWindowInputBuilder {
         474  +
        crate::operation::create_maintenance_window::builders::CreateMaintenanceWindowInputBuilder::default()
         475  +
    }
         476  +
}
         477  +
         478  +
/// A builder for [`CreateMaintenanceWindowInput`](crate::operation::create_maintenance_window::CreateMaintenanceWindowInput).
         479  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
         480  +
#[non_exhaustive]
         481  +
pub struct CreateMaintenanceWindowInputBuilder {
         482  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         483  +
    pub(crate) description: ::std::option::Option<::std::string::String>,
         484  +
    pub(crate) start_date: ::std::option::Option<::std::string::String>,
         485  +
    pub(crate) end_date: ::std::option::Option<::std::string::String>,
         486  +
    pub(crate) schedule: ::std::option::Option<::std::string::String>,
         487  +
    pub(crate) schedule_timezone: ::std::option::Option<::std::string::String>,
         488  +
    pub(crate) schedule_offset: ::std::option::Option<i32>,
         489  +
    pub(crate) duration: ::std::option::Option<i32>,
         490  +
    pub(crate) cutoff: ::std::option::Option<i32>,
         491  +
    pub(crate) allow_unassociated_targets: ::std::option::Option<bool>,
         492  +
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
         493  +
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
         494  +
}
         495  +
impl CreateMaintenanceWindowInputBuilder {
         496  +
    /// <p>The name of the maintenance window.</p>
         497  +
    /// This field is required.
         498  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         499  +
        self.name = ::std::option::Option::Some(input.into());
         500  +
        self
         501  +
    }
         502  +
    /// <p>The name of the maintenance window.</p>
         503  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         504  +
        self.name = input;
         505  +
        self
         506  +
    }
         507  +
    /// <p>The name of the maintenance window.</p>
         508  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         509  +
        &self.name
         510  +
    }
         511  +
    /// <p>An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.</p>
         512  +
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         513  +
        self.description = ::std::option::Option::Some(input.into());
         514  +
        self
         515  +
    }
         516  +
    /// <p>An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.</p>
         517  +
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         518  +
        self.description = input;
         519  +
        self
         520  +
    }
         521  +
    /// <p>An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.</p>
         522  +
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
         523  +
        &self.description
         524  +
    }
         525  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active. <code>StartDate</code> allows you to delay activation of the maintenance window until the specified future date.</p><note>
         526  +
    /// <p>When using a rate schedule, if you provide a start date that occurs in the past, the current date and time are used as the start date.</p>
         527  +
    /// </note>
         528  +
    pub fn start_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         529  +
        self.start_date = ::std::option::Option::Some(input.into());
         530  +
        self
         531  +
    }
         532  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active. <code>StartDate</code> allows you to delay activation of the maintenance window until the specified future date.</p><note>
         533  +
    /// <p>When using a rate schedule, if you provide a start date that occurs in the past, the current date and time are used as the start date.</p>
         534  +
    /// </note>
         535  +
    pub fn set_start_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         536  +
        self.start_date = input;
         537  +
        self
         538  +
    }
         539  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active. <code>StartDate</code> allows you to delay activation of the maintenance window until the specified future date.</p><note>
         540  +
    /// <p>When using a rate schedule, if you provide a start date that occurs in the past, the current date and time are used as the start date.</p>
         541  +
    /// </note>
         542  +
    pub fn get_start_date(&self) -> &::std::option::Option<::std::string::String> {
         543  +
        &self.start_date
         544  +
    }
         545  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive. <code>EndDate</code> allows you to set a date and time in the future when the maintenance window will no longer run.</p>
         546  +
    pub fn end_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         547  +
        self.end_date = ::std::option::Option::Some(input.into());
         548  +
        self
         549  +
    }
         550  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive. <code>EndDate</code> allows you to set a date and time in the future when the maintenance window will no longer run.</p>
         551  +
    pub fn set_end_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         552  +
        self.end_date = input;
         553  +
        self
         554  +
    }
         555  +
    /// <p>The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive. <code>EndDate</code> allows you to set a date and time in the future when the maintenance window will no longer run.</p>
         556  +
    pub fn get_end_date(&self) -> &::std::option::Option<::std::string::String> {
         557  +
        &self.end_date
         558  +
    }
         559  +
    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
         560  +
    /// This field is required.
         561  +
    pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         562  +
        self.schedule = ::std::option::Option::Some(input.into());
         563  +
        self
         564  +
    }
         565  +
    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
         566  +
    pub fn set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         567  +
        self.schedule = input;
         568  +
        self
         569  +
    }
         570  +
    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
         571  +
    pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
         572  +
        &self.schedule
         573  +
    }
         574  +
    /// <p>The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the <a href="https://www.iana.org/time-zones">Time Zone Database</a> on the IANA website.</p>
         575  +
    pub fn schedule_timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         576  +
        self.schedule_timezone = ::std::option::Option::Some(input.into());
         577  +
        self
         578  +
    }
         579  +
    /// <p>The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the <a href="https://www.iana.org/time-zones">Time Zone Database</a> on the IANA website.</p>
         580  +
    pub fn set_schedule_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         581  +
        self.schedule_timezone = input;
         582  +
        self
         583  +
    }
         584  +
    /// <p>The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the <a href="https://www.iana.org/time-zones">Time Zone Database</a> on the IANA website.</p>
         585  +
    pub fn get_schedule_timezone(&self) -> &::std::option::Option<::std::string::String> {
         586  +
        &self.schedule_timezone
         587  +
    }
         588  +
    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
         589  +
    /// <p>For example, the following cron expression schedules a maintenance window to run on the third Tuesday of every month at 11:30 PM.</p>
         590  +
    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
         591  +
    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
         592  +
    pub fn schedule_offset(mut self, input: i32) -> Self {
         593  +
        self.schedule_offset = ::std::option::Option::Some(input);
         594  +
        self
         595  +
    }
         596  +
    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
         597  +
    /// <p>For example, the following cron expression schedules a maintenance window to run on the third Tuesday of every month at 11:30 PM.</p>
         598  +
    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
         599  +
    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
         600  +
    pub fn set_schedule_offset(mut self, input: ::std::option::Option<i32>) -> Self {
         601  +
        self.schedule_offset = input;
         602  +
        self
         603  +
    }
         604  +
    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
         605  +
    /// <p>For example, the following cron expression schedules a maintenance window to run on the third Tuesday of every month at 11:30 PM.</p>
         606  +
    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
         607  +
    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
         608  +
    pub fn get_schedule_offset(&self) -> &::std::option::Option<i32> {
         609  +
        &self.schedule_offset
         610  +
    }
         611  +
    /// <p>The duration of the maintenance window in hours.</p>
         612  +
    /// This field is required.
         613  +
    pub fn duration(mut self, input: i32) -> Self {
         614  +
        self.duration = ::std::option::Option::Some(input);
         615  +
        self
         616  +
    }
         617  +
    /// <p>The duration of the maintenance window in hours.</p>
         618  +
    pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
         619  +
        self.duration = input;
         620  +
        self
         621  +
    }
         622  +
    /// <p>The duration of the maintenance window in hours.</p>
         623  +
    pub fn get_duration(&self) -> &::std::option::Option<i32> {
         624  +
        &self.duration
         625  +
    }
         626  +
    /// <p>The number of hours before the end of the maintenance window that Amazon Web Services Systems Manager stops scheduling new tasks for execution.</p>
         627  +
    /// This field is required.
         628  +
    pub fn cutoff(mut self, input: i32) -> Self {
         629  +
        self.cutoff = ::std::option::Option::Some(input);
         630  +
        self
         631  +
    }
         632  +
    /// <p>The number of hours before the end of the maintenance window that Amazon Web Services Systems Manager stops scheduling new tasks for execution.</p>
         633  +
    pub fn set_cutoff(mut self, input: ::std::option::Option<i32>) -> Self {
         634  +
        self.cutoff = input;
         635  +
        self
         636  +
    }
         637  +
    /// <p>The number of hours before the end of the maintenance window that Amazon Web Services Systems Manager stops scheduling new tasks for execution.</p>
         638  +
    pub fn get_cutoff(&self) -> &::std::option::Option<i32> {
         639  +
        &self.cutoff
         640  +
    }
         641  +
    /// <p>Enables a maintenance window task to run on managed nodes, even if you haven't registered those nodes as targets. If enabled, then you must specify the unregistered managed nodes (by node ID) when you register a task with the maintenance window.</p>
         642  +
    /// <p>If you don't enable this option, then you must specify previously-registered targets when you register a task with the maintenance window.</p>
         643  +
    /// This field is required.
         644  +
    pub fn allow_unassociated_targets(mut self, input: bool) -> Self {
         645  +
        self.allow_unassociated_targets = ::std::option::Option::Some(input);
         646  +
        self
         647  +
    }
         648  +
    /// <p>Enables a maintenance window task to run on managed nodes, even if you haven't registered those nodes as targets. If enabled, then you must specify the unregistered managed nodes (by node ID) when you register a task with the maintenance window.</p>
         649  +
    /// <p>If you don't enable this option, then you must specify previously-registered targets when you register a task with the maintenance window.</p>
         650  +
    pub fn set_allow_unassociated_targets(mut self, input: ::std::option::Option<bool>) -> Self {
         651  +
        self.allow_unassociated_targets = input;
         652  +
        self
         653  +
    }
         654  +
    /// <p>Enables a maintenance window task to run on managed nodes, even if you haven't registered those nodes as targets. If enabled, then you must specify the unregistered managed nodes (by node ID) when you register a task with the maintenance window.</p>
         655  +
    /// <p>If you don't enable this option, then you must specify previously-registered targets when you register a task with the maintenance window.</p>
         656  +
    pub fn get_allow_unassociated_targets(&self) -> &::std::option::Option<bool> {
         657  +
        &self.allow_unassociated_targets
         658  +
    }
         659  +
    /// <p>User-provided idempotency token.</p>
         660  +
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         661  +
        self.client_token = ::std::option::Option::Some(input.into());
         662  +
        self
         663  +
    }
         664  +
    /// <p>User-provided idempotency token.</p>
         665  +
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         666  +
        self.client_token = input;
         667  +
        self
         668  +
    }
         669  +
    /// <p>User-provided idempotency token.</p>
         670  +
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
         671  +
        &self.client_token
         672  +
    }
         673  +
    /// Appends an item to `tags`.
         674  +
    ///
         675  +
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
         676  +
    ///
         677  +
    /// <p>Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a maintenance window to identify the type of tasks it will run, the types of targets, and the environment it will run in. In this case, you could specify the following key-value pairs:</p>
         678  +
    /// <ul>
         679  +
    /// <li>
         680  +
    /// <p><code>Key=TaskType,Value=AgentUpdate</code></p></li>
         681  +
    /// <li>
         682  +
    /// <p><code>Key=OS,Value=Windows</code></p></li>
         683  +
    /// <li>
         684  +
    /// <p><code>Key=Environment,Value=Production</code></p></li>
         685  +
    /// </ul><note>
         686  +
    /// <p>To add tags to an existing maintenance window, use the <code>AddTagsToResource</code> operation.</p>
         687  +
    /// </note>
         688  +
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
         689  +
        let mut v = self.tags.unwrap_or_default();
         690  +
        v.push(input);
         691  +
        self.tags = ::std::option::Option::Some(v);
         692  +
        self
         693  +
    }
         694  +
    /// <p>Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a maintenance window to identify the type of tasks it will run, the types of targets, and the environment it will run in. In this case, you could specify the following key-value pairs:</p>
         695  +
    /// <ul>
         696  +
    /// <li>
         697  +
    /// <p><code>Key=TaskType,Value=AgentUpdate</code></p></li>
         698  +
    /// <li>
         699  +
    /// <p><code>Key=OS,Value=Windows</code></p></li>
         700  +
    /// <li>
         701  +
    /// <p><code>Key=Environment,Value=Production</code></p></li>
         702  +
    /// </ul><note>
         703  +
    /// <p>To add tags to an existing maintenance window, use the <code>AddTagsToResource</code> operation.</p>
         704  +
    /// </note>
         705  +
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
         706  +
        self.tags = input;
         707  +
        self
         708  +
    }
         709  +
    /// <p>Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a maintenance window to identify the type of tasks it will run, the types of targets, and the environment it will run in. In this case, you could specify the following key-value pairs:</p>
         710  +
    /// <ul>
         711  +
    /// <li>
         712  +
    /// <p><code>Key=TaskType,Value=AgentUpdate</code></p></li>
         713  +
    /// <li>
         714  +
    /// <p><code>Key=OS,Value=Windows</code></p></li>
         715  +
    /// <li>
         716  +
    /// <p><code>Key=Environment,Value=Production</code></p></li>
         717  +
    /// </ul><note>
         718  +
    /// <p>To add tags to an existing maintenance window, use the <code>AddTagsToResource</code> operation.</p>
         719  +
    /// </note>
         720  +
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
         721  +
        &self.tags
         722  +
    }
         723  +
    /// Consumes the builder and constructs a [`CreateMaintenanceWindowInput`](crate::operation::create_maintenance_window::CreateMaintenanceWindowInput).
         724  +
    pub fn build(
         725  +
        self,
         726  +
    ) -> ::std::result::Result<
         727  +
        crate::operation::create_maintenance_window::CreateMaintenanceWindowInput,
         728  +
        ::aws_smithy_types::error::operation::BuildError,
         729  +
    > {
         730  +
        ::std::result::Result::Ok(crate::operation::create_maintenance_window::CreateMaintenanceWindowInput {
         731  +
            name: self.name,
         732  +
            description: self.description,
         733  +
            start_date: self.start_date,
         734  +
            end_date: self.end_date,
         735  +
            schedule: self.schedule,
         736  +
            schedule_timezone: self.schedule_timezone,
         737  +
            schedule_offset: self.schedule_offset,
         738  +
            duration: self.duration,
         739  +
            cutoff: self.cutoff,
         740  +
            allow_unassociated_targets: self.allow_unassociated_targets,
         741  +
            client_token: self.client_token,
         742  +
            tags: self.tags,
         743  +
        })
         744  +
    }
         745  +
}
         746  +
impl ::std::fmt::Debug for CreateMaintenanceWindowInputBuilder {
         747  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         748  +
        let mut formatter = f.debug_struct("CreateMaintenanceWindowInputBuilder");
         749  +
        formatter.field("name", &self.name);
         750  +
        formatter.field("description", &"*** Sensitive Data Redacted ***");
         751  +
        formatter.field("start_date", &self.start_date);
         752  +
        formatter.field("end_date", &self.end_date);
         753  +
        formatter.field("schedule", &self.schedule);
         754  +
        formatter.field("schedule_timezone", &self.schedule_timezone);
         755  +
        formatter.field("schedule_offset", &self.schedule_offset);
         756  +
        formatter.field("duration", &self.duration);
         757  +
        formatter.field("cutoff", &self.cutoff);
         758  +
        formatter.field("allow_unassociated_targets", &self.allow_unassociated_targets);
         759  +
        formatter.field("client_token", &self.client_token);
         760  +
        formatter.field("tags", &self.tags);
         761  +
        formatter.finish()
         762  +
    }
         763  +
}