/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.sagemaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SearchRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The name of the SageMaker resource to search for. *
*/ private String resource; /** *
* 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
* SubExpressions
, NestedFilters
, and Filters
that can be included in a
* SearchExpression
object is 50.
*
* The name of the resource property used to sort the SearchResults
. The default is
* LastModifiedTime
.
*
* How SearchResults
are ordered. Valid values are Ascending
or Descending
.
* The default is Descending
.
*
* If more than MaxResults
resources match the specified SearchExpression
, the response
* includes a NextToken
. The NextToken
can be passed to the next
* SearchRequest
to continue retrieving results.
*
* The maximum number of results to return. *
*/ private Integer maxResults; /** *
* A cross account filter option. When the value is "CrossAccount"
the search results will only include
* resources made discoverable to you from other accounts. When the value is "SameAccount"
or
* null
the search results will only include resources from your account. Default is null
.
* For more information on searching for resources made discoverable to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
*
* The name of the SageMaker resource to search for. *
* * @param resource * The name of the SageMaker resource to search for. * @see ResourceType */ public void setResource(String resource) { this.resource = resource; } /** ** The name of the SageMaker resource to search for. *
* * @return The name of the SageMaker resource to search for. * @see ResourceType */ public String getResource() { return this.resource; } /** ** The name of the SageMaker resource to search for. *
* * @param resource * The name of the SageMaker resource to search for. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public SearchRequest withResource(String resource) { setResource(resource); return this; } /** ** The name of the SageMaker resource to search for. *
* * @param resource * The name of the SageMaker resource to search for. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public SearchRequest withResource(ResourceType resource) { this.resource = resource.toString(); return this; } /** *
* 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
* SubExpressions
, NestedFilters
, and Filters
that can be included in a
* SearchExpression
object is 50.
*
SubExpressions
, NestedFilters
, and Filters
that can be included in
* a SearchExpression
object is 50.
*/
public void setSearchExpression(SearchExpression searchExpression) {
this.searchExpression = searchExpression;
}
/**
*
* 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
* SubExpressions
, NestedFilters
, and Filters
that can be included in a
* SearchExpression
object is 50.
*
SubExpressions
, NestedFilters
, and Filters
that can be included in
* a SearchExpression
object is 50.
*/
public SearchExpression getSearchExpression() {
return this.searchExpression;
}
/**
*
* 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
* SubExpressions
, NestedFilters
, and Filters
that can be included in a
* SearchExpression
object is 50.
*
SubExpressions
, NestedFilters
, and Filters
that can be included in
* a SearchExpression
object is 50.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchRequest withSearchExpression(SearchExpression searchExpression) {
setSearchExpression(searchExpression);
return this;
}
/**
*
* The name of the resource property used to sort the SearchResults
. The default is
* LastModifiedTime
.
*
SearchResults
. The default is
* LastModifiedTime
.
*/
public void setSortBy(String sortBy) {
this.sortBy = sortBy;
}
/**
*
* The name of the resource property used to sort the SearchResults
. The default is
* LastModifiedTime
.
*
SearchResults
. The default is
* LastModifiedTime
.
*/
public String getSortBy() {
return this.sortBy;
}
/**
*
* The name of the resource property used to sort the SearchResults
. The default is
* LastModifiedTime
.
*
SearchResults
. The default is
* LastModifiedTime
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchRequest withSortBy(String sortBy) {
setSortBy(sortBy);
return this;
}
/**
*
* How SearchResults
are ordered. Valid values are Ascending
or Descending
.
* The default is Descending
.
*
SearchResults
are ordered. Valid values are Ascending
or
* Descending
. The default is Descending
.
* @see SearchSortOrder
*/
public void setSortOrder(String sortOrder) {
this.sortOrder = sortOrder;
}
/**
*
* How SearchResults
are ordered. Valid values are Ascending
or Descending
.
* The default is Descending
.
*
SearchResults
are ordered. Valid values are Ascending
or
* Descending
. The default is Descending
.
* @see SearchSortOrder
*/
public String getSortOrder() {
return this.sortOrder;
}
/**
*
* How SearchResults
are ordered. Valid values are Ascending
or Descending
.
* The default is Descending
.
*
SearchResults
are ordered. Valid values are Ascending
or
* Descending
. The default is Descending
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SearchSortOrder
*/
public SearchRequest withSortOrder(String sortOrder) {
setSortOrder(sortOrder);
return this;
}
/**
*
* How SearchResults
are ordered. Valid values are Ascending
or Descending
.
* The default is Descending
.
*
SearchResults
are ordered. Valid values are Ascending
or
* Descending
. The default is Descending
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SearchSortOrder
*/
public SearchRequest withSortOrder(SearchSortOrder sortOrder) {
this.sortOrder = sortOrder.toString();
return this;
}
/**
*
* If more than MaxResults
resources match the specified SearchExpression
, the response
* includes a NextToken
. The NextToken
can be passed to the next
* SearchRequest
to continue retrieving results.
*
MaxResults
resources match the specified SearchExpression
, the
* response includes a NextToken
. The NextToken
can be passed to the next
* SearchRequest
to continue retrieving results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* If more than MaxResults
resources match the specified SearchExpression
, the response
* includes a NextToken
. The NextToken
can be passed to the next
* SearchRequest
to continue retrieving results.
*
MaxResults
resources match the specified SearchExpression
, the
* response includes a NextToken
. The NextToken
can be passed to the next
* SearchRequest
to continue retrieving results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* If more than MaxResults
resources match the specified SearchExpression
, the response
* includes a NextToken
. The NextToken
can be passed to the next
* SearchRequest
to continue retrieving results.
*
MaxResults
resources match the specified SearchExpression
, the
* response includes a NextToken
. The NextToken
can be passed to the next
* SearchRequest
to continue retrieving results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchRequest withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
* * The maximum number of results to return. *
* * @param maxResults * The maximum number of results to return. */ public void setMaxResults(Integer maxResults) { this.maxResults = maxResults; } /** ** The maximum number of results to return. *
* * @return The maximum number of results to return. */ public Integer getMaxResults() { return this.maxResults; } /** ** The maximum number of results to return. *
* * @param maxResults * The maximum number of results to return. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchRequest withMaxResults(Integer maxResults) { setMaxResults(maxResults); return this; } /** *
* A cross account filter option. When the value is "CrossAccount"
the search results will only include
* resources made discoverable to you from other accounts. When the value is "SameAccount"
or
* null
the search results will only include resources from your account. Default is null
.
* For more information on searching for resources made discoverable to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
*
"CrossAccount"
the search results will only
* include resources made discoverable to you from other accounts. When the value is
* "SameAccount"
or null
the search results will only include resources from your
* account. Default is null
. For more information on searching for resources made discoverable
* to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
* @see CrossAccountFilterOption
*/
public void setCrossAccountFilterOption(String crossAccountFilterOption) {
this.crossAccountFilterOption = crossAccountFilterOption;
}
/**
*
* A cross account filter option. When the value is "CrossAccount"
the search results will only include
* resources made discoverable to you from other accounts. When the value is "SameAccount"
or
* null
the search results will only include resources from your account. Default is null
.
* For more information on searching for resources made discoverable to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
*
"CrossAccount"
the search results will only
* include resources made discoverable to you from other accounts. When the value is
* "SameAccount"
or null
the search results will only include resources from your
* account. Default is null
. For more information on searching for resources made discoverable
* to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
* @see CrossAccountFilterOption
*/
public String getCrossAccountFilterOption() {
return this.crossAccountFilterOption;
}
/**
*
* A cross account filter option. When the value is "CrossAccount"
the search results will only include
* resources made discoverable to you from other accounts. When the value is "SameAccount"
or
* null
the search results will only include resources from your account. Default is null
.
* For more information on searching for resources made discoverable to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
*
"CrossAccount"
the search results will only
* include resources made discoverable to you from other accounts. When the value is
* "SameAccount"
or null
the search results will only include resources from your
* account. Default is null
. For more information on searching for resources made discoverable
* to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CrossAccountFilterOption
*/
public SearchRequest withCrossAccountFilterOption(String crossAccountFilterOption) {
setCrossAccountFilterOption(crossAccountFilterOption);
return this;
}
/**
*
* A cross account filter option. When the value is "CrossAccount"
the search results will only include
* resources made discoverable to you from other accounts. When the value is "SameAccount"
or
* null
the search results will only include resources from your account. Default is null
.
* For more information on searching for resources made discoverable to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
*
"CrossAccount"
the search results will only
* include resources made discoverable to you from other accounts. When the value is
* "SameAccount"
or null
the search results will only include resources from your
* account. Default is null
. For more information on searching for resources made discoverable
* to your account, see
* Search discoverable resources in the SageMaker Developer Guide. The maximum number of
* ResourceCatalog
s viewable is 1000.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CrossAccountFilterOption
*/
public SearchRequest withCrossAccountFilterOption(CrossAccountFilterOption crossAccountFilterOption) {
this.crossAccountFilterOption = crossAccountFilterOption.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getResource() != null)
sb.append("Resource: ").append(getResource()).append(",");
if (getSearchExpression() != null)
sb.append("SearchExpression: ").append(getSearchExpression()).append(",");
if (getSortBy() != null)
sb.append("SortBy: ").append(getSortBy()).append(",");
if (getSortOrder() != null)
sb.append("SortOrder: ").append(getSortOrder()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getCrossAccountFilterOption() != null)
sb.append("CrossAccountFilterOption: ").append(getCrossAccountFilterOption());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SearchRequest == false)
return false;
SearchRequest other = (SearchRequest) obj;
if (other.getResource() == null ^ this.getResource() == null)
return false;
if (other.getResource() != null && other.getResource().equals(this.getResource()) == false)
return false;
if (other.getSearchExpression() == null ^ this.getSearchExpression() == null)
return false;
if (other.getSearchExpression() != null && other.getSearchExpression().equals(this.getSearchExpression()) == false)
return false;
if (other.getSortBy() == null ^ this.getSortBy() == null)
return false;
if (other.getSortBy() != null && other.getSortBy().equals(this.getSortBy()) == false)
return false;
if (other.getSortOrder() == null ^ this.getSortOrder() == null)
return false;
if (other.getSortOrder() != null && other.getSortOrder().equals(this.getSortOrder()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
if (other.getCrossAccountFilterOption() == null ^ this.getCrossAccountFilterOption() == null)
return false;
if (other.getCrossAccountFilterOption() != null && other.getCrossAccountFilterOption().equals(this.getCrossAccountFilterOption()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getResource() == null) ? 0 : getResource().hashCode());
hashCode = prime * hashCode + ((getSearchExpression() == null) ? 0 : getSearchExpression().hashCode());
hashCode = prime * hashCode + ((getSortBy() == null) ? 0 : getSortBy().hashCode());
hashCode = prime * hashCode + ((getSortOrder() == null) ? 0 : getSortOrder().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getCrossAccountFilterOption() == null) ? 0 : getCrossAccountFilterOption().hashCode());
return hashCode;
}
@Override
public SearchRequest clone() {
return (SearchRequest) super.clone();
}
}