1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>Information about a task defined for a maintenance window.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
|
6 + | pub struct MaintenanceWindowTask {
|
7 + | /// <p>The ID of the maintenance window where the task is registered.</p>
|
8 + | pub window_id: ::std::option::Option<::std::string::String>,
|
9 + | /// <p>The task ID.</p>
|
10 + | pub window_task_id: ::std::option::Option<::std::string::String>,
|
11 + | /// <p>The resource that the task uses during execution. For <code>RUN_COMMAND</code> and <code>AUTOMATION</code> task types, <code>TaskArn</code> is the Amazon Web Services Systems Manager (SSM document) name or ARN. For <code>LAMBDA</code> tasks, it's the function name or ARN. For <code>STEP_FUNCTIONS</code> tasks, it's the state machine ARN.</p><note>
|
12 + | /// <p>Maintenance Window does not validate the TaskArn when you register a task. A successful registration does not guarantee that the TaskArn is valid.</p>
|
13 + | /// </note>
|
14 + | pub task_arn: ::std::option::Option<::std::string::String>,
|
15 + | /// <p>The type of task.</p>
|
16 + | pub r#type: ::std::option::Option<crate::types::MaintenanceWindowTaskType>,
|
17 + | /// <p>The targets (either managed nodes or tags). Managed nodes are specified using <code>Key=instanceids,Values=<instanceid1>
|
18 + | /// ,
|
19 + | /// <instanceid2></instanceid2>
|
20 + | /// </instanceid1></code>. Tags are specified using <code>Key=<tag name>
|
21 + | /// ,Values=
|
22 + | /// <tag value></tag>
|
23 + | /// </tag></code>.</p>
|
24 + | pub targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
|
25 + | /// <p>The parameters that should be passed to the task when it is run.</p><note>
|
26 + | /// <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>
|
27 + | /// </note>
|
28 + | pub task_parameters:
|
29 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MaintenanceWindowTaskParameterValueExpression>>,
|
30 + | /// <p>The priority of the task in the maintenance window. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p>
|
31 + | pub priority: i32,
|
32 + | /// <p>Information about an S3 bucket to write task-level logs to.</p><note>
|
33 + | /// <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>
|
34 + | /// </note>
|
35 + | pub logging_info: ::std::option::Option<crate::types::LoggingInfo>,
|
36 + | /// <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>
|
37 + | /// <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>
|
38 + | pub service_role_arn: ::std::option::Option<::std::string::String>,
|
39 + | /// <p>The maximum number of targets this task can be run for, in parallel.</p><note>
|
40 + | /// <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>
|
41 + | /// <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>
|
42 + | /// </note>
|
43 + | pub max_concurrency: ::std::option::Option<::std::string::String>,
|
44 + | /// <p>The maximum number of errors allowed before this task stops being scheduled.</p><note>
|
45 + | /// <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>
|
46 + | /// <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>
|
47 + | /// </note>
|
48 + | pub max_errors: ::std::option::Option<::std::string::String>,
|
49 + | /// <p>The task name.</p>
|
50 + | pub name: ::std::option::Option<::std::string::String>,
|
51 + | /// <p>A description of the task.</p>
|
52 + | pub description: ::std::option::Option<::std::string::String>,
|
53 + | /// <p>The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
|
54 + | pub cutoff_behavior: ::std::option::Option<crate::types::MaintenanceWindowTaskCutoffBehavior>,
|
55 + | /// <p>The details for the CloudWatch alarm applied to your maintenance window task.</p>
|
56 + | pub alarm_configuration: ::std::option::Option<crate::types::AlarmConfiguration>,
|
57 + | }
|
58 + | impl MaintenanceWindowTask {
|
59 + | /// <p>The ID of the maintenance window where the task is registered.</p>
|
60 + | pub fn window_id(&self) -> ::std::option::Option<&str> {
|
61 + | self.window_id.as_deref()
|
62 + | }
|
63 + | /// <p>The task ID.</p>
|
64 + | pub fn window_task_id(&self) -> ::std::option::Option<&str> {
|
65 + | self.window_task_id.as_deref()
|
66 + | }
|
67 + | /// <p>The resource that the task uses during execution. For <code>RUN_COMMAND</code> and <code>AUTOMATION</code> task types, <code>TaskArn</code> is the Amazon Web Services Systems Manager (SSM document) name or ARN. For <code>LAMBDA</code> tasks, it's the function name or ARN. For <code>STEP_FUNCTIONS</code> tasks, it's the state machine ARN.</p><note>
|
68 + | /// <p>Maintenance Window does not validate the TaskArn when you register a task. A successful registration does not guarantee that the TaskArn is valid.</p>
|
69 + | /// </note>
|
70 + | pub fn task_arn(&self) -> ::std::option::Option<&str> {
|
71 + | self.task_arn.as_deref()
|
72 + | }
|
73 + | /// <p>The type of task.</p>
|
74 + | pub fn r#type(&self) -> ::std::option::Option<&crate::types::MaintenanceWindowTaskType> {
|
75 + | self.r#type.as_ref()
|
76 + | }
|
77 + | /// <p>The targets (either managed nodes or tags). Managed nodes are specified using <code>Key=instanceids,Values=<instanceid1>
|
78 + | /// ,
|
79 + | /// <instanceid2></instanceid2>
|
80 + | /// </instanceid1></code>. Tags are specified using <code>Key=<tag name>
|
81 + | /// ,Values=
|
82 + | /// <tag value></tag>
|
83 + | /// </tag></code>.</p>
|
84 + | ///
|
85 + | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.targets.is_none()`.
|
86 + | pub fn targets(&self) -> &[crate::types::Target] {
|
87 + | self.targets.as_deref().unwrap_or_default()
|
88 + | }
|
89 + | /// <p>The parameters that should be passed to the task when it is run.</p><note>
|
90 + | /// <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>
|
91 + | /// </note>
|
92 + | pub fn task_parameters(
|
93 + | &self,
|
94 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::MaintenanceWindowTaskParameterValueExpression>> {
|
95 + | self.task_parameters.as_ref()
|
96 + | }
|
97 + | /// <p>The priority of the task in the maintenance window. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p>
|
98 + | pub fn priority(&self) -> i32 {
|
99 + | self.priority
|
100 + | }
|
101 + | /// <p>Information about an S3 bucket to write task-level logs to.</p><note>
|
102 + | /// <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>
|
103 + | /// </note>
|
104 + | pub fn logging_info(&self) -> ::std::option::Option<&crate::types::LoggingInfo> {
|
105 + | self.logging_info.as_ref()
|
106 + | }
|
107 + | /// <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>
|
108 + | /// <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>
|
109 + | pub fn service_role_arn(&self) -> ::std::option::Option<&str> {
|
110 + | self.service_role_arn.as_deref()
|
111 + | }
|
112 + | /// <p>The maximum number of targets this task can be run for, in parallel.</p><note>
|
113 + | /// <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>
|
114 + | /// <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>
|
115 + | /// </note>
|
116 + | pub fn max_concurrency(&self) -> ::std::option::Option<&str> {
|
117 + | self.max_concurrency.as_deref()
|
118 + | }
|
119 + | /// <p>The maximum number of errors allowed before this task stops being scheduled.</p><note>
|
120 + | /// <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>
|
121 + | /// <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>
|
122 + | /// </note>
|
123 + | pub fn max_errors(&self) -> ::std::option::Option<&str> {
|
124 + | self.max_errors.as_deref()
|
125 + | }
|
126 + | /// <p>The task name.</p>
|
127 + | pub fn name(&self) -> ::std::option::Option<&str> {
|
128 + | self.name.as_deref()
|
129 + | }
|
130 + | /// <p>A description of the task.</p>
|
131 + | pub fn description(&self) -> ::std::option::Option<&str> {
|
132 + | self.description.as_deref()
|
133 + | }
|
134 + | /// <p>The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
|
135 + | pub fn cutoff_behavior(&self) -> ::std::option::Option<&crate::types::MaintenanceWindowTaskCutoffBehavior> {
|
136 + | self.cutoff_behavior.as_ref()
|
137 + | }
|
138 + | /// <p>The details for the CloudWatch alarm applied to your maintenance window task.</p>
|
139 + | pub fn alarm_configuration(&self) -> ::std::option::Option<&crate::types::AlarmConfiguration> {
|
140 + | self.alarm_configuration.as_ref()
|
141 + | }
|
142 + | }
|
143 + | impl ::std::fmt::Debug for MaintenanceWindowTask {
|
144 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
145 + | let mut formatter = f.debug_struct("MaintenanceWindowTask");
|
146 + | formatter.field("window_id", &self.window_id);
|
147 + | formatter.field("window_task_id", &self.window_task_id);
|
148 + | formatter.field("task_arn", &self.task_arn);
|
149 + | formatter.field("r#type", &self.r#type);
|
150 + | formatter.field("targets", &self.targets);
|
151 + | formatter.field("task_parameters", &"*** Sensitive Data Redacted ***");
|
152 + | formatter.field("priority", &self.priority);
|
153 + | formatter.field("logging_info", &self.logging_info);
|
154 + | formatter.field("service_role_arn", &self.service_role_arn);
|
155 + | formatter.field("max_concurrency", &self.max_concurrency);
|
156 + | formatter.field("max_errors", &self.max_errors);
|
157 + | formatter.field("name", &self.name);
|
158 + | formatter.field("description", &"*** Sensitive Data Redacted ***");
|
159 + | formatter.field("cutoff_behavior", &self.cutoff_behavior);
|
160 + | formatter.field("alarm_configuration", &self.alarm_configuration);
|
161 + | formatter.finish()
|
162 + | }
|
163 + | }
|
164 + | static MAINTENANCEWINDOWTASK_MEMBER_WINDOW_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
165 + | ::aws_smithy_schema::ShapeId::from_parts(
|
166 + | "com.amazonaws.ssm#MaintenanceWindowTask$WindowId",
|
167 + | "com.amazonaws.ssm",
|
168 + | "MaintenanceWindowTask",
|
169 + | ),
|
170 + | ::aws_smithy_schema::ShapeType::String,
|
171 + | "WindowId",
|
172 + | 0,
|
173 + | );
|
174 + | static MAINTENANCEWINDOWTASK_MEMBER_WINDOW_TASK_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
175 + | ::aws_smithy_schema::ShapeId::from_parts(
|
176 + | "com.amazonaws.ssm#MaintenanceWindowTask$WindowTaskId",
|
177 + | "com.amazonaws.ssm",
|
178 + | "MaintenanceWindowTask",
|
179 + | ),
|
180 + | ::aws_smithy_schema::ShapeType::String,
|
181 + | "WindowTaskId",
|
182 + | 1,
|
183 + | );
|
184 + | static MAINTENANCEWINDOWTASK_MEMBER_TASK_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
185 + | ::aws_smithy_schema::ShapeId::from_parts(
|
186 + | "com.amazonaws.ssm#MaintenanceWindowTask$TaskArn",
|
187 + | "com.amazonaws.ssm",
|
188 + | "MaintenanceWindowTask",
|
189 + | ),
|
190 + | ::aws_smithy_schema::ShapeType::String,
|
191 + | "TaskArn",
|
192 + | 2,
|
193 + | );
|
194 + | static MAINTENANCEWINDOWTASK_MEMBER_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
195 + | ::aws_smithy_schema::ShapeId::from_parts(
|
196 + | "com.amazonaws.ssm#MaintenanceWindowTask$Type",
|
197 + | "com.amazonaws.ssm",
|
198 + | "MaintenanceWindowTask",
|
199 + | ),
|
200 + | ::aws_smithy_schema::ShapeType::String,
|
201 + | "Type",
|
202 + | 3,
|
203 + | );
|
204 + | static MAINTENANCEWINDOWTASK_MEMBER_TARGETS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
205 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Targets$member", "com.amazonaws.ssm", "Targets"),
|
206 + | ::aws_smithy_schema::ShapeType::Structure,
|
207 + | "member",
|
208 + | 0,
|
209 + | );
|
210 + | static MAINTENANCEWINDOWTASK_MEMBER_TARGETS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
211 + | ::aws_smithy_schema::ShapeId::from_parts(
|
212 + | "com.amazonaws.ssm#MaintenanceWindowTask$Targets",
|
213 + | "com.amazonaws.ssm",
|
214 + | "MaintenanceWindowTask",
|
215 + | ),
|
216 + | ::aws_smithy_schema::ShapeType::List,
|
217 + | "Targets",
|
218 + | 4,
|
219 + | )
|
220 + | .with_list_member(&MAINTENANCEWINDOWTASK_MEMBER_TARGETS_MEMBER);
|
221 + | static MAINTENANCEWINDOWTASK_MEMBER_TASK_PARAMETERS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
222 + | ::aws_smithy_schema::ShapeId::from_parts(
|
223 + | "com.amazonaws.ssm#MaintenanceWindowTaskParameters$key",
|
224 + | "com.amazonaws.ssm",
|
225 + | "MaintenanceWindowTaskParameters",
|
226 + | ),
|
227 + | ::aws_smithy_schema::ShapeType::String,
|
228 + | "key",
|
229 + | 0,
|
230 + | );
|
231 + | static MAINTENANCEWINDOWTASK_MEMBER_TASK_PARAMETERS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
232 + | ::aws_smithy_schema::ShapeId::from_parts(
|
233 + | "com.amazonaws.ssm#MaintenanceWindowTaskParameters$value",
|
234 + | "com.amazonaws.ssm",
|
235 + | "MaintenanceWindowTaskParameters",
|
236 + | ),
|
237 + | ::aws_smithy_schema::ShapeType::Structure,
|
238 + | "value",
|
239 + | 1,
|
240 + | );
|
241 + | static MAINTENANCEWINDOWTASK_MEMBER_TASK_PARAMETERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
242 + | ::aws_smithy_schema::ShapeId::from_parts(
|
243 + | "com.amazonaws.ssm#MaintenanceWindowTask$TaskParameters",
|
244 + | "com.amazonaws.ssm",
|
245 + | "MaintenanceWindowTask",
|
246 + | ),
|
247 + | ::aws_smithy_schema::ShapeType::Map,
|
248 + | "TaskParameters",
|
249 + | 5,
|
250 + | )
|
251 + | .with_map_members(
|
252 + | &MAINTENANCEWINDOWTASK_MEMBER_TASK_PARAMETERS_KEY,
|
253 + | &MAINTENANCEWINDOWTASK_MEMBER_TASK_PARAMETERS_VALUE,
|
254 + | );
|
255 + | static MAINTENANCEWINDOWTASK_MEMBER_PRIORITY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
256 + | ::aws_smithy_schema::ShapeId::from_parts(
|
257 + | "com.amazonaws.ssm#MaintenanceWindowTask$Priority",
|
258 + | "com.amazonaws.ssm",
|
259 + | "MaintenanceWindowTask",
|
260 + | ),
|
261 + | ::aws_smithy_schema::ShapeType::Integer,
|
262 + | "Priority",
|
263 + | 6,
|
264 + | );
|
265 + | static MAINTENANCEWINDOWTASK_MEMBER_LOGGING_INFO: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
266 + | ::aws_smithy_schema::ShapeId::from_parts(
|
267 + | "com.amazonaws.ssm#MaintenanceWindowTask$LoggingInfo",
|
268 + | "com.amazonaws.ssm",
|
269 + | "MaintenanceWindowTask",
|
270 + | ),
|
271 + | ::aws_smithy_schema::ShapeType::Structure,
|
272 + | "LoggingInfo",
|
273 + | 7,
|
274 + | );
|
275 + | static MAINTENANCEWINDOWTASK_MEMBER_SERVICE_ROLE_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
276 + | ::aws_smithy_schema::ShapeId::from_parts(
|
277 + | "com.amazonaws.ssm#MaintenanceWindowTask$ServiceRoleArn",
|
278 + | "com.amazonaws.ssm",
|
279 + | "MaintenanceWindowTask",
|
280 + | ),
|
281 + | ::aws_smithy_schema::ShapeType::String,
|
282 + | "ServiceRoleArn",
|
283 + | 8,
|
284 + | );
|
285 + | static MAINTENANCEWINDOWTASK_MEMBER_MAX_CONCURRENCY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
286 + | ::aws_smithy_schema::ShapeId::from_parts(
|
287 + | "com.amazonaws.ssm#MaintenanceWindowTask$MaxConcurrency",
|
288 + | "com.amazonaws.ssm",
|
289 + | "MaintenanceWindowTask",
|
290 + | ),
|
291 + | ::aws_smithy_schema::ShapeType::String,
|
292 + | "MaxConcurrency",
|
293 + | 9,
|
294 + | );
|
295 + | static MAINTENANCEWINDOWTASK_MEMBER_MAX_ERRORS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
296 + | ::aws_smithy_schema::ShapeId::from_parts(
|
297 + | "com.amazonaws.ssm#MaintenanceWindowTask$MaxErrors",
|
298 + | "com.amazonaws.ssm",
|
299 + | "MaintenanceWindowTask",
|
300 + | ),
|
301 + | ::aws_smithy_schema::ShapeType::String,
|
302 + | "MaxErrors",
|
303 + | 10,
|
304 + | );
|
305 + | static MAINTENANCEWINDOWTASK_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
306 + | ::aws_smithy_schema::ShapeId::from_parts(
|
307 + | "com.amazonaws.ssm#MaintenanceWindowTask$Name",
|
308 + | "com.amazonaws.ssm",
|
309 + | "MaintenanceWindowTask",
|
310 + | ),
|
311 + | ::aws_smithy_schema::ShapeType::String,
|
312 + | "Name",
|
313 + | 11,
|
314 + | );
|
315 + | static MAINTENANCEWINDOWTASK_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
316 + | ::aws_smithy_schema::ShapeId::from_parts(
|
317 + | "com.amazonaws.ssm#MaintenanceWindowTask$Description",
|
318 + | "com.amazonaws.ssm",
|
319 + | "MaintenanceWindowTask",
|
320 + | ),
|
321 + | ::aws_smithy_schema::ShapeType::String,
|
322 + | "Description",
|
323 + | 12,
|
324 + | );
|
325 + | static MAINTENANCEWINDOWTASK_MEMBER_CUTOFF_BEHAVIOR: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
326 + | ::aws_smithy_schema::ShapeId::from_parts(
|
327 + | "com.amazonaws.ssm#MaintenanceWindowTask$CutoffBehavior",
|
328 + | "com.amazonaws.ssm",
|
329 + | "MaintenanceWindowTask",
|
330 + | ),
|
331 + | ::aws_smithy_schema::ShapeType::String,
|
332 + | "CutoffBehavior",
|
333 + | 13,
|
334 + | );
|
335 + | static MAINTENANCEWINDOWTASK_MEMBER_ALARM_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
336 + | ::aws_smithy_schema::ShapeId::from_parts(
|
337 + | "com.amazonaws.ssm#MaintenanceWindowTask$AlarmConfiguration",
|
338 + | "com.amazonaws.ssm",
|
339 + | "MaintenanceWindowTask",
|
340 + | ),
|
341 + | ::aws_smithy_schema::ShapeType::Structure,
|
342 + | "AlarmConfiguration",
|
343 + | 14,
|
344 + | );
|
345 + | static MAINTENANCEWINDOWTASK_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
346 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#MaintenanceWindowTask", "com.amazonaws.ssm", "MaintenanceWindowTask"),
|
347 + | ::aws_smithy_schema::ShapeType::Structure,
|
348 + | &[
|
349 + | &MAINTENANCEWINDOWTASK_MEMBER_WINDOW_ID,
|
350 + | &MAINTENANCEWINDOWTASK_MEMBER_WINDOW_TASK_ID,
|
351 + | &MAINTENANCEWINDOWTASK_MEMBER_TASK_ARN,
|
352 + | &MAINTENANCEWINDOWTASK_MEMBER_TYPE,
|
353 + | &MAINTENANCEWINDOWTASK_MEMBER_TARGETS,
|
354 + | &MAINTENANCEWINDOWTASK_MEMBER_TASK_PARAMETERS,
|
355 + | &MAINTENANCEWINDOWTASK_MEMBER_PRIORITY,
|
356 + | &MAINTENANCEWINDOWTASK_MEMBER_LOGGING_INFO,
|
357 + | &MAINTENANCEWINDOWTASK_MEMBER_SERVICE_ROLE_ARN,
|
358 + | &MAINTENANCEWINDOWTASK_MEMBER_MAX_CONCURRENCY,
|
359 + | &MAINTENANCEWINDOWTASK_MEMBER_MAX_ERRORS,
|
360 + | &MAINTENANCEWINDOWTASK_MEMBER_NAME,
|
361 + | &MAINTENANCEWINDOWTASK_MEMBER_DESCRIPTION,
|
362 + | &MAINTENANCEWINDOWTASK_MEMBER_CUTOFF_BEHAVIOR,
|
363 + | &MAINTENANCEWINDOWTASK_MEMBER_ALARM_CONFIGURATION,
|
364 + | ],
|
365 + | );
|
366 + | impl MaintenanceWindowTask {
|
367 + | /// The schema for this shape.
|
368 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &MAINTENANCEWINDOWTASK_SCHEMA;
|
369 + | }
|
370 + | impl ::aws_smithy_schema::serde::SerializableStruct for MaintenanceWindowTask {
|
371 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
372 + | fn serialize_members(
|
373 + | &self,
|
374 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
375 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
376 + | if let Some(ref val) = self.window_id {
|
377 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_WINDOW_ID, val)?;
|
378 + | }
|
379 + | if let Some(ref val) = self.window_task_id {
|
380 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_WINDOW_TASK_ID, val)?;
|
381 + | }
|
382 + | if let Some(ref val) = self.task_arn {
|
383 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_TASK_ARN, val)?;
|
384 + | }
|
385 + | if let Some(ref val) = self.r#type {
|
386 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_TYPE, val.as_str())?;
|
387 + | }
|
388 + | if let Some(ref val) = self.targets {
|
389 + | ser.write_list(
|
390 + | &MAINTENANCEWINDOWTASK_MEMBER_TARGETS,
|
391 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
392 + | for item in val {
|
393 + | ser.write_struct(crate::types::Target::SCHEMA, item)?;
|
394 + | }
|
395 + | Ok(())
|
396 + | },
|
397 + | )?;
|
398 + | }
|
399 + | if let Some(ref val) = self.task_parameters {
|
400 + | ser.write_map(
|
401 + | &MAINTENANCEWINDOWTASK_MEMBER_TASK_PARAMETERS,
|
402 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
403 + | for (key, value) in val {
|
404 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
405 + | ser.write_struct(crate::types::MaintenanceWindowTaskParameterValueExpression::SCHEMA, value)?;
|
406 + | }
|
407 + | Ok(())
|
408 + | },
|
409 + | )?;
|
410 + | }
|
411 + | {
|
412 + | let val = &self.priority;
|
413 + | ser.write_integer(&MAINTENANCEWINDOWTASK_MEMBER_PRIORITY, *val)?;
|
414 + | }
|
415 + | if let Some(ref val) = self.logging_info {
|
416 + | ser.write_struct(&MAINTENANCEWINDOWTASK_MEMBER_LOGGING_INFO, val)?;
|
417 + | }
|
418 + | if let Some(ref val) = self.service_role_arn {
|
419 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_SERVICE_ROLE_ARN, val)?;
|
420 + | }
|
421 + | if let Some(ref val) = self.max_concurrency {
|
422 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_MAX_CONCURRENCY, val)?;
|
423 + | }
|
424 + | if let Some(ref val) = self.max_errors {
|
425 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_MAX_ERRORS, val)?;
|
426 + | }
|
427 + | if let Some(ref val) = self.name {
|
428 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_NAME, val)?;
|
429 + | }
|
430 + | if let Some(ref val) = self.description {
|
431 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_DESCRIPTION, val)?;
|
432 + | }
|
433 + | if let Some(ref val) = self.cutoff_behavior {
|
434 + | ser.write_string(&MAINTENANCEWINDOWTASK_MEMBER_CUTOFF_BEHAVIOR, val.as_str())?;
|
435 + | }
|
436 + | if let Some(ref val) = self.alarm_configuration {
|
437 + | ser.write_struct(&MAINTENANCEWINDOWTASK_MEMBER_ALARM_CONFIGURATION, val)?;
|
438 + | }
|
439 + | Ok(())
|
440 + | }
|
441 + | }
|
442 + | impl MaintenanceWindowTask {
|
443 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
444 + | pub fn deserialize(
|
445 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
446 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
447 + | #[allow(unused_variables, unused_mut)]
|
448 + | let mut builder = Self::builder();
|
449 + | #[allow(
|
450 + | unused_variables,
|
451 + | unreachable_code,
|
452 + | clippy::single_match,
|
453 + | clippy::match_single_binding,
|
454 + | clippy::diverging_sub_expression
|
455 + | )]
|
456 + | deserializer.read_struct(&MAINTENANCEWINDOWTASK_SCHEMA, &mut |member, deser| {
|
457 + | match member.member_index() {
|
458 + | Some(0) => {
|
459 + | if deser.is_null() {
|
460 + | deser.read_null()?;
|
461 + | } else {
|
462 + | builder.window_id = Some(deser.read_string(member)?);
|
463 + | }
|
464 + | }
|
465 + | Some(1) => {
|
466 + | if deser.is_null() {
|
467 + | deser.read_null()?;
|
468 + | } else {
|
469 + | builder.window_task_id = Some(deser.read_string(member)?);
|
470 + | }
|
471 + | }
|
472 + | Some(2) => {
|
473 + | if deser.is_null() {
|
474 + | deser.read_null()?;
|
475 + | } else {
|
476 + | builder.task_arn = Some(deser.read_string(member)?);
|
477 + | }
|
478 + | }
|
479 + | Some(3) => {
|
480 + | if deser.is_null() {
|
481 + | deser.read_null()?;
|
482 + | } else {
|
483 + | builder.r#type = Some(crate::types::MaintenanceWindowTaskType::from(deser.read_string(member)?.as_str()));
|
484 + | }
|
485 + | }
|
486 + | Some(4) => {
|
487 + | if deser.is_null() {
|
488 + | deser.read_null()?;
|
489 + | } else {
|
490 + | builder.targets = Some({
|
491 + | let mut container = Vec::new();
|
492 + | deser.read_list(member, &mut |deser| {
|
493 + | container.push(crate::types::Target::deserialize(deser)?);
|
494 + | Ok(())
|
495 + | })?;
|
496 + | container
|
497 + | });
|
498 + | }
|
499 + | }
|
500 + | Some(5) => {
|
501 + | if deser.is_null() {
|
502 + | deser.read_null()?;
|
503 + | } else {
|
504 + | builder.task_parameters = Some({
|
505 + | let mut container = std::collections::HashMap::new();
|
506 + | deser.read_map(member, &mut |key, deser| {
|
507 + | container.insert(key, crate::types::MaintenanceWindowTaskParameterValueExpression::deserialize(deser)?);
|
508 + | Ok(())
|
509 + | })?;
|
510 + | container
|
511 + | });
|
512 + | }
|
513 + | }
|
514 + | Some(6) => {
|
515 + | builder.priority = Some(deser.read_integer(member)?);
|
516 + | }
|
517 + | Some(7) => {
|
518 + | if deser.is_null() {
|
519 + | deser.read_null()?;
|
520 + | } else {
|
521 + | builder.logging_info = Some(crate::types::LoggingInfo::deserialize(deser)?);
|
522 + | }
|
523 + | }
|
524 + | Some(8) => {
|
525 + | if deser.is_null() {
|
526 + | deser.read_null()?;
|
527 + | } else {
|
528 + | builder.service_role_arn = Some(deser.read_string(member)?);
|
529 + | }
|
530 + | }
|
531 + | Some(9) => {
|
532 + | if deser.is_null() {
|
533 + | deser.read_null()?;
|
534 + | } else {
|
535 + | builder.max_concurrency = Some(deser.read_string(member)?);
|
536 + | }
|
537 + | }
|
538 + | Some(10) => {
|
539 + | if deser.is_null() {
|
540 + | deser.read_null()?;
|
541 + | } else {
|
542 + | builder.max_errors = Some(deser.read_string(member)?);
|
543 + | }
|
544 + | }
|
545 + | Some(11) => {
|
546 + | if deser.is_null() {
|
547 + | deser.read_null()?;
|
548 + | } else {
|
549 + | builder.name = Some(deser.read_string(member)?);
|
550 + | }
|
551 + | }
|
552 + | Some(12) => {
|
553 + | if deser.is_null() {
|
554 + | deser.read_null()?;
|
555 + | } else {
|
556 + | builder.description = Some(deser.read_string(member)?);
|
557 + | }
|
558 + | }
|
559 + | Some(13) => {
|
560 + | if deser.is_null() {
|
561 + | deser.read_null()?;
|
562 + | } else {
|
563 + | builder.cutoff_behavior = Some(crate::types::MaintenanceWindowTaskCutoffBehavior::from(
|
564 + | deser.read_string(member)?.as_str(),
|
565 + | ));
|
566 + | }
|
567 + | }
|
568 + | Some(14) => {
|
569 + | if deser.is_null() {
|
570 + | deser.read_null()?;
|
571 + | } else {
|
572 + | builder.alarm_configuration = Some(crate::types::AlarmConfiguration::deserialize(deser)?);
|
573 + | }
|
574 + | }
|
575 + | _ => {}
|
576 + | }
|
577 + | Ok(())
|
578 + | })?;
|
579 + | Ok(builder.build())
|
580 + | }
|
581 + | }
|
582 + | impl MaintenanceWindowTask {
|
583 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
584 + | pub fn deserialize_with_response(
|
585 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
586 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
587 + | _status: u16,
|
588 + | _body: &[u8],
|
589 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
590 + | Self::deserialize(deserializer)
|
591 + | }
|
592 + | }
|
593 + | impl MaintenanceWindowTask {
|
594 + | /// Creates a new builder-style object to manufacture [`MaintenanceWindowTask`](crate::types::MaintenanceWindowTask).
|
595 + | pub fn builder() -> crate::types::builders::MaintenanceWindowTaskBuilder {
|
596 + | crate::types::builders::MaintenanceWindowTaskBuilder::default()
|
597 + | }
|
598 + | }
|
599 + |
|
600 + | /// A builder for [`MaintenanceWindowTask`](crate::types::MaintenanceWindowTask).
|
601 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
|
602 + | #[non_exhaustive]
|
603 + | pub struct MaintenanceWindowTaskBuilder {
|
604 + | pub(crate) window_id: ::std::option::Option<::std::string::String>,
|
605 + | pub(crate) window_task_id: ::std::option::Option<::std::string::String>,
|
606 + | pub(crate) task_arn: ::std::option::Option<::std::string::String>,
|
607 + | pub(crate) r#type: ::std::option::Option<crate::types::MaintenanceWindowTaskType>,
|
608 + | pub(crate) targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
|
609 + | pub(crate) task_parameters:
|
610 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MaintenanceWindowTaskParameterValueExpression>>,
|
611 + | pub(crate) priority: ::std::option::Option<i32>,
|
612 + | pub(crate) logging_info: ::std::option::Option<crate::types::LoggingInfo>,
|
613 + | pub(crate) service_role_arn: ::std::option::Option<::std::string::String>,
|
614 + | pub(crate) max_concurrency: ::std::option::Option<::std::string::String>,
|
615 + | pub(crate) max_errors: ::std::option::Option<::std::string::String>,
|
616 + | pub(crate) name: ::std::option::Option<::std::string::String>,
|
617 + | pub(crate) description: ::std::option::Option<::std::string::String>,
|
618 + | pub(crate) cutoff_behavior: ::std::option::Option<crate::types::MaintenanceWindowTaskCutoffBehavior>,
|
619 + | pub(crate) alarm_configuration: ::std::option::Option<crate::types::AlarmConfiguration>,
|
620 + | }
|
621 + | impl MaintenanceWindowTaskBuilder {
|
622 + | /// <p>The ID of the maintenance window where the task is registered.</p>
|
623 + | pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
624 + | self.window_id = ::std::option::Option::Some(input.into());
|
625 + | self
|
626 + | }
|
627 + | /// <p>The ID of the maintenance window where the task is registered.</p>
|
628 + | pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
629 + | self.window_id = input;
|
630 + | self
|
631 + | }
|
632 + | /// <p>The ID of the maintenance window where the task is registered.</p>
|
633 + | pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
|
634 + | &self.window_id
|
635 + | }
|
636 + | /// <p>The task ID.</p>
|
637 + | pub fn window_task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
638 + | self.window_task_id = ::std::option::Option::Some(input.into());
|
639 + | self
|
640 + | }
|
641 + | /// <p>The task ID.</p>
|
642 + | pub fn set_window_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
643 + | self.window_task_id = input;
|
644 + | self
|
645 + | }
|
646 + | /// <p>The task ID.</p>
|
647 + | pub fn get_window_task_id(&self) -> &::std::option::Option<::std::string::String> {
|
648 + | &self.window_task_id
|
649 + | }
|
650 + | /// <p>The resource that the task uses during execution. For <code>RUN_COMMAND</code> and <code>AUTOMATION</code> task types, <code>TaskArn</code> is the Amazon Web Services Systems Manager (SSM document) name or ARN. For <code>LAMBDA</code> tasks, it's the function name or ARN. For <code>STEP_FUNCTIONS</code> tasks, it's the state machine ARN.</p><note>
|
651 + | /// <p>Maintenance Window does not validate the TaskArn when you register a task. A successful registration does not guarantee that the TaskArn is valid.</p>
|
652 + | /// </note>
|
653 + | pub fn task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
654 + | self.task_arn = ::std::option::Option::Some(input.into());
|
655 + | self
|
656 + | }
|
657 + | /// <p>The resource that the task uses during execution. For <code>RUN_COMMAND</code> and <code>AUTOMATION</code> task types, <code>TaskArn</code> is the Amazon Web Services Systems Manager (SSM document) name or ARN. For <code>LAMBDA</code> tasks, it's the function name or ARN. For <code>STEP_FUNCTIONS</code> tasks, it's the state machine ARN.</p><note>
|
658 + | /// <p>Maintenance Window does not validate the TaskArn when you register a task. A successful registration does not guarantee that the TaskArn is valid.</p>
|
659 + | /// </note>
|
660 + | pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
661 + | self.task_arn = input;
|
662 + | self
|
663 + | }
|
664 + | /// <p>The resource that the task uses during execution. For <code>RUN_COMMAND</code> and <code>AUTOMATION</code> task types, <code>TaskArn</code> is the Amazon Web Services Systems Manager (SSM document) name or ARN. For <code>LAMBDA</code> tasks, it's the function name or ARN. For <code>STEP_FUNCTIONS</code> tasks, it's the state machine ARN.</p><note>
|
665 + | /// <p>Maintenance Window does not validate the TaskArn when you register a task. A successful registration does not guarantee that the TaskArn is valid.</p>
|
666 + | /// </note>
|
667 + | pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
|
668 + | &self.task_arn
|
669 + | }
|
670 + | /// <p>The type of task.</p>
|
671 + | pub fn r#type(mut self, input: crate::types::MaintenanceWindowTaskType) -> Self {
|
672 + | self.r#type = ::std::option::Option::Some(input);
|
673 + | self
|
674 + | }
|
675 + | /// <p>The type of task.</p>
|
676 + | pub fn set_type(mut self, input: ::std::option::Option<crate::types::MaintenanceWindowTaskType>) -> Self {
|
677 + | self.r#type = input;
|
678 + | self
|
679 + | }
|
680 + | /// <p>The type of task.</p>
|
681 + | pub fn get_type(&self) -> &::std::option::Option<crate::types::MaintenanceWindowTaskType> {
|
682 + | &self.r#type
|
683 + | }
|
684 + | /// Appends an item to `targets`.
|
685 + | ///
|
686 + | /// To override the contents of this collection use [`set_targets`](Self::set_targets).
|
687 + | ///
|
688 + | /// <p>The targets (either managed nodes or tags). Managed nodes are specified using <code>Key=instanceids,Values=<instanceid1>
|
689 + | /// ,
|
690 + | /// <instanceid2></instanceid2>
|
691 + | /// </instanceid1></code>. Tags are specified using <code>Key=<tag name>
|
692 + | /// ,Values=
|
693 + | /// <tag value></tag>
|
694 + | /// </tag></code>.</p>
|
695 + | pub fn targets(mut self, input: crate::types::Target) -> Self {
|
696 + | let mut v = self.targets.unwrap_or_default();
|
697 + | v.push(input);
|
698 + | self.targets = ::std::option::Option::Some(v);
|
699 + | self
|
700 + | }
|
701 + | /// <p>The targets (either managed nodes or tags). Managed nodes are specified using <code>Key=instanceids,Values=<instanceid1>
|
702 + | /// ,
|
703 + | /// <instanceid2></instanceid2>
|
704 + | /// </instanceid1></code>. Tags are specified using <code>Key=<tag name>
|
705 + | /// ,Values=
|
706 + | /// <tag value></tag>
|
707 + | /// </tag></code>.</p>
|
708 + | pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
|
709 + | self.targets = input;
|
710 + | self
|
711 + | }
|
712 + | /// <p>The targets (either managed nodes or tags). Managed nodes are specified using <code>Key=instanceids,Values=<instanceid1>
|
713 + | /// ,
|
714 + | /// <instanceid2></instanceid2>
|
715 + | /// </instanceid1></code>. Tags are specified using <code>Key=<tag name>
|
716 + | /// ,Values=
|
717 + | /// <tag value></tag>
|
718 + | /// </tag></code>.</p>
|
719 + | pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
|
720 + | &self.targets
|
721 + | }
|
722 + | /// Adds a key-value pair to `task_parameters`.
|
723 + | ///
|
724 + | /// To override the contents of this collection use [`set_task_parameters`](Self::set_task_parameters).
|
725 + | ///
|
726 + | /// <p>The parameters that should be passed to the task when it is run.</p><note>
|
727 + | /// <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>
|
728 + | /// </note>
|
729 + | pub fn task_parameters(
|
730 + | mut self,
|
731 + | k: impl ::std::convert::Into<::std::string::String>,
|
732 + | v: crate::types::MaintenanceWindowTaskParameterValueExpression,
|
733 + | ) -> Self {
|
734 + | let mut hash_map = self.task_parameters.unwrap_or_default();
|
735 + | hash_map.insert(k.into(), v);
|
736 + | self.task_parameters = ::std::option::Option::Some(hash_map);
|
737 + | self
|
738 + | }
|
739 + | /// <p>The parameters that should be passed to the task when it is run.</p><note>
|
740 + | /// <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>
|
741 + | /// </note>
|
742 + | pub fn set_task_parameters(
|
743 + | mut self,
|
744 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MaintenanceWindowTaskParameterValueExpression>>,
|
745 + | ) -> Self {
|
746 + | self.task_parameters = input;
|
747 + | self
|
748 + | }
|
749 + | /// <p>The parameters that should be passed to the task when it is run.</p><note>
|
750 + | /// <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>
|
751 + | /// </note>
|
752 + | pub fn get_task_parameters(
|
753 + | &self,
|
754 + | ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MaintenanceWindowTaskParameterValueExpression>> {
|
755 + | &self.task_parameters
|
756 + | }
|
757 + | /// <p>The priority of the task in the maintenance window. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p>
|
758 + | pub fn priority(mut self, input: i32) -> Self {
|
759 + | self.priority = ::std::option::Option::Some(input);
|
760 + | self
|
761 + | }
|
762 + | /// <p>The priority of the task in the maintenance window. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p>
|
763 + | pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
|
764 + | self.priority = input;
|
765 + | self
|
766 + | }
|
767 + | /// <p>The priority of the task in the maintenance window. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p>
|
768 + | pub fn get_priority(&self) -> &::std::option::Option<i32> {
|
769 + | &self.priority
|
770 + | }
|
771 + | /// <p>Information about an S3 bucket to write task-level logs to.</p><note>
|
772 + | /// <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>
|
773 + | /// </note>
|
774 + | pub fn logging_info(mut self, input: crate::types::LoggingInfo) -> Self {
|
775 + | self.logging_info = ::std::option::Option::Some(input);
|
776 + | self
|
777 + | }
|
778 + | /// <p>Information about an S3 bucket to write task-level logs to.</p><note>
|
779 + | /// <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>
|
780 + | /// </note>
|
781 + | pub fn set_logging_info(mut self, input: ::std::option::Option<crate::types::LoggingInfo>) -> Self {
|
782 + | self.logging_info = input;
|
783 + | self
|
784 + | }
|
785 + | /// <p>Information about an S3 bucket to write task-level logs to.</p><note>
|
786 + | /// <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>
|
787 + | /// </note>
|
788 + | pub fn get_logging_info(&self) -> &::std::option::Option<crate::types::LoggingInfo> {
|
789 + | &self.logging_info
|
790 + | }
|
791 + | /// <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>
|
792 + | /// <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>
|
793 + | pub fn service_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
794 + | self.service_role_arn = ::std::option::Option::Some(input.into());
|
795 + | self
|
796 + | }
|
797 + | /// <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>
|
798 + | /// <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>
|
799 + | pub fn set_service_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
800 + | self.service_role_arn = input;
|
801 + | self
|
802 + | }
|
803 + | /// <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>
|
804 + | /// <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>
|
805 + | pub fn get_service_role_arn(&self) -> &::std::option::Option<::std::string::String> {
|
806 + | &self.service_role_arn
|
807 + | }
|
808 + | /// <p>The maximum number of targets this task can be run for, in parallel.</p><note>
|
809 + | /// <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>
|
810 + | /// <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>
|
811 + | /// </note>
|
812 + | pub fn max_concurrency(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
813 + | self.max_concurrency = ::std::option::Option::Some(input.into());
|
814 + | self
|
815 + | }
|
816 + | /// <p>The maximum number of targets this task can be run for, in parallel.</p><note>
|
817 + | /// <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>
|
818 + | /// <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>
|
819 + | /// </note>
|
820 + | pub fn set_max_concurrency(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
821 + | self.max_concurrency = input;
|
822 + | self
|
823 + | }
|
824 + | /// <p>The maximum number of targets this task can be run for, in parallel.</p><note>
|
825 + | /// <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>
|
826 + | /// <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>
|
827 + | /// </note>
|
828 + | pub fn get_max_concurrency(&self) -> &::std::option::Option<::std::string::String> {
|
829 + | &self.max_concurrency
|
830 + | }
|
831 + | /// <p>The maximum number of errors allowed before this task stops being scheduled.</p><note>
|
832 + | /// <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>
|
833 + | /// <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>
|
834 + | /// </note>
|
835 + | pub fn max_errors(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
836 + | self.max_errors = ::std::option::Option::Some(input.into());
|
837 + | self
|
838 + | }
|
839 + | /// <p>The maximum number of errors allowed before this task stops being scheduled.</p><note>
|
840 + | /// <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>
|
841 + | /// <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>
|
842 + | /// </note>
|
843 + | pub fn set_max_errors(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
844 + | self.max_errors = input;
|
845 + | self
|
846 + | }
|
847 + | /// <p>The maximum number of errors allowed before this task stops being scheduled.</p><note>
|
848 + | /// <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>
|
849 + | /// <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>
|
850 + | /// </note>
|
851 + | pub fn get_max_errors(&self) -> &::std::option::Option<::std::string::String> {
|
852 + | &self.max_errors
|
853 + | }
|
854 + | /// <p>The task name.</p>
|
855 + | pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
856 + | self.name = ::std::option::Option::Some(input.into());
|
857 + | self
|
858 + | }
|
859 + | /// <p>The task name.</p>
|
860 + | pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
861 + | self.name = input;
|
862 + | self
|
863 + | }
|
864 + | /// <p>The task name.</p>
|
865 + | pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
|
866 + | &self.name
|
867 + | }
|
868 + | /// <p>A description of the task.</p>
|
869 + | pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
870 + | self.description = ::std::option::Option::Some(input.into());
|
871 + | self
|
872 + | }
|
873 + | /// <p>A description of the task.</p>
|
874 + | pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
875 + | self.description = input;
|
876 + | self
|
877 + | }
|
878 + | /// <p>A description of the task.</p>
|
879 + | pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
|
880 + | &self.description
|
881 + | }
|
882 + | /// <p>The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
|
883 + | pub fn cutoff_behavior(mut self, input: crate::types::MaintenanceWindowTaskCutoffBehavior) -> Self {
|
884 + | self.cutoff_behavior = ::std::option::Option::Some(input);
|
885 + | self
|
886 + | }
|
887 + | /// <p>The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
|
888 + | pub fn set_cutoff_behavior(mut self, input: ::std::option::Option<crate::types::MaintenanceWindowTaskCutoffBehavior>) -> Self {
|
889 + | self.cutoff_behavior = input;
|
890 + | self
|
891 + | }
|
892 + | /// <p>The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
|
893 + | pub fn get_cutoff_behavior(&self) -> &::std::option::Option<crate::types::MaintenanceWindowTaskCutoffBehavior> {
|
894 + | &self.cutoff_behavior
|
895 + | }
|
896 + | /// <p>The details for the CloudWatch alarm applied to your maintenance window task.</p>
|
897 + | pub fn alarm_configuration(mut self, input: crate::types::AlarmConfiguration) -> Self {
|
898 + | self.alarm_configuration = ::std::option::Option::Some(input);
|
899 + | self
|
900 + | }
|
901 + | /// <p>The details for the CloudWatch alarm applied to your maintenance window task.</p>
|
902 + | pub fn set_alarm_configuration(mut self, input: ::std::option::Option<crate::types::AlarmConfiguration>) -> Self {
|
903 + | self.alarm_configuration = input;
|
904 + | self
|
905 + | }
|
906 + | /// <p>The details for the CloudWatch alarm applied to your maintenance window task.</p>
|
907 + | pub fn get_alarm_configuration(&self) -> &::std::option::Option<crate::types::AlarmConfiguration> {
|
908 + | &self.alarm_configuration
|
909 + | }
|
910 + | /// Consumes the builder and constructs a [`MaintenanceWindowTask`](crate::types::MaintenanceWindowTask).
|
911 + | pub fn build(self) -> crate::types::MaintenanceWindowTask {
|
912 + | crate::types::MaintenanceWindowTask {
|
913 + | window_id: self.window_id,
|
914 + | window_task_id: self.window_task_id,
|
915 + | task_arn: self.task_arn,
|
916 + | r#type: self.r#type,
|
917 + | targets: self.targets,
|
918 + | task_parameters: self.task_parameters,
|
919 + | priority: self.priority.unwrap_or_default(),
|
920 + | logging_info: self.logging_info,
|
921 + | service_role_arn: self.service_role_arn,
|
922 + | max_concurrency: self.max_concurrency,
|
923 + | max_errors: self.max_errors,
|
924 + | name: self.name,
|
925 + | description: self.description,
|
926 + | cutoff_behavior: self.cutoff_behavior,
|
927 + | alarm_configuration: self.alarm_configuration,
|
928 + | }
|
929 + | }
|
930 + | }
|
931 + | impl ::std::fmt::Debug for MaintenanceWindowTaskBuilder {
|
932 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
933 + | let mut formatter = f.debug_struct("MaintenanceWindowTaskBuilder");
|
934 + | formatter.field("window_id", &self.window_id);
|
935 + | formatter.field("window_task_id", &self.window_task_id);
|
936 + | formatter.field("task_arn", &self.task_arn);
|
937 + | formatter.field("r#type", &self.r#type);
|
938 + | formatter.field("targets", &self.targets);
|
939 + | formatter.field("task_parameters", &"*** Sensitive Data Redacted ***");
|
940 + | formatter.field("priority", &self.priority);
|
941 + | formatter.field("logging_info", &self.logging_info);
|
942 + | formatter.field("service_role_arn", &self.service_role_arn);
|
943 + | formatter.field("max_concurrency", &self.max_concurrency);
|
944 + | formatter.field("max_errors", &self.max_errors);
|
945 + | formatter.field("name", &self.name);
|
946 + | formatter.field("description", &"*** Sensitive Data Redacted ***");
|
947 + | formatter.field("cutoff_behavior", &self.cutoff_behavior);
|
948 + | formatter.field("alarm_configuration", &self.alarm_configuration);
|
949 + | formatter.finish()
|
950 + | }
|
951 + | }
|