1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>One or more aggregators for viewing counts of OpsData using different dimensions such as <code>Source</code>, <code>CreatedTime</code>, or <code>Source and CreatedTime</code>, to name a few.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct OpsAggregator {
|
7 + | /// <p>Either a <code>Range</code> or <code>Count</code> aggregator for limiting an OpsData summary.</p>
|
8 + | pub aggregator_type: ::std::option::Option<::std::string::String>,
|
9 + | /// <p>The data type name to use for viewing counts of OpsData.</p>
|
10 + | pub type_name: ::std::option::Option<::std::string::String>,
|
11 + | /// <p>The name of an OpsData attribute on which to limit the count of OpsData.</p>
|
12 + | pub attribute_name: ::std::option::Option<::std::string::String>,
|
13 + | /// <p>The aggregator value.</p>
|
14 + | pub values: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
|
15 + | /// <p>The aggregator filters.</p>
|
16 + | pub filters: ::std::option::Option<::std::vec::Vec<crate::types::OpsFilter>>,
|
17 + | /// <p>A nested aggregator for viewing counts of OpsData.</p>
|
18 + | pub aggregators: ::std::option::Option<::std::vec::Vec<crate::types::OpsAggregator>>,
|
19 + | }
|
20 + | impl OpsAggregator {
|
21 + | /// <p>Either a <code>Range</code> or <code>Count</code> aggregator for limiting an OpsData summary.</p>
|
22 + | pub fn aggregator_type(&self) -> ::std::option::Option<&str> {
|
23 + | self.aggregator_type.as_deref()
|
24 + | }
|
25 + | /// <p>The data type name to use for viewing counts of OpsData.</p>
|
26 + | pub fn type_name(&self) -> ::std::option::Option<&str> {
|
27 + | self.type_name.as_deref()
|
28 + | }
|
29 + | /// <p>The name of an OpsData attribute on which to limit the count of OpsData.</p>
|
30 + | pub fn attribute_name(&self) -> ::std::option::Option<&str> {
|
31 + | self.attribute_name.as_deref()
|
32 + | }
|
33 + | /// <p>The aggregator value.</p>
|
34 + | pub fn values(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
|
35 + | self.values.as_ref()
|
36 + | }
|
37 + | /// <p>The aggregator filters.</p>
|
38 + | ///
|
39 + | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
|
40 + | pub fn filters(&self) -> &[crate::types::OpsFilter] {
|
41 + | self.filters.as_deref().unwrap_or_default()
|
42 + | }
|
43 + | /// <p>A nested aggregator for viewing counts of OpsData.</p>
|
44 + | ///
|
45 + | /// 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()`.
|
46 + | pub fn aggregators(&self) -> &[crate::types::OpsAggregator] {
|
47 + | self.aggregators.as_deref().unwrap_or_default()
|
48 + | }
|
49 + | }
|
50 + | static OPSAGGREGATOR_MEMBER_AGGREGATOR_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
51 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsAggregator$AggregatorType", "com.amazonaws.ssm", "OpsAggregator"),
|
52 + | ::aws_smithy_schema::ShapeType::String,
|
53 + | "AggregatorType",
|
54 + | 0,
|
55 + | );
|
56 + | static OPSAGGREGATOR_MEMBER_TYPE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
57 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsAggregator$TypeName", "com.amazonaws.ssm", "OpsAggregator"),
|
58 + | ::aws_smithy_schema::ShapeType::String,
|
59 + | "TypeName",
|
60 + | 1,
|
61 + | );
|
62 + | static OPSAGGREGATOR_MEMBER_ATTRIBUTE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
63 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsAggregator$AttributeName", "com.amazonaws.ssm", "OpsAggregator"),
|
64 + | ::aws_smithy_schema::ShapeType::String,
|
65 + | "AttributeName",
|
66 + | 2,
|
67 + | );
|
68 + | static OPSAGGREGATOR_MEMBER_VALUES_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
69 + | ::aws_smithy_schema::ShapeId::from_parts(
|
70 + | "com.amazonaws.ssm#OpsAggregatorValueMap$key",
|
71 + | "com.amazonaws.ssm",
|
72 + | "OpsAggregatorValueMap",
|
73 + | ),
|
74 + | ::aws_smithy_schema::ShapeType::String,
|
75 + | "key",
|
76 + | 0,
|
77 + | );
|
78 + | static OPSAGGREGATOR_MEMBER_VALUES_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
79 + | ::aws_smithy_schema::ShapeId::from_parts(
|
80 + | "com.amazonaws.ssm#OpsAggregatorValueMap$value",
|
81 + | "com.amazonaws.ssm",
|
82 + | "OpsAggregatorValueMap",
|
83 + | ),
|
84 + | ::aws_smithy_schema::ShapeType::String,
|
85 + | "value",
|
86 + | 1,
|
87 + | );
|
88 + | static OPSAGGREGATOR_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
89 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsAggregator$Values", "com.amazonaws.ssm", "OpsAggregator"),
|
90 + | ::aws_smithy_schema::ShapeType::Map,
|
91 + | "Values",
|
92 + | 3,
|
93 + | )
|
94 + | .with_map_members(&OPSAGGREGATOR_MEMBER_VALUES_KEY, &OPSAGGREGATOR_MEMBER_VALUES_VALUE);
|
95 + | static OPSAGGREGATOR_MEMBER_FILTERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
96 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsFilterList$member", "com.amazonaws.ssm", "OpsFilterList"),
|
97 + | ::aws_smithy_schema::ShapeType::Structure,
|
98 + | "member",
|
99 + | 0,
|
100 + | )
|
101 + | .with_xml_name("OpsFilter");
|
102 + | static OPSAGGREGATOR_MEMBER_FILTERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
103 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsAggregator$Filters", "com.amazonaws.ssm", "OpsAggregator"),
|
104 + | ::aws_smithy_schema::ShapeType::List,
|
105 + | "Filters",
|
106 + | 4,
|
107 + | )
|
108 + | .with_list_member(&OPSAGGREGATOR_MEMBER_FILTERS_MEMBER);
|
109 + | static OPSAGGREGATOR_MEMBER_AGGREGATORS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
110 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsAggregatorList$member", "com.amazonaws.ssm", "OpsAggregatorList"),
|
111 + | ::aws_smithy_schema::ShapeType::Structure,
|
112 + | "member",
|
113 + | 0,
|
114 + | )
|
115 + | .with_xml_name("Aggregator");
|
116 + | static OPSAGGREGATOR_MEMBER_AGGREGATORS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
117 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsAggregator$Aggregators", "com.amazonaws.ssm", "OpsAggregator"),
|
118 + | ::aws_smithy_schema::ShapeType::List,
|
119 + | "Aggregators",
|
120 + | 5,
|
121 + | )
|
122 + | .with_list_member(&OPSAGGREGATOR_MEMBER_AGGREGATORS_MEMBER);
|
123 + | static OPSAGGREGATOR_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
124 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsAggregator", "com.amazonaws.ssm", "OpsAggregator"),
|
125 + | ::aws_smithy_schema::ShapeType::Structure,
|
126 + | &[
|
127 + | &OPSAGGREGATOR_MEMBER_AGGREGATOR_TYPE,
|
128 + | &OPSAGGREGATOR_MEMBER_TYPE_NAME,
|
129 + | &OPSAGGREGATOR_MEMBER_ATTRIBUTE_NAME,
|
130 + | &OPSAGGREGATOR_MEMBER_VALUES,
|
131 + | &OPSAGGREGATOR_MEMBER_FILTERS,
|
132 + | &OPSAGGREGATOR_MEMBER_AGGREGATORS,
|
133 + | ],
|
134 + | );
|
135 + | impl OpsAggregator {
|
136 + | /// The schema for this shape.
|
137 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &OPSAGGREGATOR_SCHEMA;
|
138 + | }
|
139 + | impl ::aws_smithy_schema::serde::SerializableStruct for OpsAggregator {
|
140 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
141 + | fn serialize_members(
|
142 + | &self,
|
143 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
144 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
145 + | if let Some(ref val) = self.aggregator_type {
|
146 + | ser.write_string(&OPSAGGREGATOR_MEMBER_AGGREGATOR_TYPE, val)?;
|
147 + | }
|
148 + | if let Some(ref val) = self.type_name {
|
149 + | ser.write_string(&OPSAGGREGATOR_MEMBER_TYPE_NAME, val)?;
|
150 + | }
|
151 + | if let Some(ref val) = self.attribute_name {
|
152 + | ser.write_string(&OPSAGGREGATOR_MEMBER_ATTRIBUTE_NAME, val)?;
|
153 + | }
|
154 + | if let Some(ref val) = self.values {
|
155 + | ser.write_map(
|
156 + | &OPSAGGREGATOR_MEMBER_VALUES,
|
157 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
158 + | for (key, value) in val {
|
159 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
160 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
|
161 + | }
|
162 + | Ok(())
|
163 + | },
|
164 + | )?;
|
165 + | }
|
166 + | if let Some(ref val) = self.filters {
|
167 + | ser.write_list(
|
168 + | &OPSAGGREGATOR_MEMBER_FILTERS,
|
169 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
170 + | for item in val {
|
171 + | ser.write_struct(crate::types::OpsFilter::SCHEMA, item)?;
|
172 + | }
|
173 + | Ok(())
|
174 + | },
|
175 + | )?;
|
176 + | }
|
177 + | if let Some(ref val) = self.aggregators {
|
178 + | ser.write_list(
|
179 + | &OPSAGGREGATOR_MEMBER_AGGREGATORS,
|
180 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
181 + | for item in val {
|
182 + | ser.write_struct(crate::types::OpsAggregator::SCHEMA, item)?;
|
183 + | }
|
184 + | Ok(())
|
185 + | },
|
186 + | )?;
|
187 + | }
|
188 + | Ok(())
|
189 + | }
|
190 + | }
|
191 + | impl OpsAggregator {
|
192 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
193 + | pub fn deserialize(
|
194 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
195 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
196 + | #[allow(unused_variables, unused_mut)]
|
197 + | let mut builder = Self::builder();
|
198 + | #[allow(
|
199 + | unused_variables,
|
200 + | unreachable_code,
|
201 + | clippy::single_match,
|
202 + | clippy::match_single_binding,
|
203 + | clippy::diverging_sub_expression
|
204 + | )]
|
205 + | deserializer.read_struct(&OPSAGGREGATOR_SCHEMA, &mut |member, deser| {
|
206 + | match member.member_index() {
|
207 + | Some(0) => {
|
208 + | if deser.is_null() {
|
209 + | deser.read_null()?;
|
210 + | } else {
|
211 + | builder.aggregator_type = Some(deser.read_string(member)?);
|
212 + | }
|
213 + | }
|
214 + | Some(1) => {
|
215 + | if deser.is_null() {
|
216 + | deser.read_null()?;
|
217 + | } else {
|
218 + | builder.type_name = Some(deser.read_string(member)?);
|
219 + | }
|
220 + | }
|
221 + | Some(2) => {
|
222 + | if deser.is_null() {
|
223 + | deser.read_null()?;
|
224 + | } else {
|
225 + | builder.attribute_name = Some(deser.read_string(member)?);
|
226 + | }
|
227 + | }
|
228 + | Some(3) => {
|
229 + | if deser.is_null() {
|
230 + | deser.read_null()?;
|
231 + | } else {
|
232 + | builder.values = Some(deser.read_string_string_map(member)?);
|
233 + | }
|
234 + | }
|
235 + | Some(4) => {
|
236 + | if deser.is_null() {
|
237 + | deser.read_null()?;
|
238 + | } else {
|
239 + | builder.filters = Some({
|
240 + | let mut container = Vec::new();
|
241 + | deser.read_list(member, &mut |deser| {
|
242 + | container.push(crate::types::OpsFilter::deserialize(deser)?);
|
243 + | Ok(())
|
244 + | })?;
|
245 + | container
|
246 + | });
|
247 + | }
|
248 + | }
|
249 + | Some(5) => {
|
250 + | if deser.is_null() {
|
251 + | deser.read_null()?;
|
252 + | } else {
|
253 + | builder.aggregators = Some({
|
254 + | let mut container = Vec::new();
|
255 + | deser.read_list(member, &mut |deser| {
|
256 + | container.push(crate::types::OpsAggregator::deserialize(deser)?);
|
257 + | Ok(())
|
258 + | })?;
|
259 + | container
|
260 + | });
|
261 + | }
|
262 + | }
|
263 + | _ => {}
|
264 + | }
|
265 + | Ok(())
|
266 + | })?;
|
267 + | Ok(builder.build())
|
268 + | }
|
269 + | }
|
270 + | impl OpsAggregator {
|
271 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
272 + | pub fn deserialize_with_response(
|
273 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
274 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
275 + | _status: u16,
|
276 + | _body: &[u8],
|
277 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
278 + | Self::deserialize(deserializer)
|
279 + | }
|
280 + | }
|
281 + | impl OpsAggregator {
|
282 + | /// Creates a new builder-style object to manufacture [`OpsAggregator`](crate::types::OpsAggregator).
|
283 + | pub fn builder() -> crate::types::builders::OpsAggregatorBuilder {
|
284 + | crate::types::builders::OpsAggregatorBuilder::default()
|
285 + | }
|
286 + | }
|
287 + |
|
288 + | /// A builder for [`OpsAggregator`](crate::types::OpsAggregator).
|
289 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
290 + | #[non_exhaustive]
|
291 + | pub struct OpsAggregatorBuilder {
|
292 + | pub(crate) aggregator_type: ::std::option::Option<::std::string::String>,
|
293 + | pub(crate) type_name: ::std::option::Option<::std::string::String>,
|
294 + | pub(crate) attribute_name: ::std::option::Option<::std::string::String>,
|
295 + | pub(crate) values: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
|
296 + | pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::OpsFilter>>,
|
297 + | pub(crate) aggregators: ::std::option::Option<::std::vec::Vec<crate::types::OpsAggregator>>,
|
298 + | }
|
299 + | impl OpsAggregatorBuilder {
|
300 + | /// <p>Either a <code>Range</code> or <code>Count</code> aggregator for limiting an OpsData summary.</p>
|
301 + | pub fn aggregator_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
302 + | self.aggregator_type = ::std::option::Option::Some(input.into());
|
303 + | self
|
304 + | }
|
305 + | /// <p>Either a <code>Range</code> or <code>Count</code> aggregator for limiting an OpsData summary.</p>
|
306 + | pub fn set_aggregator_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
307 + | self.aggregator_type = input;
|
308 + | self
|
309 + | }
|
310 + | /// <p>Either a <code>Range</code> or <code>Count</code> aggregator for limiting an OpsData summary.</p>
|
311 + | pub fn get_aggregator_type(&self) -> &::std::option::Option<::std::string::String> {
|
312 + | &self.aggregator_type
|
313 + | }
|
314 + | /// <p>The data type name to use for viewing counts of OpsData.</p>
|
315 + | pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
316 + | self.type_name = ::std::option::Option::Some(input.into());
|
317 + | self
|
318 + | }
|
319 + | /// <p>The data type name to use for viewing counts of OpsData.</p>
|
320 + | pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
321 + | self.type_name = input;
|
322 + | self
|
323 + | }
|
324 + | /// <p>The data type name to use for viewing counts of OpsData.</p>
|
325 + | pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
|
326 + | &self.type_name
|
327 + | }
|
328 + | /// <p>The name of an OpsData attribute on which to limit the count of OpsData.</p>
|
329 + | pub fn attribute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
330 + | self.attribute_name = ::std::option::Option::Some(input.into());
|
331 + | self
|
332 + | }
|
333 + | /// <p>The name of an OpsData attribute on which to limit the count of OpsData.</p>
|
334 + | pub fn set_attribute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
335 + | self.attribute_name = input;
|
336 + | self
|
337 + | }
|
338 + | /// <p>The name of an OpsData attribute on which to limit the count of OpsData.</p>
|
339 + | pub fn get_attribute_name(&self) -> &::std::option::Option<::std::string::String> {
|
340 + | &self.attribute_name
|
341 + | }
|
342 + | /// Adds a key-value pair to `values`.
|
343 + | ///
|
344 + | /// To override the contents of this collection use [`set_values`](Self::set_values).
|
345 + | ///
|
346 + | /// <p>The aggregator value.</p>
|
347 + | pub fn values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
|
348 + | let mut hash_map = self.values.unwrap_or_default();
|
349 + | hash_map.insert(k.into(), v.into());
|
350 + | self.values = ::std::option::Option::Some(hash_map);
|
351 + | self
|
352 + | }
|
353 + | /// <p>The aggregator value.</p>
|
354 + | pub fn set_values(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
|
355 + | self.values = input;
|
356 + | self
|
357 + | }
|
358 + | /// <p>The aggregator value.</p>
|
359 + | pub fn get_values(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
|
360 + | &self.values
|
361 + | }
|
362 + | /// Appends an item to `filters`.
|
363 + | ///
|
364 + | /// To override the contents of this collection use [`set_filters`](Self::set_filters).
|
365 + | ///
|
366 + | /// <p>The aggregator filters.</p>
|
367 + | pub fn filters(mut self, input: crate::types::OpsFilter) -> Self {
|
368 + | let mut v = self.filters.unwrap_or_default();
|
369 + | v.push(input);
|
370 + | self.filters = ::std::option::Option::Some(v);
|
371 + | self
|
372 + | }
|
373 + | /// <p>The aggregator filters.</p>
|
374 + | pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OpsFilter>>) -> Self {
|
375 + | self.filters = input;
|
376 + | self
|
377 + | }
|
378 + | /// <p>The aggregator filters.</p>
|
379 + | pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OpsFilter>> {
|
380 + | &self.filters
|
381 + | }
|
382 + | /// Appends an item to `aggregators`.
|
383 + | ///
|
384 + | /// To override the contents of this collection use [`set_aggregators`](Self::set_aggregators).
|
385 + | ///
|
386 + | /// <p>A nested aggregator for viewing counts of OpsData.</p>
|
387 + | pub fn aggregators(mut self, input: crate::types::OpsAggregator) -> Self {
|
388 + | let mut v = self.aggregators.unwrap_or_default();
|
389 + | v.push(input);
|
390 + | self.aggregators = ::std::option::Option::Some(v);
|
391 + | self
|
392 + | }
|
393 + | /// <p>A nested aggregator for viewing counts of OpsData.</p>
|
394 + | pub fn set_aggregators(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OpsAggregator>>) -> Self {
|
395 + | self.aggregators = input;
|
396 + | self
|
397 + | }
|
398 + | /// <p>A nested aggregator for viewing counts of OpsData.</p>
|
399 + | pub fn get_aggregators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OpsAggregator>> {
|
400 + | &self.aggregators
|
401 + | }
|
402 + | /// Consumes the builder and constructs a [`OpsAggregator`](crate::types::OpsAggregator).
|
403 + | pub fn build(self) -> crate::types::OpsAggregator {
|
404 + | crate::types::OpsAggregator {
|
405 + | aggregator_type: self.aggregator_type,
|
406 + | type_name: self.type_name,
|
407 + | attribute_name: self.attribute_name,
|
408 + | values: self.values,
|
409 + | filters: self.filters,
|
410 + | aggregators: self.aggregators,
|
411 + | }
|
412 + | }
|
413 + | }
|