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#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SearchFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::search::builders::SearchInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::search::SearchOutput, crate::operation::search::SearchError>
33    for SearchFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<crate::operation::search::SearchOutput, crate::operation::search::SearchError>,
40    > {
41        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42    }
43}
44impl SearchFluentBuilder {
45    /// Creates a new `SearchFluentBuilder`.
46    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47        Self {
48            handle,
49            inner: ::std::default::Default::default(),
50            config_override: ::std::option::Option::None,
51        }
52    }
53    /// Access the Search as a reference.
54    pub fn as_input(&self) -> &crate::operation::search::builders::SearchInputBuilder {
55        &self.inner
56    }
57    /// Sends the request and returns the response.
58    ///
59    /// If an error occurs, an `SdkError` will be returned with additional details that
60    /// can be matched against.
61    ///
62    /// By default, any retryable failures will be retried twice. Retry behavior
63    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64    /// set when configuring the client.
65    pub async fn send(
66        self,
67    ) -> ::std::result::Result<
68        crate::operation::search::SearchOutput,
69        ::aws_smithy_runtime_api::client::result::SdkError<
70            crate::operation::search::SearchError,
71            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72        >,
73    > {
74        let input = self
75            .inner
76            .build()
77            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78        let runtime_plugins =
79            crate::operation::search::Search::operation_runtime_plugins(self.handle.runtime_plugins.clone(), &self.handle.conf, self.config_override);
80        crate::operation::search::Search::orchestrate(&runtime_plugins, input).await
81    }
82
83    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
84    pub fn customize(
85        self,
86    ) -> crate::client::customize::CustomizableOperation<crate::operation::search::SearchOutput, crate::operation::search::SearchError, Self> {
87        crate::client::customize::CustomizableOperation::new(self)
88    }
89    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
90        self.set_config_override(::std::option::Option::Some(config_override.into()));
91        self
92    }
93
94    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
95        self.config_override = config_override;
96        self
97    }
98    /// Create a paginator for this request
99    ///
100    /// Paginators are used by calling [`send().await`](crate::operation::search::paginator::SearchPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
101    pub fn into_paginator(self) -> crate::operation::search::paginator::SearchPaginator {
102        crate::operation::search::paginator::SearchPaginator::new(self.handle, self.inner)
103    }
104    /// <p>The identifier of the Amazon DataZone domain.</p>
105    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.inner = self.inner.domain_identifier(input.into());
107        self
108    }
109    /// <p>The identifier of the Amazon DataZone domain.</p>
110    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.inner = self.inner.set_domain_identifier(input);
112        self
113    }
114    /// <p>The identifier of the Amazon DataZone domain.</p>
115    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
116        self.inner.get_domain_identifier()
117    }
118    /// <p>The identifier of the owning project specified for the search.</p>
119    pub fn owning_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.owning_project_identifier(input.into());
121        self
122    }
123    /// <p>The identifier of the owning project specified for the search.</p>
124    pub fn set_owning_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_owning_project_identifier(input);
126        self
127    }
128    /// <p>The identifier of the owning project specified for the search.</p>
129    pub fn get_owning_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_owning_project_identifier()
131    }
132    /// <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>
133    pub fn max_results(mut self, input: i32) -> Self {
134        self.inner = self.inner.max_results(input);
135        self
136    }
137    /// <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>
138    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
139        self.inner = self.inner.set_max_results(input);
140        self
141    }
142    /// <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>
143    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
144        self.inner.get_max_results()
145    }
146    /// <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>
147    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.next_token(input.into());
149        self
150    }
151    /// <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>
152    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_next_token(input);
154        self
155    }
156    /// <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>
157    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_next_token()
159    }
160    /// <p>The scope of the search.</p>
161    pub fn search_scope(mut self, input: crate::types::InventorySearchScope) -> Self {
162        self.inner = self.inner.search_scope(input);
163        self
164    }
165    /// <p>The scope of the search.</p>
166    pub fn set_search_scope(mut self, input: ::std::option::Option<crate::types::InventorySearchScope>) -> Self {
167        self.inner = self.inner.set_search_scope(input);
168        self
169    }
170    /// <p>The scope of the search.</p>
171    pub fn get_search_scope(&self) -> &::std::option::Option<crate::types::InventorySearchScope> {
172        self.inner.get_search_scope()
173    }
174    /// <p>Specifies the text for which to search.</p>
175    pub fn search_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.search_text(input.into());
177        self
178    }
179    /// <p>Specifies the text for which to search.</p>
180    pub fn set_search_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_search_text(input);
182        self
183    }
184    /// <p>Specifies the text for which to search.</p>
185    pub fn get_search_text(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_search_text()
187    }
188    ///
189    /// Appends an item to `searchIn`.
190    ///
191    /// To override the contents of this collection use [`set_search_in`](Self::set_search_in).
192    ///
193    /// <p>The details of the search.</p>
194    pub fn search_in(mut self, input: crate::types::SearchInItem) -> Self {
195        self.inner = self.inner.search_in(input);
196        self
197    }
198    /// <p>The details of the search.</p>
199    pub fn set_search_in(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>>) -> Self {
200        self.inner = self.inner.set_search_in(input);
201        self
202    }
203    /// <p>The details of the search.</p>
204    pub fn get_search_in(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>> {
205        self.inner.get_search_in()
206    }
207    /// <p>Specifies the search filters.</p>
208    pub fn filters(mut self, input: crate::types::FilterClause) -> Self {
209        self.inner = self.inner.filters(input);
210        self
211    }
212    /// <p>Specifies the search filters.</p>
213    pub fn set_filters(mut self, input: ::std::option::Option<crate::types::FilterClause>) -> Self {
214        self.inner = self.inner.set_filters(input);
215        self
216    }
217    /// <p>Specifies the search filters.</p>
218    pub fn get_filters(&self) -> &::std::option::Option<crate::types::FilterClause> {
219        self.inner.get_filters()
220    }
221    /// <p>Specifies the way in which the search results are to be sorted.</p>
222    pub fn sort(mut self, input: crate::types::SearchSort) -> Self {
223        self.inner = self.inner.sort(input);
224        self
225    }
226    /// <p>Specifies the way in which the search results are to be sorted.</p>
227    pub fn set_sort(mut self, input: ::std::option::Option<crate::types::SearchSort>) -> Self {
228        self.inner = self.inner.set_sort(input);
229        self
230    }
231    /// <p>Specifies the way in which the search results are to be sorted.</p>
232    pub fn get_sort(&self) -> &::std::option::Option<crate::types::SearchSort> {
233        self.inner.get_sort()
234    }
235    ///
236    /// Appends an item to `additionalAttributes`.
237    ///
238    /// To override the contents of this collection use [`set_additional_attributes`](Self::set_additional_attributes).
239    ///
240    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
241    pub fn additional_attributes(mut self, input: crate::types::SearchOutputAdditionalAttribute) -> Self {
242        self.inner = self.inner.additional_attributes(input);
243        self
244    }
245    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
246    pub fn set_additional_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>>) -> Self {
247        self.inner = self.inner.set_additional_attributes(input);
248        self
249    }
250    /// <p>Specifies additional attributes for the <code>Search</code> action.</p>
251    pub fn get_additional_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>> {
252        self.inner.get_additional_attributes()
253    }
254}