1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>Information about an Automation failure.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct FailureDetails {
|
7 + | /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
|
8 + | pub failure_stage: ::std::option::Option<::std::string::String>,
|
9 + | /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
|
10 + | pub failure_type: ::std::option::Option<::std::string::String>,
|
11 + | /// <p>Detailed information about the Automation step failure.</p>
|
12 + | pub details: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
|
13 + | }
|
14 + | impl FailureDetails {
|
15 + | /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
|
16 + | pub fn failure_stage(&self) -> ::std::option::Option<&str> {
|
17 + | self.failure_stage.as_deref()
|
18 + | }
|
19 + | /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
|
20 + | pub fn failure_type(&self) -> ::std::option::Option<&str> {
|
21 + | self.failure_type.as_deref()
|
22 + | }
|
23 + | /// <p>Detailed information about the Automation step failure.</p>
|
24 + | pub fn details(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
|
25 + | self.details.as_ref()
|
26 + | }
|
27 + | }
|
28 + | static FAILUREDETAILS_MEMBER_FAILURE_STAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
29 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#FailureDetails$FailureStage", "com.amazonaws.ssm", "FailureDetails"),
|
30 + | ::aws_smithy_schema::ShapeType::String,
|
31 + | "FailureStage",
|
32 + | 0,
|
33 + | );
|
34 + | static FAILUREDETAILS_MEMBER_FAILURE_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
35 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#FailureDetails$FailureType", "com.amazonaws.ssm", "FailureDetails"),
|
36 + | ::aws_smithy_schema::ShapeType::String,
|
37 + | "FailureType",
|
38 + | 1,
|
39 + | );
|
40 + | static FAILUREDETAILS_MEMBER_DETAILS_VALUE_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
41 + | ::aws_smithy_schema::ShapeId::from_parts(
|
42 + | "com.amazonaws.ssm#AutomationParameterValueList$member",
|
43 + | "com.amazonaws.ssm",
|
44 + | "AutomationParameterValueList",
|
45 + | ),
|
46 + | ::aws_smithy_schema::ShapeType::String,
|
47 + | "member",
|
48 + | 0,
|
49 + | );
|
50 + | static FAILUREDETAILS_MEMBER_DETAILS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
51 + | ::aws_smithy_schema::ShapeId::from_parts(
|
52 + | "com.amazonaws.ssm#AutomationParameterMap$key",
|
53 + | "com.amazonaws.ssm",
|
54 + | "AutomationParameterMap",
|
55 + | ),
|
56 + | ::aws_smithy_schema::ShapeType::String,
|
57 + | "key",
|
58 + | 0,
|
59 + | );
|
60 + | static FAILUREDETAILS_MEMBER_DETAILS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
61 + | ::aws_smithy_schema::ShapeId::from_parts(
|
62 + | "com.amazonaws.ssm#AutomationParameterMap$value",
|
63 + | "com.amazonaws.ssm",
|
64 + | "AutomationParameterMap",
|
65 + | ),
|
66 + | ::aws_smithy_schema::ShapeType::List,
|
67 + | "value",
|
68 + | 1,
|
69 + | )
|
70 + | .with_list_member(&FAILUREDETAILS_MEMBER_DETAILS_VALUE_MEMBER);
|
71 + | static FAILUREDETAILS_MEMBER_DETAILS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
72 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#FailureDetails$Details", "com.amazonaws.ssm", "FailureDetails"),
|
73 + | ::aws_smithy_schema::ShapeType::Map,
|
74 + | "Details",
|
75 + | 2,
|
76 + | )
|
77 + | .with_map_members(&FAILUREDETAILS_MEMBER_DETAILS_KEY, &FAILUREDETAILS_MEMBER_DETAILS_VALUE);
|
78 + | static FAILUREDETAILS_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
79 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#FailureDetails", "com.amazonaws.ssm", "FailureDetails"),
|
80 + | ::aws_smithy_schema::ShapeType::Structure,
|
81 + | &[
|
82 + | &FAILUREDETAILS_MEMBER_FAILURE_STAGE,
|
83 + | &FAILUREDETAILS_MEMBER_FAILURE_TYPE,
|
84 + | &FAILUREDETAILS_MEMBER_DETAILS,
|
85 + | ],
|
86 + | );
|
87 + | impl FailureDetails {
|
88 + | /// The schema for this shape.
|
89 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &FAILUREDETAILS_SCHEMA;
|
90 + | }
|
91 + | impl ::aws_smithy_schema::serde::SerializableStruct for FailureDetails {
|
92 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
93 + | fn serialize_members(
|
94 + | &self,
|
95 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
96 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
97 + | if let Some(ref val) = self.failure_stage {
|
98 + | ser.write_string(&FAILUREDETAILS_MEMBER_FAILURE_STAGE, val)?;
|
99 + | }
|
100 + | if let Some(ref val) = self.failure_type {
|
101 + | ser.write_string(&FAILUREDETAILS_MEMBER_FAILURE_TYPE, val)?;
|
102 + | }
|
103 + | if let Some(ref val) = self.details {
|
104 + | ser.write_map(
|
105 + | &FAILUREDETAILS_MEMBER_DETAILS,
|
106 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
107 + | for (key, value) in val {
|
108 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
109 + |
|
110 + | ser.write_list(
|
111 + | &FAILUREDETAILS_MEMBER_DETAILS_VALUE,
|
112 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
113 + | for item in value {
|
114 + | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
115 + | }
|
116 + | Ok(())
|
117 + | },
|
118 + | )?;
|
119 + | }
|
120 + | Ok(())
|
121 + | },
|
122 + | )?;
|
123 + | }
|
124 + | Ok(())
|
125 + | }
|
126 + | }
|
127 + | impl FailureDetails {
|
128 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
129 + | pub fn deserialize(
|
130 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
131 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
132 + | #[allow(unused_variables, unused_mut)]
|
133 + | let mut builder = Self::builder();
|
134 + | #[allow(
|
135 + | unused_variables,
|
136 + | unreachable_code,
|
137 + | clippy::single_match,
|
138 + | clippy::match_single_binding,
|
139 + | clippy::diverging_sub_expression
|
140 + | )]
|
141 + | deserializer.read_struct(&FAILUREDETAILS_SCHEMA, &mut |member, deser| {
|
142 + | match member.member_index() {
|
143 + | Some(0) => {
|
144 + | if deser.is_null() {
|
145 + | deser.read_null()?;
|
146 + | } else {
|
147 + | builder.failure_stage = Some(deser.read_string(member)?);
|
148 + | }
|
149 + | }
|
150 + | Some(1) => {
|
151 + | if deser.is_null() {
|
152 + | deser.read_null()?;
|
153 + | } else {
|
154 + | builder.failure_type = Some(deser.read_string(member)?);
|
155 + | }
|
156 + | }
|
157 + | Some(2) => {
|
158 + | if deser.is_null() {
|
159 + | deser.read_null()?;
|
160 + | } else {
|
161 + | builder.details = Some({
|
162 + | let mut container = std::collections::HashMap::new();
|
163 + | deser.read_map(member, &mut |key, deser| {
|
164 + | container.insert(key, {
|
165 + | let mut list = Vec::new();
|
166 + | deser.read_list(&FAILUREDETAILS_MEMBER_DETAILS_VALUE, &mut |deser| {
|
167 + | list.push(deser.read_string(&::aws_smithy_schema::prelude::STRING)?);
|
168 + | Ok(())
|
169 + | })?;
|
170 + | list
|
171 + | });
|
172 + | Ok(())
|
173 + | })?;
|
174 + | container
|
175 + | });
|
176 + | }
|
177 + | }
|
178 + | _ => {}
|
179 + | }
|
180 + | Ok(())
|
181 + | })?;
|
182 + | Ok(builder.build())
|
183 + | }
|
184 + | }
|
185 + | impl FailureDetails {
|
186 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
187 + | pub fn deserialize_with_response(
|
188 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
189 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
190 + | _status: u16,
|
191 + | _body: &[u8],
|
192 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
193 + | Self::deserialize(deserializer)
|
194 + | }
|
195 + | }
|
196 + | impl FailureDetails {
|
197 + | /// Creates a new builder-style object to manufacture [`FailureDetails`](crate::types::FailureDetails).
|
198 + | pub fn builder() -> crate::types::builders::FailureDetailsBuilder {
|
199 + | crate::types::builders::FailureDetailsBuilder::default()
|
200 + | }
|
201 + | }
|
202 + |
|
203 + | /// A builder for [`FailureDetails`](crate::types::FailureDetails).
|
204 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
205 + | #[non_exhaustive]
|
206 + | pub struct FailureDetailsBuilder {
|
207 + | pub(crate) failure_stage: ::std::option::Option<::std::string::String>,
|
208 + | pub(crate) failure_type: ::std::option::Option<::std::string::String>,
|
209 + | pub(crate) details: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
|
210 + | }
|
211 + | impl FailureDetailsBuilder {
|
212 + | /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
|
213 + | pub fn failure_stage(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
214 + | self.failure_stage = ::std::option::Option::Some(input.into());
|
215 + | self
|
216 + | }
|
217 + | /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
|
218 + | pub fn set_failure_stage(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
219 + | self.failure_stage = input;
|
220 + | self
|
221 + | }
|
222 + | /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
|
223 + | pub fn get_failure_stage(&self) -> &::std::option::Option<::std::string::String> {
|
224 + | &self.failure_stage
|
225 + | }
|
226 + | /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
|
227 + | pub fn failure_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
228 + | self.failure_type = ::std::option::Option::Some(input.into());
|
229 + | self
|
230 + | }
|
231 + | /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
|
232 + | pub fn set_failure_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
233 + | self.failure_type = input;
|
234 + | self
|
235 + | }
|
236 + | /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
|
237 + | pub fn get_failure_type(&self) -> &::std::option::Option<::std::string::String> {
|
238 + | &self.failure_type
|
239 + | }
|
240 + | /// Adds a key-value pair to `details`.
|
241 + | ///
|
242 + | /// To override the contents of this collection use [`set_details`](Self::set_details).
|
243 + | ///
|
244 + | /// <p>Detailed information about the Automation step failure.</p>
|
245 + | pub fn details(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
|
246 + | let mut hash_map = self.details.unwrap_or_default();
|
247 + | hash_map.insert(k.into(), v);
|
248 + | self.details = ::std::option::Option::Some(hash_map);
|
249 + | self
|
250 + | }
|
251 + | /// <p>Detailed information about the Automation step failure.</p>
|
252 + | pub fn set_details(
|
253 + | mut self,
|
254 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
|
255 + | ) -> Self {
|
256 + | self.details = input;
|
257 + | self
|
258 + | }
|
259 + | /// <p>Detailed information about the Automation step failure.</p>
|
260 + | pub fn get_details(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
|
261 + | &self.details
|
262 + | }
|
263 + | /// Consumes the builder and constructs a [`FailureDetails`](crate::types::FailureDetails).
|
264 + | pub fn build(self) -> crate::types::FailureDetails {
|
265 + | crate::types::FailureDetails {
|
266 + | failure_stage: self.failure_stage,
|
267 + | failure_type: self.failure_type,
|
268 + | details: self.details,
|
269 + | }
|
270 + | }
|
271 + | }
|