supportedMessagingContentTypes;
private StartChatContactRequest(BuilderImpl builder) {
super(builder);
this.instanceId = builder.instanceId;
this.contactFlowId = builder.contactFlowId;
this.attributes = builder.attributes;
this.participantDetails = builder.participantDetails;
this.initialMessage = builder.initialMessage;
this.clientToken = builder.clientToken;
this.chatDurationInMinutes = builder.chatDurationInMinutes;
this.supportedMessagingContentTypes = builder.supportedMessagingContentTypes;
}
/**
*
* The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.
*
*
* @return The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.
*/
public final String instanceId() {
return instanceId;
}
/**
*
* The identifier of the flow for initiating the chat. To see the ContactFlowId in the Amazon Connect console user
* interface, on the navigation menu go to Routing , Contact Flows . Choose the flow. On the flow page,
* under the name of the flow, choose Show additional flow information . The ContactFlowId is the last part of
* the ARN, shown here in bold:
*
*
* arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/
* 846ec553-a005-41c0-8341-xxxxxxxxxxxx
*
*
* @return The identifier of the flow for initiating the chat. To see the ContactFlowId in the Amazon Connect
* console user interface, on the navigation menu go to Routing , Contact Flows . Choose the
* flow. On the flow page, under the name of the flow, choose Show additional flow information . The
* ContactFlowId is the last part of the ARN, shown here in bold:
*
* arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/
* 846ec553-a005-41c0-8341-xxxxxxxxxxxx
*/
public final String contactFlowId() {
return contactFlowId;
}
/**
* For responses, this returns true if the service returned a value for the Attributes 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 hasAttributes() {
return attributes != null && !(attributes instanceof SdkAutoConstructMap);
}
/**
*
* A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes. They can
* be accessed in flows just like any other contact attributes.
*
*
* There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only
* alphanumeric, dash, and underscore characters.
*
*
* 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 #hasAttributes} method.
*
*
* @return A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes.
* They can be accessed in flows just like any other contact attributes.
*
* There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include
* only alphanumeric, dash, and underscore characters.
*/
public final Map attributes() {
return attributes;
}
/**
*
* Information identifying the participant.
*
*
* @return Information identifying the participant.
*/
public final ParticipantDetails participantDetails() {
return participantDetails;
}
/**
*
* The initial message to be sent to the newly created chat.
*
*
* @return The initial message to be sent to the newly created chat.
*/
public final ChatMessage initialMessage() {
return initialMessage;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided,
* the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with
* idempotent APIs .
*
*
* @return A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not
* provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see
* Making
* retries safe with idempotent APIs .
*/
public final String clientToken() {
return clientToken;
}
/**
*
* The total duration of the newly started chat session. If not specified, the chat session duration defaults to 25
* hour. The minumum configurable time is 60 minutes. The maximum configurable time is 10,080 minutes (7 days).
*
*
* @return The total duration of the newly started chat session. If not specified, the chat session duration
* defaults to 25 hour. The minumum configurable time is 60 minutes. The maximum configurable time is 10,080
* minutes (7 days).
*/
public final Integer chatDurationInMinutes() {
return chatDurationInMinutes;
}
/**
* For responses, this returns true if the service returned a value for the SupportedMessagingContentTypes 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 hasSupportedMessagingContentTypes() {
return supportedMessagingContentTypes != null && !(supportedMessagingContentTypes instanceof SdkAutoConstructList);
}
/**
*
* The supported chat message content types. Content types can be text/plain or both text/plain and text/markdown.
*
*
* 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 #hasSupportedMessagingContentTypes} method.
*
*
* @return The supported chat message content types. Content types can be text/plain or both text/plain and
* text/markdown.
*/
public final List supportedMessagingContentTypes() {
return supportedMessagingContentTypes;
}
@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(instanceId());
hashCode = 31 * hashCode + Objects.hashCode(contactFlowId());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributes() : null);
hashCode = 31 * hashCode + Objects.hashCode(participantDetails());
hashCode = 31 * hashCode + Objects.hashCode(initialMessage());
hashCode = 31 * hashCode + Objects.hashCode(clientToken());
hashCode = 31 * hashCode + Objects.hashCode(chatDurationInMinutes());
hashCode = 31 * hashCode
+ Objects.hashCode(hasSupportedMessagingContentTypes() ? supportedMessagingContentTypes() : 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 StartChatContactRequest)) {
return false;
}
StartChatContactRequest other = (StartChatContactRequest) obj;
return Objects.equals(instanceId(), other.instanceId()) && Objects.equals(contactFlowId(), other.contactFlowId())
&& hasAttributes() == other.hasAttributes() && Objects.equals(attributes(), other.attributes())
&& Objects.equals(participantDetails(), other.participantDetails())
&& Objects.equals(initialMessage(), other.initialMessage()) && Objects.equals(clientToken(), other.clientToken())
&& Objects.equals(chatDurationInMinutes(), other.chatDurationInMinutes())
&& hasSupportedMessagingContentTypes() == other.hasSupportedMessagingContentTypes()
&& Objects.equals(supportedMessagingContentTypes(), other.supportedMessagingContentTypes());
}
/**
* 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("StartChatContactRequest")
.add("InstanceId", instanceId())
.add("ContactFlowId", contactFlowId())
.add("Attributes", hasAttributes() ? attributes() : null)
.add("ParticipantDetails", participantDetails())
.add("InitialMessage", initialMessage())
.add("ClientToken", clientToken())
.add("ChatDurationInMinutes", chatDurationInMinutes())
.add("SupportedMessagingContentTypes",
hasSupportedMessagingContentTypes() ? supportedMessagingContentTypes() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "InstanceId":
return Optional.ofNullable(clazz.cast(instanceId()));
case "ContactFlowId":
return Optional.ofNullable(clazz.cast(contactFlowId()));
case "Attributes":
return Optional.ofNullable(clazz.cast(attributes()));
case "ParticipantDetails":
return Optional.ofNullable(clazz.cast(participantDetails()));
case "InitialMessage":
return Optional.ofNullable(clazz.cast(initialMessage()));
case "ClientToken":
return Optional.ofNullable(clazz.cast(clientToken()));
case "ChatDurationInMinutes":
return Optional.ofNullable(clazz.cast(chatDurationInMinutes()));
case "SupportedMessagingContentTypes":
return Optional.ofNullable(clazz.cast(supportedMessagingContentTypes()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((StartChatContactRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ConnectRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.
*
*
* @param instanceId
* The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder instanceId(String instanceId);
/**
*
* The identifier of the flow for initiating the chat. To see the ContactFlowId in the Amazon Connect console
* user interface, on the navigation menu go to Routing , Contact Flows . Choose the flow. On the
* flow page, under the name of the flow, choose Show additional flow information . The ContactFlowId is
* the last part of the ARN, shown here in bold:
*
*
* arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/
* 846ec553-a005-41c0-8341-xxxxxxxxxxxx
*
*
* @param contactFlowId
* The identifier of the flow for initiating the chat. To see the ContactFlowId in the Amazon Connect
* console user interface, on the navigation menu go to Routing , Contact Flows . Choose the
* flow. On the flow page, under the name of the flow, choose Show additional flow information .
* The ContactFlowId is the last part of the ARN, shown here in bold:
*
* arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/
* 846ec553-a005-41c0-8341-xxxxxxxxxxxx
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder contactFlowId(String contactFlowId);
/**
*
* A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes. They
* can be accessed in flows just like any other contact attributes.
*
*
* There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only
* alphanumeric, dash, and underscore characters.
*
*
* @param attributes
* A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes.
* They can be accessed in flows just like any other contact attributes.
*
* There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can
* include only alphanumeric, dash, and underscore characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributes(Map attributes);
/**
*
* Information identifying the participant.
*
*
* @param participantDetails
* Information identifying the participant.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder participantDetails(ParticipantDetails participantDetails);
/**
*
* Information identifying the participant.
*
* This is a convenience method that creates an instance of the {@link ParticipantDetails.Builder} avoiding the
* need to create one manually via {@link ParticipantDetails#builder()}.
*
*
* When the {@link Consumer} completes, {@link ParticipantDetails.Builder#build()} is called immediately and its
* result is passed to {@link #participantDetails(ParticipantDetails)}.
*
* @param participantDetails
* a consumer that will call methods on {@link ParticipantDetails.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #participantDetails(ParticipantDetails)
*/
default Builder participantDetails(Consumer participantDetails) {
return participantDetails(ParticipantDetails.builder().applyMutation(participantDetails).build());
}
/**
*
* The initial message to be sent to the newly created chat.
*
*
* @param initialMessage
* The initial message to be sent to the newly created chat.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder initialMessage(ChatMessage initialMessage);
/**
*
* The initial message to be sent to the newly created chat.
*
* This is a convenience method that creates an instance of the {@link ChatMessage.Builder} avoiding the need to
* create one manually via {@link ChatMessage#builder()}.
*
*
* When the {@link Consumer} completes, {@link ChatMessage.Builder#build()} is called immediately and its result
* is passed to {@link #initialMessage(ChatMessage)}.
*
* @param initialMessage
* a consumer that will call methods on {@link ChatMessage.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #initialMessage(ChatMessage)
*/
default Builder initialMessage(Consumer initialMessage) {
return initialMessage(ChatMessage.builder().applyMutation(initialMessage).build());
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not
* provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe
* with idempotent APIs .
*
*
* @param clientToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not
* provided, the Amazon Web Services SDK populates this field. For more information about idempotency,
* see Making
* retries safe with idempotent APIs .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder clientToken(String clientToken);
/**
*
* The total duration of the newly started chat session. If not specified, the chat session duration defaults to
* 25 hour. The minumum configurable time is 60 minutes. The maximum configurable time is 10,080 minutes (7
* days).
*
*
* @param chatDurationInMinutes
* The total duration of the newly started chat session. If not specified, the chat session duration
* defaults to 25 hour. The minumum configurable time is 60 minutes. The maximum configurable time is
* 10,080 minutes (7 days).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder chatDurationInMinutes(Integer chatDurationInMinutes);
/**
*
* The supported chat message content types. Content types can be text/plain or both text/plain and
* text/markdown.
*
*
* @param supportedMessagingContentTypes
* The supported chat message content types. Content types can be text/plain or both text/plain and
* text/markdown.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedMessagingContentTypes(Collection supportedMessagingContentTypes);
/**
*
* The supported chat message content types. Content types can be text/plain or both text/plain and
* text/markdown.
*
*
* @param supportedMessagingContentTypes
* The supported chat message content types. Content types can be text/plain or both text/plain and
* text/markdown.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedMessagingContentTypes(String... supportedMessagingContentTypes);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends ConnectRequest.BuilderImpl implements Builder {
private String instanceId;
private String contactFlowId;
private Map attributes = DefaultSdkAutoConstructMap.getInstance();
private ParticipantDetails participantDetails;
private ChatMessage initialMessage;
private String clientToken;
private Integer chatDurationInMinutes;
private List supportedMessagingContentTypes = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(StartChatContactRequest model) {
super(model);
instanceId(model.instanceId);
contactFlowId(model.contactFlowId);
attributes(model.attributes);
participantDetails(model.participantDetails);
initialMessage(model.initialMessage);
clientToken(model.clientToken);
chatDurationInMinutes(model.chatDurationInMinutes);
supportedMessagingContentTypes(model.supportedMessagingContentTypes);
}
public final String getInstanceId() {
return instanceId;
}
public final void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
@Override
public final Builder instanceId(String instanceId) {
this.instanceId = instanceId;
return this;
}
public final String getContactFlowId() {
return contactFlowId;
}
public final void setContactFlowId(String contactFlowId) {
this.contactFlowId = contactFlowId;
}
@Override
public final Builder contactFlowId(String contactFlowId) {
this.contactFlowId = contactFlowId;
return this;
}
public final Map getAttributes() {
if (attributes instanceof SdkAutoConstructMap) {
return null;
}
return attributes;
}
public final void setAttributes(Map attributes) {
this.attributes = AttributesCopier.copy(attributes);
}
@Override
public final Builder attributes(Map attributes) {
this.attributes = AttributesCopier.copy(attributes);
return this;
}
public final ParticipantDetails.Builder getParticipantDetails() {
return participantDetails != null ? participantDetails.toBuilder() : null;
}
public final void setParticipantDetails(ParticipantDetails.BuilderImpl participantDetails) {
this.participantDetails = participantDetails != null ? participantDetails.build() : null;
}
@Override
public final Builder participantDetails(ParticipantDetails participantDetails) {
this.participantDetails = participantDetails;
return this;
}
public final ChatMessage.Builder getInitialMessage() {
return initialMessage != null ? initialMessage.toBuilder() : null;
}
public final void setInitialMessage(ChatMessage.BuilderImpl initialMessage) {
this.initialMessage = initialMessage != null ? initialMessage.build() : null;
}
@Override
public final Builder initialMessage(ChatMessage initialMessage) {
this.initialMessage = initialMessage;
return this;
}
public final String getClientToken() {
return clientToken;
}
public final void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
@Override
public final Builder clientToken(String clientToken) {
this.clientToken = clientToken;
return this;
}
public final Integer getChatDurationInMinutes() {
return chatDurationInMinutes;
}
public final void setChatDurationInMinutes(Integer chatDurationInMinutes) {
this.chatDurationInMinutes = chatDurationInMinutes;
}
@Override
public final Builder chatDurationInMinutes(Integer chatDurationInMinutes) {
this.chatDurationInMinutes = chatDurationInMinutes;
return this;
}
public final Collection getSupportedMessagingContentTypes() {
if (supportedMessagingContentTypes instanceof SdkAutoConstructList) {
return null;
}
return supportedMessagingContentTypes;
}
public final void setSupportedMessagingContentTypes(Collection supportedMessagingContentTypes) {
this.supportedMessagingContentTypes = SupportedMessagingContentTypesCopier.copy(supportedMessagingContentTypes);
}
@Override
public final Builder supportedMessagingContentTypes(Collection supportedMessagingContentTypes) {
this.supportedMessagingContentTypes = SupportedMessagingContentTypesCopier.copy(supportedMessagingContentTypes);
return this;
}
@Override
@SafeVarargs
public final Builder supportedMessagingContentTypes(String... supportedMessagingContentTypes) {
supportedMessagingContentTypes(Arrays.asList(supportedMessagingContentTypes));
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 StartChatContactRequest build() {
return new StartChatContactRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}