software.amazon.awssdk.services.connectcampaigns.model.OutboundCallConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of connectcampaigns Show documentation
Show all versions of connectcampaigns Show documentation
The AWS Java SDK for Connect Campaigns module holds the client classes that are used for
communicating with Connect Campaigns.
/*
* 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.connectcampaigns.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The configuration used for outbound calls.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OutboundCallConfig implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CONNECT_CONTACT_FLOW_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("connectContactFlowId").getter(getter(OutboundCallConfig::connectContactFlowId))
.setter(setter(Builder::connectContactFlowId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectContactFlowId").build())
.build();
private static final SdkField CONNECT_SOURCE_PHONE_NUMBER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("connectSourcePhoneNumber").getter(getter(OutboundCallConfig::connectSourcePhoneNumber))
.setter(setter(Builder::connectSourcePhoneNumber))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectSourcePhoneNumber").build())
.build();
private static final SdkField CONNECT_QUEUE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("connectQueueId").getter(getter(OutboundCallConfig::connectQueueId))
.setter(setter(Builder::connectQueueId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectQueueId").build()).build();
private static final SdkField ANSWER_MACHINE_DETECTION_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("answerMachineDetectionConfig")
.getter(getter(OutboundCallConfig::answerMachineDetectionConfig))
.setter(setter(Builder::answerMachineDetectionConfig))
.constructor(AnswerMachineDetectionConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("answerMachineDetectionConfig")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONNECT_CONTACT_FLOW_ID_FIELD,
CONNECT_SOURCE_PHONE_NUMBER_FIELD, CONNECT_QUEUE_ID_FIELD, ANSWER_MACHINE_DETECTION_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final String connectContactFlowId;
private final String connectSourcePhoneNumber;
private final String connectQueueId;
private final AnswerMachineDetectionConfig answerMachineDetectionConfig;
private OutboundCallConfig(BuilderImpl builder) {
this.connectContactFlowId = builder.connectContactFlowId;
this.connectSourcePhoneNumber = builder.connectSourcePhoneNumber;
this.connectQueueId = builder.connectQueueId;
this.answerMachineDetectionConfig = builder.answerMachineDetectionConfig;
}
/**
* Returns the value of the ConnectContactFlowId property for this object.
*
* @return The value of the ConnectContactFlowId property for this object.
*/
public final String connectContactFlowId() {
return connectContactFlowId;
}
/**
* Returns the value of the ConnectSourcePhoneNumber property for this object.
*
* @return The value of the ConnectSourcePhoneNumber property for this object.
*/
public final String connectSourcePhoneNumber() {
return connectSourcePhoneNumber;
}
/**
* Returns the value of the ConnectQueueId property for this object.
*
* @return The value of the ConnectQueueId property for this object.
*/
public final String connectQueueId() {
return connectQueueId;
}
/**
* Returns the value of the AnswerMachineDetectionConfig property for this object.
*
* @return The value of the AnswerMachineDetectionConfig property for this object.
*/
public final AnswerMachineDetectionConfig answerMachineDetectionConfig() {
return answerMachineDetectionConfig;
}
@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 + Objects.hashCode(connectContactFlowId());
hashCode = 31 * hashCode + Objects.hashCode(connectSourcePhoneNumber());
hashCode = 31 * hashCode + Objects.hashCode(connectQueueId());
hashCode = 31 * hashCode + Objects.hashCode(answerMachineDetectionConfig());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OutboundCallConfig)) {
return false;
}
OutboundCallConfig other = (OutboundCallConfig) obj;
return Objects.equals(connectContactFlowId(), other.connectContactFlowId())
&& Objects.equals(connectSourcePhoneNumber(), other.connectSourcePhoneNumber())
&& Objects.equals(connectQueueId(), other.connectQueueId())
&& Objects.equals(answerMachineDetectionConfig(), other.answerMachineDetectionConfig());
}
/**
* 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("OutboundCallConfig").add("ConnectContactFlowId", connectContactFlowId())
.add("ConnectSourcePhoneNumber", connectSourcePhoneNumber()).add("ConnectQueueId", connectQueueId())
.add("AnswerMachineDetectionConfig", answerMachineDetectionConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "connectContactFlowId":
return Optional.ofNullable(clazz.cast(connectContactFlowId()));
case "connectSourcePhoneNumber":
return Optional.ofNullable(clazz.cast(connectSourcePhoneNumber()));
case "connectQueueId":
return Optional.ofNullable(clazz.cast(connectQueueId()));
case "answerMachineDetectionConfig":
return Optional.ofNullable(clazz.cast(answerMachineDetectionConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function