aws_sdk_ssm/operation/update_maintenance_window_task/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_maintenance_window_task::_update_maintenance_window_task_output::UpdateMaintenanceWindowTaskOutputBuilder;
3
4pub use crate::operation::update_maintenance_window_task::_update_maintenance_window_task_input::UpdateMaintenanceWindowTaskInputBuilder;
5
6impl crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskInputBuilder {
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_task::UpdateMaintenanceWindowTaskOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_maintenance_window_task();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateMaintenanceWindowTask`.
24///
25/// <p>Modifies a task assigned to a maintenance window. You can't change the task type, but you can change the following values:</p>
26/// <ul>
27/// <li>
28/// <p><code>TaskARN</code>. For example, you can change a <code>RUN_COMMAND</code> task from <code>AWS-RunPowerShellScript</code> to <code>AWS-RunShellScript</code>.</p></li>
29/// <li>
30/// <p><code>ServiceRoleArn</code></p></li>
31/// <li>
32/// <p><code>TaskInvocationParameters</code></p></li>
33/// <li>
34/// <p><code>Priority</code></p></li>
35/// <li>
36/// <p><code>MaxConcurrency</code></p></li>
37/// <li>
38/// <p><code>MaxErrors</code></p></li>
39/// </ul><note>
40/// <p>One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">Registering maintenance window tasks without targets</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
41/// </note>
42/// <p>If the value for a parameter in <code>UpdateMaintenanceWindowTask</code> is null, then the corresponding field isn't modified. If you set <code>Replace</code> to true, then all fields required by the <code>RegisterTaskWithMaintenanceWindow</code> operation are required for this request. Optional fields that aren't specified are set to null.</p><important>
43/// <p>When you update a maintenance window task that has options specified in <code>TaskInvocationParameters</code>, you must provide again all the <code>TaskInvocationParameters</code> values that you want to retain. The values you don't specify again are removed. For example, suppose that when you registered a Run Command task, you specified <code>TaskInvocationParameters</code> values for <code>Comment</code>, <code>NotificationConfig</code>, and <code>OutputS3BucketName</code>. If you update the maintenance window task and specify only a different <code>OutputS3BucketName</code> value, the values for <code>Comment</code> and <code>NotificationConfig</code> are removed.</p>
44/// </important>
45#[derive(::std::clone::Clone, ::std::fmt::Debug)]
46pub struct UpdateMaintenanceWindowTaskFluentBuilder {
47    handle: ::std::sync::Arc<crate::client::Handle>,
48    inner: crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskInputBuilder,
49    config_override: ::std::option::Option<crate::config::Builder>,
50}
51impl
52    crate::client::customize::internal::CustomizableSend<
53        crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput,
54        crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskError,
55    > for UpdateMaintenanceWindowTaskFluentBuilder
56{
57    fn send(
58        self,
59        config_override: crate::config::Builder,
60    ) -> crate::client::customize::internal::BoxFuture<
61        crate::client::customize::internal::SendResult<
62            crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput,
63            crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskError,
64        >,
65    > {
66        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
67    }
68}
69impl UpdateMaintenanceWindowTaskFluentBuilder {
70    /// Creates a new `UpdateMaintenanceWindowTaskFluentBuilder`.
71    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
72        Self {
73            handle,
74            inner: ::std::default::Default::default(),
75            config_override: ::std::option::Option::None,
76        }
77    }
78    /// Access the UpdateMaintenanceWindowTask as a reference.
79    pub fn as_input(&self) -> &crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskInputBuilder {
80        &self.inner
81    }
82    /// Sends the request and returns the response.
83    ///
84    /// If an error occurs, an `SdkError` will be returned with additional details that
85    /// can be matched against.
86    ///
87    /// By default, any retryable failures will be retried twice. Retry behavior
88    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
89    /// set when configuring the client.
90    pub async fn send(
91        self,
92    ) -> ::std::result::Result<
93        crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput,
94        ::aws_smithy_runtime_api::client::result::SdkError<
95            crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskError,
96            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
97        >,
98    > {
99        let input = self
100            .inner
101            .build()
102            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
103        let runtime_plugins = crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTask::operation_runtime_plugins(
104            self.handle.runtime_plugins.clone(),
105            &self.handle.conf,
106            self.config_override,
107        );
108        crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTask::orchestrate(&runtime_plugins, input).await
109    }
110
111    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
112    pub fn customize(
113        self,
114    ) -> crate::client::customize::CustomizableOperation<
115        crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput,
116        crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskError,
117        Self,
118    > {
119        crate::client::customize::CustomizableOperation::new(self)
120    }
121    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
122        self.set_config_override(::std::option::Option::Some(config_override.into()));
123        self
124    }
125
126    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
127        self.config_override = config_override;
128        self
129    }
130    /// <p>The maintenance window ID that contains the task to modify.</p>
131    pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.window_id(input.into());
133        self
134    }
135    /// <p>The maintenance window ID that contains the task to modify.</p>
136    pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_window_id(input);
138        self
139    }
140    /// <p>The maintenance window ID that contains the task to modify.</p>
141    pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_window_id()
143    }
144    /// <p>The task ID to modify.</p>
145    pub fn window_task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.window_task_id(input.into());
147        self
148    }
149    /// <p>The task ID to modify.</p>
150    pub fn set_window_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_window_task_id(input);
152        self
153    }
154    /// <p>The task ID to modify.</p>
155    pub fn get_window_task_id(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_window_task_id()
157    }
158    ///
159    /// Appends an item to `Targets`.
160    ///
161    /// To override the contents of this collection use [`set_targets`](Self::set_targets).
162    ///
163    /// <p>The targets (either managed nodes or tags) to modify. Managed nodes are specified using the format <code>Key=instanceids,Values=instanceID_1,instanceID_2</code>. Tags are specified using the format <code> Key=tag_name,Values=tag_value</code>.</p><note>
164    /// <p>One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">Registering maintenance window tasks without targets</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
165    /// </note>
166    pub fn targets(mut self, input: crate::types::Target) -> Self {
167        self.inner = self.inner.targets(input);
168        self
169    }
170    /// <p>The targets (either managed nodes or tags) to modify. Managed nodes are specified using the format <code>Key=instanceids,Values=instanceID_1,instanceID_2</code>. Tags are specified using the format <code> Key=tag_name,Values=tag_value</code>.</p><note>
171    /// <p>One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">Registering maintenance window tasks without targets</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
172    /// </note>
173    pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
174        self.inner = self.inner.set_targets(input);
175        self
176    }
177    /// <p>The targets (either managed nodes or tags) to modify. Managed nodes are specified using the format <code>Key=instanceids,Values=instanceID_1,instanceID_2</code>. Tags are specified using the format <code> Key=tag_name,Values=tag_value</code>.</p><note>
178    /// <p>One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">Registering maintenance window tasks without targets</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
179    /// </note>
180    pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
181        self.inner.get_targets()
182    }
183    /// <p>The task ARN to modify.</p>
184    pub fn task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.task_arn(input.into());
186        self
187    }
188    /// <p>The task ARN to modify.</p>
189    pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_task_arn(input);
191        self
192    }
193    /// <p>The task ARN to modify.</p>
194    pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_task_arn()
196    }
197    /// <p>The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run <code>RegisterTaskWithMaintenanceWindow</code>.</p>
198    /// <p>However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html">Setting up Maintenance Windows</a> in the in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
199    pub fn service_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.inner = self.inner.service_role_arn(input.into());
201        self
202    }
203    /// <p>The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run <code>RegisterTaskWithMaintenanceWindow</code>.</p>
204    /// <p>However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html">Setting up Maintenance Windows</a> in the in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
205    pub fn set_service_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206        self.inner = self.inner.set_service_role_arn(input);
207        self
208    }
209    /// <p>The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run <code>RegisterTaskWithMaintenanceWindow</code>.</p>
210    /// <p>However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html">Setting up Maintenance Windows</a> in the in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
211    pub fn get_service_role_arn(&self) -> &::std::option::Option<::std::string::String> {
212        self.inner.get_service_role_arn()
213    }
214    ///
215    /// Adds a key-value pair to `TaskParameters`.
216    ///
217    /// To override the contents of this collection use [`set_task_parameters`](Self::set_task_parameters).
218    ///
219    /// <p>The parameters to modify.</p><note>
220    /// <p><code>TaskParameters</code> has been deprecated. To specify parameters to pass to a task when it runs, instead use the <code>Parameters</code> option in the <code>TaskInvocationParameters</code> structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p>
221    /// </note>
222    /// <p>The map has the following format:</p>
223    /// <p>Key: string, between 1 and 255 characters</p>
224    /// <p>Value: an array of strings, each string is between 1 and 255 characters</p>
225    pub fn task_parameters(
226        mut self,
227        k: impl ::std::convert::Into<::std::string::String>,
228        v: crate::types::MaintenanceWindowTaskParameterValueExpression,
229    ) -> Self {
230        self.inner = self.inner.task_parameters(k.into(), v);
231        self
232    }
233    /// <p>The parameters to modify.</p><note>
234    /// <p><code>TaskParameters</code> has been deprecated. To specify parameters to pass to a task when it runs, instead use the <code>Parameters</code> option in the <code>TaskInvocationParameters</code> structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p>
235    /// </note>
236    /// <p>The map has the following format:</p>
237    /// <p>Key: string, between 1 and 255 characters</p>
238    /// <p>Value: an array of strings, each string is between 1 and 255 characters</p>
239    pub fn set_task_parameters(
240        mut self,
241        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MaintenanceWindowTaskParameterValueExpression>>,
242    ) -> Self {
243        self.inner = self.inner.set_task_parameters(input);
244        self
245    }
246    /// <p>The parameters to modify.</p><note>
247    /// <p><code>TaskParameters</code> has been deprecated. To specify parameters to pass to a task when it runs, instead use the <code>Parameters</code> option in the <code>TaskInvocationParameters</code> structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p>
248    /// </note>
249    /// <p>The map has the following format:</p>
250    /// <p>Key: string, between 1 and 255 characters</p>
251    /// <p>Value: an array of strings, each string is between 1 and 255 characters</p>
252    pub fn get_task_parameters(
253        &self,
254    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MaintenanceWindowTaskParameterValueExpression>> {
255        self.inner.get_task_parameters()
256    }
257    /// <p>The parameters that the task should use during execution. Populate only the fields that match the task type. All other fields should be empty.</p><important>
258    /// <p>When you update a maintenance window task that has options specified in <code>TaskInvocationParameters</code>, you must provide again all the <code>TaskInvocationParameters</code> values that you want to retain. The values you don't specify again are removed. For example, suppose that when you registered a Run Command task, you specified <code>TaskInvocationParameters</code> values for <code>Comment</code>, <code>NotificationConfig</code>, and <code>OutputS3BucketName</code>. If you update the maintenance window task and specify only a different <code>OutputS3BucketName</code> value, the values for <code>Comment</code> and <code>NotificationConfig</code> are removed.</p>
259    /// </important>
260    pub fn task_invocation_parameters(mut self, input: crate::types::MaintenanceWindowTaskInvocationParameters) -> Self {
261        self.inner = self.inner.task_invocation_parameters(input);
262        self
263    }
264    /// <p>The parameters that the task should use during execution. Populate only the fields that match the task type. All other fields should be empty.</p><important>
265    /// <p>When you update a maintenance window task that has options specified in <code>TaskInvocationParameters</code>, you must provide again all the <code>TaskInvocationParameters</code> values that you want to retain. The values you don't specify again are removed. For example, suppose that when you registered a Run Command task, you specified <code>TaskInvocationParameters</code> values for <code>Comment</code>, <code>NotificationConfig</code>, and <code>OutputS3BucketName</code>. If you update the maintenance window task and specify only a different <code>OutputS3BucketName</code> value, the values for <code>Comment</code> and <code>NotificationConfig</code> are removed.</p>
266    /// </important>
267    pub fn set_task_invocation_parameters(mut self, input: ::std::option::Option<crate::types::MaintenanceWindowTaskInvocationParameters>) -> Self {
268        self.inner = self.inner.set_task_invocation_parameters(input);
269        self
270    }
271    /// <p>The parameters that the task should use during execution. Populate only the fields that match the task type. All other fields should be empty.</p><important>
272    /// <p>When you update a maintenance window task that has options specified in <code>TaskInvocationParameters</code>, you must provide again all the <code>TaskInvocationParameters</code> values that you want to retain. The values you don't specify again are removed. For example, suppose that when you registered a Run Command task, you specified <code>TaskInvocationParameters</code> values for <code>Comment</code>, <code>NotificationConfig</code>, and <code>OutputS3BucketName</code>. If you update the maintenance window task and specify only a different <code>OutputS3BucketName</code> value, the values for <code>Comment</code> and <code>NotificationConfig</code> are removed.</p>
273    /// </important>
274    pub fn get_task_invocation_parameters(&self) -> &::std::option::Option<crate::types::MaintenanceWindowTaskInvocationParameters> {
275        self.inner.get_task_invocation_parameters()
276    }
277    /// <p>The new task priority to specify. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p>
278    pub fn priority(mut self, input: i32) -> Self {
279        self.inner = self.inner.priority(input);
280        self
281    }
282    /// <p>The new task priority to specify. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p>
283    pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
284        self.inner = self.inner.set_priority(input);
285        self
286    }
287    /// <p>The new task priority to specify. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p>
288    pub fn get_priority(&self) -> &::std::option::Option<i32> {
289        self.inner.get_priority()
290    }
291    /// <p>The new <code>MaxConcurrency</code> value you want to specify. <code>MaxConcurrency</code> is the number of targets that are allowed to run this task, in parallel.</p><note>
292    /// <p>Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> You must provide a value in all other cases.</p>
293    /// <p>For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of <code>1</code>. This value doesn't affect the running of your task.</p>
294    /// </note>
295    pub fn max_concurrency(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
296        self.inner = self.inner.max_concurrency(input.into());
297        self
298    }
299    /// <p>The new <code>MaxConcurrency</code> value you want to specify. <code>MaxConcurrency</code> is the number of targets that are allowed to run this task, in parallel.</p><note>
300    /// <p>Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> You must provide a value in all other cases.</p>
301    /// <p>For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of <code>1</code>. This value doesn't affect the running of your task.</p>
302    /// </note>
303    pub fn set_max_concurrency(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
304        self.inner = self.inner.set_max_concurrency(input);
305        self
306    }
307    /// <p>The new <code>MaxConcurrency</code> value you want to specify. <code>MaxConcurrency</code> is the number of targets that are allowed to run this task, in parallel.</p><note>
308    /// <p>Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> You must provide a value in all other cases.</p>
309    /// <p>For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of <code>1</code>. This value doesn't affect the running of your task.</p>
310    /// </note>
311    pub fn get_max_concurrency(&self) -> &::std::option::Option<::std::string::String> {
312        self.inner.get_max_concurrency()
313    }
314    /// <p>The new <code>MaxErrors</code> value to specify. <code>MaxErrors</code> is the maximum number of errors that are allowed before the task stops being scheduled.</p><note>
315    /// <p>Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> You must provide a value in all other cases.</p>
316    /// <p>For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of <code>1</code>. This value doesn't affect the running of your task.</p>
317    /// </note>
318    pub fn max_errors(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
319        self.inner = self.inner.max_errors(input.into());
320        self
321    }
322    /// <p>The new <code>MaxErrors</code> value to specify. <code>MaxErrors</code> is the maximum number of errors that are allowed before the task stops being scheduled.</p><note>
323    /// <p>Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> You must provide a value in all other cases.</p>
324    /// <p>For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of <code>1</code>. This value doesn't affect the running of your task.</p>
325    /// </note>
326    pub fn set_max_errors(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
327        self.inner = self.inner.set_max_errors(input);
328        self
329    }
330    /// <p>The new <code>MaxErrors</code> value to specify. <code>MaxErrors</code> is the maximum number of errors that are allowed before the task stops being scheduled.</p><note>
331    /// <p>Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> You must provide a value in all other cases.</p>
332    /// <p>For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of <code>1</code>. This value doesn't affect the running of your task.</p>
333    /// </note>
334    pub fn get_max_errors(&self) -> &::std::option::Option<::std::string::String> {
335        self.inner.get_max_errors()
336    }
337    /// <p>The new logging location in Amazon S3 to specify.</p><note>
338    /// <p><code>LoggingInfo</code> has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the <code>OutputS3BucketName</code> and <code>OutputS3KeyPrefix</code> options in the <code>TaskInvocationParameters</code> structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p>
339    /// </note>
340    pub fn logging_info(mut self, input: crate::types::LoggingInfo) -> Self {
341        self.inner = self.inner.logging_info(input);
342        self
343    }
344    /// <p>The new logging location in Amazon S3 to specify.</p><note>
345    /// <p><code>LoggingInfo</code> has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the <code>OutputS3BucketName</code> and <code>OutputS3KeyPrefix</code> options in the <code>TaskInvocationParameters</code> structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p>
346    /// </note>
347    pub fn set_logging_info(mut self, input: ::std::option::Option<crate::types::LoggingInfo>) -> Self {
348        self.inner = self.inner.set_logging_info(input);
349        self
350    }
351    /// <p>The new logging location in Amazon S3 to specify.</p><note>
352    /// <p><code>LoggingInfo</code> has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the <code>OutputS3BucketName</code> and <code>OutputS3KeyPrefix</code> options in the <code>TaskInvocationParameters</code> structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p>
353    /// </note>
354    pub fn get_logging_info(&self) -> &::std::option::Option<crate::types::LoggingInfo> {
355        self.inner.get_logging_info()
356    }
357    /// <p>The new task name to specify.</p>
358    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
359        self.inner = self.inner.name(input.into());
360        self
361    }
362    /// <p>The new task name to specify.</p>
363    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
364        self.inner = self.inner.set_name(input);
365        self
366    }
367    /// <p>The new task name to specify.</p>
368    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
369        self.inner.get_name()
370    }
371    /// <p>The new task description to specify.</p>
372    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
373        self.inner = self.inner.description(input.into());
374        self
375    }
376    /// <p>The new task description to specify.</p>
377    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
378        self.inner = self.inner.set_description(input);
379        self
380    }
381    /// <p>The new task description to specify.</p>
382    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
383        self.inner.get_description()
384    }
385    /// <p>If True, then all fields that are required by the <code>RegisterTaskWithMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
386    pub fn replace(mut self, input: bool) -> Self {
387        self.inner = self.inner.replace(input);
388        self
389    }
390    /// <p>If True, then all fields that are required by the <code>RegisterTaskWithMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
391    pub fn set_replace(mut self, input: ::std::option::Option<bool>) -> Self {
392        self.inner = self.inner.set_replace(input);
393        self
394    }
395    /// <p>If True, then all fields that are required by the <code>RegisterTaskWithMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
396    pub fn get_replace(&self) -> &::std::option::Option<bool> {
397        self.inner.get_replace()
398    }
399    /// <p>Indicates whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
400    /// <ul>
401    /// <li>
402    /// <p><code>CONTINUE_TASK</code>: When the cutoff time is reached, any tasks that are running continue. The default value.</p></li>
403    /// <li>
404    /// <p><code>CANCEL_TASK</code>:</p>
405    /// <ul>
406    /// <li>
407    /// <p>For Automation, Lambda, Step Functions tasks: When the cutoff time is reached, any task invocations that are already running continue, but no new task invocations are started.</p></li>
408    /// <li>
409    /// <p>For Run Command tasks: When the cutoff time is reached, the system sends a <code>CancelCommand</code> operation that attempts to cancel the command associated with the task. However, there is no guarantee that the command will be terminated and the underlying process stopped.</p></li>
410    /// </ul>
411    /// <p>The status for tasks that are not completed is <code>TIMED_OUT</code>.</p></li>
412    /// </ul>
413    pub fn cutoff_behavior(mut self, input: crate::types::MaintenanceWindowTaskCutoffBehavior) -> Self {
414        self.inner = self.inner.cutoff_behavior(input);
415        self
416    }
417    /// <p>Indicates whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
418    /// <ul>
419    /// <li>
420    /// <p><code>CONTINUE_TASK</code>: When the cutoff time is reached, any tasks that are running continue. The default value.</p></li>
421    /// <li>
422    /// <p><code>CANCEL_TASK</code>:</p>
423    /// <ul>
424    /// <li>
425    /// <p>For Automation, Lambda, Step Functions tasks: When the cutoff time is reached, any task invocations that are already running continue, but no new task invocations are started.</p></li>
426    /// <li>
427    /// <p>For Run Command tasks: When the cutoff time is reached, the system sends a <code>CancelCommand</code> operation that attempts to cancel the command associated with the task. However, there is no guarantee that the command will be terminated and the underlying process stopped.</p></li>
428    /// </ul>
429    /// <p>The status for tasks that are not completed is <code>TIMED_OUT</code>.</p></li>
430    /// </ul>
431    pub fn set_cutoff_behavior(mut self, input: ::std::option::Option<crate::types::MaintenanceWindowTaskCutoffBehavior>) -> Self {
432        self.inner = self.inner.set_cutoff_behavior(input);
433        self
434    }
435    /// <p>Indicates whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
436    /// <ul>
437    /// <li>
438    /// <p><code>CONTINUE_TASK</code>: When the cutoff time is reached, any tasks that are running continue. The default value.</p></li>
439    /// <li>
440    /// <p><code>CANCEL_TASK</code>:</p>
441    /// <ul>
442    /// <li>
443    /// <p>For Automation, Lambda, Step Functions tasks: When the cutoff time is reached, any task invocations that are already running continue, but no new task invocations are started.</p></li>
444    /// <li>
445    /// <p>For Run Command tasks: When the cutoff time is reached, the system sends a <code>CancelCommand</code> operation that attempts to cancel the command associated with the task. However, there is no guarantee that the command will be terminated and the underlying process stopped.</p></li>
446    /// </ul>
447    /// <p>The status for tasks that are not completed is <code>TIMED_OUT</code>.</p></li>
448    /// </ul>
449    pub fn get_cutoff_behavior(&self) -> &::std::option::Option<crate::types::MaintenanceWindowTaskCutoffBehavior> {
450        self.inner.get_cutoff_behavior()
451    }
452    /// <p>The CloudWatch alarm you want to apply to your maintenance window task.</p>
453    pub fn alarm_configuration(mut self, input: crate::types::AlarmConfiguration) -> Self {
454        self.inner = self.inner.alarm_configuration(input);
455        self
456    }
457    /// <p>The CloudWatch alarm you want to apply to your maintenance window task.</p>
458    pub fn set_alarm_configuration(mut self, input: ::std::option::Option<crate::types::AlarmConfiguration>) -> Self {
459        self.inner = self.inner.set_alarm_configuration(input);
460        self
461    }
462    /// <p>The CloudWatch alarm you want to apply to your maintenance window task.</p>
463    pub fn get_alarm_configuration(&self) -> &::std::option::Option<crate::types::AlarmConfiguration> {
464        self.inner.get_alarm_configuration()
465    }
466}