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 ParameterStringFilter {
|
7 + | /// <p>The name of the filter.</p>
|
8 + | /// <p>The <code>ParameterStringFilter</code> object is used by the <code>DescribeParameters</code> and <code>GetParametersByPath</code> API operations. However, not all of the pattern values listed for <code>Key</code> can be used with both operations.</p>
|
9 + | /// <p>For <code>DescribeParameters</code>, all of the listed patterns are valid except <code>Label</code>.</p>
|
10 + | /// <p>For <code>GetParametersByPath</code>, the following patterns listed for <code>Key</code> aren't valid: <code>tag</code>, <code>DataType</code>, <code>Name</code>, <code>Path</code>, and <code>Tier</code>.</p>
|
11 + | /// <p>For examples of Amazon Web Services CLI commands demonstrating valid parameter filter constructions, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html">Searching for Systems Manager parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
|
12 + | pub key: ::std::string::String,
|
13 + | /// <p>For all filters used with <code>DescribeParameters</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. The <code>Name</code> filter additionally supports the <code>Contains</code> option. (Exception: For filters using the key <code>Path</code>, valid options include <code>Recursive</code> and <code>OneLevel</code>.)</p>
|
14 + | /// <p>For filters used with <code>GetParametersByPath</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. (Exception: For filters using <code>Label</code> as the Key name, the only valid option is <code>Equals</code>.)</p>
|
15 + | pub option: ::std::option::Option<::std::string::String>,
|
16 + | /// <p>The value you want to search for.</p>
|
17 + | pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
18 + | }
|
19 + | impl ParameterStringFilter {
|
20 + | /// <p>The name of the filter.</p>
|
21 + | /// <p>The <code>ParameterStringFilter</code> object is used by the <code>DescribeParameters</code> and <code>GetParametersByPath</code> API operations. However, not all of the pattern values listed for <code>Key</code> can be used with both operations.</p>
|
22 + | /// <p>For <code>DescribeParameters</code>, all of the listed patterns are valid except <code>Label</code>.</p>
|
23 + | /// <p>For <code>GetParametersByPath</code>, the following patterns listed for <code>Key</code> aren't valid: <code>tag</code>, <code>DataType</code>, <code>Name</code>, <code>Path</code>, and <code>Tier</code>.</p>
|
24 + | /// <p>For examples of Amazon Web Services CLI commands demonstrating valid parameter filter constructions, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html">Searching for Systems Manager parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
|
25 + | pub fn key(&self) -> &str {
|
26 + | use std::ops::Deref;
|
27 + | self.key.deref()
|
28 + | }
|
29 + | /// <p>For all filters used with <code>DescribeParameters</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. The <code>Name</code> filter additionally supports the <code>Contains</code> option. (Exception: For filters using the key <code>Path</code>, valid options include <code>Recursive</code> and <code>OneLevel</code>.)</p>
|
30 + | /// <p>For filters used with <code>GetParametersByPath</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. (Exception: For filters using <code>Label</code> as the Key name, the only valid option is <code>Equals</code>.)</p>
|
31 + | pub fn option(&self) -> ::std::option::Option<&str> {
|
32 + | self.option.as_deref()
|
33 + | }
|
34 + | /// <p>The value you want to search for.</p>
|
35 + | ///
|
36 + | /// 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()`.
|
37 + | pub fn values(&self) -> &[::std::string::String] {
|
38 + | self.values.as_deref().unwrap_or_default()
|
39 + | }
|
40 + | }
|
41 + | static PARAMETERSTRINGFILTER_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
42 + | ::aws_smithy_schema::ShapeId::from_parts(
|
43 + | "com.amazonaws.ssm#ParameterStringFilter$Key",
|
44 + | "com.amazonaws.ssm",
|
45 + | "ParameterStringFilter",
|
46 + | ),
|
47 + | ::aws_smithy_schema::ShapeType::String,
|
48 + | "Key",
|
49 + | 0,
|
50 + | );
|
51 + | static PARAMETERSTRINGFILTER_MEMBER_OPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
52 + | ::aws_smithy_schema::ShapeId::from_parts(
|
53 + | "com.amazonaws.ssm#ParameterStringFilter$Option",
|
54 + | "com.amazonaws.ssm",
|
55 + | "ParameterStringFilter",
|
56 + | ),
|
57 + | ::aws_smithy_schema::ShapeType::String,
|
58 + | "Option",
|
59 + | 1,
|
60 + | );
|
61 + | static PARAMETERSTRINGFILTER_MEMBER_VALUES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
62 + | ::aws_smithy_schema::ShapeId::from_parts(
|
63 + | "com.amazonaws.ssm#ParameterStringFilterValueList$member",
|
64 + | "com.amazonaws.ssm",
|
65 + | "ParameterStringFilterValueList",
|
66 + | ),
|
67 + | ::aws_smithy_schema::ShapeType::String,
|
68 + | "member",
|
69 + | 0,
|
70 + | );
|
71 + | static PARAMETERSTRINGFILTER_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
72 + | ::aws_smithy_schema::ShapeId::from_parts(
|
73 + | "com.amazonaws.ssm#ParameterStringFilter$Values",
|
74 + | "com.amazonaws.ssm",
|
75 + | "ParameterStringFilter",
|
76 + | ),
|
77 + | ::aws_smithy_schema::ShapeType::List,
|
78 + | "Values",
|
79 + | 2,
|
80 + | )
|
81 + | .with_list_member(&PARAMETERSTRINGFILTER_MEMBER_VALUES_MEMBER);
|
82 + | static PARAMETERSTRINGFILTER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
83 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ParameterStringFilter", "com.amazonaws.ssm", "ParameterStringFilter"),
|
84 + | ::aws_smithy_schema::ShapeType::Structure,
|
85 + | &[
|
86 + | &PARAMETERSTRINGFILTER_MEMBER_KEY,
|
87 + | &PARAMETERSTRINGFILTER_MEMBER_OPTION,
|
88 + | &PARAMETERSTRINGFILTER_MEMBER_VALUES,
|
89 + | ],
|
90 + | );
|
91 + | impl ParameterStringFilter {
|
92 + | /// The schema for this shape.
|
93 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PARAMETERSTRINGFILTER_SCHEMA;
|
94 + | }
|
95 + | impl ::aws_smithy_schema::serde::SerializableStruct for ParameterStringFilter {
|
96 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
97 + | fn serialize_members(
|
98 + | &self,
|
99 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
100 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
101 + | {
|
102 + | let val = &self.key;
|
103 + | ser.write_string(&PARAMETERSTRINGFILTER_MEMBER_KEY, val)?;
|
104 + | }
|
105 + | if let Some(ref val) = self.option {
|
106 + | ser.write_string(&PARAMETERSTRINGFILTER_MEMBER_OPTION, val)?;
|
107 + | }
|
108 + | if let Some(ref val) = self.values {
|
109 + | ser.write_list(
|
110 + | &PARAMETERSTRINGFILTER_MEMBER_VALUES,
|
111 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
112 + | for item in val {
|
113 + | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
114 + | }
|
115 + | Ok(())
|
116 + | },
|
117 + | )?;
|
118 + | }
|
119 + | Ok(())
|
120 + | }
|
121 + | }
|
122 + | impl ParameterStringFilter {
|
123 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
124 + | pub fn deserialize(
|
125 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
126 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
127 + | #[allow(unused_variables, unused_mut)]
|
128 + | let mut builder = Self::builder();
|
129 + | #[allow(
|
130 + | unused_variables,
|
131 + | unreachable_code,
|
132 + | clippy::single_match,
|
133 + | clippy::match_single_binding,
|
134 + | clippy::diverging_sub_expression
|
135 + | )]
|
136 + | deserializer.read_struct(&PARAMETERSTRINGFILTER_SCHEMA, &mut |member, deser| {
|
137 + | match member.member_index() {
|
138 + | Some(0) => {
|
139 + | builder.key = Some(deser.read_string(member)?);
|
140 + | }
|
141 + | Some(1) => {
|
142 + | if deser.is_null() {
|
143 + | deser.read_null()?;
|
144 + | } else {
|
145 + | builder.option = Some(deser.read_string(member)?);
|
146 + | }
|
147 + | }
|
148 + | Some(2) => {
|
149 + | if deser.is_null() {
|
150 + | deser.read_null()?;
|
151 + | } else {
|
152 + | builder.values = Some(deser.read_string_list(member)?);
|
153 + | }
|
154 + | }
|
155 + | _ => {}
|
156 + | }
|
157 + | Ok(())
|
158 + | })?;
|
159 + | builder.key = builder.key.or(Some(String::new()));
|
160 + | builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
|
161 + | }
|
162 + | }
|
163 + | impl ParameterStringFilter {
|
164 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
165 + | pub fn deserialize_with_response(
|
166 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
167 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
168 + | _status: u16,
|
169 + | _body: &[u8],
|
170 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
171 + | Self::deserialize(deserializer)
|
172 + | }
|
173 + | }
|
174 + | impl ParameterStringFilter {
|
175 + | /// Creates a new builder-style object to manufacture [`ParameterStringFilter`](crate::types::ParameterStringFilter).
|
176 + | pub fn builder() -> crate::types::builders::ParameterStringFilterBuilder {
|
177 + | crate::types::builders::ParameterStringFilterBuilder::default()
|
178 + | }
|
179 + | }
|
180 + |
|
181 + | /// A builder for [`ParameterStringFilter`](crate::types::ParameterStringFilter).
|
182 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
183 + | #[non_exhaustive]
|
184 + | pub struct ParameterStringFilterBuilder {
|
185 + | pub(crate) key: ::std::option::Option<::std::string::String>,
|
186 + | pub(crate) option: ::std::option::Option<::std::string::String>,
|
187 + | pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
188 + | }
|
189 + | impl ParameterStringFilterBuilder {
|
190 + | /// <p>The name of the filter.</p>
|
191 + | /// <p>The <code>ParameterStringFilter</code> object is used by the <code>DescribeParameters</code> and <code>GetParametersByPath</code> API operations. However, not all of the pattern values listed for <code>Key</code> can be used with both operations.</p>
|
192 + | /// <p>For <code>DescribeParameters</code>, all of the listed patterns are valid except <code>Label</code>.</p>
|
193 + | /// <p>For <code>GetParametersByPath</code>, the following patterns listed for <code>Key</code> aren't valid: <code>tag</code>, <code>DataType</code>, <code>Name</code>, <code>Path</code>, and <code>Tier</code>.</p>
|
194 + | /// <p>For examples of Amazon Web Services CLI commands demonstrating valid parameter filter constructions, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html">Searching for Systems Manager parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
|
195 + | /// This field is required.
|
196 + | pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
197 + | self.key = ::std::option::Option::Some(input.into());
|
198 + | self
|
199 + | }
|
200 + | /// <p>The name of the filter.</p>
|
201 + | /// <p>The <code>ParameterStringFilter</code> object is used by the <code>DescribeParameters</code> and <code>GetParametersByPath</code> API operations. However, not all of the pattern values listed for <code>Key</code> can be used with both operations.</p>
|
202 + | /// <p>For <code>DescribeParameters</code>, all of the listed patterns are valid except <code>Label</code>.</p>
|
203 + | /// <p>For <code>GetParametersByPath</code>, the following patterns listed for <code>Key</code> aren't valid: <code>tag</code>, <code>DataType</code>, <code>Name</code>, <code>Path</code>, and <code>Tier</code>.</p>
|
204 + | /// <p>For examples of Amazon Web Services CLI commands demonstrating valid parameter filter constructions, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html">Searching for Systems Manager parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
|
205 + | pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
206 + | self.key = input;
|
207 + | self
|
208 + | }
|
209 + | /// <p>The name of the filter.</p>
|
210 + | /// <p>The <code>ParameterStringFilter</code> object is used by the <code>DescribeParameters</code> and <code>GetParametersByPath</code> API operations. However, not all of the pattern values listed for <code>Key</code> can be used with both operations.</p>
|
211 + | /// <p>For <code>DescribeParameters</code>, all of the listed patterns are valid except <code>Label</code>.</p>
|
212 + | /// <p>For <code>GetParametersByPath</code>, the following patterns listed for <code>Key</code> aren't valid: <code>tag</code>, <code>DataType</code>, <code>Name</code>, <code>Path</code>, and <code>Tier</code>.</p>
|
213 + | /// <p>For examples of Amazon Web Services CLI commands demonstrating valid parameter filter constructions, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html">Searching for Systems Manager parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
|
214 + | pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
|
215 + | &self.key
|
216 + | }
|
217 + | /// <p>For all filters used with <code>DescribeParameters</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. The <code>Name</code> filter additionally supports the <code>Contains</code> option. (Exception: For filters using the key <code>Path</code>, valid options include <code>Recursive</code> and <code>OneLevel</code>.)</p>
|
218 + | /// <p>For filters used with <code>GetParametersByPath</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. (Exception: For filters using <code>Label</code> as the Key name, the only valid option is <code>Equals</code>.)</p>
|
219 + | pub fn option(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
220 + | self.option = ::std::option::Option::Some(input.into());
|
221 + | self
|
222 + | }
|
223 + | /// <p>For all filters used with <code>DescribeParameters</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. The <code>Name</code> filter additionally supports the <code>Contains</code> option. (Exception: For filters using the key <code>Path</code>, valid options include <code>Recursive</code> and <code>OneLevel</code>.)</p>
|
224 + | /// <p>For filters used with <code>GetParametersByPath</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. (Exception: For filters using <code>Label</code> as the Key name, the only valid option is <code>Equals</code>.)</p>
|
225 + | pub fn set_option(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
226 + | self.option = input;
|
227 + | self
|
228 + | }
|
229 + | /// <p>For all filters used with <code>DescribeParameters</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. The <code>Name</code> filter additionally supports the <code>Contains</code> option. (Exception: For filters using the key <code>Path</code>, valid options include <code>Recursive</code> and <code>OneLevel</code>.)</p>
|
230 + | /// <p>For filters used with <code>GetParametersByPath</code>, valid options include <code>Equals</code> and <code>BeginsWith</code>. (Exception: For filters using <code>Label</code> as the Key name, the only valid option is <code>Equals</code>.)</p>
|
231 + | pub fn get_option(&self) -> &::std::option::Option<::std::string::String> {
|
232 + | &self.option
|
233 + | }
|
234 + | /// Appends an item to `values`.
|
235 + | ///
|
236 + | /// To override the contents of this collection use [`set_values`](Self::set_values).
|
237 + | ///
|
238 + | /// <p>The value you want to search for.</p>
|
239 + | pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
240 + | let mut v = self.values.unwrap_or_default();
|
241 + | v.push(input.into());
|
242 + | self.values = ::std::option::Option::Some(v);
|
243 + | self
|
244 + | }
|
245 + | /// <p>The value you want to search for.</p>
|
246 + | pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
|
247 + | self.values = input;
|
248 + | self
|
249 + | }
|
250 + | /// <p>The value you want to search for.</p>
|
251 + | pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
|
252 + | &self.values
|
253 + | }
|
254 + | /// Consumes the builder and constructs a [`ParameterStringFilter`](crate::types::ParameterStringFilter).
|
255 + | /// This method will fail if any of the following fields are not set:
|
256 + | /// - [`key`](crate::types::builders::ParameterStringFilterBuilder::key)
|
257 + | pub fn build(self) -> ::std::result::Result<crate::types::ParameterStringFilter, ::aws_smithy_types::error::operation::BuildError> {
|
258 + | ::std::result::Result::Ok(crate::types::ParameterStringFilter {
|
259 + | key: self.key.ok_or_else(|| {
|
260 + | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
261 + | "key",
|
262 + | "key was not specified but it is required when building ParameterStringFilter",
|
263 + | )
|
264 + | })?,
|
265 + | option: self.option,
|
266 + | values: self.values,
|
267 + | })
|
268 + | }
|
269 + | }
|