1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>Specifies the inventory type and attribute for the aggregation execution.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct InventoryAggregator {
|
7 + | /// <p>The inventory type and attribute name for aggregation.</p>
|
8 + | pub expression: ::std::option::Option<::std::string::String>,
|
9 + | /// <p>Nested aggregators to further refine aggregation for an inventory type.</p>
|
10 + | pub aggregators: ::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>>,
|
11 + | /// <p>A user-defined set of one or more filters on which to aggregate inventory data. Groups return a count of resources that match and don't match the specified criteria.</p>
|
12 + | pub groups: ::std::option::Option<::std::vec::Vec<crate::types::InventoryGroup>>,
|
13 + | }
|
14 + | impl InventoryAggregator {
|
15 + | /// <p>The inventory type and attribute name for aggregation.</p>
|
16 + | pub fn expression(&self) -> ::std::option::Option<&str> {
|
17 + | self.expression.as_deref()
|
18 + | }
|
19 + | /// <p>Nested aggregators to further refine aggregation for an inventory type.</p>
|
20 + | ///
|
21 + | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.aggregators.is_none()`.
|
22 + | pub fn aggregators(&self) -> &[crate::types::InventoryAggregator] {
|
23 + | self.aggregators.as_deref().unwrap_or_default()
|
24 + | }
|
25 + | /// <p>A user-defined set of one or more filters on which to aggregate inventory data. Groups return a count of resources that match and don't match the specified criteria.</p>
|
26 + | ///
|
27 + | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.groups.is_none()`.
|
28 + | pub fn groups(&self) -> &[crate::types::InventoryGroup] {
|
29 + | self.groups.as_deref().unwrap_or_default()
|
30 + | }
|
31 + | }
|
32 + | static INVENTORYAGGREGATOR_MEMBER_EXPRESSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
33 + | ::aws_smithy_schema::ShapeId::from_parts(
|
34 + | "com.amazonaws.ssm#InventoryAggregator$Expression",
|
35 + | "com.amazonaws.ssm",
|
36 + | "InventoryAggregator",
|
37 + | ),
|
38 + | ::aws_smithy_schema::ShapeType::String,
|
39 + | "Expression",
|
40 + | 0,
|
41 + | );
|
42 + | static INVENTORYAGGREGATOR_MEMBER_AGGREGATORS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
43 + | ::aws_smithy_schema::ShapeId::from_parts(
|
44 + | "com.amazonaws.ssm#InventoryAggregatorList$member",
|
45 + | "com.amazonaws.ssm",
|
46 + | "InventoryAggregatorList",
|
47 + | ),
|
48 + | ::aws_smithy_schema::ShapeType::Structure,
|
49 + | "member",
|
50 + | 0,
|
51 + | )
|
52 + | .with_xml_name("Aggregator");
|
53 + | static INVENTORYAGGREGATOR_MEMBER_AGGREGATORS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
54 + | ::aws_smithy_schema::ShapeId::from_parts(
|
55 + | "com.amazonaws.ssm#InventoryAggregator$Aggregators",
|
56 + | "com.amazonaws.ssm",
|
57 + | "InventoryAggregator",
|
58 + | ),
|
59 + | ::aws_smithy_schema::ShapeType::List,
|
60 + | "Aggregators",
|
61 + | 1,
|
62 + | )
|
63 + | .with_list_member(&INVENTORYAGGREGATOR_MEMBER_AGGREGATORS_MEMBER);
|
64 + | static INVENTORYAGGREGATOR_MEMBER_GROUPS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
65 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryGroupList$member", "com.amazonaws.ssm", "InventoryGroupList"),
|
66 + | ::aws_smithy_schema::ShapeType::Structure,
|
67 + | "member",
|
68 + | 0,
|
69 + | )
|
70 + | .with_xml_name("InventoryGroup");
|
71 + | static INVENTORYAGGREGATOR_MEMBER_GROUPS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
72 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryAggregator$Groups", "com.amazonaws.ssm", "InventoryAggregator"),
|
73 + | ::aws_smithy_schema::ShapeType::List,
|
74 + | "Groups",
|
75 + | 2,
|
76 + | )
|
77 + | .with_list_member(&INVENTORYAGGREGATOR_MEMBER_GROUPS_MEMBER);
|
78 + | static INVENTORYAGGREGATOR_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
79 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryAggregator", "com.amazonaws.ssm", "InventoryAggregator"),
|
80 + | ::aws_smithy_schema::ShapeType::Structure,
|
81 + | &[
|
82 + | &INVENTORYAGGREGATOR_MEMBER_EXPRESSION,
|
83 + | &INVENTORYAGGREGATOR_MEMBER_AGGREGATORS,
|
84 + | &INVENTORYAGGREGATOR_MEMBER_GROUPS,
|
85 + | ],
|
86 + | );
|
87 + | impl InventoryAggregator {
|
88 + | /// The schema for this shape.
|
89 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &INVENTORYAGGREGATOR_SCHEMA;
|
90 + | }
|
91 + | impl ::aws_smithy_schema::serde::SerializableStruct for InventoryAggregator {
|
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.expression {
|
98 + | ser.write_string(&INVENTORYAGGREGATOR_MEMBER_EXPRESSION, val)?;
|
99 + | }
|
100 + | if let Some(ref val) = self.aggregators {
|
101 + | ser.write_list(
|
102 + | &INVENTORYAGGREGATOR_MEMBER_AGGREGATORS,
|
103 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
104 + | for item in val {
|
105 + | ser.write_struct(crate::types::InventoryAggregator::SCHEMA, item)?;
|
106 + | }
|
107 + | Ok(())
|
108 + | },
|
109 + | )?;
|
110 + | }
|
111 + | if let Some(ref val) = self.groups {
|
112 + | ser.write_list(
|
113 + | &INVENTORYAGGREGATOR_MEMBER_GROUPS,
|
114 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
115 + | for item in val {
|
116 + | ser.write_struct(crate::types::InventoryGroup::SCHEMA, item)?;
|
117 + | }
|
118 + | Ok(())
|
119 + | },
|
120 + | )?;
|
121 + | }
|
122 + | Ok(())
|
123 + | }
|
124 + | }
|
125 + | impl InventoryAggregator {
|
126 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
127 + | pub fn deserialize(
|
128 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
129 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
130 + | #[allow(unused_variables, unused_mut)]
|
131 + | let mut builder = Self::builder();
|
132 + | #[allow(
|
133 + | unused_variables,
|
134 + | unreachable_code,
|
135 + | clippy::single_match,
|
136 + | clippy::match_single_binding,
|
137 + | clippy::diverging_sub_expression
|
138 + | )]
|
139 + | deserializer.read_struct(&INVENTORYAGGREGATOR_SCHEMA, &mut |member, deser| {
|
140 + | match member.member_index() {
|
141 + | Some(0) => {
|
142 + | if deser.is_null() {
|
143 + | deser.read_null()?;
|
144 + | } else {
|
145 + | builder.expression = Some(deser.read_string(member)?);
|
146 + | }
|
147 + | }
|
148 + | Some(1) => {
|
149 + | if deser.is_null() {
|
150 + | deser.read_null()?;
|
151 + | } else {
|
152 + | builder.aggregators = Some({
|
153 + | let mut container = Vec::new();
|
154 + | deser.read_list(member, &mut |deser| {
|
155 + | container.push(crate::types::InventoryAggregator::deserialize(deser)?);
|
156 + | Ok(())
|
157 + | })?;
|
158 + | container
|
159 + | });
|
160 + | }
|
161 + | }
|
162 + | Some(2) => {
|
163 + | if deser.is_null() {
|
164 + | deser.read_null()?;
|
165 + | } else {
|
166 + | builder.groups = Some({
|
167 + | let mut container = Vec::new();
|
168 + | deser.read_list(member, &mut |deser| {
|
169 + | container.push(crate::types::InventoryGroup::deserialize(deser)?);
|
170 + | Ok(())
|
171 + | })?;
|
172 + | container
|
173 + | });
|
174 + | }
|
175 + | }
|
176 + | _ => {}
|
177 + | }
|
178 + | Ok(())
|
179 + | })?;
|
180 + | Ok(builder.build())
|
181 + | }
|
182 + | }
|
183 + | impl InventoryAggregator {
|
184 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
185 + | pub fn deserialize_with_response(
|
186 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
187 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
188 + | _status: u16,
|
189 + | _body: &[u8],
|
190 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
191 + | Self::deserialize(deserializer)
|
192 + | }
|
193 + | }
|
194 + | impl InventoryAggregator {
|
195 + | /// Creates a new builder-style object to manufacture [`InventoryAggregator`](crate::types::InventoryAggregator).
|
196 + | pub fn builder() -> crate::types::builders::InventoryAggregatorBuilder {
|
197 + | crate::types::builders::InventoryAggregatorBuilder::default()
|
198 + | }
|
199 + | }
|
200 + |
|
201 + | /// A builder for [`InventoryAggregator`](crate::types::InventoryAggregator).
|
202 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
203 + | #[non_exhaustive]
|
204 + | pub struct InventoryAggregatorBuilder {
|
205 + | pub(crate) expression: ::std::option::Option<::std::string::String>,
|
206 + | pub(crate) aggregators: ::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>>,
|
207 + | pub(crate) groups: ::std::option::Option<::std::vec::Vec<crate::types::InventoryGroup>>,
|
208 + | }
|
209 + | impl InventoryAggregatorBuilder {
|
210 + | /// <p>The inventory type and attribute name for aggregation.</p>
|
211 + | pub fn expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
212 + | self.expression = ::std::option::Option::Some(input.into());
|
213 + | self
|
214 + | }
|
215 + | /// <p>The inventory type and attribute name for aggregation.</p>
|
216 + | pub fn set_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
217 + | self.expression = input;
|
218 + | self
|
219 + | }
|
220 + | /// <p>The inventory type and attribute name for aggregation.</p>
|
221 + | pub fn get_expression(&self) -> &::std::option::Option<::std::string::String> {
|
222 + | &self.expression
|
223 + | }
|
224 + | /// Appends an item to `aggregators`.
|
225 + | ///
|
226 + | /// To override the contents of this collection use [`set_aggregators`](Self::set_aggregators).
|
227 + | ///
|
228 + | /// <p>Nested aggregators to further refine aggregation for an inventory type.</p>
|
229 + | pub fn aggregators(mut self, input: crate::types::InventoryAggregator) -> Self {
|
230 + | let mut v = self.aggregators.unwrap_or_default();
|
231 + | v.push(input);
|
232 + | self.aggregators = ::std::option::Option::Some(v);
|
233 + | self
|
234 + | }
|
235 + | /// <p>Nested aggregators to further refine aggregation for an inventory type.</p>
|
236 + | pub fn set_aggregators(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>>) -> Self {
|
237 + | self.aggregators = input;
|
238 + | self
|
239 + | }
|
240 + | /// <p>Nested aggregators to further refine aggregation for an inventory type.</p>
|
241 + | pub fn get_aggregators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>> {
|
242 + | &self.aggregators
|
243 + | }
|
244 + | /// Appends an item to `groups`.
|
245 + | ///
|
246 + | /// To override the contents of this collection use [`set_groups`](Self::set_groups).
|
247 + | ///
|
248 + | /// <p>A user-defined set of one or more filters on which to aggregate inventory data. Groups return a count of resources that match and don't match the specified criteria.</p>
|
249 + | pub fn groups(mut self, input: crate::types::InventoryGroup) -> Self {
|
250 + | let mut v = self.groups.unwrap_or_default();
|
251 + | v.push(input);
|
252 + | self.groups = ::std::option::Option::Some(v);
|
253 + | self
|
254 + | }
|
255 + | /// <p>A user-defined set of one or more filters on which to aggregate inventory data. Groups return a count of resources that match and don't match the specified criteria.</p>
|
256 + | pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InventoryGroup>>) -> Self {
|
257 + | self.groups = input;
|
258 + | self
|
259 + | }
|
260 + | /// <p>A user-defined set of one or more filters on which to aggregate inventory data. Groups return a count of resources that match and don't match the specified criteria.</p>
|
261 + | pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InventoryGroup>> {
|
262 + | &self.groups
|
263 + | }
|
264 + | /// Consumes the builder and constructs a [`InventoryAggregator`](crate::types::InventoryAggregator).
|
265 + | pub fn build(self) -> crate::types::InventoryAggregator {
|
266 + | crate::types::InventoryAggregator {
|
267 + | expression: self.expression,
|
268 + | aggregators: self.aggregators,
|
269 + | groups: self.groups,
|
270 + | }
|
271 + | }
|
272 + | }
|