1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>One or more filters. Use a filter to return a more specific list of results.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct ComplianceStringFilter {
|
7 + | /// <p>The name of the filter.</p>
|
8 + | pub key: ::std::option::Option<::std::string::String>,
|
9 + | /// <p>The value for which to search.</p>
|
10 + | pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
11 + | /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
|
12 + | pub r#type: ::std::option::Option<crate::types::ComplianceQueryOperatorType>,
|
13 + | }
|
14 + | impl ComplianceStringFilter {
|
15 + | /// <p>The name of the filter.</p>
|
16 + | pub fn key(&self) -> ::std::option::Option<&str> {
|
17 + | self.key.as_deref()
|
18 + | }
|
19 + | /// <p>The value for which to search.</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 `.values.is_none()`.
|
22 + | pub fn values(&self) -> &[::std::string::String] {
|
23 + | self.values.as_deref().unwrap_or_default()
|
24 + | }
|
25 + | /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
|
26 + | pub fn r#type(&self) -> ::std::option::Option<&crate::types::ComplianceQueryOperatorType> {
|
27 + | self.r#type.as_ref()
|
28 + | }
|
29 + | }
|
30 + | static COMPLIANCESTRINGFILTER_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
31 + | ::aws_smithy_schema::ShapeId::from_parts(
|
32 + | "com.amazonaws.ssm#ComplianceStringFilter$Key",
|
33 + | "com.amazonaws.ssm",
|
34 + | "ComplianceStringFilter",
|
35 + | ),
|
36 + | ::aws_smithy_schema::ShapeType::String,
|
37 + | "Key",
|
38 + | 0,
|
39 + | );
|
40 + | static COMPLIANCESTRINGFILTER_MEMBER_VALUES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
41 + | ::aws_smithy_schema::ShapeId::from_parts(
|
42 + | "com.amazonaws.ssm#ComplianceStringFilterValueList$member",
|
43 + | "com.amazonaws.ssm",
|
44 + | "ComplianceStringFilterValueList",
|
45 + | ),
|
46 + | ::aws_smithy_schema::ShapeType::String,
|
47 + | "member",
|
48 + | 0,
|
49 + | )
|
50 + | .with_xml_name("FilterValue");
|
51 + | static COMPLIANCESTRINGFILTER_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
52 + | ::aws_smithy_schema::ShapeId::from_parts(
|
53 + | "com.amazonaws.ssm#ComplianceStringFilter$Values",
|
54 + | "com.amazonaws.ssm",
|
55 + | "ComplianceStringFilter",
|
56 + | ),
|
57 + | ::aws_smithy_schema::ShapeType::List,
|
58 + | "Values",
|
59 + | 1,
|
60 + | )
|
61 + | .with_list_member(&COMPLIANCESTRINGFILTER_MEMBER_VALUES_MEMBER);
|
62 + | static COMPLIANCESTRINGFILTER_MEMBER_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
63 + | ::aws_smithy_schema::ShapeId::from_parts(
|
64 + | "com.amazonaws.ssm#ComplianceStringFilter$Type",
|
65 + | "com.amazonaws.ssm",
|
66 + | "ComplianceStringFilter",
|
67 + | ),
|
68 + | ::aws_smithy_schema::ShapeType::String,
|
69 + | "Type",
|
70 + | 2,
|
71 + | );
|
72 + | static COMPLIANCESTRINGFILTER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
73 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ComplianceStringFilter", "com.amazonaws.ssm", "ComplianceStringFilter"),
|
74 + | ::aws_smithy_schema::ShapeType::Structure,
|
75 + | &[
|
76 + | &COMPLIANCESTRINGFILTER_MEMBER_KEY,
|
77 + | &COMPLIANCESTRINGFILTER_MEMBER_VALUES,
|
78 + | &COMPLIANCESTRINGFILTER_MEMBER_TYPE,
|
79 + | ],
|
80 + | );
|
81 + | impl ComplianceStringFilter {
|
82 + | /// The schema for this shape.
|
83 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &COMPLIANCESTRINGFILTER_SCHEMA;
|
84 + | }
|
85 + | impl ::aws_smithy_schema::serde::SerializableStruct for ComplianceStringFilter {
|
86 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
87 + | fn serialize_members(
|
88 + | &self,
|
89 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
90 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
91 + | if let Some(ref val) = self.key {
|
92 + | ser.write_string(&COMPLIANCESTRINGFILTER_MEMBER_KEY, val)?;
|
93 + | }
|
94 + | if let Some(ref val) = self.values {
|
95 + | ser.write_list(
|
96 + | &COMPLIANCESTRINGFILTER_MEMBER_VALUES,
|
97 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
98 + | for item in val {
|
99 + | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
100 + | }
|
101 + | Ok(())
|
102 + | },
|
103 + | )?;
|
104 + | }
|
105 + | if let Some(ref val) = self.r#type {
|
106 + | ser.write_string(&COMPLIANCESTRINGFILTER_MEMBER_TYPE, val.as_str())?;
|
107 + | }
|
108 + | Ok(())
|
109 + | }
|
110 + | }
|
111 + | impl ComplianceStringFilter {
|
112 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
113 + | pub fn deserialize(
|
114 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
115 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
116 + | #[allow(unused_variables, unused_mut)]
|
117 + | let mut builder = Self::builder();
|
118 + | #[allow(
|
119 + | unused_variables,
|
120 + | unreachable_code,
|
121 + | clippy::single_match,
|
122 + | clippy::match_single_binding,
|
123 + | clippy::diverging_sub_expression
|
124 + | )]
|
125 + | deserializer.read_struct(&COMPLIANCESTRINGFILTER_SCHEMA, &mut |member, deser| {
|
126 + | match member.member_index() {
|
127 + | Some(0) => {
|
128 + | if deser.is_null() {
|
129 + | deser.read_null()?;
|
130 + | } else {
|
131 + | builder.key = Some(deser.read_string(member)?);
|
132 + | }
|
133 + | }
|
134 + | Some(1) => {
|
135 + | if deser.is_null() {
|
136 + | deser.read_null()?;
|
137 + | } else {
|
138 + | builder.values = Some(deser.read_string_list(member)?);
|
139 + | }
|
140 + | }
|
141 + | Some(2) => {
|
142 + | if deser.is_null() {
|
143 + | deser.read_null()?;
|
144 + | } else {
|
145 + | builder.r#type = Some(crate::types::ComplianceQueryOperatorType::from(deser.read_string(member)?.as_str()));
|
146 + | }
|
147 + | }
|
148 + | _ => {}
|
149 + | }
|
150 + | Ok(())
|
151 + | })?;
|
152 + | Ok(builder.build())
|
153 + | }
|
154 + | }
|
155 + | impl ComplianceStringFilter {
|
156 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
157 + | pub fn deserialize_with_response(
|
158 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
159 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
160 + | _status: u16,
|
161 + | _body: &[u8],
|
162 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
163 + | Self::deserialize(deserializer)
|
164 + | }
|
165 + | }
|
166 + | impl ComplianceStringFilter {
|
167 + | /// Creates a new builder-style object to manufacture [`ComplianceStringFilter`](crate::types::ComplianceStringFilter).
|
168 + | pub fn builder() -> crate::types::builders::ComplianceStringFilterBuilder {
|
169 + | crate::types::builders::ComplianceStringFilterBuilder::default()
|
170 + | }
|
171 + | }
|
172 + |
|
173 + | /// A builder for [`ComplianceStringFilter`](crate::types::ComplianceStringFilter).
|
174 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
175 + | #[non_exhaustive]
|
176 + | pub struct ComplianceStringFilterBuilder {
|
177 + | pub(crate) key: ::std::option::Option<::std::string::String>,
|
178 + | pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
179 + | pub(crate) r#type: ::std::option::Option<crate::types::ComplianceQueryOperatorType>,
|
180 + | }
|
181 + | impl ComplianceStringFilterBuilder {
|
182 + | /// <p>The name of the filter.</p>
|
183 + | pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
184 + | self.key = ::std::option::Option::Some(input.into());
|
185 + | self
|
186 + | }
|
187 + | /// <p>The name of the filter.</p>
|
188 + | pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
189 + | self.key = input;
|
190 + | self
|
191 + | }
|
192 + | /// <p>The name of the filter.</p>
|
193 + | pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
|
194 + | &self.key
|
195 + | }
|
196 + | /// Appends an item to `values`.
|
197 + | ///
|
198 + | /// To override the contents of this collection use [`set_values`](Self::set_values).
|
199 + | ///
|
200 + | /// <p>The value for which to search.</p>
|
201 + | pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
202 + | let mut v = self.values.unwrap_or_default();
|
203 + | v.push(input.into());
|
204 + | self.values = ::std::option::Option::Some(v);
|
205 + | self
|
206 + | }
|
207 + | /// <p>The value for which to search.</p>
|
208 + | pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
|
209 + | self.values = input;
|
210 + | self
|
211 + | }
|
212 + | /// <p>The value for which to search.</p>
|
213 + | pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
|
214 + | &self.values
|
215 + | }
|
216 + | /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
|
217 + | pub fn r#type(mut self, input: crate::types::ComplianceQueryOperatorType) -> Self {
|
218 + | self.r#type = ::std::option::Option::Some(input);
|
219 + | self
|
220 + | }
|
221 + | /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
|
222 + | pub fn set_type(mut self, input: ::std::option::Option<crate::types::ComplianceQueryOperatorType>) -> Self {
|
223 + | self.r#type = input;
|
224 + | self
|
225 + | }
|
226 + | /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
|
227 + | pub fn get_type(&self) -> &::std::option::Option<crate::types::ComplianceQueryOperatorType> {
|
228 + | &self.r#type
|
229 + | }
|
230 + | /// Consumes the builder and constructs a [`ComplianceStringFilter`](crate::types::ComplianceStringFilter).
|
231 + | pub fn build(self) -> crate::types::ComplianceStringFilter {
|
232 + | crate::types::ComplianceStringFilter {
|
233 + | key: self.key,
|
234 + | values: self.values,
|
235 + | r#type: self.r#type,
|
236 + | }
|
237 + | }
|
238 + | }
|