software.amazon.awssdk.services.connect.model.MediaConcurrency Maven / Gradle / Ivy
Show all versions of connect Show documentation
/*
* 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.connect.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;
/**
*
* Contains information about which channels are supported, and how many contacts an agent can have on a channel
* simultaneously.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class MediaConcurrency implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CHANNEL_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Channel")
.getter(getter(MediaConcurrency::channelAsString)).setter(setter(Builder::channel))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Channel").build()).build();
private static final SdkField CONCURRENCY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Concurrency").getter(getter(MediaConcurrency::concurrency)).setter(setter(Builder::concurrency))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Concurrency").build()).build();
private static final SdkField CROSS_CHANNEL_BEHAVIOR_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CrossChannelBehavior")
.getter(getter(MediaConcurrency::crossChannelBehavior)).setter(setter(Builder::crossChannelBehavior))
.constructor(CrossChannelBehavior::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrossChannelBehavior").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CHANNEL_FIELD,
CONCURRENCY_FIELD, CROSS_CHANNEL_BEHAVIOR_FIELD));
private static final long serialVersionUID = 1L;
private final String channel;
private final Integer concurrency;
private final CrossChannelBehavior crossChannelBehavior;
private MediaConcurrency(BuilderImpl builder) {
this.channel = builder.channel;
this.concurrency = builder.concurrency;
this.crossChannelBehavior = builder.crossChannelBehavior;
}
/**
*
* The channels that agents can handle in the Contact Control Panel (CCP).
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #channel} will
* return {@link Channel#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #channelAsString}.
*
*
* @return The channels that agents can handle in the Contact Control Panel (CCP).
* @see Channel
*/
public final Channel channel() {
return Channel.fromValue(channel);
}
/**
*
* The channels that agents can handle in the Contact Control Panel (CCP).
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #channel} will
* return {@link Channel#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #channelAsString}.
*
*
* @return The channels that agents can handle in the Contact Control Panel (CCP).
* @see Channel
*/
public final String channelAsString() {
return channel;
}
/**
*
* The number of contacts an agent can have on a channel simultaneously.
*
*
* Valid Range for VOICE
: Minimum value of 1. Maximum value of 1.
*
*
* Valid Range for CHAT
: Minimum value of 1. Maximum value of 10.
*
*
* Valid Range for TASK
: Minimum value of 1. Maximum value of 10.
*
*
* @return The number of contacts an agent can have on a channel simultaneously.
*
* Valid Range for VOICE
: Minimum value of 1. Maximum value of 1.
*
*
* Valid Range for CHAT
: Minimum value of 1. Maximum value of 10.
*
*
* Valid Range for TASK
: Minimum value of 1. Maximum value of 10.
*/
public final Integer concurrency() {
return concurrency;
}
/**
*
* Defines the cross-channel routing behavior for each channel that is enabled for this Routing Profile. For
* example, this allows you to offer an agent a different contact from another channel when they are currently
* working with a contact from a Voice channel.
*
*
* @return Defines the cross-channel routing behavior for each channel that is enabled for this Routing Profile. For
* example, this allows you to offer an agent a different contact from another channel when they are
* currently working with a contact from a Voice channel.
*/
public final CrossChannelBehavior crossChannelBehavior() {
return crossChannelBehavior;
}
@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(channelAsString());
hashCode = 31 * hashCode + Objects.hashCode(concurrency());
hashCode = 31 * hashCode + Objects.hashCode(crossChannelBehavior());
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 MediaConcurrency)) {
return false;
}
MediaConcurrency other = (MediaConcurrency) obj;
return Objects.equals(channelAsString(), other.channelAsString()) && Objects.equals(concurrency(), other.concurrency())
&& Objects.equals(crossChannelBehavior(), other.crossChannelBehavior());
}
/**
* 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("MediaConcurrency").add("Channel", channelAsString()).add("Concurrency", concurrency())
.add("CrossChannelBehavior", crossChannelBehavior()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Channel":
return Optional.ofNullable(clazz.cast(channelAsString()));
case "Concurrency":
return Optional.ofNullable(clazz.cast(concurrency()));
case "CrossChannelBehavior":
return Optional.ofNullable(clazz.cast(crossChannelBehavior()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function