attributes;
private final AnswerMachineDetectionConfig answerMachineDetectionConfig;
private final String campaignId;
private final String trafficType;
private StartOutboundVoiceContactRequest(BuilderImpl builder) {
super(builder);
this.destinationPhoneNumber = builder.destinationPhoneNumber;
this.contactFlowId = builder.contactFlowId;
this.instanceId = builder.instanceId;
this.clientToken = builder.clientToken;
this.sourcePhoneNumber = builder.sourcePhoneNumber;
this.queueId = builder.queueId;
this.attributes = builder.attributes;
this.answerMachineDetectionConfig = builder.answerMachineDetectionConfig;
this.campaignId = builder.campaignId;
this.trafficType = builder.trafficType;
}
/**
*
* The phone number of the customer, in E.164 format.
*
*
* @return The phone number of the customer, in E.164 format.
*/
public final String destinationPhoneNumber() {
return destinationPhoneNumber;
}
/**
*
* The identifier of the flow for the outbound call. 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 the outbound call. 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;
}
/**
*
* 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;
}
/**
*
* 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 . The token is valid for 7 days after creation. If a contact is already started, the contact
* ID is returned.
*
*
* @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 . The token is valid for 7 days after creation. If a contact is
* already started, the contact ID is returned.
*/
public final String clientToken() {
return clientToken;
}
/**
*
* The phone number associated with the Amazon Connect instance, in E.164 format. If you do not specify a source
* phone number, you must specify a queue.
*
*
* @return The phone number associated with the Amazon Connect instance, in E.164 format. If you do not specify a
* source phone number, you must specify a queue.
*/
public final String sourcePhoneNumber() {
return sourcePhoneNumber;
}
/**
*
* The queue for the call. If you specify a queue, the phone displayed for caller ID is the phone number specified
* in the queue. If you do not specify a queue, the queue defined in the flow is used. If you do not specify a
* queue, you must specify a source phone number.
*
*
* @return The queue for the call. If you specify a queue, the phone displayed for caller ID is the phone number
* specified in the queue. If you do not specify a queue, the queue defined in the flow is used. If you do
* not specify a queue, you must specify a source phone number.
*/
public final String queueId() {
return queueId;
}
/**
* 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;
}
/**
*
* Configuration of the answering machine detection for this outbound call.
*
*
* @return Configuration of the answering machine detection for this outbound call.
*/
public final AnswerMachineDetectionConfig answerMachineDetectionConfig() {
return answerMachineDetectionConfig;
}
/**
*
* The campaign identifier of the outbound communication.
*
*
* @return The campaign identifier of the outbound communication.
*/
public final String campaignId() {
return campaignId;
}
/**
*
* Denotes the class of traffic. Calls with different traffic types are handled differently by Amazon Connect. The
* default value is GENERAL
. Use CAMPAIGN
if EnableAnswerMachineDetection
is
* set to true
. For all other cases, use GENERAL
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #trafficType} will
* return {@link TrafficType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #trafficTypeAsString}.
*
*
* @return Denotes the class of traffic. Calls with different traffic types are handled differently by Amazon
* Connect. The default value is GENERAL
. Use CAMPAIGN
if
* EnableAnswerMachineDetection
is set to true
. For all other cases, use
* GENERAL
.
* @see TrafficType
*/
public final TrafficType trafficType() {
return TrafficType.fromValue(trafficType);
}
/**
*
* Denotes the class of traffic. Calls with different traffic types are handled differently by Amazon Connect. The
* default value is GENERAL
. Use CAMPAIGN
if EnableAnswerMachineDetection
is
* set to true
. For all other cases, use GENERAL
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #trafficType} will
* return {@link TrafficType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #trafficTypeAsString}.
*
*
* @return Denotes the class of traffic. Calls with different traffic types are handled differently by Amazon
* Connect. The default value is GENERAL
. Use CAMPAIGN
if
* EnableAnswerMachineDetection
is set to true
. For all other cases, use
* GENERAL
.
* @see TrafficType
*/
public final String trafficTypeAsString() {
return trafficType;
}
@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(destinationPhoneNumber());
hashCode = 31 * hashCode + Objects.hashCode(contactFlowId());
hashCode = 31 * hashCode + Objects.hashCode(instanceId());
hashCode = 31 * hashCode + Objects.hashCode(clientToken());
hashCode = 31 * hashCode + Objects.hashCode(sourcePhoneNumber());
hashCode = 31 * hashCode + Objects.hashCode(queueId());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributes() : null);
hashCode = 31 * hashCode + Objects.hashCode(answerMachineDetectionConfig());
hashCode = 31 * hashCode + Objects.hashCode(campaignId());
hashCode = 31 * hashCode + Objects.hashCode(trafficTypeAsString());
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 StartOutboundVoiceContactRequest)) {
return false;
}
StartOutboundVoiceContactRequest other = (StartOutboundVoiceContactRequest) obj;
return Objects.equals(destinationPhoneNumber(), other.destinationPhoneNumber())
&& Objects.equals(contactFlowId(), other.contactFlowId()) && Objects.equals(instanceId(), other.instanceId())
&& Objects.equals(clientToken(), other.clientToken())
&& Objects.equals(sourcePhoneNumber(), other.sourcePhoneNumber()) && Objects.equals(queueId(), other.queueId())
&& hasAttributes() == other.hasAttributes() && Objects.equals(attributes(), other.attributes())
&& Objects.equals(answerMachineDetectionConfig(), other.answerMachineDetectionConfig())
&& Objects.equals(campaignId(), other.campaignId())
&& Objects.equals(trafficTypeAsString(), other.trafficTypeAsString());
}
/**
* 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("StartOutboundVoiceContactRequest").add("DestinationPhoneNumber", destinationPhoneNumber())
.add("ContactFlowId", contactFlowId()).add("InstanceId", instanceId()).add("ClientToken", clientToken())
.add("SourcePhoneNumber", sourcePhoneNumber()).add("QueueId", queueId())
.add("Attributes", hasAttributes() ? attributes() : null)
.add("AnswerMachineDetectionConfig", answerMachineDetectionConfig()).add("CampaignId", campaignId())
.add("TrafficType", trafficTypeAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DestinationPhoneNumber":
return Optional.ofNullable(clazz.cast(destinationPhoneNumber()));
case "ContactFlowId":
return Optional.ofNullable(clazz.cast(contactFlowId()));
case "InstanceId":
return Optional.ofNullable(clazz.cast(instanceId()));
case "ClientToken":
return Optional.ofNullable(clazz.cast(clientToken()));
case "SourcePhoneNumber":
return Optional.ofNullable(clazz.cast(sourcePhoneNumber()));
case "QueueId":
return Optional.ofNullable(clazz.cast(queueId()));
case "Attributes":
return Optional.ofNullable(clazz.cast(attributes()));
case "AnswerMachineDetectionConfig":
return Optional.ofNullable(clazz.cast(answerMachineDetectionConfig()));
case "CampaignId":
return Optional.ofNullable(clazz.cast(campaignId()));
case "TrafficType":
return Optional.ofNullable(clazz.cast(trafficTypeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((StartOutboundVoiceContactRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ConnectRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The phone number of the customer, in E.164 format.
*
*
* @param destinationPhoneNumber
* The phone number of the customer, in E.164 format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder destinationPhoneNumber(String destinationPhoneNumber);
/**
*
* The identifier of the flow for the outbound call. 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 the outbound call. 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);
/**
*
* 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);
/**
*
* 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 . The token is valid for 7 days after creation. If a contact is already started, the
* contact ID is returned.
*
*
* @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 . The token is valid for 7 days after creation. If a contact is
* already started, the contact ID is returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder clientToken(String clientToken);
/**
*
* The phone number associated with the Amazon Connect instance, in E.164 format. If you do not specify a source
* phone number, you must specify a queue.
*
*
* @param sourcePhoneNumber
* The phone number associated with the Amazon Connect instance, in E.164 format. If you do not specify a
* source phone number, you must specify a queue.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sourcePhoneNumber(String sourcePhoneNumber);
/**
*
* The queue for the call. If you specify a queue, the phone displayed for caller ID is the phone number
* specified in the queue. If you do not specify a queue, the queue defined in the flow is used. If you do not
* specify a queue, you must specify a source phone number.
*
*
* @param queueId
* The queue for the call. If you specify a queue, the phone displayed for caller ID is the phone number
* specified in the queue. If you do not specify a queue, the queue defined in the flow is used. If you
* do not specify a queue, you must specify a source phone number.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queueId(String queueId);
/**
*
* 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);
/**
*
* Configuration of the answering machine detection for this outbound call.
*
*
* @param answerMachineDetectionConfig
* Configuration of the answering machine detection for this outbound call.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder answerMachineDetectionConfig(AnswerMachineDetectionConfig answerMachineDetectionConfig);
/**
*
* Configuration of the answering machine detection for this outbound call.
*
* This is a convenience method that creates an instance of the {@link AnswerMachineDetectionConfig.Builder}
* avoiding the need to create one manually via {@link AnswerMachineDetectionConfig#builder()}.
*
*
* When the {@link Consumer} completes, {@link AnswerMachineDetectionConfig.Builder#build()} is called
* immediately and its result is passed to {@link #answerMachineDetectionConfig(AnswerMachineDetectionConfig)}.
*
* @param answerMachineDetectionConfig
* a consumer that will call methods on {@link AnswerMachineDetectionConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #answerMachineDetectionConfig(AnswerMachineDetectionConfig)
*/
default Builder answerMachineDetectionConfig(Consumer answerMachineDetectionConfig) {
return answerMachineDetectionConfig(AnswerMachineDetectionConfig.builder()
.applyMutation(answerMachineDetectionConfig).build());
}
/**
*
* The campaign identifier of the outbound communication.
*
*
* @param campaignId
* The campaign identifier of the outbound communication.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder campaignId(String campaignId);
/**
*
* Denotes the class of traffic. Calls with different traffic types are handled differently by Amazon Connect.
* The default value is GENERAL
. Use CAMPAIGN
if
* EnableAnswerMachineDetection
is set to true
. For all other cases, use
* GENERAL
.
*
*
* @param trafficType
* Denotes the class of traffic. Calls with different traffic types are handled differently by Amazon
* Connect. The default value is GENERAL
. Use CAMPAIGN
if
* EnableAnswerMachineDetection
is set to true
. For all other cases, use
* GENERAL
.
* @see TrafficType
* @return Returns a reference to this object so that method calls can be chained together.
* @see TrafficType
*/
Builder trafficType(String trafficType);
/**
*
* Denotes the class of traffic. Calls with different traffic types are handled differently by Amazon Connect.
* The default value is GENERAL
. Use CAMPAIGN
if
* EnableAnswerMachineDetection
is set to true
. For all other cases, use
* GENERAL
.
*
*
* @param trafficType
* Denotes the class of traffic. Calls with different traffic types are handled differently by Amazon
* Connect. The default value is GENERAL
. Use CAMPAIGN
if
* EnableAnswerMachineDetection
is set to true
. For all other cases, use
* GENERAL
.
* @see TrafficType
* @return Returns a reference to this object so that method calls can be chained together.
* @see TrafficType
*/
Builder trafficType(TrafficType trafficType);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends ConnectRequest.BuilderImpl implements Builder {
private String destinationPhoneNumber;
private String contactFlowId;
private String instanceId;
private String clientToken;
private String sourcePhoneNumber;
private String queueId;
private Map attributes = DefaultSdkAutoConstructMap.getInstance();
private AnswerMachineDetectionConfig answerMachineDetectionConfig;
private String campaignId;
private String trafficType;
private BuilderImpl() {
}
private BuilderImpl(StartOutboundVoiceContactRequest model) {
super(model);
destinationPhoneNumber(model.destinationPhoneNumber);
contactFlowId(model.contactFlowId);
instanceId(model.instanceId);
clientToken(model.clientToken);
sourcePhoneNumber(model.sourcePhoneNumber);
queueId(model.queueId);
attributes(model.attributes);
answerMachineDetectionConfig(model.answerMachineDetectionConfig);
campaignId(model.campaignId);
trafficType(model.trafficType);
}
public final String getDestinationPhoneNumber() {
return destinationPhoneNumber;
}
public final void setDestinationPhoneNumber(String destinationPhoneNumber) {
this.destinationPhoneNumber = destinationPhoneNumber;
}
@Override
public final Builder destinationPhoneNumber(String destinationPhoneNumber) {
this.destinationPhoneNumber = destinationPhoneNumber;
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 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 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 String getSourcePhoneNumber() {
return sourcePhoneNumber;
}
public final void setSourcePhoneNumber(String sourcePhoneNumber) {
this.sourcePhoneNumber = sourcePhoneNumber;
}
@Override
public final Builder sourcePhoneNumber(String sourcePhoneNumber) {
this.sourcePhoneNumber = sourcePhoneNumber;
return this;
}
public final String getQueueId() {
return queueId;
}
public final void setQueueId(String queueId) {
this.queueId = queueId;
}
@Override
public final Builder queueId(String queueId) {
this.queueId = queueId;
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 AnswerMachineDetectionConfig.Builder getAnswerMachineDetectionConfig() {
return answerMachineDetectionConfig != null ? answerMachineDetectionConfig.toBuilder() : null;
}
public final void setAnswerMachineDetectionConfig(AnswerMachineDetectionConfig.BuilderImpl answerMachineDetectionConfig) {
this.answerMachineDetectionConfig = answerMachineDetectionConfig != null ? answerMachineDetectionConfig.build()
: null;
}
@Override
public final Builder answerMachineDetectionConfig(AnswerMachineDetectionConfig answerMachineDetectionConfig) {
this.answerMachineDetectionConfig = answerMachineDetectionConfig;
return this;
}
public final String getCampaignId() {
return campaignId;
}
public final void setCampaignId(String campaignId) {
this.campaignId = campaignId;
}
@Override
public final Builder campaignId(String campaignId) {
this.campaignId = campaignId;
return this;
}
public final String getTrafficType() {
return trafficType;
}
public final void setTrafficType(String trafficType) {
this.trafficType = trafficType;
}
@Override
public final Builder trafficType(String trafficType) {
this.trafficType = trafficType;
return this;
}
@Override
public final Builder trafficType(TrafficType trafficType) {
this.trafficType(trafficType == null ? null : trafficType.toString());
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 StartOutboundVoiceContactRequest build() {
return new StartOutboundVoiceContactRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}