references;
private final String description;
private final String clientToken;
private final Instant scheduledTime;
private final String taskTemplateId;
private final String quickConnectId;
private final String relatedContactId;
private StartTaskContactRequest(BuilderImpl builder) {
super(builder);
this.instanceId = builder.instanceId;
this.previousContactId = builder.previousContactId;
this.contactFlowId = builder.contactFlowId;
this.attributes = builder.attributes;
this.name = builder.name;
this.references = builder.references;
this.description = builder.description;
this.clientToken = builder.clientToken;
this.scheduledTime = builder.scheduledTime;
this.taskTemplateId = builder.taskTemplateId;
this.quickConnectId = builder.quickConnectId;
this.relatedContactId = builder.relatedContactId;
}
/**
*
* The identifier of the Amazon Connect instance. You can find the instance ID in
* the Amazon Resource Name (ARN) of the instance.
*
*
* @return The identifier of the Amazon Connect instance. You can find the instance
* ID in the Amazon Resource Name (ARN) of the instance.
*/
public final String instanceId() {
return instanceId;
}
/**
*
* The identifier of the previous chat, voice, or task contact. Any updates to user-defined attributes to task
* contacts linked using the same PreviousContactID
will affect every contact in the chain. There can
* be a maximum of 12 linked task contacts in a chain.
*
*
* @return The identifier of the previous chat, voice, or task contact. Any updates to user-defined attributes to
* task contacts linked using the same PreviousContactID
will affect every contact in the
* chain. There can be a maximum of 12 linked task contacts in a chain.
*/
public final String previousContactId() {
return previousContactId;
}
/**
*
* The identifier of the flow for initiating the tasks. To see the ContactFlowId in the Amazon Connect admin
* website, 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 tasks. To see the ContactFlowId in the Amazon Connect admin
* website, 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, and 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,
* and 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;
}
/**
*
* The name of a task that is shown to an agent in the Contact Control Panel (CCP).
*
*
* @return The name of a task that is shown to an agent in the Contact Control Panel (CCP).
*/
public final String name() {
return name;
}
/**
* For responses, this returns true if the service returned a value for the References 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 hasReferences() {
return references != null && !(references instanceof SdkAutoConstructMap);
}
/**
*
* A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the following
* reference types at the time of creation: URL
| NUMBER
| STRING
|
* DATE
| EMAIL
. ATTACHMENT
is not a supported reference type during task
* creation.
*
*
* 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 #hasReferences} method.
*
*
* @return A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the
* following reference types at the time of creation: URL
| NUMBER
|
* STRING
| DATE
| EMAIL
. ATTACHMENT
is not a supported
* reference type during task creation.
*/
public final Map references() {
return references;
}
/**
*
* A description of the task that is shown to an agent in the Contact Control Panel (CCP).
*
*
* @return A description of the task that is shown to an agent in the Contact Control Panel (CCP).
*/
public final String description() {
return description;
}
/**
*
* 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 timestamp, in Unix Epoch seconds format, at which to start running the inbound flow. The scheduled time
* cannot be in the past. It must be within up to 6 days in future.
*
*
* @return The timestamp, in Unix Epoch seconds format, at which to start running the inbound flow. The scheduled
* time cannot be in the past. It must be within up to 6 days in future.
*/
public final Instant scheduledTime() {
return scheduledTime;
}
/**
*
* A unique identifier for the task template. For more information about task templates, see Create task templates in the
* Amazon Connect Administrator Guide .
*
*
* @return A unique identifier for the task template. For more information about task templates, see Create task
* templates in the Amazon Connect Administrator Guide .
*/
public final String taskTemplateId() {
return taskTemplateId;
}
/**
*
* The identifier for the quick connect. Tasks that are created by using QuickConnectId
will use the
* flow that is defined on agent or queue quick connect. For more information about quick connects, see Create quick connects .
*
*
* @return The identifier for the quick connect. Tasks that are created by using QuickConnectId
will
* use the flow that is defined on agent or queue quick connect. For more information about quick connects,
* see Create quick
* connects .
*/
public final String quickConnectId() {
return quickConnectId;
}
/**
*
* The contactId that is related to this contact.
* Linking tasks together by using RelatedContactID
copies over contact attributes from the related
* task contact to the new task contact. All updates to user-defined attributes in the new task contact are limited
* to the individual contact ID, unlike what happens when tasks are linked by using PreviousContactID
.
* There are no limits to the number of contacts that can be linked by using RelatedContactId
.
*
*
* @return The contactId that is related to this
* contact. Linking tasks together by using RelatedContactID
copies over contact attributes
* from the related task contact to the new task contact. All updates to user-defined attributes in the new
* task contact are limited to the individual contact ID, unlike what happens when tasks are linked by using
* PreviousContactID
. There are no limits to the number of contacts that can be linked by using
* RelatedContactId
.
*/
public final String relatedContactId() {
return relatedContactId;
}
@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(previousContactId());
hashCode = 31 * hashCode + Objects.hashCode(contactFlowId());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributes() : null);
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(hasReferences() ? references() : null);
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(clientToken());
hashCode = 31 * hashCode + Objects.hashCode(scheduledTime());
hashCode = 31 * hashCode + Objects.hashCode(taskTemplateId());
hashCode = 31 * hashCode + Objects.hashCode(quickConnectId());
hashCode = 31 * hashCode + Objects.hashCode(relatedContactId());
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 StartTaskContactRequest)) {
return false;
}
StartTaskContactRequest other = (StartTaskContactRequest) obj;
return Objects.equals(instanceId(), other.instanceId()) && Objects.equals(previousContactId(), other.previousContactId())
&& Objects.equals(contactFlowId(), other.contactFlowId()) && hasAttributes() == other.hasAttributes()
&& Objects.equals(attributes(), other.attributes()) && Objects.equals(name(), other.name())
&& hasReferences() == other.hasReferences() && Objects.equals(references(), other.references())
&& Objects.equals(description(), other.description()) && Objects.equals(clientToken(), other.clientToken())
&& Objects.equals(scheduledTime(), other.scheduledTime())
&& Objects.equals(taskTemplateId(), other.taskTemplateId())
&& Objects.equals(quickConnectId(), other.quickConnectId())
&& Objects.equals(relatedContactId(), other.relatedContactId());
}
/**
* 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("StartTaskContactRequest").add("InstanceId", instanceId())
.add("PreviousContactId", previousContactId()).add("ContactFlowId", contactFlowId())
.add("Attributes", hasAttributes() ? attributes() : null).add("Name", name())
.add("References", hasReferences() ? references() : null).add("Description", description())
.add("ClientToken", clientToken()).add("ScheduledTime", scheduledTime()).add("TaskTemplateId", taskTemplateId())
.add("QuickConnectId", quickConnectId()).add("RelatedContactId", relatedContactId()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "InstanceId":
return Optional.ofNullable(clazz.cast(instanceId()));
case "PreviousContactId":
return Optional.ofNullable(clazz.cast(previousContactId()));
case "ContactFlowId":
return Optional.ofNullable(clazz.cast(contactFlowId()));
case "Attributes":
return Optional.ofNullable(clazz.cast(attributes()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "References":
return Optional.ofNullable(clazz.cast(references()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "ClientToken":
return Optional.ofNullable(clazz.cast(clientToken()));
case "ScheduledTime":
return Optional.ofNullable(clazz.cast(scheduledTime()));
case "TaskTemplateId":
return Optional.ofNullable(clazz.cast(taskTemplateId()));
case "QuickConnectId":
return Optional.ofNullable(clazz.cast(quickConnectId()));
case "RelatedContactId":
return Optional.ofNullable(clazz.cast(relatedContactId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((StartTaskContactRequest) 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 instance ID
* in the Amazon Resource Name (ARN) of the instance.
*
*
* @param instanceId
* The identifier of the Amazon Connect instance. You can find the instance
* ID in the Amazon Resource Name (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 previous chat, voice, or task contact. Any updates to user-defined attributes to task
* contacts linked using the same PreviousContactID
will affect every contact in the chain. There
* can be a maximum of 12 linked task contacts in a chain.
*
*
* @param previousContactId
* The identifier of the previous chat, voice, or task contact. Any updates to user-defined attributes to
* task contacts linked using the same PreviousContactID
will affect every contact in the
* chain. There can be a maximum of 12 linked task contacts in a chain.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder previousContactId(String previousContactId);
/**
*
* The identifier of the flow for initiating the tasks. To see the ContactFlowId in the Amazon Connect admin
* website, 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 tasks. To see the ContactFlowId in the Amazon Connect
* admin website, 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, and
* 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,
* and 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);
/**
*
* The name of a task that is shown to an agent in the Contact Control Panel (CCP).
*
*
* @param name
* The name of a task that is shown to an agent in the Contact Control Panel (CCP).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the following
* reference types at the time of creation: URL
| NUMBER
| STRING
|
* DATE
| EMAIL
. ATTACHMENT
is not a supported reference type during task
* creation.
*
*
* @param references
* A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the
* following reference types at the time of creation: URL
| NUMBER
|
* STRING
| DATE
| EMAIL
. ATTACHMENT
is not a
* supported reference type during task creation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder references(Map references);
/**
*
* A description of the task that is shown to an agent in the Contact Control Panel (CCP).
*
*
* @param description
* A description of the task that is shown to an agent in the Contact Control Panel (CCP).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* 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 timestamp, in Unix Epoch seconds format, at which to start running the inbound flow. The scheduled time
* cannot be in the past. It must be within up to 6 days in future.
*
*
* @param scheduledTime
* The timestamp, in Unix Epoch seconds format, at which to start running the inbound flow. The scheduled
* time cannot be in the past. It must be within up to 6 days in future.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder scheduledTime(Instant scheduledTime);
/**
*
* A unique identifier for the task template. For more information about task templates, see Create task templates in
* the Amazon Connect Administrator Guide .
*
*
* @param taskTemplateId
* A unique identifier for the task template. For more information about task templates, see Create task
* templates in the Amazon Connect Administrator Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder taskTemplateId(String taskTemplateId);
/**
*
* The identifier for the quick connect. Tasks that are created by using QuickConnectId
will use
* the flow that is defined on agent or queue quick connect. For more information about quick connects, see Create quick connects .
*
*
* @param quickConnectId
* The identifier for the quick connect. Tasks that are created by using QuickConnectId
will
* use the flow that is defined on agent or queue quick connect. For more information about quick
* connects, see Create quick
* connects .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder quickConnectId(String quickConnectId);
/**
*
* The contactId that is related to this
* contact. Linking tasks together by using RelatedContactID
copies over contact attributes from
* the related task contact to the new task contact. All updates to user-defined attributes in the new task
* contact are limited to the individual contact ID, unlike what happens when tasks are linked by using
* PreviousContactID
. There are no limits to the number of contacts that can be linked by using
* RelatedContactId
.
*
*
* @param relatedContactId
* The contactId that is related to
* this contact. Linking tasks together by using RelatedContactID
copies over contact
* attributes from the related task contact to the new task contact. All updates to user-defined
* attributes in the new task contact are limited to the individual contact ID, unlike what happens when
* tasks are linked by using PreviousContactID
. There are no limits to the number of
* contacts that can be linked by using RelatedContactId
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder relatedContactId(String relatedContactId);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends ConnectRequest.BuilderImpl implements Builder {
private String instanceId;
private String previousContactId;
private String contactFlowId;
private Map attributes = DefaultSdkAutoConstructMap.getInstance();
private String name;
private Map references = DefaultSdkAutoConstructMap.getInstance();
private String description;
private String clientToken;
private Instant scheduledTime;
private String taskTemplateId;
private String quickConnectId;
private String relatedContactId;
private BuilderImpl() {
}
private BuilderImpl(StartTaskContactRequest model) {
super(model);
instanceId(model.instanceId);
previousContactId(model.previousContactId);
contactFlowId(model.contactFlowId);
attributes(model.attributes);
name(model.name);
references(model.references);
description(model.description);
clientToken(model.clientToken);
scheduledTime(model.scheduledTime);
taskTemplateId(model.taskTemplateId);
quickConnectId(model.quickConnectId);
relatedContactId(model.relatedContactId);
}
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 getPreviousContactId() {
return previousContactId;
}
public final void setPreviousContactId(String previousContactId) {
this.previousContactId = previousContactId;
}
@Override
public final Builder previousContactId(String previousContactId) {
this.previousContactId = previousContactId;
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 String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final Map getReferences() {
Map result = ContactReferencesCopier.copyToBuilder(this.references);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setReferences(Map references) {
this.references = ContactReferencesCopier.copyFromBuilder(references);
}
@Override
public final Builder references(Map references) {
this.references = ContactReferencesCopier.copy(references);
return this;
}
public final String getDescription() {
return description;
}
public final void setDescription(String description) {
this.description = description;
}
@Override
public final Builder description(String description) {
this.description = description;
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 Instant getScheduledTime() {
return scheduledTime;
}
public final void setScheduledTime(Instant scheduledTime) {
this.scheduledTime = scheduledTime;
}
@Override
public final Builder scheduledTime(Instant scheduledTime) {
this.scheduledTime = scheduledTime;
return this;
}
public final String getTaskTemplateId() {
return taskTemplateId;
}
public final void setTaskTemplateId(String taskTemplateId) {
this.taskTemplateId = taskTemplateId;
}
@Override
public final Builder taskTemplateId(String taskTemplateId) {
this.taskTemplateId = taskTemplateId;
return this;
}
public final String getQuickConnectId() {
return quickConnectId;
}
public final void setQuickConnectId(String quickConnectId) {
this.quickConnectId = quickConnectId;
}
@Override
public final Builder quickConnectId(String quickConnectId) {
this.quickConnectId = quickConnectId;
return this;
}
public final String getRelatedContactId() {
return relatedContactId;
}
public final void setRelatedContactId(String relatedContactId) {
this.relatedContactId = relatedContactId;
}
@Override
public final Builder relatedContactId(String relatedContactId) {
this.relatedContactId = relatedContactId;
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 StartTaskContactRequest build() {
return new StartTaskContactRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}