1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Defines the query to run against an object.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Query {
/// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
pub selectors: ::std::option::Option<::std::vec::Vec<crate::types::Selector>>,
}
impl Query {
/// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.selectors.is_none()`.
pub fn selectors(&self) -> &[crate::types::Selector] {
self.selectors.as_deref().unwrap_or_default()
}
}
impl Query {
/// Creates a new builder-style object to manufacture [`Query`](crate::types::Query).
pub fn builder() -> crate::types::builders::QueryBuilder {
crate::types::builders::QueryBuilder::default()
}
}
/// A builder for [`Query`](crate::types::Query).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct QueryBuilder {
pub(crate) selectors: ::std::option::Option<::std::vec::Vec<crate::types::Selector>>,
}
impl QueryBuilder {
/// Appends an item to `selectors`.
///
/// To override the contents of this collection use [`set_selectors`](Self::set_selectors).
///
/// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
pub fn selectors(mut self, input: crate::types::Selector) -> Self {
let mut v = self.selectors.unwrap_or_default();
v.push(input);
self.selectors = ::std::option::Option::Some(v);
self
}
/// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
pub fn set_selectors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Selector>>) -> Self {
self.selectors = input;
self
}
/// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
pub fn get_selectors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Selector>> {
&self.selectors
}
/// Consumes the builder and constructs a [`Query`](crate::types::Query).
pub fn build(self) -> crate::types::Query {
crate::types::Query { selectors: self.selectors }
}
}