aws_sdk_ssm/operation/create_maintenance_window/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_maintenance_window::_create_maintenance_window_output::CreateMaintenanceWindowOutputBuilder;
3
4pub use crate::operation::create_maintenance_window::_create_maintenance_window_input::CreateMaintenanceWindowInputBuilder;
5
6impl crate::operation::create_maintenance_window::builders::CreateMaintenanceWindowInputBuilder {
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::create_maintenance_window::CreateMaintenanceWindowOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_maintenance_window::CreateMaintenanceWindowError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_maintenance_window();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateMaintenanceWindow`.
24///
25/// <p>Creates a new maintenance window.</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 CreateMaintenanceWindowFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_maintenance_window::builders::CreateMaintenanceWindowInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_maintenance_window::CreateMaintenanceWindowOutput,
37        crate::operation::create_maintenance_window::CreateMaintenanceWindowError,
38    > for CreateMaintenanceWindowFluentBuilder
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::create_maintenance_window::CreateMaintenanceWindowOutput,
46            crate::operation::create_maintenance_window::CreateMaintenanceWindowError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateMaintenanceWindowFluentBuilder {
53    /// Creates a new `CreateMaintenanceWindowFluentBuilder`.
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 CreateMaintenanceWindow as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_maintenance_window::builders::CreateMaintenanceWindowInputBuilder {
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::create_maintenance_window::CreateMaintenanceWindowOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_maintenance_window::CreateMaintenanceWindowError,
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::create_maintenance_window::CreateMaintenanceWindow::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_maintenance_window::CreateMaintenanceWindow::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::create_maintenance_window::CreateMaintenanceWindowOutput,
99        crate::operation::create_maintenance_window::CreateMaintenanceWindowError,
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 name of the maintenance window.</p>
114    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.name(input.into());
116        self
117    }
118    /// <p>The name of the maintenance window.</p>
119    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_name(input);
121        self
122    }
123    /// <p>The name of the maintenance window.</p>
124    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_name()
126    }
127    /// <p>An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.</p>
128    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.description(input.into());
130        self
131    }
132    /// <p>An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.</p>
133    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_description(input);
135        self
136    }
137    /// <p>An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.</p>
138    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_description()
140    }
141    /// <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>
142    /// <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>
143    /// </note>
144    pub fn start_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.start_date(input.into());
146        self
147    }
148    /// <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>
149    /// <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>
150    /// </note>
151    pub fn set_start_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_start_date(input);
153        self
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 get_start_date(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_start_date()
160    }
161    /// <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>
162    pub fn end_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.end_date(input.into());
164        self
165    }
166    /// <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>
167    pub fn set_end_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_end_date(input);
169        self
170    }
171    /// <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>
172    pub fn get_end_date(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_end_date()
174    }
175    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
176    pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.schedule(input.into());
178        self
179    }
180    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
181    pub fn set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_schedule(input);
183        self
184    }
185    /// <p>The schedule of the maintenance window in the form of a cron or rate expression.</p>
186    pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_schedule()
188    }
189    /// <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>
190    pub fn schedule_timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.schedule_timezone(input.into());
192        self
193    }
194    /// <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>
195    pub fn set_schedule_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_schedule_timezone(input);
197        self
198    }
199    /// <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>
200    pub fn get_schedule_timezone(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_schedule_timezone()
202    }
203    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
204    /// <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>
205    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
206    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
207    pub fn schedule_offset(mut self, input: i32) -> Self {
208        self.inner = self.inner.schedule_offset(input);
209        self
210    }
211    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
212    /// <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>
213    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
214    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
215    pub fn set_schedule_offset(mut self, input: ::std::option::Option<i32>) -> Self {
216        self.inner = self.inner.set_schedule_offset(input);
217        self
218    }
219    /// <p>The number of days to wait after the date and time specified by a cron expression before running the maintenance window.</p>
220    /// <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>
221    /// <p><code>cron(30 23 ? * TUE#3 *)</code></p>
222    /// <p>If the schedule offset is <code>2</code>, the maintenance window won't run until two days later.</p>
223    pub fn get_schedule_offset(&self) -> &::std::option::Option<i32> {
224        self.inner.get_schedule_offset()
225    }
226    /// <p>The duration of the maintenance window in hours.</p>
227    pub fn duration(mut self, input: i32) -> Self {
228        self.inner = self.inner.duration(input);
229        self
230    }
231    /// <p>The duration of the maintenance window in hours.</p>
232    pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
233        self.inner = self.inner.set_duration(input);
234        self
235    }
236    /// <p>The duration of the maintenance window in hours.</p>
237    pub fn get_duration(&self) -> &::std::option::Option<i32> {
238        self.inner.get_duration()
239    }
240    /// <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>
241    pub fn cutoff(mut self, input: i32) -> Self {
242        self.inner = self.inner.cutoff(input);
243        self
244    }
245    /// <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>
246    pub fn set_cutoff(mut self, input: ::std::option::Option<i32>) -> Self {
247        self.inner = self.inner.set_cutoff(input);
248        self
249    }
250    /// <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>
251    pub fn get_cutoff(&self) -> &::std::option::Option<i32> {
252        self.inner.get_cutoff()
253    }
254    /// <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>
255    /// <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>
256    pub fn allow_unassociated_targets(mut self, input: bool) -> Self {
257        self.inner = self.inner.allow_unassociated_targets(input);
258        self
259    }
260    /// <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>
261    /// <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>
262    pub fn set_allow_unassociated_targets(mut self, input: ::std::option::Option<bool>) -> Self {
263        self.inner = self.inner.set_allow_unassociated_targets(input);
264        self
265    }
266    /// <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>
267    /// <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>
268    pub fn get_allow_unassociated_targets(&self) -> &::std::option::Option<bool> {
269        self.inner.get_allow_unassociated_targets()
270    }
271    /// <p>User-provided idempotency token.</p>
272    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.inner = self.inner.client_token(input.into());
274        self
275    }
276    /// <p>User-provided idempotency token.</p>
277    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.inner = self.inner.set_client_token(input);
279        self
280    }
281    /// <p>User-provided idempotency token.</p>
282    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
283        self.inner.get_client_token()
284    }
285    ///
286    /// Appends an item to `Tags`.
287    ///
288    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
289    ///
290    /// <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>
291    /// <ul>
292    /// <li>
293    /// <p><code>Key=TaskType,Value=AgentUpdate</code></p></li>
294    /// <li>
295    /// <p><code>Key=OS,Value=Windows</code></p></li>
296    /// <li>
297    /// <p><code>Key=Environment,Value=Production</code></p></li>
298    /// </ul><note>
299    /// <p>To add tags to an existing maintenance window, use the <code>AddTagsToResource</code> operation.</p>
300    /// </note>
301    pub fn tags(mut self, input: crate::types::Tag) -> Self {
302        self.inner = self.inner.tags(input);
303        self
304    }
305    /// <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>
306    /// <ul>
307    /// <li>
308    /// <p><code>Key=TaskType,Value=AgentUpdate</code></p></li>
309    /// <li>
310    /// <p><code>Key=OS,Value=Windows</code></p></li>
311    /// <li>
312    /// <p><code>Key=Environment,Value=Production</code></p></li>
313    /// </ul><note>
314    /// <p>To add tags to an existing maintenance window, use the <code>AddTagsToResource</code> operation.</p>
315    /// </note>
316    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
317        self.inner = self.inner.set_tags(input);
318        self
319    }
320    /// <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>
321    /// <ul>
322    /// <li>
323    /// <p><code>Key=TaskType,Value=AgentUpdate</code></p></li>
324    /// <li>
325    /// <p><code>Key=OS,Value=Windows</code></p></li>
326    /// <li>
327    /// <p><code>Key=Environment,Value=Production</code></p></li>
328    /// </ul><note>
329    /// <p>To add tags to an existing maintenance window, use the <code>AddTagsToResource</code> operation.</p>
330    /// </note>
331    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
332        self.inner.get_tags()
333    }
334}