Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.lexruntime.model.PostTextRequest Maven / Gradle / Ivy
/*
* 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.lexruntime.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.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 PostTextRequest extends LexRuntimeRequest implements
ToCopyableBuilder {
private static final SdkField BOT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("botName").getter(getter(PostTextRequest::botName)).setter(setter(Builder::botName))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("botName").build()).build();
private static final SdkField BOT_ALIAS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("botAlias").getter(getter(PostTextRequest::botAlias)).setter(setter(Builder::botAlias))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("botAlias").build()).build();
private static final SdkField USER_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("userId")
.getter(getter(PostTextRequest::userId)).setter(setter(Builder::userId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("userId").build()).build();
private static final SdkField> SESSION_ATTRIBUTES_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("sessionAttributes")
.getter(getter(PostTextRequest::sessionAttributes))
.setter(setter(Builder::sessionAttributes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sessionAttributes").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField> REQUEST_ATTRIBUTES_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("requestAttributes")
.getter(getter(PostTextRequest::requestAttributes))
.setter(setter(Builder::requestAttributes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requestAttributes").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField INPUT_TEXT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("inputText").getter(getter(PostTextRequest::inputText)).setter(setter(Builder::inputText))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("inputText").build()).build();
private static final SdkField> ACTIVE_CONTEXTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("activeContexts")
.getter(getter(PostTextRequest::activeContexts))
.setter(setter(Builder::activeContexts))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("activeContexts").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ActiveContext::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BOT_NAME_FIELD,
BOT_ALIAS_FIELD, USER_ID_FIELD, SESSION_ATTRIBUTES_FIELD, REQUEST_ATTRIBUTES_FIELD, INPUT_TEXT_FIELD,
ACTIVE_CONTEXTS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private final String botName;
private final String botAlias;
private final String userId;
private final Map sessionAttributes;
private final Map requestAttributes;
private final String inputText;
private final List activeContexts;
private PostTextRequest(BuilderImpl builder) {
super(builder);
this.botName = builder.botName;
this.botAlias = builder.botAlias;
this.userId = builder.userId;
this.sessionAttributes = builder.sessionAttributes;
this.requestAttributes = builder.requestAttributes;
this.inputText = builder.inputText;
this.activeContexts = builder.activeContexts;
}
/**
*
* The name of the Amazon Lex bot.
*
*
* @return The name of the Amazon Lex bot.
*/
public final String botName() {
return botName;
}
/**
*
* The alias of the Amazon Lex bot.
*
*
* @return The alias of the Amazon Lex bot.
*/
public final String botAlias() {
return botAlias;
}
/**
*
* The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot. At
* runtime, each request must contain the userID
field.
*
*
* To decide the user ID to use for your application, consider the following factors.
*
*
*
*
* The userID
field must not contain any personally identifiable information of the user, for example,
* name, personal identification numbers, or other end user personal information.
*
*
*
*
* If you want a user to start a conversation on one device and continue on another device, use a user-specific
* identifier.
*
*
*
*
* If you want the same user to be able to have two independent conversations on two different devices, choose a
* device-specific identifier.
*
*
*
*
* A user can't have two independent conversations with two different versions of the same bot. For example, a user
* can't have a conversation with the PROD and BETA versions of the same bot. If you anticipate that a user will
* need to have conversation with two different versions, for example, while testing, include the bot alias in the
* user ID to separate the two conversations.
*
*
*
*
* @return The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your
* bot. At runtime, each request must contain the userID
field.
*
* To decide the user ID to use for your application, consider the following factors.
*
*
*
*
* The userID
field must not contain any personally identifiable information of the user, for
* example, name, personal identification numbers, or other end user personal information.
*
*
*
*
* If you want a user to start a conversation on one device and continue on another device, use a
* user-specific identifier.
*
*
*
*
* If you want the same user to be able to have two independent conversations on two different devices,
* choose a device-specific identifier.
*
*
*
*
* A user can't have two independent conversations with two different versions of the same bot. For example,
* a user can't have a conversation with the PROD and BETA versions of the same bot. If you anticipate that
* a user will need to have conversation with two different versions, for example, while testing, include
* the bot alias in the user ID to separate the two conversations.
*
*
*/
public final String userId() {
return userId;
}
/**
* For responses, this returns true if the service returned a value for the SessionAttributes 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 hasSessionAttributes() {
return sessionAttributes != null && !(sessionAttributes instanceof SdkAutoConstructMap);
}
/**
*
* Application-specific information passed between Amazon Lex and a client application.
*
*
* For more information, see Setting Session
* Attributes .
*
*
* 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 #hasSessionAttributes} method.
*
*
* @return Application-specific information passed between Amazon Lex and a client application.
*
* For more information, see Setting
* Session Attributes .
*/
public final Map sessionAttributes() {
return sessionAttributes;
}
/**
* For responses, this returns true if the service returned a value for the RequestAttributes 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 hasRequestAttributes() {
return requestAttributes != null && !(requestAttributes instanceof SdkAutoConstructMap);
}
/**
*
* Request-specific information passed between Amazon Lex and a client application.
*
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request attributes
* with the prefix x-amz-lex:
.
*
*
* For more information, see Setting Request
* Attributes .
*
*
* 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 #hasRequestAttributes} method.
*
*
* @return Request-specific information passed between Amazon Lex and a client application.
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request
* attributes with the prefix x-amz-lex:
.
*
*
* For more information, see Setting
* Request Attributes .
*/
public final Map requestAttributes() {
return requestAttributes;
}
/**
*
* The text that the user entered (Amazon Lex interprets this text).
*
*
* @return The text that the user entered (Amazon Lex interprets this text).
*/
public final String inputText() {
return inputText;
}
/**
* For responses, this returns true if the service returned a value for the ActiveContexts 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 hasActiveContexts() {
return activeContexts != null && !(activeContexts instanceof SdkAutoConstructList);
}
/**
*
* A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by
* including the context in the request,
*
*
* If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you
* specify an empty list, all contexts for the session are cleared.
*
*
* 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 #hasActiveContexts} method.
*
*
* @return A list of contexts active for the request. A context can be activated when a previous intent is
* fulfilled, or by including the context in the request,
*
* If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the
* session. If you specify an empty list, all contexts for the session are cleared.
*/
public final List activeContexts() {
return activeContexts;
}
@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(botName());
hashCode = 31 * hashCode + Objects.hashCode(botAlias());
hashCode = 31 * hashCode + Objects.hashCode(userId());
hashCode = 31 * hashCode + Objects.hashCode(hasSessionAttributes() ? sessionAttributes() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasRequestAttributes() ? requestAttributes() : null);
hashCode = 31 * hashCode + Objects.hashCode(inputText());
hashCode = 31 * hashCode + Objects.hashCode(hasActiveContexts() ? activeContexts() : null);
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 PostTextRequest)) {
return false;
}
PostTextRequest other = (PostTextRequest) obj;
return Objects.equals(botName(), other.botName()) && Objects.equals(botAlias(), other.botAlias())
&& Objects.equals(userId(), other.userId()) && hasSessionAttributes() == other.hasSessionAttributes()
&& Objects.equals(sessionAttributes(), other.sessionAttributes())
&& hasRequestAttributes() == other.hasRequestAttributes()
&& Objects.equals(requestAttributes(), other.requestAttributes())
&& Objects.equals(inputText(), other.inputText()) && hasActiveContexts() == other.hasActiveContexts()
&& Objects.equals(activeContexts(), other.activeContexts());
}
/**
* 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("PostTextRequest").add("BotName", botName()).add("BotAlias", botAlias()).add("UserId", userId())
.add("SessionAttributes", sessionAttributes() == null ? null : "*** Sensitive Data Redacted ***")
.add("RequestAttributes", requestAttributes() == null ? null : "*** Sensitive Data Redacted ***")
.add("InputText", inputText() == null ? null : "*** Sensitive Data Redacted ***")
.add("ActiveContexts", activeContexts() == null ? null : "*** Sensitive Data Redacted ***").build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "botName":
return Optional.ofNullable(clazz.cast(botName()));
case "botAlias":
return Optional.ofNullable(clazz.cast(botAlias()));
case "userId":
return Optional.ofNullable(clazz.cast(userId()));
case "sessionAttributes":
return Optional.ofNullable(clazz.cast(sessionAttributes()));
case "requestAttributes":
return Optional.ofNullable(clazz.cast(requestAttributes()));
case "inputText":
return Optional.ofNullable(clazz.cast(inputText()));
case "activeContexts":
return Optional.ofNullable(clazz.cast(activeContexts()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("botName", BOT_NAME_FIELD);
map.put("botAlias", BOT_ALIAS_FIELD);
map.put("userId", USER_ID_FIELD);
map.put("sessionAttributes", SESSION_ATTRIBUTES_FIELD);
map.put("requestAttributes", REQUEST_ATTRIBUTES_FIELD);
map.put("inputText", INPUT_TEXT_FIELD);
map.put("activeContexts", ACTIVE_CONTEXTS_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function getter(Function g) {
return obj -> g.apply((PostTextRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends LexRuntimeRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The name of the Amazon Lex bot.
*
*
* @param botName
* The name of the Amazon Lex bot.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder botName(String botName);
/**
*
* The alias of the Amazon Lex bot.
*
*
* @param botAlias
* The alias of the Amazon Lex bot.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder botAlias(String botAlias);
/**
*
* The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot.
* At runtime, each request must contain the userID
field.
*
*
* To decide the user ID to use for your application, consider the following factors.
*
*
*
*
* The userID
field must not contain any personally identifiable information of the user, for
* example, name, personal identification numbers, or other end user personal information.
*
*
*
*
* If you want a user to start a conversation on one device and continue on another device, use a user-specific
* identifier.
*
*
*
*
* If you want the same user to be able to have two independent conversations on two different devices, choose a
* device-specific identifier.
*
*
*
*
* A user can't have two independent conversations with two different versions of the same bot. For example, a
* user can't have a conversation with the PROD and BETA versions of the same bot. If you anticipate that a user
* will need to have conversation with two different versions, for example, while testing, include the bot alias
* in the user ID to separate the two conversations.
*
*
*
*
* @param userId
* The ID of the client application user. Amazon Lex uses this to identify a user's conversation with
* your bot. At runtime, each request must contain the userID
field.
*
* To decide the user ID to use for your application, consider the following factors.
*
*
*
*
* The userID
field must not contain any personally identifiable information of the user,
* for example, name, personal identification numbers, or other end user personal information.
*
*
*
*
* If you want a user to start a conversation on one device and continue on another device, use a
* user-specific identifier.
*
*
*
*
* If you want the same user to be able to have two independent conversations on two different devices,
* choose a device-specific identifier.
*
*
*
*
* A user can't have two independent conversations with two different versions of the same bot. For
* example, a user can't have a conversation with the PROD and BETA versions of the same bot. If you
* anticipate that a user will need to have conversation with two different versions, for example, while
* testing, include the bot alias in the user ID to separate the two conversations.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder userId(String userId);
/**
*
* Application-specific information passed between Amazon Lex and a client application.
*
*
* For more information, see Setting
* Session Attributes .
*
*
* @param sessionAttributes
* Application-specific information passed between Amazon Lex and a client application.
*
* For more information, see Setting Session Attributes .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sessionAttributes(Map sessionAttributes);
/**
*
* Request-specific information passed between Amazon Lex and a client application.
*
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request attributes
* with the prefix x-amz-lex:
.
*
*
* For more information, see Setting
* Request Attributes .
*
*
* @param requestAttributes
* Request-specific information passed between Amazon Lex and a client application.
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request
* attributes with the prefix x-amz-lex:
.
*
*
* For more information, see Setting Request Attributes .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder requestAttributes(Map requestAttributes);
/**
*
* The text that the user entered (Amazon Lex interprets this text).
*
*
* @param inputText
* The text that the user entered (Amazon Lex interprets this text).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder inputText(String inputText);
/**
*
* A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or
* by including the context in the request,
*
*
* If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If
* you specify an empty list, all contexts for the session are cleared.
*
*
* @param activeContexts
* A list of contexts active for the request. A context can be activated when a previous intent is
* fulfilled, or by including the context in the request,
*
* If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the
* session. If you specify an empty list, all contexts for the session are cleared.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder activeContexts(Collection activeContexts);
/**
*
* A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or
* by including the context in the request,
*
*
* If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If
* you specify an empty list, all contexts for the session are cleared.
*
*
* @param activeContexts
* A list of contexts active for the request. A context can be activated when a previous intent is
* fulfilled, or by including the context in the request,
*
* If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the
* session. If you specify an empty list, all contexts for the session are cleared.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder activeContexts(ActiveContext... activeContexts);
/**
*
* A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or
* by including the context in the request,
*
*
* If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If
* you specify an empty list, all contexts for the session are cleared.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.lexruntime.model.ActiveContext.Builder} avoiding the need to create
* one manually via {@link software.amazon.awssdk.services.lexruntime.model.ActiveContext#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.lexruntime.model.ActiveContext.Builder#build()} is called immediately
* and its result is passed to {@link #activeContexts(List)}.
*
* @param activeContexts
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.lexruntime.model.ActiveContext.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #activeContexts(java.util.Collection)
*/
Builder activeContexts(Consumer... activeContexts);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends LexRuntimeRequest.BuilderImpl implements Builder {
private String botName;
private String botAlias;
private String userId;
private Map sessionAttributes = DefaultSdkAutoConstructMap.getInstance();
private Map requestAttributes = DefaultSdkAutoConstructMap.getInstance();
private String inputText;
private List activeContexts = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(PostTextRequest model) {
super(model);
botName(model.botName);
botAlias(model.botAlias);
userId(model.userId);
sessionAttributes(model.sessionAttributes);
requestAttributes(model.requestAttributes);
inputText(model.inputText);
activeContexts(model.activeContexts);
}
public final String getBotName() {
return botName;
}
public final void setBotName(String botName) {
this.botName = botName;
}
@Override
public final Builder botName(String botName) {
this.botName = botName;
return this;
}
public final String getBotAlias() {
return botAlias;
}
public final void setBotAlias(String botAlias) {
this.botAlias = botAlias;
}
@Override
public final Builder botAlias(String botAlias) {
this.botAlias = botAlias;
return this;
}
public final String getUserId() {
return userId;
}
public final void setUserId(String userId) {
this.userId = userId;
}
@Override
public final Builder userId(String userId) {
this.userId = userId;
return this;
}
public final Map getSessionAttributes() {
if (sessionAttributes instanceof SdkAutoConstructMap) {
return null;
}
return sessionAttributes;
}
public final void setSessionAttributes(Map sessionAttributes) {
this.sessionAttributes = StringMapCopier.copy(sessionAttributes);
}
@Override
public final Builder sessionAttributes(Map sessionAttributes) {
this.sessionAttributes = StringMapCopier.copy(sessionAttributes);
return this;
}
public final Map getRequestAttributes() {
if (requestAttributes instanceof SdkAutoConstructMap) {
return null;
}
return requestAttributes;
}
public final void setRequestAttributes(Map requestAttributes) {
this.requestAttributes = StringMapCopier.copy(requestAttributes);
}
@Override
public final Builder requestAttributes(Map requestAttributes) {
this.requestAttributes = StringMapCopier.copy(requestAttributes);
return this;
}
public final String getInputText() {
return inputText;
}
public final void setInputText(String inputText) {
this.inputText = inputText;
}
@Override
public final Builder inputText(String inputText) {
this.inputText = inputText;
return this;
}
public final List getActiveContexts() {
List result = ActiveContextsListCopier.copyToBuilder(this.activeContexts);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setActiveContexts(Collection activeContexts) {
this.activeContexts = ActiveContextsListCopier.copyFromBuilder(activeContexts);
}
@Override
public final Builder activeContexts(Collection activeContexts) {
this.activeContexts = ActiveContextsListCopier.copy(activeContexts);
return this;
}
@Override
@SafeVarargs
public final Builder activeContexts(ActiveContext... activeContexts) {
activeContexts(Arrays.asList(activeContexts));
return this;
}
@Override
@SafeVarargs
public final Builder activeContexts(Consumer... activeContexts) {
activeContexts(Stream.of(activeContexts).map(c -> ActiveContext.builder().applyMutation(c).build())
.collect(Collectors.toList()));
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 PostTextRequest build() {
return new PostTextRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
@Override
public Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
}
}