software.amazon.awssdk.services.glue.model.SearchTablesRequest Maven / Gradle / Ivy
Show all versions of glue Show documentation
/*
* Copyright 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 software.amazon.awssdk.services.glue.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class SearchTablesRequest extends GlueRequest implements
ToCopyableBuilder {
private static final SdkField CATALOG_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CatalogId").getter(getter(SearchTablesRequest::catalogId)).setter(setter(Builder::catalogId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CatalogId").build()).build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextToken").getter(getter(SearchTablesRequest::nextToken)).setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();
private static final SdkField> FILTERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Filters")
.getter(getter(SearchTablesRequest::filters))
.setter(setter(Builder::filters))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Filters").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(PropertyPredicate::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField SEARCH_TEXT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SearchText").getter(getter(SearchTablesRequest::searchText)).setter(setter(Builder::searchText))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SearchText").build()).build();
private static final SdkField> SORT_CRITERIA_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SortCriteria")
.getter(getter(SearchTablesRequest::sortCriteria))
.setter(setter(Builder::sortCriteria))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SortCriteria").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(SortCriterion::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxResults").getter(getter(SearchTablesRequest::maxResults)).setter(setter(Builder::maxResults))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxResults").build()).build();
private static final SdkField RESOURCE_SHARE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ResourceShareType").getter(getter(SearchTablesRequest::resourceShareTypeAsString))
.setter(setter(Builder::resourceShareType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceShareType").build()).build();
private static final SdkField INCLUDE_STATUS_DETAILS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("IncludeStatusDetails").getter(getter(SearchTablesRequest::includeStatusDetails))
.setter(setter(Builder::includeStatusDetails))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IncludeStatusDetails").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CATALOG_ID_FIELD,
NEXT_TOKEN_FIELD, FILTERS_FIELD, SEARCH_TEXT_FIELD, SORT_CRITERIA_FIELD, MAX_RESULTS_FIELD,
RESOURCE_SHARE_TYPE_FIELD, INCLUDE_STATUS_DETAILS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("CatalogId", CATALOG_ID_FIELD);
put("NextToken", NEXT_TOKEN_FIELD);
put("Filters", FILTERS_FIELD);
put("SearchText", SEARCH_TEXT_FIELD);
put("SortCriteria", SORT_CRITERIA_FIELD);
put("MaxResults", MAX_RESULTS_FIELD);
put("ResourceShareType", RESOURCE_SHARE_TYPE_FIELD);
put("IncludeStatusDetails", INCLUDE_STATUS_DETAILS_FIELD);
}
});
private final String catalogId;
private final String nextToken;
private final List filters;
private final String searchText;
private final List sortCriteria;
private final Integer maxResults;
private final String resourceShareType;
private final Boolean includeStatusDetails;
private SearchTablesRequest(BuilderImpl builder) {
super(builder);
this.catalogId = builder.catalogId;
this.nextToken = builder.nextToken;
this.filters = builder.filters;
this.searchText = builder.searchText;
this.sortCriteria = builder.sortCriteria;
this.maxResults = builder.maxResults;
this.resourceShareType = builder.resourceShareType;
this.includeStatusDetails = builder.includeStatusDetails;
}
/**
*
* A unique identifier, consisting of account_id
.
*
*
* @return A unique identifier, consisting of account_id
.
*/
public final String catalogId() {
return catalogId;
}
/**
*
* A continuation token, included if this is a continuation call.
*
*
* @return A continuation token, included if this is a continuation call.
*/
public final String nextToken() {
return nextToken;
}
/**
* For responses, this returns true if the service returned a value for the Filters property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasFilters() {
return filters != null && !(filters instanceof SdkAutoConstructList);
}
/**
*
* A list of key-value pairs, and a comparator used to filter the search results. Returns all entities matching the
* predicate.
*
*
* The Comparator
member of the PropertyPredicate
struct is used only for time fields, and
* can be omitted for other field types. Also, when comparing string values, such as when Key=Name
, a
* fuzzy match algorithm is used. The Key
field (for example, the value of the Name
field)
* is split on certain punctuation characters, for example, -, :, #, etc. into tokens. Then each token is
* exact-match compared with the Value
member of PropertyPredicate
. For example, if
* Key=Name
and Value=link
, tables named customer-link
and
* xx-link-yy
are returned, but xxlinkyy
is not returned.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasFilters} method.
*
*
* @return A list of key-value pairs, and a comparator used to filter the search results. Returns all entities
* matching the predicate.
*
* The Comparator
member of the PropertyPredicate
struct is used only for time
* fields, and can be omitted for other field types. Also, when comparing string values, such as when
* Key=Name
, a fuzzy match algorithm is used. The Key
field (for example, the
* value of the Name
field) is split on certain punctuation characters, for example, -, :, #,
* etc. into tokens. Then each token is exact-match compared with the Value
member of
* PropertyPredicate
. For example, if Key=Name
and Value=link
, tables
* named customer-link
and xx-link-yy
are returned, but xxlinkyy
is
* not returned.
*/
public final List filters() {
return filters;
}
/**
*
* A string used for a text search.
*
*
* Specifying a value in quotes filters based on an exact match to the value.
*
*
* @return A string used for a text search.
*
* Specifying a value in quotes filters based on an exact match to the value.
*/
public final String searchText() {
return searchText;
}
/**
* For responses, this returns true if the service returned a value for the SortCriteria property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasSortCriteria() {
return sortCriteria != null && !(sortCriteria instanceof SdkAutoConstructList);
}
/**
*
* A list of criteria for sorting the results by a field name, in an ascending or descending order.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSortCriteria} method.
*
*
* @return A list of criteria for sorting the results by a field name, in an ascending or descending order.
*/
public final List sortCriteria() {
return sortCriteria;
}
/**
*
* The maximum number of tables to return in a single response.
*
*
* @return The maximum number of tables to return in a single response.
*/
public final Integer maxResults() {
return maxResults;
}
/**
*
* Allows you to specify that you want to search the tables shared with your account. The allowable values are
* FOREIGN
or ALL
.
*
*
* -
*
* If set to FOREIGN
, will search the tables shared with your account.
*
*
* -
*
* If set to ALL
, will search the tables shared with your account, as well as the tables in yor local
* account.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #resourceShareType}
* will return {@link ResourceShareType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #resourceShareTypeAsString}.
*
*
* @return Allows you to specify that you want to search the tables shared with your account. The allowable values
* are FOREIGN
or ALL
.
*
* -
*
* If set to FOREIGN
, will search the tables shared with your account.
*
*
* -
*
* If set to ALL
, will search the tables shared with your account, as well as the tables in yor
* local account.
*
*
* @see ResourceShareType
*/
public final ResourceShareType resourceShareType() {
return ResourceShareType.fromValue(resourceShareType);
}
/**
*
* Allows you to specify that you want to search the tables shared with your account. The allowable values are
* FOREIGN
or ALL
.
*
*
* -
*
* If set to FOREIGN
, will search the tables shared with your account.
*
*
* -
*
* If set to ALL
, will search the tables shared with your account, as well as the tables in yor local
* account.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #resourceShareType}
* will return {@link ResourceShareType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #resourceShareTypeAsString}.
*
*
* @return Allows you to specify that you want to search the tables shared with your account. The allowable values
* are FOREIGN
or ALL
.
*
* -
*
* If set to FOREIGN
, will search the tables shared with your account.
*
*
* -
*
* If set to ALL
, will search the tables shared with your account, as well as the tables in yor
* local account.
*
*
* @see ResourceShareType
*/
public final String resourceShareTypeAsString() {
return resourceShareType;
}
/**
*
* Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.
*
*
* @return Specifies whether to include status details related to a request to create or update an Glue Data Catalog
* view.
*/
public final Boolean includeStatusDetails() {
return includeStatusDetails;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(catalogId());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(hasFilters() ? filters() : null);
hashCode = 31 * hashCode + Objects.hashCode(searchText());
hashCode = 31 * hashCode + Objects.hashCode(hasSortCriteria() ? sortCriteria() : null);
hashCode = 31 * hashCode + Objects.hashCode(maxResults());
hashCode = 31 * hashCode + Objects.hashCode(resourceShareTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(includeStatusDetails());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SearchTablesRequest)) {
return false;
}
SearchTablesRequest other = (SearchTablesRequest) obj;
return Objects.equals(catalogId(), other.catalogId()) && Objects.equals(nextToken(), other.nextToken())
&& hasFilters() == other.hasFilters() && Objects.equals(filters(), other.filters())
&& Objects.equals(searchText(), other.searchText()) && hasSortCriteria() == other.hasSortCriteria()
&& Objects.equals(sortCriteria(), other.sortCriteria()) && Objects.equals(maxResults(), other.maxResults())
&& Objects.equals(resourceShareTypeAsString(), other.resourceShareTypeAsString())
&& Objects.equals(includeStatusDetails(), other.includeStatusDetails());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("SearchTablesRequest").add("CatalogId", catalogId()).add("NextToken", nextToken())
.add("Filters", hasFilters() ? filters() : null).add("SearchText", searchText())
.add("SortCriteria", hasSortCriteria() ? sortCriteria() : null).add("MaxResults", maxResults())
.add("ResourceShareType", resourceShareTypeAsString()).add("IncludeStatusDetails", includeStatusDetails())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CatalogId":
return Optional.ofNullable(clazz.cast(catalogId()));
case "NextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "Filters":
return Optional.ofNullable(clazz.cast(filters()));
case "SearchText":
return Optional.ofNullable(clazz.cast(searchText()));
case "SortCriteria":
return Optional.ofNullable(clazz.cast(sortCriteria()));
case "MaxResults":
return Optional.ofNullable(clazz.cast(maxResults()));
case "ResourceShareType":
return Optional.ofNullable(clazz.cast(resourceShareTypeAsString()));
case "IncludeStatusDetails":
return Optional.ofNullable(clazz.cast(includeStatusDetails()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function