aws_sdk_datazone/operation/search/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::search::_search_output::SearchOutputBuilder;
3
4pub use crate::operation::search::_search_input::SearchInputBuilder;
5
6impl crate::operation::search::builders::SearchInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::search::SearchOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::search::SearchError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.search();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `Search`.
24///
25/// <p>Searches for assets in Amazon DataZone.</p>
26/// <p>Search in Amazon DataZone is a powerful capability that enables users to discover and explore data assets, glossary terms, and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. Search can be scoped to specific types of resources (like assets, glossary terms, or data products) and can be filtered using various criteria such as creation date, owner, or status. The search functionality is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.</p>
27/// <p>Many search commands in Amazon DataZone are paginated, including <code>search</code> and <code>search-types</code>. When the result set is large, Amazon DataZone returns a <code>nextToken</code> in the response. This token can be used to retrieve the next page of results.</p>
28/// <p>Prerequisites:</p>
29/// <ul>
30/// <li>
31/// <p>The --domain-identifier must refer to an existing Amazon DataZone domain.</p></li>
32/// <li>
33/// <p>--search-scope must be one of: ASSET, GLOSSARY_TERM, DATA_PRODUCT, or GLOSSARY.</p></li>
34/// <li>
35/// <p>The user must have search permissions in the specified domain.</p></li>
36/// <li>
37/// <p>If using --filters, ensure that the JSON is well-formed and that each filter includes valid attribute and value keys.</p></li>
38/// <li>
39/// <p>For paginated results, be prepared to use --next-token to fetch additional pages.</p></li>
40/// </ul>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct SearchFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::search::builders::SearchInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl crate::client::customize::internal::CustomizableSend<crate::operation::search::SearchOutput, crate::operation::search::SearchError>
48    for SearchFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<crate::operation::search::SearchOutput, crate::operation::search::SearchError>,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl SearchFluentBuilder {
60    /// Creates a new `SearchFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the Search as a reference.
69    pub fn as_input(&self) -> &crate::operation::search::builders::SearchInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::search::SearchOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::search::SearchError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins =
94            crate::operation::search::Search::operation_runtime_plugins(self.handle.runtime_plugins.clone(), &self.handle.conf, self.config_override);
95        crate::operation::search::Search::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<crate::operation::search::SearchOutput, crate::operation::search::SearchError, Self> {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// Create a paginator for this request
114    ///
115    /// Paginators are used by calling [`send().await`](crate::operation::search::paginator::SearchPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
116    pub fn into_paginator(self) -> crate::operation::search::paginator::SearchPaginator {
117        crate::operation::search::paginator::SearchPaginator::new(self.handle, self.inner)
118    }
119    /// <p>The identifier of the Amazon DataZone domain.</p>
120    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.domain_identifier(input.into());
122        self
123    }
124    /// <p>The identifier of the Amazon DataZone domain.</p>
125    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_domain_identifier(input);
127        self
128    }
129    /// <p>The identifier of the Amazon DataZone domain.</p>
130    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_domain_identifier()
132    }
133    /// <p>The identifier of the owning project specified for the search.</p>
134    pub fn owning_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.owning_project_identifier(input.into());
136        self
137    }
138    /// <p>The identifier of the owning project specified for the search.</p>
139    pub fn set_owning_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_owning_project_identifier(input);
141        self
142    }
143    /// <p>The identifier of the owning project specified for the search.</p>
144    pub fn get_owning_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_owning_project_identifier()
146    }
147    /// <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>
148    pub fn max_results(mut self, input: i32) -> Self {
149        self.inner = self.inner.max_results(input);
150        self
151    }
152    /// <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>
153    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
154        self.inner = self.inner.set_max_results(input);
155        self
156    }
157    /// <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>
158    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
159        self.inner.get_max_results()
160    }
161    /// <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>
162    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.next_token(input.into());
164        self
165    }
166    /// <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>
167    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_next_token(input);
169        self
170    }
171    /// <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>
172    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_next_token()
174    }
175    /// <p>The scope of the search.</p>
176    pub fn search_scope(mut self, input: crate::types::InventorySearchScope) -> Self {
177        self.inner = self.inner.search_scope(input);
178        self
179    }
180    /// <p>The scope of the search.</p>
181    pub fn set_search_scope(mut self, input: ::std::option::Option<crate::types::InventorySearchScope>) -> Self {
182        self.inner = self.inner.set_search_scope(input);
183        self
184    }
185    /// <p>The scope of the search.</p>
186    pub fn get_search_scope(&self) -> &::std::option::Option<crate::types::InventorySearchScope> {
187        self.inner.get_search_scope()
188    }
189    /// <p>Specifies the text for which to search.</p>
190    pub fn search_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.search_text(input.into());
192        self
193    }
194    /// <p>Specifies the text for which to search.</p>
195    pub fn set_search_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_search_text(input);
197        self
198    }
199    /// <p>Specifies the text for which to search.</p>
200    pub fn get_search_text(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_search_text()
202    }
203    ///
204    /// Appends an item to `searchIn`.
205    ///
206    /// To override the contents of this collection use [`set_search_in`](Self::set_search_in).
207    ///
208    /// <p>The details of the search.</p>
209    pub fn search_in(mut self, input: crate::types::SearchInItem) -> Self {
210        self.inner = self.inner.search_in(input);
211        self
212    }
213    /// <p>The details of the search.</p>
214    pub fn set_search_in(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>>) -> Self {
215        self.inner = self.inner.set_search_in(input);
216        self
217    }
218    /// <p>The details of the search.</p>
219    pub fn get_search_in(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>> {
220        self.inner.get_search_in()
221    }
222    /// <p>Specifies the search filters.</p>
223    pub fn filters(mut self, input: crate::types::FilterClause) -> Self {
224        self.inner = self.inner.filters(input);
225        self
226    }
227    /// <p>Specifies the search filters.</p>
228    pub fn set_filters(mut self, input: ::std::option::Option<crate::types::FilterClause>) -> Self {
229        self.inner = self.inner.set_filters(input);
230        self
231    }
232    /// <p>Specifies the search filters.</p>
233    pub fn get_filters(&self) -> &::std::option::Option<crate::types::FilterClause> {
234        self.inner.get_filters()
235    }
236    /// <p>Specifies the way in which the search results are to be sorted.</p>
237    pub fn sort(mut self, input: crate::types::SearchSort) -> Self {
238        self.inner = self.inner.sort(input);
239        self
240    }
241    /// <p>Specifies the way in which the search results are to be sorted.</p>
242    pub fn set_sort(mut self, input: ::std::option::Option<crate::types::SearchSort>) -> Self {
243        self.inner = self.inner.set_sort(input);
244        self
245    }
246    /// <p>Specifies the way in which the search results are to be sorted.</p>
247    pub fn get_sort(&self) -> &::std::option::Option<crate::types::SearchSort> {
248        self.inner.get_sort()
249    }
250    ///
251    /// Appends an item to `additionalAttributes`.
252    ///
253    /// To override the contents of this collection use [`set_additional_attributes`](Self::set_additional_attributes).
254    ///
255    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
256    pub fn additional_attributes(mut self, input: crate::types::SearchOutputAdditionalAttribute) -> Self {
257        self.inner = self.inner.additional_attributes(input);
258        self
259    }
260    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
261    pub fn set_additional_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>>) -> Self {
262        self.inner = self.inner.set_additional_attributes(input);
263        self
264    }
265    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
266    pub fn get_additional_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>> {
267        self.inner.get_additional_attributes()
268    }
269}