software.amazon.awssdk.services.location.model.SearchPlaceIndexForTextRequest Maven / Gradle / Ivy
Show all versions of location 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.location.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
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 SearchPlaceIndexForTextRequest extends LocationRequest implements
ToCopyableBuilder {
private static final SdkField INDEX_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IndexName").getter(getter(SearchPlaceIndexForTextRequest::indexName)).setter(setter(Builder::indexName))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("IndexName").build()).build();
private static final SdkField TEXT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Text")
.getter(getter(SearchPlaceIndexForTextRequest::text)).setter(setter(Builder::text))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Text").build()).build();
private static final SdkField> BIAS_POSITION_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("BiasPosition")
.getter(getter(SearchPlaceIndexForTextRequest::biasPosition))
.setter(setter(Builder::biasPosition))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BiasPosition").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.DOUBLE)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> FILTER_B_BOX_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("FilterBBox")
.getter(getter(SearchPlaceIndexForTextRequest::filterBBox))
.setter(setter(Builder::filterBBox))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FilterBBox").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.DOUBLE)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> FILTER_COUNTRIES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("FilterCountries")
.getter(getter(SearchPlaceIndexForTextRequest::filterCountries))
.setter(setter(Builder::filterCountries))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FilterCountries").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.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(SearchPlaceIndexForTextRequest::maxResults))
.setter(setter(Builder::maxResults))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxResults").build()).build();
private static final SdkField LANGUAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Language").getter(getter(SearchPlaceIndexForTextRequest::language)).setter(setter(Builder::language))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Language").build()).build();
private static final SdkField> FILTER_CATEGORIES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("FilterCategories")
.getter(getter(SearchPlaceIndexForTextRequest::filterCategories))
.setter(setter(Builder::filterCategories))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FilterCategories").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField KEY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Key")
.getter(getter(SearchPlaceIndexForTextRequest::key)).setter(setter(Builder::key))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("key").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INDEX_NAME_FIELD, TEXT_FIELD,
BIAS_POSITION_FIELD, FILTER_B_BOX_FIELD, FILTER_COUNTRIES_FIELD, MAX_RESULTS_FIELD, LANGUAGE_FIELD,
FILTER_CATEGORIES_FIELD, KEY_FIELD));
private final String indexName;
private final String text;
private final List biasPosition;
private final List filterBBox;
private final List filterCountries;
private final Integer maxResults;
private final String language;
private final List filterCategories;
private final String key;
private SearchPlaceIndexForTextRequest(BuilderImpl builder) {
super(builder);
this.indexName = builder.indexName;
this.text = builder.text;
this.biasPosition = builder.biasPosition;
this.filterBBox = builder.filterBBox;
this.filterCountries = builder.filterCountries;
this.maxResults = builder.maxResults;
this.language = builder.language;
this.filterCategories = builder.filterCategories;
this.key = builder.key;
}
/**
*
* The name of the place index resource you want to use for the search.
*
*
* @return The name of the place index resource you want to use for the search.
*/
public final String indexName() {
return indexName;
}
/**
*
* The address, name, city, or region to be used in the search in free-form text format. For example,
* 123 Any Street
.
*
*
* @return The address, name, city, or region to be used in the search in free-form text format. For example,
* 123 Any Street
.
*/
public final String text() {
return text;
}
/**
* For responses, this returns true if the service returned a value for the BiasPosition 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 hasBiasPosition() {
return biasPosition != null && !(biasPosition instanceof SdkAutoConstructList);
}
/**
*
* An optional parameter that indicates a preference for places that are closer to a specified position.
*
*
* If provided, this parameter must contain a pair of numbers. The first number represents the X coordinate, or
* longitude; the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents the position with longitude -123.1174
and
* latitude 49.2847
.
*
*
*
* BiasPosition
and FilterBBox
are mutually exclusive. Specifying both options results in
* an error.
*
*
*
* 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 #hasBiasPosition} method.
*
*
* @return An optional parameter that indicates a preference for places that are closer to a specified position.
*
* If provided, this parameter must contain a pair of numbers. The first number represents the X coordinate,
* or longitude; the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents the position with longitude
* -123.1174
and latitude 49.2847
.
*
*
*
* BiasPosition
and FilterBBox
are mutually exclusive. Specifying both options
* results in an error.
*
*/
public final List biasPosition() {
return biasPosition;
}
/**
* For responses, this returns true if the service returned a value for the FilterBBox 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 hasFilterBBox() {
return filterBBox != null && !(filterBBox instanceof SdkAutoConstructList);
}
/**
*
* An optional parameter that limits the search results by returning only places that are within the provided
* bounding box.
*
*
* If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair of
* numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest corner of the
* bounding box; the second pair of numbers represents the X and Y coordinates (longitude and latitude,
* respectively) of the northeast corner of the bounding box.
*
*
* For example, [-12.7935, -37.4835, -12.0684, -36.9542]
represents a bounding box where the southwest
* corner has longitude -12.7935
and latitude -37.4835
, and the northeast corner has
* longitude -12.0684
and latitude -36.9542
.
*
*
*
* FilterBBox
and BiasPosition
are mutually exclusive. Specifying both options results in
* an error.
*
*
*
* 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 #hasFilterBBox} method.
*
*
* @return An optional parameter that limits the search results by returning only places that are within the
* provided bounding box.
*
* If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair
* of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest
* corner of the bounding box; the second pair of numbers represents the X and Y coordinates (longitude and
* latitude, respectively) of the northeast corner of the bounding box.
*
*
* For example, [-12.7935, -37.4835, -12.0684, -36.9542]
represents a bounding box where the
* southwest corner has longitude -12.7935
and latitude -37.4835
, and the
* northeast corner has longitude -12.0684
and latitude -36.9542
.
*
*
*
* FilterBBox
and BiasPosition
are mutually exclusive. Specifying both options
* results in an error.
*
*/
public final List filterBBox() {
return filterBBox;
}
/**
* For responses, this returns true if the service returned a value for the FilterCountries 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 hasFilterCountries() {
return filterCountries != null && !(filterCountries instanceof SdkAutoConstructList);
}
/**
*
* An optional parameter that limits the search results by returning only places that are in a specified list of
* countries.
*
*
* -
*
* Valid values include ISO 3166 3-digit country
* codes. For example, Australia uses three upper-case characters: AUS
.
*
*
*
*
* 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 #hasFilterCountries} method.
*
*
* @return An optional parameter that limits the search results by returning only places that are in a specified
* list of countries.
*
* -
*
* Valid values include ISO 3166 3-digit
* country codes. For example, Australia uses three upper-case characters: AUS
.
*
*
*/
public final List filterCountries() {
return filterCountries;
}
/**
*
* An optional parameter. The maximum number of results returned per request.
*
*
* The default: 50
*
*
* @return An optional parameter. The maximum number of results returned per request.
*
* The default: 50
*/
public final Integer maxResults() {
return maxResults;
}
/**
*
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for English.
*
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the result.
*
*
* For an example, we'll use the Greek language. You search for Athens, Greece
, with the
* language
parameter set to en
. The result found will most likely be returned as
* Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the result found will more
* likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider does
* support.
*
*
* @return The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for
* English.
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the
* result.
*
*
* For an example, we'll use the Greek language. You search for Athens, Greece
, with the
* language
parameter set to en
. The result found will most likely be returned as
* Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the result found will
* more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider
* does support.
*/
public final String language() {
return language;
}
/**
* For responses, this returns true if the service returned a value for the FilterCategories 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 hasFilterCategories() {
return filterCategories != null && !(filterCategories instanceof SdkAutoConstructList);
}
/**
*
* A list of one or more Amazon Location categories to filter the returned places. If you include more than one
* category, the results will include results that match any of the categories listed.
*
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*
*
* 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 #hasFilterCategories} method.
*
*
* @return A list of one or more Amazon Location categories to filter the returned places. If you include more than
* one category, the results will include results that match any of the categories listed.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*/
public final List filterCategories() {
return filterCategories;
}
/**
*
* The optional API key
* to authorize the request.
*
*
* @return The optional API
* key to authorize the request.
*/
public final String key() {
return key;
}
@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(indexName());
hashCode = 31 * hashCode + Objects.hashCode(text());
hashCode = 31 * hashCode + Objects.hashCode(hasBiasPosition() ? biasPosition() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasFilterBBox() ? filterBBox() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasFilterCountries() ? filterCountries() : null);
hashCode = 31 * hashCode + Objects.hashCode(maxResults());
hashCode = 31 * hashCode + Objects.hashCode(language());
hashCode = 31 * hashCode + Objects.hashCode(hasFilterCategories() ? filterCategories() : null);
hashCode = 31 * hashCode + Objects.hashCode(key());
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 SearchPlaceIndexForTextRequest)) {
return false;
}
SearchPlaceIndexForTextRequest other = (SearchPlaceIndexForTextRequest) obj;
return Objects.equals(indexName(), other.indexName()) && Objects.equals(text(), other.text())
&& hasBiasPosition() == other.hasBiasPosition() && Objects.equals(biasPosition(), other.biasPosition())
&& hasFilterBBox() == other.hasFilterBBox() && Objects.equals(filterBBox(), other.filterBBox())
&& hasFilterCountries() == other.hasFilterCountries()
&& Objects.equals(filterCountries(), other.filterCountries()) && Objects.equals(maxResults(), other.maxResults())
&& Objects.equals(language(), other.language()) && hasFilterCategories() == other.hasFilterCategories()
&& Objects.equals(filterCategories(), other.filterCategories()) && Objects.equals(key(), other.key());
}
/**
* 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("SearchPlaceIndexForTextRequest").add("IndexName", indexName())
.add("Text", text() == null ? null : "*** Sensitive Data Redacted ***")
.add("BiasPosition", biasPosition() == null ? null : "*** Sensitive Data Redacted ***")
.add("FilterBBox", filterBBox() == null ? null : "*** Sensitive Data Redacted ***")
.add("FilterCountries", hasFilterCountries() ? filterCountries() : null).add("MaxResults", maxResults())
.add("Language", language()).add("FilterCategories", hasFilterCategories() ? filterCategories() : null)
.add("Key", key() == null ? null : "*** Sensitive Data Redacted ***").build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "IndexName":
return Optional.ofNullable(clazz.cast(indexName()));
case "Text":
return Optional.ofNullable(clazz.cast(text()));
case "BiasPosition":
return Optional.ofNullable(clazz.cast(biasPosition()));
case "FilterBBox":
return Optional.ofNullable(clazz.cast(filterBBox()));
case "FilterCountries":
return Optional.ofNullable(clazz.cast(filterCountries()));
case "MaxResults":
return Optional.ofNullable(clazz.cast(maxResults()));
case "Language":
return Optional.ofNullable(clazz.cast(language()));
case "FilterCategories":
return Optional.ofNullable(clazz.cast(filterCategories()));
case "Key":
return Optional.ofNullable(clazz.cast(key()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* If provided, this parameter must contain a pair of numbers. The first number represents the X
* coordinate, or longitude; the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents the position with longitude
* -123.1174
and latitude 49.2847
.
*
*
*
* BiasPosition
and FilterBBox
are mutually exclusive. Specifying both options
* results in an error.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder biasPosition(Collection biasPosition);
/**
*
* An optional parameter that indicates a preference for places that are closer to a specified position.
*
*
* If provided, this parameter must contain a pair of numbers. The first number represents the X coordinate, or
* longitude; the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents the position with longitude -123.1174
* and latitude 49.2847
.
*
*
*
* BiasPosition
and FilterBBox
are mutually exclusive. Specifying both options results
* in an error.
*
*
*
* @param biasPosition
* An optional parameter that indicates a preference for places that are closer to a specified
* position.
*
* If provided, this parameter must contain a pair of numbers. The first number represents the X
* coordinate, or longitude; the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents the position with longitude
* -123.1174
and latitude 49.2847
.
*
*
*
* BiasPosition
and FilterBBox
are mutually exclusive. Specifying both options
* results in an error.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder biasPosition(Double... biasPosition);
/**
*
* An optional parameter that limits the search results by returning only places that are within the provided
* bounding box.
*
*
* If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair of
* numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest corner of
* the bounding box; the second pair of numbers represents the X and Y coordinates (longitude and latitude,
* respectively) of the northeast corner of the bounding box.
*
*
* For example, [-12.7935, -37.4835, -12.0684, -36.9542]
represents a bounding box where the
* southwest corner has longitude -12.7935
and latitude -37.4835
, and the northeast
* corner has longitude -12.0684
and latitude -36.9542
.
*
*
*
* FilterBBox
and BiasPosition
are mutually exclusive. Specifying both options results
* in an error.
*
*
*
* @param filterBBox
* An optional parameter that limits the search results by returning only places that are within the
* provided bounding box.
*
* If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first
* pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the
* southwest corner of the bounding box; the second pair of numbers represents the X and Y coordinates
* (longitude and latitude, respectively) of the northeast corner of the bounding box.
*
*
* For example, [-12.7935, -37.4835, -12.0684, -36.9542]
represents a bounding box where the
* southwest corner has longitude -12.7935
and latitude -37.4835
, and the
* northeast corner has longitude -12.0684
and latitude -36.9542
.
*
*
*
* FilterBBox
and BiasPosition
are mutually exclusive. Specifying both options
* results in an error.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder filterBBox(Collection filterBBox);
/**
*
* An optional parameter that limits the search results by returning only places that are within the provided
* bounding box.
*
*
* If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair of
* numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest corner of
* the bounding box; the second pair of numbers represents the X and Y coordinates (longitude and latitude,
* respectively) of the northeast corner of the bounding box.
*
*
* For example, [-12.7935, -37.4835, -12.0684, -36.9542]
represents a bounding box where the
* southwest corner has longitude -12.7935
and latitude -37.4835
, and the northeast
* corner has longitude -12.0684
and latitude -36.9542
.
*
*
*
* FilterBBox
and BiasPosition
are mutually exclusive. Specifying both options results
* in an error.
*
*
*
* @param filterBBox
* An optional parameter that limits the search results by returning only places that are within the
* provided bounding box.
*
* If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first
* pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the
* southwest corner of the bounding box; the second pair of numbers represents the X and Y coordinates
* (longitude and latitude, respectively) of the northeast corner of the bounding box.
*
*
* For example, [-12.7935, -37.4835, -12.0684, -36.9542]
represents a bounding box where the
* southwest corner has longitude -12.7935
and latitude -37.4835
, and the
* northeast corner has longitude -12.0684
and latitude -36.9542
.
*
*
*
* FilterBBox
and BiasPosition
are mutually exclusive. Specifying both options
* results in an error.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder filterBBox(Double... filterBBox);
/**
*
* An optional parameter that limits the search results by returning only places that are in a specified list of
* countries.
*
*
* -
*
* Valid values include ISO 3166 3-digit country
* codes. For example, Australia uses three upper-case characters: AUS
.
*
*
*
*
* @param filterCountries
* An optional parameter that limits the search results by returning only places that are in a specified
* list of countries.
*
* -
*
* Valid values include ISO 3166 3-digit
* country codes. For example, Australia uses three upper-case characters: AUS
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder filterCountries(Collection filterCountries);
/**
*
* An optional parameter that limits the search results by returning only places that are in a specified list of
* countries.
*
*
* -
*
* Valid values include ISO 3166 3-digit country
* codes. For example, Australia uses three upper-case characters: AUS
.
*
*
*
*
* @param filterCountries
* An optional parameter that limits the search results by returning only places that are in a specified
* list of countries.
*
* -
*
* Valid values include ISO 3166 3-digit
* country codes. For example, Australia uses three upper-case characters: AUS
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder filterCountries(String... filterCountries);
/**
*
* An optional parameter. The maximum number of results returned per request.
*
*
* The default: 50
*
*
* @param maxResults
* An optional parameter. The maximum number of results returned per request.
*
* The default: 50
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder maxResults(Integer maxResults);
/**
*
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for English.
*
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the
* result.
*
*
* For an example, we'll use the Greek language. You search for Athens, Greece
, with the
* language
parameter set to en
. The result found will most likely be returned as
* Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the result found will more
* likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider does
* support.
*
*
* @param language
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for
* English.
*
* This setting affects the languages used in the results, but not the results themselves. If no language
* is specified, or not supported for a particular result, the partner automatically chooses a language
* for the result.
*
*
* For an example, we'll use the Greek language. You search for Athens, Greece
, with the
* language
parameter set to en
. The result found will most likely be returned
* as Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the result found
* will more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the
* provider does support.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder language(String language);
/**
*
* A list of one or more Amazon Location categories to filter the returned places. If you include more than one
* category, the results will include results that match any of the categories listed.
*
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*
*
* @param filterCategories
* A list of one or more Amazon Location categories to filter the returned places. If you include more
* than one category, the results will include results that match any of the categories
* listed.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories
* and filtering, in the Amazon Location Service Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder filterCategories(Collection filterCategories);
/**
*
* A list of one or more Amazon Location categories to filter the returned places. If you include more than one
* category, the results will include results that match any of the categories listed.
*
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*
*
* @param filterCategories
* A list of one or more Amazon Location categories to filter the returned places. If you include more
* than one category, the results will include results that match any of the categories
* listed.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories
* and filtering, in the Amazon Location Service Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder filterCategories(String... filterCategories);
/**
*
* The optional API
* key to authorize the request.
*
*
* @param key
* The optional API key to
* authorize the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder key(String key);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends LocationRequest.BuilderImpl implements Builder {
private String indexName;
private String text;
private List biasPosition = DefaultSdkAutoConstructList.getInstance();
private List filterBBox = DefaultSdkAutoConstructList.getInstance();
private List filterCountries = DefaultSdkAutoConstructList.getInstance();
private Integer maxResults;
private String language;
private List filterCategories = DefaultSdkAutoConstructList.getInstance();
private String key;
private BuilderImpl() {
}
private BuilderImpl(SearchPlaceIndexForTextRequest model) {
super(model);
indexName(model.indexName);
text(model.text);
biasPosition(model.biasPosition);
filterBBox(model.filterBBox);
filterCountries(model.filterCountries);
maxResults(model.maxResults);
language(model.language);
filterCategories(model.filterCategories);
key(model.key);
}
public final String getIndexName() {
return indexName;
}
public final void setIndexName(String indexName) {
this.indexName = indexName;
}
@Override
public final Builder indexName(String indexName) {
this.indexName = indexName;
return this;
}
public final String getText() {
return text;
}
public final void setText(String text) {
this.text = text;
}
@Override
public final Builder text(String text) {
this.text = text;
return this;
}
public final Collection getBiasPosition() {
if (biasPosition instanceof SdkAutoConstructList) {
return null;
}
return biasPosition;
}
public final void setBiasPosition(Collection biasPosition) {
this.biasPosition = PositionCopier.copy(biasPosition);
}
@Override
public final Builder biasPosition(Collection biasPosition) {
this.biasPosition = PositionCopier.copy(biasPosition);
return this;
}
@Override
@SafeVarargs
public final Builder biasPosition(Double... biasPosition) {
biasPosition(Arrays.asList(biasPosition));
return this;
}
public final Collection getFilterBBox() {
if (filterBBox instanceof SdkAutoConstructList) {
return null;
}
return filterBBox;
}
public final void setFilterBBox(Collection filterBBox) {
this.filterBBox = BoundingBoxCopier.copy(filterBBox);
}
@Override
public final Builder filterBBox(Collection filterBBox) {
this.filterBBox = BoundingBoxCopier.copy(filterBBox);
return this;
}
@Override
@SafeVarargs
public final Builder filterBBox(Double... filterBBox) {
filterBBox(Arrays.asList(filterBBox));
return this;
}
public final Collection getFilterCountries() {
if (filterCountries instanceof SdkAutoConstructList) {
return null;
}
return filterCountries;
}
public final void setFilterCountries(Collection filterCountries) {
this.filterCountries = CountryCodeListCopier.copy(filterCountries);
}
@Override
public final Builder filterCountries(Collection filterCountries) {
this.filterCountries = CountryCodeListCopier.copy(filterCountries);
return this;
}
@Override
@SafeVarargs
public final Builder filterCountries(String... filterCountries) {
filterCountries(Arrays.asList(filterCountries));
return this;
}
public final Integer getMaxResults() {
return maxResults;
}
public final void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
@Override
public final Builder maxResults(Integer maxResults) {
this.maxResults = maxResults;
return this;
}
public final String getLanguage() {
return language;
}
public final void setLanguage(String language) {
this.language = language;
}
@Override
public final Builder language(String language) {
this.language = language;
return this;
}
public final Collection getFilterCategories() {
if (filterCategories instanceof SdkAutoConstructList) {
return null;
}
return filterCategories;
}
public final void setFilterCategories(Collection filterCategories) {
this.filterCategories = FilterPlaceCategoryListCopier.copy(filterCategories);
}
@Override
public final Builder filterCategories(Collection filterCategories) {
this.filterCategories = FilterPlaceCategoryListCopier.copy(filterCategories);
return this;
}
@Override
@SafeVarargs
public final Builder filterCategories(String... filterCategories) {
filterCategories(Arrays.asList(filterCategories));
return this;
}
public final String getKey() {
return key;
}
public final void setKey(String key) {
this.key = key;
}
@Override
public final Builder key(String key) {
this.key = key;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public SearchPlaceIndexForTextRequest build() {
return new SearchPlaceIndexForTextRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}