aws_sdk_sagemaker/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 name of the SageMaker resource to search for.</p>
7    pub resource: ::std::option::Option<crate::types::ResourceType>,
8    /// <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>
9    pub search_expression: ::std::option::Option<crate::types::SearchExpression>,
10    /// <p>The name of the resource property used to sort the <code>SearchResults</code>. The default is <code>LastModifiedTime</code>.</p>
11    pub sort_by: ::std::option::Option<::std::string::String>,
12    /// <p>How <code>SearchResults</code> are ordered. Valid values are <code>Ascending</code> or <code>Descending</code>. The default is <code>Descending</code>.</p>
13    pub sort_order: ::std::option::Option<crate::types::SearchSortOrder>,
14    /// <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>
15    pub next_token: ::std::option::Option<::std::string::String>,
16    /// <p>The maximum number of results to return.</p>
17    pub max_results: ::std::option::Option<i32>,
18    /// <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>
19    pub cross_account_filter_option: ::std::option::Option<crate::types::CrossAccountFilterOption>,
20    /// <p>Limits the results of your search request to the resources that you can access.</p>
21    pub visibility_conditions: ::std::option::Option<::std::vec::Vec<crate::types::VisibilityConditions>>,
22}
23impl SearchInput {
24    /// <p>The name of the SageMaker resource to search for.</p>
25    pub fn resource(&self) -> ::std::option::Option<&crate::types::ResourceType> {
26        self.resource.as_ref()
27    }
28    /// <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>
29    pub fn search_expression(&self) -> ::std::option::Option<&crate::types::SearchExpression> {
30        self.search_expression.as_ref()
31    }
32    /// <p>The name of the resource property used to sort the <code>SearchResults</code>. The default is <code>LastModifiedTime</code>.</p>
33    pub fn sort_by(&self) -> ::std::option::Option<&str> {
34        self.sort_by.as_deref()
35    }
36    /// <p>How <code>SearchResults</code> are ordered. Valid values are <code>Ascending</code> or <code>Descending</code>. The default is <code>Descending</code>.</p>
37    pub fn sort_order(&self) -> ::std::option::Option<&crate::types::SearchSortOrder> {
38        self.sort_order.as_ref()
39    }
40    /// <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>
41    pub fn next_token(&self) -> ::std::option::Option<&str> {
42        self.next_token.as_deref()
43    }
44    /// <p>The maximum number of results to return.</p>
45    pub fn max_results(&self) -> ::std::option::Option<i32> {
46        self.max_results
47    }
48    /// <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>
49    pub fn cross_account_filter_option(&self) -> ::std::option::Option<&crate::types::CrossAccountFilterOption> {
50        self.cross_account_filter_option.as_ref()
51    }
52    /// <p>Limits the results of your search request to the resources that you can access.</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 `.visibility_conditions.is_none()`.
55    pub fn visibility_conditions(&self) -> &[crate::types::VisibilityConditions] {
56        self.visibility_conditions.as_deref().unwrap_or_default()
57    }
58}
59impl SearchInput {
60    /// Creates a new builder-style object to manufacture [`SearchInput`](crate::operation::search::SearchInput).
61    pub fn builder() -> crate::operation::search::builders::SearchInputBuilder {
62        crate::operation::search::builders::SearchInputBuilder::default()
63    }
64}
65
66/// A builder for [`SearchInput`](crate::operation::search::SearchInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct SearchInputBuilder {
70    pub(crate) resource: ::std::option::Option<crate::types::ResourceType>,
71    pub(crate) search_expression: ::std::option::Option<crate::types::SearchExpression>,
72    pub(crate) sort_by: ::std::option::Option<::std::string::String>,
73    pub(crate) sort_order: ::std::option::Option<crate::types::SearchSortOrder>,
74    pub(crate) next_token: ::std::option::Option<::std::string::String>,
75    pub(crate) max_results: ::std::option::Option<i32>,
76    pub(crate) cross_account_filter_option: ::std::option::Option<crate::types::CrossAccountFilterOption>,
77    pub(crate) visibility_conditions: ::std::option::Option<::std::vec::Vec<crate::types::VisibilityConditions>>,
78}
79impl SearchInputBuilder {
80    /// <p>The name of the SageMaker resource to search for.</p>
81    /// This field is required.
82    pub fn resource(mut self, input: crate::types::ResourceType) -> Self {
83        self.resource = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>The name of the SageMaker resource to search for.</p>
87    pub fn set_resource(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
88        self.resource = input;
89        self
90    }
91    /// <p>The name of the SageMaker resource to search for.</p>
92    pub fn get_resource(&self) -> &::std::option::Option<crate::types::ResourceType> {
93        &self.resource
94    }
95    /// <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>
96    pub fn search_expression(mut self, input: crate::types::SearchExpression) -> Self {
97        self.search_expression = ::std::option::Option::Some(input);
98        self
99    }
100    /// <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>
101    pub fn set_search_expression(mut self, input: ::std::option::Option<crate::types::SearchExpression>) -> Self {
102        self.search_expression = input;
103        self
104    }
105    /// <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>
106    pub fn get_search_expression(&self) -> &::std::option::Option<crate::types::SearchExpression> {
107        &self.search_expression
108    }
109    /// <p>The name of the resource property used to sort the <code>SearchResults</code>. The default is <code>LastModifiedTime</code>.</p>
110    pub fn sort_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.sort_by = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The name of the resource property used to sort the <code>SearchResults</code>. The default is <code>LastModifiedTime</code>.</p>
115    pub fn set_sort_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.sort_by = input;
117        self
118    }
119    /// <p>The name of the resource property used to sort the <code>SearchResults</code>. The default is <code>LastModifiedTime</code>.</p>
120    pub fn get_sort_by(&self) -> &::std::option::Option<::std::string::String> {
121        &self.sort_by
122    }
123    /// <p>How <code>SearchResults</code> are ordered. Valid values are <code>Ascending</code> or <code>Descending</code>. The default is <code>Descending</code>.</p>
124    pub fn sort_order(mut self, input: crate::types::SearchSortOrder) -> Self {
125        self.sort_order = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>How <code>SearchResults</code> are ordered. Valid values are <code>Ascending</code> or <code>Descending</code>. The default is <code>Descending</code>.</p>
129    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SearchSortOrder>) -> Self {
130        self.sort_order = input;
131        self
132    }
133    /// <p>How <code>SearchResults</code> are ordered. Valid values are <code>Ascending</code> or <code>Descending</code>. The default is <code>Descending</code>.</p>
134    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SearchSortOrder> {
135        &self.sort_order
136    }
137    /// <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>
138    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.next_token = ::std::option::Option::Some(input.into());
140        self
141    }
142    /// <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>
143    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.next_token = input;
145        self
146    }
147    /// <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>
148    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
149        &self.next_token
150    }
151    /// <p>The maximum number of results to return.</p>
152    pub fn max_results(mut self, input: i32) -> Self {
153        self.max_results = ::std::option::Option::Some(input);
154        self
155    }
156    /// <p>The maximum number of results to return.</p>
157    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
158        self.max_results = input;
159        self
160    }
161    /// <p>The maximum number of results to return.</p>
162    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
163        &self.max_results
164    }
165    /// <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>
166    pub fn cross_account_filter_option(mut self, input: crate::types::CrossAccountFilterOption) -> Self {
167        self.cross_account_filter_option = ::std::option::Option::Some(input);
168        self
169    }
170    /// <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>
171    pub fn set_cross_account_filter_option(mut self, input: ::std::option::Option<crate::types::CrossAccountFilterOption>) -> Self {
172        self.cross_account_filter_option = input;
173        self
174    }
175    /// <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>
176    pub fn get_cross_account_filter_option(&self) -> &::std::option::Option<crate::types::CrossAccountFilterOption> {
177        &self.cross_account_filter_option
178    }
179    /// Appends an item to `visibility_conditions`.
180    ///
181    /// To override the contents of this collection use [`set_visibility_conditions`](Self::set_visibility_conditions).
182    ///
183    /// <p>Limits the results of your search request to the resources that you can access.</p>
184    pub fn visibility_conditions(mut self, input: crate::types::VisibilityConditions) -> Self {
185        let mut v = self.visibility_conditions.unwrap_or_default();
186        v.push(input);
187        self.visibility_conditions = ::std::option::Option::Some(v);
188        self
189    }
190    /// <p>Limits the results of your search request to the resources that you can access.</p>
191    pub fn set_visibility_conditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VisibilityConditions>>) -> Self {
192        self.visibility_conditions = input;
193        self
194    }
195    /// <p>Limits the results of your search request to the resources that you can access.</p>
196    pub fn get_visibility_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VisibilityConditions>> {
197        &self.visibility_conditions
198    }
199    /// Consumes the builder and constructs a [`SearchInput`](crate::operation::search::SearchInput).
200    pub fn build(self) -> ::std::result::Result<crate::operation::search::SearchInput, ::aws_smithy_types::error::operation::BuildError> {
201        ::std::result::Result::Ok(crate::operation::search::SearchInput {
202            resource: self.resource,
203            search_expression: self.search_expression,
204            sort_by: self.sort_by,
205            sort_order: self.sort_order,
206            next_token: self.next_token,
207            max_results: self.max_results,
208            cross_account_filter_option: self.cross_account_filter_option,
209            visibility_conditions: self.visibility_conditions,
210        })
211    }
212}