aws_sdk_datazone/operation/search_listings/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::search_listings::_search_listings_output::SearchListingsOutputBuilder;
3
4pub use crate::operation::search_listings::_search_listings_input::SearchListingsInputBuilder;
5
6impl crate::operation::search_listings::builders::SearchListingsInputBuilder {
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_listings::SearchListingsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::search_listings::SearchListingsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.search_listings();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `SearchListings`.
24///
25/// <p>Searches listings in Amazon DataZone.</p>
26/// <p>SearchListings is a powerful capability that enables users to discover and explore published assets 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. SearchListings also supports filtering using various criteria such as creation date, owner, or status. This API 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>SearchListings returns results in a paginated format. When the result set is large, the response will include a nextToken, which can be used to retrieve the next page of results.</p>
28/// <p>The SearchListings API gives users flexibility in specifying what kind of search is run.</p>
29/// <p>To run a free-text search, the <code>searchText</code> parameter must be supplied. By default, all searchable fields are indexed for semantic search and will return semantic matches for SearchListings queries. To prevent semantic search indexing for a custom form attribute, see the <a href="https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateFormType.html">CreateFormType API documentation</a>. To run a lexical search query, enclose the query with double quotes (""). This will disable semantic search even for fields that have semantic search enabled and will only return results that contain the keywords wrapped by double quotes (order of tokens in the query is not enforced). Free-text search is supported for all attributes annotated with @amazon.datazone#searchable.</p>
30/// <p>To run a filtered search, provide filter clause using the filters parameter. To filter on glossary terms, use the special attribute <code>__DataZoneGlossaryTerms</code>.</p>
31/// <p>To find out whether an attribute has been annotated and indexed for a given search type, use the GetFormType API to retrieve the form containing the attribute.</p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct SearchListingsFluentBuilder {
34 handle: ::std::sync::Arc<crate::client::Handle>,
35 inner: crate::operation::search_listings::builders::SearchListingsInputBuilder,
36 config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39 crate::client::customize::internal::CustomizableSend<
40 crate::operation::search_listings::SearchListingsOutput,
41 crate::operation::search_listings::SearchListingsError,
42 > for SearchListingsFluentBuilder
43{
44 fn send(
45 self,
46 config_override: crate::config::Builder,
47 ) -> crate::client::customize::internal::BoxFuture<
48 crate::client::customize::internal::SendResult<
49 crate::operation::search_listings::SearchListingsOutput,
50 crate::operation::search_listings::SearchListingsError,
51 >,
52 > {
53 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54 }
55}
56impl SearchListingsFluentBuilder {
57 /// Creates a new `SearchListingsFluentBuilder`.
58 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59 Self {
60 handle,
61 inner: ::std::default::Default::default(),
62 config_override: ::std::option::Option::None,
63 }
64 }
65 /// Access the SearchListings as a reference.
66 pub fn as_input(&self) -> &crate::operation::search_listings::builders::SearchListingsInputBuilder {
67 &self.inner
68 }
69 /// Sends the request and returns the response.
70 ///
71 /// If an error occurs, an `SdkError` will be returned with additional details that
72 /// can be matched against.
73 ///
74 /// By default, any retryable failures will be retried twice. Retry behavior
75 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76 /// set when configuring the client.
77 pub async fn send(
78 self,
79 ) -> ::std::result::Result<
80 crate::operation::search_listings::SearchListingsOutput,
81 ::aws_smithy_runtime_api::client::result::SdkError<
82 crate::operation::search_listings::SearchListingsError,
83 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84 >,
85 > {
86 let input = self
87 .inner
88 .build()
89 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90 let runtime_plugins = crate::operation::search_listings::SearchListings::operation_runtime_plugins(
91 self.handle.runtime_plugins.clone(),
92 &self.handle.conf,
93 self.config_override,
94 );
95 crate::operation::search_listings::SearchListings::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<
102 crate::operation::search_listings::SearchListingsOutput,
103 crate::operation::search_listings::SearchListingsError,
104 Self,
105 > {
106 crate::client::customize::CustomizableOperation::new(self)
107 }
108 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109 self.set_config_override(::std::option::Option::Some(config_override.into()));
110 self
111 }
112
113 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114 self.config_override = config_override;
115 self
116 }
117 /// Create a paginator for this request
118 ///
119 /// Paginators are used by calling [`send().await`](crate::operation::search_listings::paginator::SearchListingsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
120 pub fn into_paginator(self) -> crate::operation::search_listings::paginator::SearchListingsPaginator {
121 crate::operation::search_listings::paginator::SearchListingsPaginator::new(self.handle, self.inner)
122 }
123 /// <p>The identifier of the domain in which to search listings.</p>
124 pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.inner = self.inner.domain_identifier(input.into());
126 self
127 }
128 /// <p>The identifier of the domain in which to search listings.</p>
129 pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.inner = self.inner.set_domain_identifier(input);
131 self
132 }
133 /// <p>The identifier of the domain in which to search listings.</p>
134 pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
135 self.inner.get_domain_identifier()
136 }
137 /// <p>Specifies the text for which to search.</p>
138 pub fn search_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 self.inner = self.inner.search_text(input.into());
140 self
141 }
142 /// <p>Specifies the text for which to search.</p>
143 pub fn set_search_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144 self.inner = self.inner.set_search_text(input);
145 self
146 }
147 /// <p>Specifies the text for which to search.</p>
148 pub fn get_search_text(&self) -> &::std::option::Option<::std::string::String> {
149 self.inner.get_search_text()
150 }
151 ///
152 /// Appends an item to `searchIn`.
153 ///
154 /// To override the contents of this collection use [`set_search_in`](Self::set_search_in).
155 ///
156 /// <p>The details of the search.</p>
157 pub fn search_in(mut self, input: crate::types::SearchInItem) -> Self {
158 self.inner = self.inner.search_in(input);
159 self
160 }
161 /// <p>The details of the search.</p>
162 pub fn set_search_in(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>>) -> Self {
163 self.inner = self.inner.set_search_in(input);
164 self
165 }
166 /// <p>The details of the search.</p>
167 pub fn get_search_in(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchInItem>> {
168 self.inner.get_search_in()
169 }
170 /// <p>The maximum number of results to return in a single call to <code>SearchListings</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>SearchListings</code> to list the next set of results.</p>
171 pub fn max_results(mut self, input: i32) -> Self {
172 self.inner = self.inner.max_results(input);
173 self
174 }
175 /// <p>The maximum number of results to return in a single call to <code>SearchListings</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>SearchListings</code> to list the next set of results.</p>
176 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
177 self.inner = self.inner.set_max_results(input);
178 self
179 }
180 /// <p>The maximum number of results to return in a single call to <code>SearchListings</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>SearchListings</code> to list the next set of results.</p>
181 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
182 self.inner.get_max_results()
183 }
184 /// <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>SearchListings</code> to list the next set of results.</p>
185 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.inner = self.inner.next_token(input.into());
187 self
188 }
189 /// <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>SearchListings</code> to list the next set of results.</p>
190 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.inner = self.inner.set_next_token(input);
192 self
193 }
194 /// <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>SearchListings</code> to list the next set of results.</p>
195 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
196 self.inner.get_next_token()
197 }
198 /// <p>Specifies the filters for the search of listings.</p>
199 pub fn filters(mut self, input: crate::types::FilterClause) -> Self {
200 self.inner = self.inner.filters(input);
201 self
202 }
203 /// <p>Specifies the filters for the search of listings.</p>
204 pub fn set_filters(mut self, input: ::std::option::Option<crate::types::FilterClause>) -> Self {
205 self.inner = self.inner.set_filters(input);
206 self
207 }
208 /// <p>Specifies the filters for the search of listings.</p>
209 pub fn get_filters(&self) -> &::std::option::Option<crate::types::FilterClause> {
210 self.inner.get_filters()
211 }
212 ///
213 /// Appends an item to `aggregations`.
214 ///
215 /// To override the contents of this collection use [`set_aggregations`](Self::set_aggregations).
216 ///
217 /// <p>Enables you to specify one or more attributes to compute and return counts grouped by field values.</p>
218 pub fn aggregations(mut self, input: crate::types::AggregationListItem) -> Self {
219 self.inner = self.inner.aggregations(input);
220 self
221 }
222 /// <p>Enables you to specify one or more attributes to compute and return counts grouped by field values.</p>
223 pub fn set_aggregations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AggregationListItem>>) -> Self {
224 self.inner = self.inner.set_aggregations(input);
225 self
226 }
227 /// <p>Enables you to specify one or more attributes to compute and return counts grouped by field values.</p>
228 pub fn get_aggregations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AggregationListItem>> {
229 self.inner.get_aggregations()
230 }
231 /// <p>Specifies the way for sorting the search results.</p>
232 pub fn sort(mut self, input: crate::types::SearchSort) -> Self {
233 self.inner = self.inner.sort(input);
234 self
235 }
236 /// <p>Specifies the way for sorting the search results.</p>
237 pub fn set_sort(mut self, input: ::std::option::Option<crate::types::SearchSort>) -> Self {
238 self.inner = self.inner.set_sort(input);
239 self
240 }
241 /// <p>Specifies the way for sorting the search results.</p>
242 pub fn get_sort(&self) -> &::std::option::Option<crate::types::SearchSort> {
243 self.inner.get_sort()
244 }
245 ///
246 /// Appends an item to `additionalAttributes`.
247 ///
248 /// To override the contents of this collection use [`set_additional_attributes`](Self::set_additional_attributes).
249 ///
250 /// <p>Specifies additional attributes for the search.</p>
251 pub fn additional_attributes(mut self, input: crate::types::SearchOutputAdditionalAttribute) -> Self {
252 self.inner = self.inner.additional_attributes(input);
253 self
254 }
255 /// <p>Specifies additional attributes for the search.</p>
256 pub fn set_additional_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>>) -> Self {
257 self.inner = self.inner.set_additional_attributes(input);
258 self
259 }
260 /// <p>Specifies additional attributes for the search.</p>
261 pub fn get_additional_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchOutputAdditionalAttribute>> {
262 self.inner.get_additional_attributes()
263 }
264}