1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>Information about the association.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct AssociationOverview {
|
7 + | /// <p>The status of the association. Status can be: Pending, Success, or Failed.</p>
|
8 + | pub status: ::std::option::Option<::std::string::String>,
|
9 + | /// <p>A detailed status of the association.</p>
|
10 + | pub detailed_status: ::std::option::Option<::std::string::String>,
|
11 + | /// <p>Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.</p>
|
12 + | pub association_status_aggregated_count: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
13 + | }
|
14 + | impl AssociationOverview {
|
15 + | /// <p>The status of the association. Status can be: Pending, Success, or Failed.</p>
|
16 + | pub fn status(&self) -> ::std::option::Option<&str> {
|
17 + | self.status.as_deref()
|
18 + | }
|
19 + | /// <p>A detailed status of the association.</p>
|
20 + | pub fn detailed_status(&self) -> ::std::option::Option<&str> {
|
21 + | self.detailed_status.as_deref()
|
22 + | }
|
23 + | /// <p>Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.</p>
|
24 + | pub fn association_status_aggregated_count(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
25 + | self.association_status_aggregated_count.as_ref()
|
26 + | }
|
27 + | }
|
28 + | static ASSOCIATIONOVERVIEW_MEMBER_STATUS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
29 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#AssociationOverview$Status", "com.amazonaws.ssm", "AssociationOverview"),
|
30 + | ::aws_smithy_schema::ShapeType::String,
|
31 + | "Status",
|
32 + | 0,
|
33 + | );
|
34 + | static ASSOCIATIONOVERVIEW_MEMBER_DETAILED_STATUS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
35 + | ::aws_smithy_schema::ShapeId::from_parts(
|
36 + | "com.amazonaws.ssm#AssociationOverview$DetailedStatus",
|
37 + | "com.amazonaws.ssm",
|
38 + | "AssociationOverview",
|
39 + | ),
|
40 + | ::aws_smithy_schema::ShapeType::String,
|
41 + | "DetailedStatus",
|
42 + | 1,
|
43 + | );
|
44 + | static ASSOCIATIONOVERVIEW_MEMBER_ASSOCIATION_STATUS_AGGREGATED_COUNT_KEY: ::aws_smithy_schema::Schema<'static> =
|
45 + | ::aws_smithy_schema::Schema::new_member(
|
46 + | ::aws_smithy_schema::ShapeId::from_parts(
|
47 + | "com.amazonaws.ssm#AssociationStatusAggregatedCount$key",
|
48 + | "com.amazonaws.ssm",
|
49 + | "AssociationStatusAggregatedCount",
|
50 + | ),
|
51 + | ::aws_smithy_schema::ShapeType::String,
|
52 + | "key",
|
53 + | 0,
|
54 + | );
|
55 + | static ASSOCIATIONOVERVIEW_MEMBER_ASSOCIATION_STATUS_AGGREGATED_COUNT_VALUE: ::aws_smithy_schema::Schema<'static> =
|
56 + | ::aws_smithy_schema::Schema::new_member(
|
57 + | ::aws_smithy_schema::ShapeId::from_parts(
|
58 + | "com.amazonaws.ssm#AssociationStatusAggregatedCount$value",
|
59 + | "com.amazonaws.ssm",
|
60 + | "AssociationStatusAggregatedCount",
|
61 + | ),
|
62 + | ::aws_smithy_schema::ShapeType::Integer,
|
63 + | "value",
|
64 + | 1,
|
65 + | );
|
66 + | static ASSOCIATIONOVERVIEW_MEMBER_ASSOCIATION_STATUS_AGGREGATED_COUNT: ::aws_smithy_schema::Schema<'static> =
|
67 + | ::aws_smithy_schema::Schema::new_member(
|
68 + | ::aws_smithy_schema::ShapeId::from_parts(
|
69 + | "com.amazonaws.ssm#AssociationOverview$AssociationStatusAggregatedCount",
|
70 + | "com.amazonaws.ssm",
|
71 + | "AssociationOverview",
|
72 + | ),
|
73 + | ::aws_smithy_schema::ShapeType::Map,
|
74 + | "AssociationStatusAggregatedCount",
|
75 + | 2,
|
76 + | )
|
77 + | .with_map_members(
|
78 + | &ASSOCIATIONOVERVIEW_MEMBER_ASSOCIATION_STATUS_AGGREGATED_COUNT_KEY,
|
79 + | &ASSOCIATIONOVERVIEW_MEMBER_ASSOCIATION_STATUS_AGGREGATED_COUNT_VALUE,
|
80 + | );
|
81 + | static ASSOCIATIONOVERVIEW_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
82 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#AssociationOverview", "com.amazonaws.ssm", "AssociationOverview"),
|
83 + | ::aws_smithy_schema::ShapeType::Structure,
|
84 + | &[
|
85 + | &ASSOCIATIONOVERVIEW_MEMBER_STATUS,
|
86 + | &ASSOCIATIONOVERVIEW_MEMBER_DETAILED_STATUS,
|
87 + | &ASSOCIATIONOVERVIEW_MEMBER_ASSOCIATION_STATUS_AGGREGATED_COUNT,
|
88 + | ],
|
89 + | );
|
90 + | impl AssociationOverview {
|
91 + | /// The schema for this shape.
|
92 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &ASSOCIATIONOVERVIEW_SCHEMA;
|
93 + | }
|
94 + | impl ::aws_smithy_schema::serde::SerializableStruct for AssociationOverview {
|
95 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
96 + | fn serialize_members(
|
97 + | &self,
|
98 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
99 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
100 + | if let Some(ref val) = self.status {
|
101 + | ser.write_string(&ASSOCIATIONOVERVIEW_MEMBER_STATUS, val)?;
|
102 + | }
|
103 + | if let Some(ref val) = self.detailed_status {
|
104 + | ser.write_string(&ASSOCIATIONOVERVIEW_MEMBER_DETAILED_STATUS, val)?;
|
105 + | }
|
106 + | if let Some(ref val) = self.association_status_aggregated_count {
|
107 + | ser.write_map(
|
108 + | &ASSOCIATIONOVERVIEW_MEMBER_ASSOCIATION_STATUS_AGGREGATED_COUNT,
|
109 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
110 + | for (key, value) in val {
|
111 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
112 + | ser.write_integer(&::aws_smithy_schema::prelude::INTEGER, *value)?;
|
113 + | }
|
114 + | Ok(())
|
115 + | },
|
116 + | )?;
|
117 + | }
|
118 + | Ok(())
|
119 + | }
|
120 + | }
|
121 + | impl AssociationOverview {
|
122 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
123 + | pub fn deserialize(
|
124 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
125 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
126 + | #[allow(unused_variables, unused_mut)]
|
127 + | let mut builder = Self::builder();
|
128 + | #[allow(
|
129 + | unused_variables,
|
130 + | unreachable_code,
|
131 + | clippy::single_match,
|
132 + | clippy::match_single_binding,
|
133 + | clippy::diverging_sub_expression
|
134 + | )]
|
135 + | deserializer.read_struct(&ASSOCIATIONOVERVIEW_SCHEMA, &mut |member, deser| {
|
136 + | match member.member_index() {
|
137 + | Some(0) => {
|
138 + | if deser.is_null() {
|
139 + | deser.read_null()?;
|
140 + | } else {
|
141 + | builder.status = Some(deser.read_string(member)?);
|
142 + | }
|
143 + | }
|
144 + | Some(1) => {
|
145 + | if deser.is_null() {
|
146 + | deser.read_null()?;
|
147 + | } else {
|
148 + | builder.detailed_status = Some(deser.read_string(member)?);
|
149 + | }
|
150 + | }
|
151 + | Some(2) => {
|
152 + | if deser.is_null() {
|
153 + | deser.read_null()?;
|
154 + | } else {
|
155 + | builder.association_status_aggregated_count = Some({
|
156 + | let mut container = std::collections::HashMap::new();
|
157 + | deser.read_map(member, &mut |key, deser| {
|
158 + | container.insert(key, deser.read_integer(&::aws_smithy_schema::prelude::INTEGER)?);
|
159 + | Ok(())
|
160 + | })?;
|
161 + | container
|
162 + | });
|
163 + | }
|
164 + | }
|
165 + | _ => {}
|
166 + | }
|
167 + | Ok(())
|
168 + | })?;
|
169 + | Ok(builder.build())
|
170 + | }
|
171 + | }
|
172 + | impl AssociationOverview {
|
173 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
174 + | pub fn deserialize_with_response(
|
175 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
176 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
177 + | _status: u16,
|
178 + | _body: &[u8],
|
179 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
180 + | Self::deserialize(deserializer)
|
181 + | }
|
182 + | }
|
183 + | impl AssociationOverview {
|
184 + | /// Creates a new builder-style object to manufacture [`AssociationOverview`](crate::types::AssociationOverview).
|
185 + | pub fn builder() -> crate::types::builders::AssociationOverviewBuilder {
|
186 + | crate::types::builders::AssociationOverviewBuilder::default()
|
187 + | }
|
188 + | }
|
189 + |
|
190 + | /// A builder for [`AssociationOverview`](crate::types::AssociationOverview).
|
191 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
192 + | #[non_exhaustive]
|
193 + | pub struct AssociationOverviewBuilder {
|
194 + | pub(crate) status: ::std::option::Option<::std::string::String>,
|
195 + | pub(crate) detailed_status: ::std::option::Option<::std::string::String>,
|
196 + | pub(crate) association_status_aggregated_count: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
197 + | }
|
198 + | impl AssociationOverviewBuilder {
|
199 + | /// <p>The status of the association. Status can be: Pending, Success, or Failed.</p>
|
200 + | pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
201 + | self.status = ::std::option::Option::Some(input.into());
|
202 + | self
|
203 + | }
|
204 + | /// <p>The status of the association. Status can be: Pending, Success, or Failed.</p>
|
205 + | pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
206 + | self.status = input;
|
207 + | self
|
208 + | }
|
209 + | /// <p>The status of the association. Status can be: Pending, Success, or Failed.</p>
|
210 + | pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
|
211 + | &self.status
|
212 + | }
|
213 + | /// <p>A detailed status of the association.</p>
|
214 + | pub fn detailed_status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
215 + | self.detailed_status = ::std::option::Option::Some(input.into());
|
216 + | self
|
217 + | }
|
218 + | /// <p>A detailed status of the association.</p>
|
219 + | pub fn set_detailed_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
220 + | self.detailed_status = input;
|
221 + | self
|
222 + | }
|
223 + | /// <p>A detailed status of the association.</p>
|
224 + | pub fn get_detailed_status(&self) -> &::std::option::Option<::std::string::String> {
|
225 + | &self.detailed_status
|
226 + | }
|
227 + | /// Adds a key-value pair to `association_status_aggregated_count`.
|
228 + | ///
|
229 + | /// To override the contents of this collection use [`set_association_status_aggregated_count`](Self::set_association_status_aggregated_count).
|
230 + | ///
|
231 + | /// <p>Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.</p>
|
232 + | pub fn association_status_aggregated_count(mut self, k: impl ::std::convert::Into<::std::string::String>, v: i32) -> Self {
|
233 + | let mut hash_map = self.association_status_aggregated_count.unwrap_or_default();
|
234 + | hash_map.insert(k.into(), v);
|
235 + | self.association_status_aggregated_count = ::std::option::Option::Some(hash_map);
|
236 + | self
|
237 + | }
|
238 + | /// <p>Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.</p>
|
239 + | pub fn set_association_status_aggregated_count(
|
240 + | mut self,
|
241 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
242 + | ) -> Self {
|
243 + | self.association_status_aggregated_count = input;
|
244 + | self
|
245 + | }
|
246 + | /// <p>Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.</p>
|
247 + | pub fn get_association_status_aggregated_count(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, i32>> {
|
248 + | &self.association_status_aggregated_count
|
249 + | }
|
250 + | /// Consumes the builder and constructs a [`AssociationOverview`](crate::types::AssociationOverview).
|
251 + | pub fn build(self) -> crate::types::AssociationOverview {
|
252 + | crate::types::AssociationOverview {
|
253 + | status: self.status,
|
254 + | detailed_status: self.detailed_status,
|
255 + | association_status_aggregated_count: self.association_status_aggregated_count,
|
256 + | }
|
257 + | }
|
258 + | }
|