aws_sdk_ssm/operation/update_maintenance_window/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_maintenance_window::_update_maintenance_window_output::UpdateMaintenanceWindowOutputBuilder;
3
4pub use crate::operation::update_maintenance_window::_update_maintenance_window_input::UpdateMaintenanceWindowInputBuilder;
5
6impl crate::operation::update_maintenance_window::builders::UpdateMaintenanceWindowInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::update_maintenance_window::UpdateMaintenanceWindowOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_maintenance_window::UpdateMaintenanceWindowError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_maintenance_window();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateMaintenanceWindow`.
24///
25/// <p>Updates an existing maintenance window. Only specified parameters are modified.</p><note>
26/// <p>The value you specify for <code>Duration</code> determines the specific end time for the maintenance window based on the time it begins. No maintenance window tasks are permitted to start after the resulting endtime minus the number of hours you specify for <code>Cutoff</code>. For example, if the maintenance window starts at 3 PM, the duration is three hours, and the value you specify for <code>Cutoff</code> is one hour, no maintenance window tasks can start after 5 PM.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct UpdateMaintenanceWindowFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::update_maintenance_window::builders::UpdateMaintenanceWindowInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::update_maintenance_window::UpdateMaintenanceWindowOutput,
37        crate::operation::update_maintenance_window::UpdateMaintenanceWindowError,
38    > for UpdateMaintenanceWindowFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::update_maintenance_window::UpdateMaintenanceWindowOutput,
46            crate::operation::update_maintenance_window::UpdateMaintenanceWindowError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl UpdateMaintenanceWindowFluentBuilder {
53    /// Creates a new `UpdateMaintenanceWindowFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the UpdateMaintenanceWindow as a reference.
62    pub fn as_input(&self) -> &crate::operation::update_maintenance_window::builders::UpdateMaintenanceWindowInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::update_maintenance_window::UpdateMaintenanceWindowOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::update_maintenance_window::UpdateMaintenanceWindowError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::update_maintenance_window::UpdateMaintenanceWindow::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::update_maintenance_window::UpdateMaintenanceWindow::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::update_maintenance_window::UpdateMaintenanceWindowOutput,
99        crate::operation::update_maintenance_window::UpdateMaintenanceWindowError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The ID of the maintenance window to update.</p>
114    pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.window_id(input.into());
116        self
117    }
118    /// <p>The ID of the maintenance window to update.</p>
119    pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_window_id(input);
121        self
122    }
123    /// <p>The ID of the maintenance window to update.</p>
124    pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_window_id()
126    }
127    /// <p>The name of the maintenance window.</p>
128    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.name(input.into());
130        self
131    }
132    /// <p>The name of the maintenance window.</p>
133    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_name(input);
135        self
136    }
137    /// <p>The name of the maintenance window.</p>
138    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_name()
140    }
141    /// <p>An optional description for the update request.</p>
142    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.description(input.into());
144        self
145    }
146    /// <p>An optional description for the update request.</p>
147    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_description(input);
149        self
150    }
151    /// <p>An optional description for the update request.</p>
152    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_description()
154    }
155    /// <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>
156    /// <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>
157    /// </note>
158    pub fn start_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.start_date(input.into());
160        self
161    }
162    /// <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>
163    /// <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>
164    /// </note>
165    pub fn set_start_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_start_date(input);
167        self
168    }
169    /// <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>
170    /// <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>
171    /// </note>
172    pub fn get_start_date(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_start_date()
174    }
175    /// <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>
176    pub fn end_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.end_date(input.into());
178        self
179    }
180    /// <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>
181    pub fn set_end_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_end_date(input);
183        self
184    }
185    /// <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>
186    pub fn get_end_date(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_end_date()
188    }
189    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
190    pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.schedule(input.into());
192        self
193    }
194    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
195    pub fn set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_schedule(input);
197        self
198    }
199    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
200    pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_schedule()
202    }
203    /// <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>
204    pub fn schedule_timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.schedule_timezone(input.into());
206        self
207    }
208    /// <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>
209    pub fn set_schedule_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.inner = self.inner.set_schedule_timezone(input);
211        self
212    }
213    /// <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>
214    pub fn get_schedule_timezone(&self) -> &::std::option::Option<::std::string::String> {
215        self.inner.get_schedule_timezone()
216    }
217    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
218    /// <p>For example, the following cron expression schedules a maintenance window to run the third Tuesday of every month at 11:30 PM.</p>
219    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
220    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
221    pub fn schedule_offset(mut self, input: i32) -> Self {
222        self.inner = self.inner.schedule_offset(input);
223        self
224    }
225    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
226    /// <p>For example, the following cron expression schedules a maintenance window to run the third Tuesday of every month at 11:30 PM.</p>
227    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
228    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
229    pub fn set_schedule_offset(mut self, input: ::std::option::Option<i32>) -> Self {
230        self.inner = self.inner.set_schedule_offset(input);
231        self
232    }
233    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
234    /// <p>For example, the following cron expression schedules a maintenance window to run the third Tuesday of every month at 11:30 PM.</p>
235    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
236    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
237    pub fn get_schedule_offset(&self) -> &::std::option::Option<i32> {
238        self.inner.get_schedule_offset()
239    }
240    /// <p>The duration of the maintenance window in hours.</p>
241    pub fn duration(mut self, input: i32) -> Self {
242        self.inner = self.inner.duration(input);
243        self
244    }
245    /// <p>The duration of the maintenance window in hours.</p>
246    pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
247        self.inner = self.inner.set_duration(input);
248        self
249    }
250    /// <p>The duration of the maintenance window in hours.</p>
251    pub fn get_duration(&self) -> &::std::option::Option<i32> {
252        self.inner.get_duration()
253    }
254    /// <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>
255    pub fn cutoff(mut self, input: i32) -> Self {
256        self.inner = self.inner.cutoff(input);
257        self
258    }
259    /// <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>
260    pub fn set_cutoff(mut self, input: ::std::option::Option<i32>) -> Self {
261        self.inner = self.inner.set_cutoff(input);
262        self
263    }
264    /// <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>
265    pub fn get_cutoff(&self) -> &::std::option::Option<i32> {
266        self.inner.get_cutoff()
267    }
268    /// <p>Whether targets must be registered with the maintenance window before tasks can be defined for those targets.</p>
269    pub fn allow_unassociated_targets(mut self, input: bool) -> Self {
270        self.inner = self.inner.allow_unassociated_targets(input);
271        self
272    }
273    /// <p>Whether targets must be registered with the maintenance window before tasks can be defined for those targets.</p>
274    pub fn set_allow_unassociated_targets(mut self, input: ::std::option::Option<bool>) -> Self {
275        self.inner = self.inner.set_allow_unassociated_targets(input);
276        self
277    }
278    /// <p>Whether targets must be registered with the maintenance window before tasks can be defined for those targets.</p>
279    pub fn get_allow_unassociated_targets(&self) -> &::std::option::Option<bool> {
280        self.inner.get_allow_unassociated_targets()
281    }
282    /// <p>Whether the maintenance window is enabled.</p>
283    pub fn enabled(mut self, input: bool) -> Self {
284        self.inner = self.inner.enabled(input);
285        self
286    }
287    /// <p>Whether the maintenance window is enabled.</p>
288    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
289        self.inner = self.inner.set_enabled(input);
290        self
291    }
292    /// <p>Whether the maintenance window is enabled.</p>
293    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
294        self.inner.get_enabled()
295    }
296    /// <p>If <code>True</code>, then all fields that are required by the <code>CreateMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
297    pub fn replace(mut self, input: bool) -> Self {
298        self.inner = self.inner.replace(input);
299        self
300    }
301    /// <p>If <code>True</code>, then all fields that are required by the <code>CreateMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
302    pub fn set_replace(mut self, input: ::std::option::Option<bool>) -> Self {
303        self.inner = self.inner.set_replace(input);
304        self
305    }
306    /// <p>If <code>True</code>, then all fields that are required by the <code>CreateMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
307    pub fn get_replace(&self) -> &::std::option::Option<bool> {
308        self.inner.get_replace()
309    }
310}