1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>Information about an Automation runbook used in a runbook workflow in Change Manager.</p><note>
|
4 + | /// <p>The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.</p>
|
5 + | /// </note>
|
6 + | #[non_exhaustive]
|
7 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8 + | pub struct Runbook {
|
9 + | /// <p>The name of the Automation runbook used in a runbook workflow.</p>
|
10 + | pub document_name: ::std::string::String,
|
11 + | /// <p>The version of the Automation runbook used in a runbook workflow.</p>
|
12 + | pub document_version: ::std::option::Option<::std::string::String>,
|
13 + | /// <p>The key-value map of execution parameters, which were supplied when calling <code>StartChangeRequestExecution</code>.</p>
|
14 + | pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
|
15 + | /// <p>The name of the parameter used as the target resource for the rate-controlled runbook workflow. Required if you specify <code>Targets</code>.</p>
|
16 + | pub target_parameter_name: ::std::option::Option<::std::string::String>,
|
17 + | /// <p>A key-value mapping to target resources that the runbook operation performs tasks on. Required if you specify <code>TargetParameterName</code>.</p>
|
18 + | pub targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
|
19 + | /// <p>A key-value mapping of runbook parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
|
20 + | pub target_maps:
|
21 + | ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
|
22 + | /// <p>The <code>MaxConcurrency</code> value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.</p>
|
23 + | pub max_concurrency: ::std::option::Option<::std::string::String>,
|
24 + | /// <p>The <code>MaxErrors</code> value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.</p>
|
25 + | pub max_errors: ::std::option::Option<::std::string::String>,
|
26 + | /// <p>Information about the Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Runbook operation.</p>
|
27 + | pub target_locations: ::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>>,
|
28 + | }
|
29 + | impl Runbook {
|
30 + | /// <p>The name of the Automation runbook used in a runbook workflow.</p>
|
31 + | pub fn document_name(&self) -> &str {
|
32 + | use std::ops::Deref;
|
33 + | self.document_name.deref()
|
34 + | }
|
35 + | /// <p>The version of the Automation runbook used in a runbook workflow.</p>
|
36 + | pub fn document_version(&self) -> ::std::option::Option<&str> {
|
37 + | self.document_version.as_deref()
|
38 + | }
|
39 + | /// <p>The key-value map of execution parameters, which were supplied when calling <code>StartChangeRequestExecution</code>.</p>
|
40 + | pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
|
41 + | self.parameters.as_ref()
|
42 + | }
|
43 + | /// <p>The name of the parameter used as the target resource for the rate-controlled runbook workflow. Required if you specify <code>Targets</code>.</p>
|
44 + | pub fn target_parameter_name(&self) -> ::std::option::Option<&str> {
|
45 + | self.target_parameter_name.as_deref()
|
46 + | }
|
47 + | /// <p>A key-value mapping to target resources that the runbook operation performs tasks on. Required if you specify <code>TargetParameterName</code>.</p>
|
48 + | ///
|
49 + | /// 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()`.
|
50 + | pub fn targets(&self) -> &[crate::types::Target] {
|
51 + | self.targets.as_deref().unwrap_or_default()
|
52 + | }
|
53 + | /// <p>A key-value mapping of runbook parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
|
54 + | ///
|
55 + | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_maps.is_none()`.
|
56 + | pub fn target_maps(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>] {
|
57 + | self.target_maps.as_deref().unwrap_or_default()
|
58 + | }
|
59 + | /// <p>The <code>MaxConcurrency</code> value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.</p>
|
60 + | pub fn max_concurrency(&self) -> ::std::option::Option<&str> {
|
61 + | self.max_concurrency.as_deref()
|
62 + | }
|
63 + | /// <p>The <code>MaxErrors</code> value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.</p>
|
64 + | pub fn max_errors(&self) -> ::std::option::Option<&str> {
|
65 + | self.max_errors.as_deref()
|
66 + | }
|
67 + | /// <p>Information about the Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Runbook operation.</p>
|
68 + | ///
|
69 + | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_locations.is_none()`.
|
70 + | pub fn target_locations(&self) -> &[crate::types::TargetLocation] {
|
71 + | self.target_locations.as_deref().unwrap_or_default()
|
72 + | }
|
73 + | }
|
74 + | static RUNBOOK_MEMBER_DOCUMENT_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
75 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$DocumentName", "com.amazonaws.ssm", "Runbook"),
|
76 + | ::aws_smithy_schema::ShapeType::String,
|
77 + | "DocumentName",
|
78 + | 0,
|
79 + | );
|
80 + | static RUNBOOK_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
81 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$DocumentVersion", "com.amazonaws.ssm", "Runbook"),
|
82 + | ::aws_smithy_schema::ShapeType::String,
|
83 + | "DocumentVersion",
|
84 + | 1,
|
85 + | );
|
86 + | static RUNBOOK_MEMBER_PARAMETERS_VALUE_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
87 + | ::aws_smithy_schema::ShapeId::from_parts(
|
88 + | "com.amazonaws.ssm#AutomationParameterValueList$member",
|
89 + | "com.amazonaws.ssm",
|
90 + | "AutomationParameterValueList",
|
91 + | ),
|
92 + | ::aws_smithy_schema::ShapeType::String,
|
93 + | "member",
|
94 + | 0,
|
95 + | );
|
96 + | static RUNBOOK_MEMBER_PARAMETERS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
97 + | ::aws_smithy_schema::ShapeId::from_parts(
|
98 + | "com.amazonaws.ssm#AutomationParameterMap$key",
|
99 + | "com.amazonaws.ssm",
|
100 + | "AutomationParameterMap",
|
101 + | ),
|
102 + | ::aws_smithy_schema::ShapeType::String,
|
103 + | "key",
|
104 + | 0,
|
105 + | );
|
106 + | static RUNBOOK_MEMBER_PARAMETERS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
107 + | ::aws_smithy_schema::ShapeId::from_parts(
|
108 + | "com.amazonaws.ssm#AutomationParameterMap$value",
|
109 + | "com.amazonaws.ssm",
|
110 + | "AutomationParameterMap",
|
111 + | ),
|
112 + | ::aws_smithy_schema::ShapeType::List,
|
113 + | "value",
|
114 + | 1,
|
115 + | )
|
116 + | .with_list_member(&RUNBOOK_MEMBER_PARAMETERS_VALUE_MEMBER);
|
117 + | static RUNBOOK_MEMBER_PARAMETERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
118 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$Parameters", "com.amazonaws.ssm", "Runbook"),
|
119 + | ::aws_smithy_schema::ShapeType::Map,
|
120 + | "Parameters",
|
121 + | 2,
|
122 + | )
|
123 + | .with_map_members(&RUNBOOK_MEMBER_PARAMETERS_KEY, &RUNBOOK_MEMBER_PARAMETERS_VALUE);
|
124 + | static RUNBOOK_MEMBER_TARGET_PARAMETER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
125 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$TargetParameterName", "com.amazonaws.ssm", "Runbook"),
|
126 + | ::aws_smithy_schema::ShapeType::String,
|
127 + | "TargetParameterName",
|
128 + | 3,
|
129 + | );
|
130 + | static RUNBOOK_MEMBER_TARGETS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
131 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Targets$member", "com.amazonaws.ssm", "Targets"),
|
132 + | ::aws_smithy_schema::ShapeType::Structure,
|
133 + | "member",
|
134 + | 0,
|
135 + | );
|
136 + | static RUNBOOK_MEMBER_TARGETS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
137 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$Targets", "com.amazonaws.ssm", "Runbook"),
|
138 + | ::aws_smithy_schema::ShapeType::List,
|
139 + | "Targets",
|
140 + | 4,
|
141 + | )
|
142 + | .with_list_member(&RUNBOOK_MEMBER_TARGETS_MEMBER);
|
143 + | static RUNBOOK_MEMBER_TARGET_MAPS_MEMBER_VALUE_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
144 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#TargetMapValueList$member", "com.amazonaws.ssm", "TargetMapValueList"),
|
145 + | ::aws_smithy_schema::ShapeType::String,
|
146 + | "member",
|
147 + | 0,
|
148 + | );
|
149 + | static RUNBOOK_MEMBER_TARGET_MAPS_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
150 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#TargetMap$key", "com.amazonaws.ssm", "TargetMap"),
|
151 + | ::aws_smithy_schema::ShapeType::String,
|
152 + | "key",
|
153 + | 0,
|
154 + | );
|
155 + | static RUNBOOK_MEMBER_TARGET_MAPS_MEMBER_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
156 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#TargetMap$value", "com.amazonaws.ssm", "TargetMap"),
|
157 + | ::aws_smithy_schema::ShapeType::List,
|
158 + | "value",
|
159 + | 1,
|
160 + | )
|
161 + | .with_list_member(&RUNBOOK_MEMBER_TARGET_MAPS_MEMBER_VALUE_MEMBER);
|
162 + | static RUNBOOK_MEMBER_TARGET_MAPS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
163 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#TargetMaps$member", "com.amazonaws.ssm", "TargetMaps"),
|
164 + | ::aws_smithy_schema::ShapeType::Map,
|
165 + | "member",
|
166 + | 0,
|
167 + | )
|
168 + | .with_map_members(&RUNBOOK_MEMBER_TARGET_MAPS_MEMBER_KEY, &RUNBOOK_MEMBER_TARGET_MAPS_MEMBER_VALUE);
|
169 + | static RUNBOOK_MEMBER_TARGET_MAPS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
170 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$TargetMaps", "com.amazonaws.ssm", "Runbook"),
|
171 + | ::aws_smithy_schema::ShapeType::List,
|
172 + | "TargetMaps",
|
173 + | 5,
|
174 + | )
|
175 + | .with_list_member(&RUNBOOK_MEMBER_TARGET_MAPS_MEMBER);
|
176 + | static RUNBOOK_MEMBER_MAX_CONCURRENCY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
177 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$MaxConcurrency", "com.amazonaws.ssm", "Runbook"),
|
178 + | ::aws_smithy_schema::ShapeType::String,
|
179 + | "MaxConcurrency",
|
180 + | 6,
|
181 + | );
|
182 + | static RUNBOOK_MEMBER_MAX_ERRORS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
183 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$MaxErrors", "com.amazonaws.ssm", "Runbook"),
|
184 + | ::aws_smithy_schema::ShapeType::String,
|
185 + | "MaxErrors",
|
186 + | 7,
|
187 + | );
|
188 + | static RUNBOOK_MEMBER_TARGET_LOCATIONS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
189 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#TargetLocations$member", "com.amazonaws.ssm", "TargetLocations"),
|
190 + | ::aws_smithy_schema::ShapeType::Structure,
|
191 + | "member",
|
192 + | 0,
|
193 + | );
|
194 + | static RUNBOOK_MEMBER_TARGET_LOCATIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
195 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook$TargetLocations", "com.amazonaws.ssm", "Runbook"),
|
196 + | ::aws_smithy_schema::ShapeType::List,
|
197 + | "TargetLocations",
|
198 + | 8,
|
199 + | )
|
200 + | .with_list_member(&RUNBOOK_MEMBER_TARGET_LOCATIONS_MEMBER);
|
201 + | static RUNBOOK_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
202 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Runbook", "com.amazonaws.ssm", "Runbook"),
|
203 + | ::aws_smithy_schema::ShapeType::Structure,
|
204 + | &[
|
205 + | &RUNBOOK_MEMBER_DOCUMENT_NAME,
|
206 + | &RUNBOOK_MEMBER_DOCUMENT_VERSION,
|
207 + | &RUNBOOK_MEMBER_PARAMETERS,
|
208 + | &RUNBOOK_MEMBER_TARGET_PARAMETER_NAME,
|
209 + | &RUNBOOK_MEMBER_TARGETS,
|
210 + | &RUNBOOK_MEMBER_TARGET_MAPS,
|
211 + | &RUNBOOK_MEMBER_MAX_CONCURRENCY,
|
212 + | &RUNBOOK_MEMBER_MAX_ERRORS,
|
213 + | &RUNBOOK_MEMBER_TARGET_LOCATIONS,
|
214 + | ],
|
215 + | );
|
216 + | impl Runbook {
|
217 + | /// The schema for this shape.
|
218 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &RUNBOOK_SCHEMA;
|
219 + | }
|
220 + | impl ::aws_smithy_schema::serde::SerializableStruct for Runbook {
|
221 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
222 + | fn serialize_members(
|
223 + | &self,
|
224 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
225 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
226 + | {
|
227 + | let val = &self.document_name;
|
228 + | ser.write_string(&RUNBOOK_MEMBER_DOCUMENT_NAME, val)?;
|
229 + | }
|
230 + | if let Some(ref val) = self.document_version {
|
231 + | ser.write_string(&RUNBOOK_MEMBER_DOCUMENT_VERSION, val)?;
|
232 + | }
|
233 + | if let Some(ref val) = self.parameters {
|
234 + | ser.write_map(
|
235 + | &RUNBOOK_MEMBER_PARAMETERS,
|
236 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
237 + | for (key, value) in val {
|
238 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
239 + |
|
240 + | ser.write_list(
|
241 + | &RUNBOOK_MEMBER_PARAMETERS_VALUE,
|
242 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
243 + | for item in value {
|
244 + | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
245 + | }
|
246 + | Ok(())
|
247 + | },
|
248 + | )?;
|
249 + | }
|
250 + | Ok(())
|
251 + | },
|
252 + | )?;
|
253 + | }
|
254 + | if let Some(ref val) = self.target_parameter_name {
|
255 + | ser.write_string(&RUNBOOK_MEMBER_TARGET_PARAMETER_NAME, val)?;
|
256 + | }
|
257 + | if let Some(ref val) = self.targets {
|
258 + | ser.write_list(&RUNBOOK_MEMBER_TARGETS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
259 + | for item in val {
|
260 + | ser.write_struct(crate::types::Target::SCHEMA, item)?;
|
261 + | }
|
262 + | Ok(())
|
263 + | })?;
|
264 + | }
|
265 + | if let Some(ref val) = self.target_maps {
|
266 + | ser.write_list(
|
267 + | &RUNBOOK_MEMBER_TARGET_MAPS,
|
268 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
269 + | for item in val {
|
270 + | ser.write_map(
|
271 + | &RUNBOOK_MEMBER_TARGET_MAPS_MEMBER,
|
272 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
273 + | for (key, value) in item {
|
274 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
275 + |
|
276 + | ser.write_list(
|
277 + | &RUNBOOK_MEMBER_TARGET_MAPS_MEMBER_VALUE,
|
278 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
279 + | for item in value {
|
280 + | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
281 + | }
|
282 + | Ok(())
|
283 + | },
|
284 + | )?;
|
285 + | }
|
286 + | Ok(())
|
287 + | },
|
288 + | )?;
|
289 + | }
|
290 + | Ok(())
|
291 + | },
|
292 + | )?;
|
293 + | }
|
294 + | if let Some(ref val) = self.max_concurrency {
|
295 + | ser.write_string(&RUNBOOK_MEMBER_MAX_CONCURRENCY, val)?;
|
296 + | }
|
297 + | if let Some(ref val) = self.max_errors {
|
298 + | ser.write_string(&RUNBOOK_MEMBER_MAX_ERRORS, val)?;
|
299 + | }
|
300 + | if let Some(ref val) = self.target_locations {
|
301 + | ser.write_list(
|
302 + | &RUNBOOK_MEMBER_TARGET_LOCATIONS,
|
303 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
304 + | for item in val {
|
305 + | ser.write_struct(crate::types::TargetLocation::SCHEMA, item)?;
|
306 + | }
|
307 + | Ok(())
|
308 + | },
|
309 + | )?;
|
310 + | }
|
311 + | Ok(())
|
312 + | }
|
313 + | }
|
314 + | impl Runbook {
|
315 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
316 + | pub fn deserialize(
|
317 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
318 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
319 + | #[allow(unused_variables, unused_mut)]
|
320 + | let mut builder = Self::builder();
|
321 + | #[allow(
|
322 + | unused_variables,
|
323 + | unreachable_code,
|
324 + | clippy::single_match,
|
325 + | clippy::match_single_binding,
|
326 + | clippy::diverging_sub_expression
|
327 + | )]
|
328 + | deserializer.read_struct(&RUNBOOK_SCHEMA, &mut |member, deser| {
|
329 + | match member.member_index() {
|
330 + | Some(0) => {
|
331 + | builder.document_name = Some(deser.read_string(member)?);
|
332 + | }
|
333 + | Some(1) => {
|
334 + | if deser.is_null() {
|
335 + | deser.read_null()?;
|
336 + | } else {
|
337 + | builder.document_version = Some(deser.read_string(member)?);
|
338 + | }
|
339 + | }
|
340 + | Some(2) => {
|
341 + | if deser.is_null() {
|
342 + | deser.read_null()?;
|
343 + | } else {
|
344 + | builder.parameters = Some({
|
345 + | let mut container = std::collections::HashMap::new();
|
346 + | deser.read_map(member, &mut |key, deser| {
|
347 + | container.insert(key, {
|
348 + | let mut list = Vec::new();
|
349 + | deser.read_list(&RUNBOOK_MEMBER_PARAMETERS_VALUE, &mut |deser| {
|
350 + | list.push(deser.read_string(&::aws_smithy_schema::prelude::STRING)?);
|
351 + | Ok(())
|
352 + | })?;
|
353 + | list
|
354 + | });
|
355 + | Ok(())
|
356 + | })?;
|
357 + | container
|
358 + | });
|
359 + | }
|
360 + | }
|
361 + | Some(3) => {
|
362 + | if deser.is_null() {
|
363 + | deser.read_null()?;
|
364 + | } else {
|
365 + | builder.target_parameter_name = Some(deser.read_string(member)?);
|
366 + | }
|
367 + | }
|
368 + | Some(4) => {
|
369 + | if deser.is_null() {
|
370 + | deser.read_null()?;
|
371 + | } else {
|
372 + | builder.targets = Some({
|
373 + | let mut container = Vec::new();
|
374 + | deser.read_list(member, &mut |deser| {
|
375 + | container.push(crate::types::Target::deserialize(deser)?);
|
376 + | Ok(())
|
377 + | })?;
|
378 + | container
|
379 + | });
|
380 + | }
|
381 + | }
|
382 + | Some(5) => {
|
383 + | if deser.is_null() {
|
384 + | deser.read_null()?;
|
385 + | } else {
|
386 + | builder.target_maps = Some({
|
387 + | let mut container = Vec::new();
|
388 + | deser.read_list(member, &mut |deser| {
|
389 + | container.push({
|
390 + | let mut map = ::std::collections::HashMap::new();
|
391 + | deser.read_map(&RUNBOOK_MEMBER_TARGET_MAPS_MEMBER, &mut |key, deser| {
|
392 + | let value = {
|
393 + | let mut list = Vec::new();
|
394 + | deser.read_list(&RUNBOOK_MEMBER_TARGET_MAPS_MEMBER_VALUE, &mut |deser| {
|
395 + | list.push(deser.read_string(&::aws_smithy_schema::prelude::STRING)?);
|
396 + | Ok(())
|
397 + | })?;
|
398 + | list
|
399 + | };
|
400 + | map.insert(key, value);
|
401 + | Ok(())
|
402 + | })?;
|
403 + | map
|
404 + | });
|
405 + | Ok(())
|
406 + | })?;
|
407 + | container
|
408 + | });
|
409 + | }
|
410 + | }
|
411 + | Some(6) => {
|
412 + | if deser.is_null() {
|
413 + | deser.read_null()?;
|
414 + | } else {
|
415 + | builder.max_concurrency = Some(deser.read_string(member)?);
|
416 + | }
|
417 + | }
|
418 + | Some(7) => {
|
419 + | if deser.is_null() {
|
420 + | deser.read_null()?;
|
421 + | } else {
|
422 + | builder.max_errors = Some(deser.read_string(member)?);
|
423 + | }
|
424 + | }
|
425 + | Some(8) => {
|
426 + | if deser.is_null() {
|
427 + | deser.read_null()?;
|
428 + | } else {
|
429 + | builder.target_locations = Some({
|
430 + | let mut container = Vec::new();
|
431 + | deser.read_list(member, &mut |deser| {
|
432 + | container.push(crate::types::TargetLocation::deserialize(deser)?);
|
433 + | Ok(())
|
434 + | })?;
|
435 + | container
|
436 + | });
|
437 + | }
|
438 + | }
|
439 + | _ => {}
|
440 + | }
|
441 + | Ok(())
|
442 + | })?;
|
443 + | builder.document_name = builder.document_name.or(Some(String::new()));
|
444 + | builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
|
445 + | }
|
446 + | }
|
447 + | impl Runbook {
|
448 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
449 + | pub fn deserialize_with_response(
|
450 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
451 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
452 + | _status: u16,
|
453 + | _body: &[u8],
|
454 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
455 + | Self::deserialize(deserializer)
|
456 + | }
|
457 + | }
|
458 + | impl Runbook {
|
459 + | /// Creates a new builder-style object to manufacture [`Runbook`](crate::types::Runbook).
|
460 + | pub fn builder() -> crate::types::builders::RunbookBuilder {
|
461 + | crate::types::builders::RunbookBuilder::default()
|
462 + | }
|
463 + | }
|
464 + |
|
465 + | /// A builder for [`Runbook`](crate::types::Runbook).
|
466 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
467 + | #[non_exhaustive]
|
468 + | pub struct RunbookBuilder {
|
469 + | pub(crate) document_name: ::std::option::Option<::std::string::String>,
|
470 + | pub(crate) document_version: ::std::option::Option<::std::string::String>,
|
471 + | pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
|
472 + | pub(crate) target_parameter_name: ::std::option::Option<::std::string::String>,
|
473 + | pub(crate) targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
|
474 + | pub(crate) target_maps:
|
475 + | ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
|
476 + | pub(crate) max_concurrency: ::std::option::Option<::std::string::String>,
|
477 + | pub(crate) max_errors: ::std::option::Option<::std::string::String>,
|
478 + | pub(crate) target_locations: ::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>>,
|
479 + | }
|
480 + | impl RunbookBuilder {
|
481 + | /// <p>The name of the Automation runbook used in a runbook workflow.</p>
|
482 + | /// This field is required.
|
483 + | pub fn document_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
484 + | self.document_name = ::std::option::Option::Some(input.into());
|
485 + | self
|
486 + | }
|
487 + | /// <p>The name of the Automation runbook used in a runbook workflow.</p>
|
488 + | pub fn set_document_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
489 + | self.document_name = input;
|
490 + | self
|
491 + | }
|
492 + | /// <p>The name of the Automation runbook used in a runbook workflow.</p>
|
493 + | pub fn get_document_name(&self) -> &::std::option::Option<::std::string::String> {
|
494 + | &self.document_name
|
495 + | }
|
496 + | /// <p>The version of the Automation runbook used in a runbook workflow.</p>
|
497 + | pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
498 + | self.document_version = ::std::option::Option::Some(input.into());
|
499 + | self
|
500 + | }
|
501 + | /// <p>The version of the Automation runbook used in a runbook workflow.</p>
|
502 + | pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
503 + | self.document_version = input;
|
504 + | self
|
505 + | }
|
506 + | /// <p>The version of the Automation runbook used in a runbook workflow.</p>
|
507 + | pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
|
508 + | &self.document_version
|
509 + | }
|
510 + | /// Adds a key-value pair to `parameters`.
|
511 + | ///
|
512 + | /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
|
513 + | ///
|
514 + | /// <p>The key-value map of execution parameters, which were supplied when calling <code>StartChangeRequestExecution</code>.</p>
|
515 + | pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
|
516 + | let mut hash_map = self.parameters.unwrap_or_default();
|
517 + | hash_map.insert(k.into(), v);
|
518 + | self.parameters = ::std::option::Option::Some(hash_map);
|
519 + | self
|
520 + | }
|
521 + | /// <p>The key-value map of execution parameters, which were supplied when calling <code>StartChangeRequestExecution</code>.</p>
|
522 + | pub fn set_parameters(
|
523 + | mut self,
|
524 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
|
525 + | ) -> Self {
|
526 + | self.parameters = input;
|
527 + | self
|
528 + | }
|
529 + | /// <p>The key-value map of execution parameters, which were supplied when calling <code>StartChangeRequestExecution</code>.</p>
|
530 + | pub fn get_parameters(
|
531 + | &self,
|
532 + | ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
|
533 + | &self.parameters
|
534 + | }
|
535 + | /// <p>The name of the parameter used as the target resource for the rate-controlled runbook workflow. Required if you specify <code>Targets</code>.</p>
|
536 + | pub fn target_parameter_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
537 + | self.target_parameter_name = ::std::option::Option::Some(input.into());
|
538 + | self
|
539 + | }
|
540 + | /// <p>The name of the parameter used as the target resource for the rate-controlled runbook workflow. Required if you specify <code>Targets</code>.</p>
|
541 + | pub fn set_target_parameter_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
542 + | self.target_parameter_name = input;
|
543 + | self
|
544 + | }
|
545 + | /// <p>The name of the parameter used as the target resource for the rate-controlled runbook workflow. Required if you specify <code>Targets</code>.</p>
|
546 + | pub fn get_target_parameter_name(&self) -> &::std::option::Option<::std::string::String> {
|
547 + | &self.target_parameter_name
|
548 + | }
|
549 + | /// Appends an item to `targets`.
|
550 + | ///
|
551 + | /// To override the contents of this collection use [`set_targets`](Self::set_targets).
|
552 + | ///
|
553 + | /// <p>A key-value mapping to target resources that the runbook operation performs tasks on. Required if you specify <code>TargetParameterName</code>.</p>
|
554 + | pub fn targets(mut self, input: crate::types::Target) -> Self {
|
555 + | let mut v = self.targets.unwrap_or_default();
|
556 + | v.push(input);
|
557 + | self.targets = ::std::option::Option::Some(v);
|
558 + | self
|
559 + | }
|
560 + | /// <p>A key-value mapping to target resources that the runbook operation performs tasks on. Required if you specify <code>TargetParameterName</code>.</p>
|
561 + | pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
|
562 + | self.targets = input;
|
563 + | self
|
564 + | }
|
565 + | /// <p>A key-value mapping to target resources that the runbook operation performs tasks on. Required if you specify <code>TargetParameterName</code>.</p>
|
566 + | pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
|
567 + | &self.targets
|
568 + | }
|
569 + | /// Appends an item to `target_maps`.
|
570 + | ///
|
571 + | /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps).
|
572 + | ///
|
573 + | /// <p>A key-value mapping of runbook parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
|
574 + | pub fn target_maps(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>) -> Self {
|
575 + | let mut v = self.target_maps.unwrap_or_default();
|
576 + | v.push(input);
|
577 + | self.target_maps = ::std::option::Option::Some(v);
|
578 + | self
|
579 + | }
|
580 + | /// <p>A key-value mapping of runbook parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
|
581 + | pub fn set_target_maps(
|
582 + | mut self,
|
583 + | input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
|
584 + | ) -> Self {
|
585 + | self.target_maps = input;
|
586 + | self
|
587 + | }
|
588 + | /// <p>A key-value mapping of runbook parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
|
589 + | pub fn get_target_maps(
|
590 + | &self,
|
591 + | ) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>> {
|
592 + | &self.target_maps
|
593 + | }
|
594 + | /// <p>The <code>MaxConcurrency</code> value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.</p>
|
595 + | pub fn max_concurrency(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
596 + | self.max_concurrency = ::std::option::Option::Some(input.into());
|
597 + | self
|
598 + | }
|
599 + | /// <p>The <code>MaxConcurrency</code> value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.</p>
|
600 + | pub fn set_max_concurrency(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
601 + | self.max_concurrency = input;
|
602 + | self
|
603 + | }
|
604 + | /// <p>The <code>MaxConcurrency</code> value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.</p>
|
605 + | pub fn get_max_concurrency(&self) -> &::std::option::Option<::std::string::String> {
|
606 + | &self.max_concurrency
|
607 + | }
|
608 + | /// <p>The <code>MaxErrors</code> value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.</p>
|
609 + | pub fn max_errors(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
610 + | self.max_errors = ::std::option::Option::Some(input.into());
|
611 + | self
|
612 + | }
|
613 + | /// <p>The <code>MaxErrors</code> value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.</p>
|
614 + | pub fn set_max_errors(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
615 + | self.max_errors = input;
|
616 + | self
|
617 + | }
|
618 + | /// <p>The <code>MaxErrors</code> value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.</p>
|
619 + | pub fn get_max_errors(&self) -> &::std::option::Option<::std::string::String> {
|
620 + | &self.max_errors
|
621 + | }
|
622 + | /// Appends an item to `target_locations`.
|
623 + | ///
|
624 + | /// To override the contents of this collection use [`set_target_locations`](Self::set_target_locations).
|
625 + | ///
|
626 + | /// <p>Information about the Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Runbook operation.</p>
|
627 + | pub fn target_locations(mut self, input: crate::types::TargetLocation) -> Self {
|
628 + | let mut v = self.target_locations.unwrap_or_default();
|
629 + | v.push(input);
|
630 + | self.target_locations = ::std::option::Option::Some(v);
|
631 + | self
|
632 + | }
|
633 + | /// <p>Information about the Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Runbook operation.</p>
|
634 + | pub fn set_target_locations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>>) -> Self {
|
635 + | self.target_locations = input;
|
636 + | self
|
637 + | }
|
638 + | /// <p>Information about the Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Runbook operation.</p>
|
639 + | pub fn get_target_locations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>> {
|
640 + | &self.target_locations
|
641 + | }
|
642 + | /// Consumes the builder and constructs a [`Runbook`](crate::types::Runbook).
|
643 + | /// This method will fail if any of the following fields are not set:
|
644 + | /// - [`document_name`](crate::types::builders::RunbookBuilder::document_name)
|
645 + | pub fn build(self) -> ::std::result::Result<crate::types::Runbook, ::aws_smithy_types::error::operation::BuildError> {
|
646 + | ::std::result::Result::Ok(crate::types::Runbook {
|
647 + | document_name: self.document_name.ok_or_else(|| {
|
648 + | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
649 + | "document_name",
|
650 + | "document_name was not specified but it is required when building Runbook",
|
651 + | )
|
652 + | })?,
|
653 + | document_version: self.document_version,
|
654 + | parameters: self.parameters,
|
655 + | target_parameter_name: self.target_parameter_name,
|
656 + | targets: self.targets,
|
657 + | target_maps: self.target_maps,
|
658 + | max_concurrency: self.max_concurrency,
|
659 + | max_errors: self.max_errors,
|
660 + | target_locations: self.target_locations,
|
661 + | })
|
662 + | }
|
663 + | }
|