aws_sdk_datazone/operation/search/
_search_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct SearchInput {
6    /// <p>The identifier of the Amazon DataZone domain.</p>
7    pub domain_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the owning project specified for the search.</p>
9    pub owning_project_identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The maximum number of results to return in a single call to <code>Search</code>. When the number of results to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>Search</code> to list the next set of results.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14    /// <p>The scope of the search.</p>
15    pub search_scope: ::std::option::Option<crate::types::InventorySearchScope>,
16    /// <p>Specifies the text for which to search.</p>
17    pub search_text: ::std::option::Option<::std::string::String>,
18    /// <p>The details of the search.</p>
19    pub search_in: ::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>>,
20    /// <p>Specifies the search filters.</p>
21    pub filters: ::std::option::Option<crate::types::FilterClause>,
22    /// <p>Specifies the way in which the search results are to be sorted.</p>
23    pub sort: ::std::option::Option<crate::types::SearchSort>,
24    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
25    pub additional_attributes: ::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>>,
26}
27impl SearchInput {
28    /// <p>The identifier of the Amazon DataZone domain.</p>
29    pub fn domain_identifier(&self) -> ::std::option::Option<&str> {
30        self.domain_identifier.as_deref()
31    }
32    /// <p>The identifier of the owning project specified for the search.</p>
33    pub fn owning_project_identifier(&self) -> ::std::option::Option<&str> {
34        self.owning_project_identifier.as_deref()
35    }
36    /// <p>The maximum number of results to return in a single call to <code>Search</code>. When the number of results to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>Search</code> to list the next set of results.</p>
37    pub fn max_results(&self) -> ::std::option::Option<i32> {
38        self.max_results
39    }
40    /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
41    pub fn next_token(&self) -> ::std::option::Option<&str> {
42        self.next_token.as_deref()
43    }
44    /// <p>The scope of the search.</p>
45    pub fn search_scope(&self) -> ::std::option::Option<&crate::types::InventorySearchScope> {
46        self.search_scope.as_ref()
47    }
48    /// <p>Specifies the text for which to search.</p>
49    pub fn search_text(&self) -> ::std::option::Option<&str> {
50        self.search_text.as_deref()
51    }
52    /// <p>The details of the search.</p>
53    ///
54    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.search_in.is_none()`.
55    pub fn search_in(&self) -> &[crate::types::SearchInItem] {
56        self.search_in.as_deref().unwrap_or_default()
57    }
58    /// <p>Specifies the search filters.</p>
59    pub fn filters(&self) -> ::std::option::Option<&crate::types::FilterClause> {
60        self.filters.as_ref()
61    }
62    /// <p>Specifies the way in which the search results are to be sorted.</p>
63    pub fn sort(&self) -> ::std::option::Option<&crate::types::SearchSort> {
64        self.sort.as_ref()
65    }
66    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
67    ///
68    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.additional_attributes.is_none()`.
69    pub fn additional_attributes(&self) -> &[crate::types::SearchOutputAdditionalAttribute] {
70        self.additional_attributes.as_deref().unwrap_or_default()
71    }
72}
73impl SearchInput {
74    /// Creates a new builder-style object to manufacture [`SearchInput`](crate::operation::search::SearchInput).
75    pub fn builder() -> crate::operation::search::builders::SearchInputBuilder {
76        crate::operation::search::builders::SearchInputBuilder::default()
77    }
78}
79
80/// A builder for [`SearchInput`](crate::operation::search::SearchInput).
81#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
82#[non_exhaustive]
83pub struct SearchInputBuilder {
84    pub(crate) domain_identifier: ::std::option::Option<::std::string::String>,
85    pub(crate) owning_project_identifier: ::std::option::Option<::std::string::String>,
86    pub(crate) max_results: ::std::option::Option<i32>,
87    pub(crate) next_token: ::std::option::Option<::std::string::String>,
88    pub(crate) search_scope: ::std::option::Option<crate::types::InventorySearchScope>,
89    pub(crate) search_text: ::std::option::Option<::std::string::String>,
90    pub(crate) search_in: ::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>>,
91    pub(crate) filters: ::std::option::Option<crate::types::FilterClause>,
92    pub(crate) sort: ::std::option::Option<crate::types::SearchSort>,
93    pub(crate) additional_attributes: ::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>>,
94}
95impl SearchInputBuilder {
96    /// <p>The identifier of the Amazon DataZone domain.</p>
97    /// This field is required.
98    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.domain_identifier = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The identifier of the Amazon DataZone domain.</p>
103    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.domain_identifier = input;
105        self
106    }
107    /// <p>The identifier of the Amazon DataZone domain.</p>
108    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
109        &self.domain_identifier
110    }
111    /// <p>The identifier of the owning project specified for the search.</p>
112    pub fn owning_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.owning_project_identifier = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The identifier of the owning project specified for the search.</p>
117    pub fn set_owning_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.owning_project_identifier = input;
119        self
120    }
121    /// <p>The identifier of the owning project specified for the search.</p>
122    pub fn get_owning_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
123        &self.owning_project_identifier
124    }
125    /// <p>The maximum number of results to return in a single call to <code>Search</code>. When the number of results to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>Search</code> to list the next set of results.</p>
126    pub fn max_results(mut self, input: i32) -> Self {
127        self.max_results = ::std::option::Option::Some(input);
128        self
129    }
130    /// <p>The maximum number of results to return in a single call to <code>Search</code>. When the number of results to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>Search</code> to list the next set of results.</p>
131    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
132        self.max_results = input;
133        self
134    }
135    /// <p>The maximum number of results to return in a single call to <code>Search</code>. When the number of results to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>Search</code> to list the next set of results.</p>
136    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
137        &self.max_results
138    }
139    /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
140    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.next_token = ::std::option::Option::Some(input.into());
142        self
143    }
144    /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
145    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.next_token = input;
147        self
148    }
149    /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
150    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
151        &self.next_token
152    }
153    /// <p>The scope of the search.</p>
154    /// This field is required.
155    pub fn search_scope(mut self, input: crate::types::InventorySearchScope) -> Self {
156        self.search_scope = ::std::option::Option::Some(input);
157        self
158    }
159    /// <p>The scope of the search.</p>
160    pub fn set_search_scope(mut self, input: ::std::option::Option<crate::types::InventorySearchScope>) -> Self {
161        self.search_scope = input;
162        self
163    }
164    /// <p>The scope of the search.</p>
165    pub fn get_search_scope(&self) -> &::std::option::Option<crate::types::InventorySearchScope> {
166        &self.search_scope
167    }
168    /// <p>Specifies the text for which to search.</p>
169    pub fn search_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.search_text = ::std::option::Option::Some(input.into());
171        self
172    }
173    /// <p>Specifies the text for which to search.</p>
174    pub fn set_search_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.search_text = input;
176        self
177    }
178    /// <p>Specifies the text for which to search.</p>
179    pub fn get_search_text(&self) -> &::std::option::Option<::std::string::String> {
180        &self.search_text
181    }
182    /// Appends an item to `search_in`.
183    ///
184    /// To override the contents of this collection use [`set_search_in`](Self::set_search_in).
185    ///
186    /// <p>The details of the search.</p>
187    pub fn search_in(mut self, input: crate::types::SearchInItem) -> Self {
188        let mut v = self.search_in.unwrap_or_default();
189        v.push(input);
190        self.search_in = ::std::option::Option::Some(v);
191        self
192    }
193    /// <p>The details of the search.</p>
194    pub fn set_search_in(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>>) -> Self {
195        self.search_in = input;
196        self
197    }
198    /// <p>The details of the search.</p>
199    pub fn get_search_in(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>> {
200        &self.search_in
201    }
202    /// <p>Specifies the search filters.</p>
203    pub fn filters(mut self, input: crate::types::FilterClause) -> Self {
204        self.filters = ::std::option::Option::Some(input);
205        self
206    }
207    /// <p>Specifies the search filters.</p>
208    pub fn set_filters(mut self, input: ::std::option::Option<crate::types::FilterClause>) -> Self {
209        self.filters = input;
210        self
211    }
212    /// <p>Specifies the search filters.</p>
213    pub fn get_filters(&self) -> &::std::option::Option<crate::types::FilterClause> {
214        &self.filters
215    }
216    /// <p>Specifies the way in which the search results are to be sorted.</p>
217    pub fn sort(mut self, input: crate::types::SearchSort) -> Self {
218        self.sort = ::std::option::Option::Some(input);
219        self
220    }
221    /// <p>Specifies the way in which the search results are to be sorted.</p>
222    pub fn set_sort(mut self, input: ::std::option::Option<crate::types::SearchSort>) -> Self {
223        self.sort = input;
224        self
225    }
226    /// <p>Specifies the way in which the search results are to be sorted.</p>
227    pub fn get_sort(&self) -> &::std::option::Option<crate::types::SearchSort> {
228        &self.sort
229    }
230    /// Appends an item to `additional_attributes`.
231    ///
232    /// To override the contents of this collection use [`set_additional_attributes`](Self::set_additional_attributes).
233    ///
234    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
235    pub fn additional_attributes(mut self, input: crate::types::SearchOutputAdditionalAttribute) -> Self {
236        let mut v = self.additional_attributes.unwrap_or_default();
237        v.push(input);
238        self.additional_attributes = ::std::option::Option::Some(v);
239        self
240    }
241    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
242    pub fn set_additional_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>>) -> Self {
243        self.additional_attributes = input;
244        self
245    }
246    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
247    pub fn get_additional_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>> {
248        &self.additional_attributes
249    }
250    /// Consumes the builder and constructs a [`SearchInput`](crate::operation::search::SearchInput).
251    pub fn build(self) -> ::std::result::Result<crate::operation::search::SearchInput, ::aws_smithy_types::error::operation::BuildError> {
252        ::std::result::Result::Ok(crate::operation::search::SearchInput {
253            domain_identifier: self.domain_identifier,
254            owning_project_identifier: self.owning_project_identifier,
255            max_results: self.max_results,
256            next_token: self.next_token,
257            search_scope: self.search_scope,
258            search_text: self.search_text,
259            search_in: self.search_in,
260            filters: self.filters,
261            sort: self.sort,
262            additional_attributes: self.additional_attributes,
263        })
264    }
265}