All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.connectcampaigns.model.OutboundCallConfig Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Connect Campaigns module holds the client classes that are used for communicating with Connect Campaigns.

There is a newer version: 2.29.16
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((OutboundCallConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** * Sets the value of the ConnectContactFlowId property for this object. * * @param connectContactFlowId * The new value for the ConnectContactFlowId property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectContactFlowId(String connectContactFlowId); /** * Sets the value of the ConnectSourcePhoneNumber property for this object. * * @param connectSourcePhoneNumber * The new value for the ConnectSourcePhoneNumber property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectSourcePhoneNumber(String connectSourcePhoneNumber); /** * Sets the value of the ConnectQueueId property for this object. * * @param connectQueueId * The new value for the ConnectQueueId property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectQueueId(String connectQueueId); /** * Sets the value of the AnswerMachineDetectionConfig property for this object. * * @param answerMachineDetectionConfig * The new value for the AnswerMachineDetectionConfig property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder answerMachineDetectionConfig(AnswerMachineDetectionConfig answerMachineDetectionConfig); /** * Sets the value of the AnswerMachineDetectionConfig property for this object. * * 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()); } } static final class BuilderImpl implements Builder { private String connectContactFlowId; private String connectSourcePhoneNumber; private String connectQueueId; private AnswerMachineDetectionConfig answerMachineDetectionConfig; private BuilderImpl() { } private BuilderImpl(OutboundCallConfig model) { connectContactFlowId(model.connectContactFlowId); connectSourcePhoneNumber(model.connectSourcePhoneNumber); connectQueueId(model.connectQueueId); answerMachineDetectionConfig(model.answerMachineDetectionConfig); } public final String getConnectContactFlowId() { return connectContactFlowId; } public final void setConnectContactFlowId(String connectContactFlowId) { this.connectContactFlowId = connectContactFlowId; } @Override public final Builder connectContactFlowId(String connectContactFlowId) { this.connectContactFlowId = connectContactFlowId; return this; } public final String getConnectSourcePhoneNumber() { return connectSourcePhoneNumber; } public final void setConnectSourcePhoneNumber(String connectSourcePhoneNumber) { this.connectSourcePhoneNumber = connectSourcePhoneNumber; } @Override public final Builder connectSourcePhoneNumber(String connectSourcePhoneNumber) { this.connectSourcePhoneNumber = connectSourcePhoneNumber; return this; } public final String getConnectQueueId() { return connectQueueId; } public final void setConnectQueueId(String connectQueueId) { this.connectQueueId = connectQueueId; } @Override public final Builder connectQueueId(String connectQueueId) { this.connectQueueId = connectQueueId; 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; } @Override public OutboundCallConfig build() { return new OutboundCallConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy