aws_sdk_sagemaker/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>Finds SageMaker resources that match a search query. Matching resources are returned as a list of <code>SearchRecord</code> objects in the response. You can sort the search results by any resource property in a ascending or descending order.</p>
26/// <p>You can query against the following value types: numeric, text, Boolean, and timestamp.</p><note>
27/// <p>The Search API may provide access to otherwise restricted data. See <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/api-permissions-reference.html">Amazon SageMaker API Permissions: Actions, Permissions, and Resources Reference</a> for more information.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct SearchFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::search::builders::SearchInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl crate::client::customize::internal::CustomizableSend<crate::operation::search::SearchOutput, crate::operation::search::SearchError>
36    for SearchFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<crate::operation::search::SearchOutput, crate::operation::search::SearchError>,
43    > {
44        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45    }
46}
47impl SearchFluentBuilder {
48    /// Creates a new `SearchFluentBuilder`.
49    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50        Self {
51            handle,
52            inner: ::std::default::Default::default(),
53            config_override: ::std::option::Option::None,
54        }
55    }
56    /// Access the Search as a reference.
57    pub fn as_input(&self) -> &crate::operation::search::builders::SearchInputBuilder {
58        &self.inner
59    }
60    /// Sends the request and returns the response.
61    ///
62    /// If an error occurs, an `SdkError` will be returned with additional details that
63    /// can be matched against.
64    ///
65    /// By default, any retryable failures will be retried twice. Retry behavior
66    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67    /// set when configuring the client.
68    pub async fn send(
69        self,
70    ) -> ::std::result::Result<
71        crate::operation::search::SearchOutput,
72        ::aws_smithy_runtime_api::client::result::SdkError<
73            crate::operation::search::SearchError,
74            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
75        >,
76    > {
77        let input = self
78            .inner
79            .build()
80            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
81        let runtime_plugins =
82            crate::operation::search::Search::operation_runtime_plugins(self.handle.runtime_plugins.clone(), &self.handle.conf, self.config_override);
83        crate::operation::search::Search::orchestrate(&runtime_plugins, input).await
84    }
85
86    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87    pub fn customize(
88        self,
89    ) -> crate::client::customize::CustomizableOperation<crate::operation::search::SearchOutput, crate::operation::search::SearchError, Self> {
90        crate::client::customize::CustomizableOperation::new(self)
91    }
92    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
93        self.set_config_override(::std::option::Option::Some(config_override.into()));
94        self
95    }
96
97    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
98        self.config_override = config_override;
99        self
100    }
101    /// Create a paginator for this request
102    ///
103    /// Paginators are used by calling [`send().await`](crate::operation::search::paginator::SearchPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
104    pub fn into_paginator(self) -> crate::operation::search::paginator::SearchPaginator {
105        crate::operation::search::paginator::SearchPaginator::new(self.handle, self.inner)
106    }
107    /// <p>The name of the SageMaker resource to search for.</p>
108    pub fn resource(mut self, input: crate::types::ResourceType) -> Self {
109        self.inner = self.inner.resource(input);
110        self
111    }
112    /// <p>The name of the SageMaker resource to search for.</p>
113    pub fn set_resource(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
114        self.inner = self.inner.set_resource(input);
115        self
116    }
117    /// <p>The name of the SageMaker resource to search for.</p>
118    pub fn get_resource(&self) -> &::std::option::Option<crate::types::ResourceType> {
119        self.inner.get_resource()
120    }
121    /// <p>A Boolean conditional statement. Resources must satisfy this condition to be included in search results. You must provide at least one subexpression, filter, or nested filter. The maximum number of recursive <code>SubExpressions</code>, <code>NestedFilters</code>, and <code>Filters</code> that can be included in a <code>SearchExpression</code> object is 50.</p>
122    pub fn search_expression(mut self, input: crate::types::SearchExpression) -> Self {
123        self.inner = self.inner.search_expression(input);
124        self
125    }
126    /// <p>A Boolean conditional statement. Resources must satisfy this condition to be included in search results. You must provide at least one subexpression, filter, or nested filter. The maximum number of recursive <code>SubExpressions</code>, <code>NestedFilters</code>, and <code>Filters</code> that can be included in a <code>SearchExpression</code> object is 50.</p>
127    pub fn set_search_expression(mut self, input: ::std::option::Option<crate::types::SearchExpression>) -> Self {
128        self.inner = self.inner.set_search_expression(input);
129        self
130    }
131    /// <p>A Boolean conditional statement. Resources must satisfy this condition to be included in search results. You must provide at least one subexpression, filter, or nested filter. The maximum number of recursive <code>SubExpressions</code>, <code>NestedFilters</code>, and <code>Filters</code> that can be included in a <code>SearchExpression</code> object is 50.</p>
132    pub fn get_search_expression(&self) -> &::std::option::Option<crate::types::SearchExpression> {
133        self.inner.get_search_expression()
134    }
135    /// <p>The name of the resource property used to sort the <code>SearchResults</code>. The default is <code>LastModifiedTime</code>.</p>
136    pub fn sort_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.sort_by(input.into());
138        self
139    }
140    /// <p>The name of the resource property used to sort the <code>SearchResults</code>. The default is <code>LastModifiedTime</code>.</p>
141    pub fn set_sort_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_sort_by(input);
143        self
144    }
145    /// <p>The name of the resource property used to sort the <code>SearchResults</code>. The default is <code>LastModifiedTime</code>.</p>
146    pub fn get_sort_by(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_sort_by()
148    }
149    /// <p>How <code>SearchResults</code> are ordered. Valid values are <code>Ascending</code> or <code>Descending</code>. The default is <code>Descending</code>.</p>
150    pub fn sort_order(mut self, input: crate::types::SearchSortOrder) -> Self {
151        self.inner = self.inner.sort_order(input);
152        self
153    }
154    /// <p>How <code>SearchResults</code> are ordered. Valid values are <code>Ascending</code> or <code>Descending</code>. The default is <code>Descending</code>.</p>
155    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SearchSortOrder>) -> Self {
156        self.inner = self.inner.set_sort_order(input);
157        self
158    }
159    /// <p>How <code>SearchResults</code> are ordered. Valid values are <code>Ascending</code> or <code>Descending</code>. The default is <code>Descending</code>.</p>
160    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SearchSortOrder> {
161        self.inner.get_sort_order()
162    }
163    /// <p>If more than <code>MaxResults</code> resources match the specified <code>SearchExpression</code>, the response includes a <code>NextToken</code>. The <code>NextToken</code> can be passed to the next <code>SearchRequest</code> to continue retrieving results.</p>
164    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.next_token(input.into());
166        self
167    }
168    /// <p>If more than <code>MaxResults</code> resources match the specified <code>SearchExpression</code>, the response includes a <code>NextToken</code>. The <code>NextToken</code> can be passed to the next <code>SearchRequest</code> to continue retrieving results.</p>
169    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_next_token(input);
171        self
172    }
173    /// <p>If more than <code>MaxResults</code> resources match the specified <code>SearchExpression</code>, the response includes a <code>NextToken</code>. The <code>NextToken</code> can be passed to the next <code>SearchRequest</code> to continue retrieving results.</p>
174    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_next_token()
176    }
177    /// <p>The maximum number of results to return.</p>
178    pub fn max_results(mut self, input: i32) -> Self {
179        self.inner = self.inner.max_results(input);
180        self
181    }
182    /// <p>The maximum number of results to return.</p>
183    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
184        self.inner = self.inner.set_max_results(input);
185        self
186    }
187    /// <p>The maximum number of results to return.</p>
188    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
189        self.inner.get_max_results()
190    }
191    /// <p>A cross account filter option. When the value is <code>"CrossAccount"</code> the search results will only include resources made discoverable to you from other accounts. When the value is <code>"SameAccount"</code> or <code>null</code> the search results will only include resources from your account. Default is <code>null</code>. For more information on searching for resources made discoverable to your account, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/feature-store-cross-account-discoverability-use.html"> Search discoverable resources</a> in the SageMaker Developer Guide. The maximum number of <code>ResourceCatalog</code>s viewable is 1000.</p>
192    pub fn cross_account_filter_option(mut self, input: crate::types::CrossAccountFilterOption) -> Self {
193        self.inner = self.inner.cross_account_filter_option(input);
194        self
195    }
196    /// <p>A cross account filter option. When the value is <code>"CrossAccount"</code> the search results will only include resources made discoverable to you from other accounts. When the value is <code>"SameAccount"</code> or <code>null</code> the search results will only include resources from your account. Default is <code>null</code>. For more information on searching for resources made discoverable to your account, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/feature-store-cross-account-discoverability-use.html"> Search discoverable resources</a> in the SageMaker Developer Guide. The maximum number of <code>ResourceCatalog</code>s viewable is 1000.</p>
197    pub fn set_cross_account_filter_option(mut self, input: ::std::option::Option<crate::types::CrossAccountFilterOption>) -> Self {
198        self.inner = self.inner.set_cross_account_filter_option(input);
199        self
200    }
201    /// <p>A cross account filter option. When the value is <code>"CrossAccount"</code> the search results will only include resources made discoverable to you from other accounts. When the value is <code>"SameAccount"</code> or <code>null</code> the search results will only include resources from your account. Default is <code>null</code>. For more information on searching for resources made discoverable to your account, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/feature-store-cross-account-discoverability-use.html"> Search discoverable resources</a> in the SageMaker Developer Guide. The maximum number of <code>ResourceCatalog</code>s viewable is 1000.</p>
202    pub fn get_cross_account_filter_option(&self) -> &::std::option::Option<crate::types::CrossAccountFilterOption> {
203        self.inner.get_cross_account_filter_option()
204    }
205    ///
206    /// Appends an item to `VisibilityConditions`.
207    ///
208    /// To override the contents of this collection use [`set_visibility_conditions`](Self::set_visibility_conditions).
209    ///
210    /// <p>Limits the results of your search request to the resources that you can access.</p>
211    pub fn visibility_conditions(mut self, input: crate::types::VisibilityConditions) -> Self {
212        self.inner = self.inner.visibility_conditions(input);
213        self
214    }
215    /// <p>Limits the results of your search request to the resources that you can access.</p>
216    pub fn set_visibility_conditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VisibilityConditions>>) -> Self {
217        self.inner = self.inner.set_visibility_conditions(input);
218        self
219    }
220    /// <p>Limits the results of your search request to the resources that you can access.</p>
221    pub fn get_visibility_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VisibilityConditions>> {
222        self.inner.get_visibility_conditions()
223    }
224}