Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.connect.model.UserData Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Connect module holds the client classes that are used for
communicating with Connect.
/*
* 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.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Data for a user.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class UserData implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField USER_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("User").getter(getter(UserData::user)).setter(setter(Builder::user)).constructor(UserReference::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("User").build()).build();
private static final SdkField ROUTING_PROFILE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RoutingProfile")
.getter(getter(UserData::routingProfile)).setter(setter(Builder::routingProfile))
.constructor(RoutingProfileReference::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoutingProfile").build()).build();
private static final SdkField HIERARCHY_PATH_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("HierarchyPath")
.getter(getter(UserData::hierarchyPath)).setter(setter(Builder::hierarchyPath))
.constructor(HierarchyPathReference::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HierarchyPath").build()).build();
private static final SdkField STATUS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Status").getter(getter(UserData::status))
.setter(setter(Builder::status)).constructor(AgentStatusReference::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField> AVAILABLE_SLOTS_BY_CHANNEL_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("AvailableSlotsByChannel")
.getter(getter(UserData::availableSlotsByChannelAsStrings))
.setter(setter(Builder::availableSlotsByChannelWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailableSlotsByChannel").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField> MAX_SLOTS_BY_CHANNEL_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("MaxSlotsByChannel")
.getter(getter(UserData::maxSlotsByChannelAsStrings))
.setter(setter(Builder::maxSlotsByChannelWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxSlotsByChannel").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField> ACTIVE_SLOTS_BY_CHANNEL_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("ActiveSlotsByChannel")
.getter(getter(UserData::activeSlotsByChannelAsStrings))
.setter(setter(Builder::activeSlotsByChannelWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActiveSlotsByChannel").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField> CONTACTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Contacts")
.getter(getter(UserData::contacts))
.setter(setter(Builder::contacts))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Contacts").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AgentContactReference::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField NEXT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextStatus").getter(getter(UserData::nextStatus)).setter(setter(Builder::nextStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextStatus").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(USER_FIELD,
ROUTING_PROFILE_FIELD, HIERARCHY_PATH_FIELD, STATUS_FIELD, AVAILABLE_SLOTS_BY_CHANNEL_FIELD,
MAX_SLOTS_BY_CHANNEL_FIELD, ACTIVE_SLOTS_BY_CHANNEL_FIELD, CONTACTS_FIELD, NEXT_STATUS_FIELD));
private static final long serialVersionUID = 1L;
private final UserReference user;
private final RoutingProfileReference routingProfile;
private final HierarchyPathReference hierarchyPath;
private final AgentStatusReference status;
private final Map availableSlotsByChannel;
private final Map maxSlotsByChannel;
private final Map activeSlotsByChannel;
private final List contacts;
private final String nextStatus;
private UserData(BuilderImpl builder) {
this.user = builder.user;
this.routingProfile = builder.routingProfile;
this.hierarchyPath = builder.hierarchyPath;
this.status = builder.status;
this.availableSlotsByChannel = builder.availableSlotsByChannel;
this.maxSlotsByChannel = builder.maxSlotsByChannel;
this.activeSlotsByChannel = builder.activeSlotsByChannel;
this.contacts = builder.contacts;
this.nextStatus = builder.nextStatus;
}
/**
*
* Information about the user for the data that is returned. It contains the resourceId
and ARN of the
* user.
*
*
* @return Information about the user for the data that is returned. It contains the resourceId
and ARN
* of the user.
*/
public final UserReference user() {
return user;
}
/**
*
* Information about the routing profile that is assigned to the user.
*
*
* @return Information about the routing profile that is assigned to the user.
*/
public final RoutingProfileReference routingProfile() {
return routingProfile;
}
/**
*
* Contains information about the levels of a hierarchy group assigned to a user.
*
*
* @return Contains information about the levels of a hierarchy group assigned to a user.
*/
public final HierarchyPathReference hierarchyPath() {
return hierarchyPath;
}
/**
*
* The status of the agent that they manually set in their Contact Control Panel (CCP), or that the supervisor
* manually changes in the real-time metrics report.
*
*
* @return The status of the agent that they manually set in their Contact Control Panel (CCP), or that the
* supervisor manually changes in the real-time metrics report.
*/
public final AgentStatusReference status() {
return status;
}
/**
*
* A map of available slots by channel. The key is a channel name. The value is an integer: the available number of
* slots.
*
*
* 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 #hasAvailableSlotsByChannel} method.
*
*
* @return A map of available slots by channel. The key is a channel name. The value is an integer: the available
* number of slots.
*/
public final Map availableSlotsByChannel() {
return ChannelToCountMapCopier.copyStringToEnum(availableSlotsByChannel);
}
/**
* For responses, this returns true if the service returned a value for the AvailableSlotsByChannel 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 hasAvailableSlotsByChannel() {
return availableSlotsByChannel != null && !(availableSlotsByChannel instanceof SdkAutoConstructMap);
}
/**
*
* A map of available slots by channel. The key is a channel name. The value is an integer: the available number of
* slots.
*
*
* 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 #hasAvailableSlotsByChannel} method.
*
*
* @return A map of available slots by channel. The key is a channel name. The value is an integer: the available
* number of slots.
*/
public final Map availableSlotsByChannelAsStrings() {
return availableSlotsByChannel;
}
/**
*
* A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum number of
* slots. This is calculated from MediaConcurrency of
* the RoutingProfile
assigned to the agent.
*
*
* 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 #hasMaxSlotsByChannel} method.
*
*
* @return A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum number
* of slots. This is calculated from MediaConcurrency of the RoutingProfile
assigned to the agent.
*/
public final Map maxSlotsByChannel() {
return ChannelToCountMapCopier.copyStringToEnum(maxSlotsByChannel);
}
/**
* For responses, this returns true if the service returned a value for the MaxSlotsByChannel 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 hasMaxSlotsByChannel() {
return maxSlotsByChannel != null && !(maxSlotsByChannel instanceof SdkAutoConstructMap);
}
/**
*
* A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum number of
* slots. This is calculated from MediaConcurrency of
* the RoutingProfile
assigned to the agent.
*
*
* 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 #hasMaxSlotsByChannel} method.
*
*
* @return A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum number
* of slots. This is calculated from MediaConcurrency of the RoutingProfile
assigned to the agent.
*/
public final Map maxSlotsByChannelAsStrings() {
return maxSlotsByChannel;
}
/**
*
* A map of active slots by channel. The key is a channel name. The value is an integer: the number of active slots.
*
*
* 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 #hasActiveSlotsByChannel} method.
*
*
* @return A map of active slots by channel. The key is a channel name. The value is an integer: the number of
* active slots.
*/
public final Map activeSlotsByChannel() {
return ChannelToCountMapCopier.copyStringToEnum(activeSlotsByChannel);
}
/**
* For responses, this returns true if the service returned a value for the ActiveSlotsByChannel 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 hasActiveSlotsByChannel() {
return activeSlotsByChannel != null && !(activeSlotsByChannel instanceof SdkAutoConstructMap);
}
/**
*
* A map of active slots by channel. The key is a channel name. The value is an integer: the number of active slots.
*
*
* 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 #hasActiveSlotsByChannel} method.
*
*
* @return A map of active slots by channel. The key is a channel name. The value is an integer: the number of
* active slots.
*/
public final Map activeSlotsByChannelAsStrings() {
return activeSlotsByChannel;
}
/**
* For responses, this returns true if the service returned a value for the Contacts 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 hasContacts() {
return contacts != null && !(contacts instanceof SdkAutoConstructList);
}
/**
*
* A list of contact reference information.
*
*
* 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 #hasContacts} method.
*
*
* @return A list of contact reference information.
*/
public final List contacts() {
return contacts;
}
/**
*
* The Next status of the agent.
*
*
* @return The Next status of the agent.
*/
public final String nextStatus() {
return nextStatus;
}
@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(user());
hashCode = 31 * hashCode + Objects.hashCode(routingProfile());
hashCode = 31 * hashCode + Objects.hashCode(hierarchyPath());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(hasAvailableSlotsByChannel() ? availableSlotsByChannelAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMaxSlotsByChannel() ? maxSlotsByChannelAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasActiveSlotsByChannel() ? activeSlotsByChannelAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasContacts() ? contacts() : null);
hashCode = 31 * hashCode + Objects.hashCode(nextStatus());
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 UserData)) {
return false;
}
UserData other = (UserData) obj;
return Objects.equals(user(), other.user()) && Objects.equals(routingProfile(), other.routingProfile())
&& Objects.equals(hierarchyPath(), other.hierarchyPath()) && Objects.equals(status(), other.status())
&& hasAvailableSlotsByChannel() == other.hasAvailableSlotsByChannel()
&& Objects.equals(availableSlotsByChannelAsStrings(), other.availableSlotsByChannelAsStrings())
&& hasMaxSlotsByChannel() == other.hasMaxSlotsByChannel()
&& Objects.equals(maxSlotsByChannelAsStrings(), other.maxSlotsByChannelAsStrings())
&& hasActiveSlotsByChannel() == other.hasActiveSlotsByChannel()
&& Objects.equals(activeSlotsByChannelAsStrings(), other.activeSlotsByChannelAsStrings())
&& hasContacts() == other.hasContacts() && Objects.equals(contacts(), other.contacts())
&& Objects.equals(nextStatus(), other.nextStatus());
}
/**
* 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("UserData").add("User", user()).add("RoutingProfile", routingProfile())
.add("HierarchyPath", hierarchyPath()).add("Status", status())
.add("AvailableSlotsByChannel", hasAvailableSlotsByChannel() ? availableSlotsByChannelAsStrings() : null)
.add("MaxSlotsByChannel", hasMaxSlotsByChannel() ? maxSlotsByChannelAsStrings() : null)
.add("ActiveSlotsByChannel", hasActiveSlotsByChannel() ? activeSlotsByChannelAsStrings() : null)
.add("Contacts", hasContacts() ? contacts() : null).add("NextStatus", nextStatus()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "User":
return Optional.ofNullable(clazz.cast(user()));
case "RoutingProfile":
return Optional.ofNullable(clazz.cast(routingProfile()));
case "HierarchyPath":
return Optional.ofNullable(clazz.cast(hierarchyPath()));
case "Status":
return Optional.ofNullable(clazz.cast(status()));
case "AvailableSlotsByChannel":
return Optional.ofNullable(clazz.cast(availableSlotsByChannelAsStrings()));
case "MaxSlotsByChannel":
return Optional.ofNullable(clazz.cast(maxSlotsByChannelAsStrings()));
case "ActiveSlotsByChannel":
return Optional.ofNullable(clazz.cast(activeSlotsByChannelAsStrings()));
case "Contacts":
return Optional.ofNullable(clazz.cast(contacts()));
case "NextStatus":
return Optional.ofNullable(clazz.cast(nextStatus()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((UserData) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* Information about the user for the data that is returned. It contains the resourceId
and ARN of
* the user.
*
*
* @param user
* Information about the user for the data that is returned. It contains the resourceId
and
* ARN of the user.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder user(UserReference user);
/**
*
* Information about the user for the data that is returned. It contains the resourceId
and ARN of
* the user.
*
* This is a convenience method that creates an instance of the {@link UserReference.Builder} avoiding the need
* to create one manually via {@link UserReference#builder()}.
*
*
* When the {@link Consumer} completes, {@link UserReference.Builder#build()} is called immediately and its
* result is passed to {@link #user(UserReference)}.
*
* @param user
* a consumer that will call methods on {@link UserReference.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #user(UserReference)
*/
default Builder user(Consumer user) {
return user(UserReference.builder().applyMutation(user).build());
}
/**
*
* Information about the routing profile that is assigned to the user.
*
*
* @param routingProfile
* Information about the routing profile that is assigned to the user.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder routingProfile(RoutingProfileReference routingProfile);
/**
*
* Information about the routing profile that is assigned to the user.
*
* This is a convenience method that creates an instance of the {@link RoutingProfileReference.Builder} avoiding
* the need to create one manually via {@link RoutingProfileReference#builder()}.
*
*
* When the {@link Consumer} completes, {@link RoutingProfileReference.Builder#build()} is called immediately
* and its result is passed to {@link #routingProfile(RoutingProfileReference)}.
*
* @param routingProfile
* a consumer that will call methods on {@link RoutingProfileReference.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #routingProfile(RoutingProfileReference)
*/
default Builder routingProfile(Consumer routingProfile) {
return routingProfile(RoutingProfileReference.builder().applyMutation(routingProfile).build());
}
/**
*
* Contains information about the levels of a hierarchy group assigned to a user.
*
*
* @param hierarchyPath
* Contains information about the levels of a hierarchy group assigned to a user.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder hierarchyPath(HierarchyPathReference hierarchyPath);
/**
*
* Contains information about the levels of a hierarchy group assigned to a user.
*
* This is a convenience method that creates an instance of the {@link HierarchyPathReference.Builder} avoiding
* the need to create one manually via {@link HierarchyPathReference#builder()}.
*
*
* When the {@link Consumer} completes, {@link HierarchyPathReference.Builder#build()} is called immediately and
* its result is passed to {@link #hierarchyPath(HierarchyPathReference)}.
*
* @param hierarchyPath
* a consumer that will call methods on {@link HierarchyPathReference.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #hierarchyPath(HierarchyPathReference)
*/
default Builder hierarchyPath(Consumer hierarchyPath) {
return hierarchyPath(HierarchyPathReference.builder().applyMutation(hierarchyPath).build());
}
/**
*
* The status of the agent that they manually set in their Contact Control Panel (CCP), or that the supervisor
* manually changes in the real-time metrics report.
*
*
* @param status
* The status of the agent that they manually set in their Contact Control Panel (CCP), or that the
* supervisor manually changes in the real-time metrics report.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder status(AgentStatusReference status);
/**
*
* The status of the agent that they manually set in their Contact Control Panel (CCP), or that the supervisor
* manually changes in the real-time metrics report.
*
* This is a convenience method that creates an instance of the {@link AgentStatusReference.Builder} avoiding
* the need to create one manually via {@link AgentStatusReference#builder()}.
*
*
* When the {@link Consumer} completes, {@link AgentStatusReference.Builder#build()} is called immediately and
* its result is passed to {@link #status(AgentStatusReference)}.
*
* @param status
* a consumer that will call methods on {@link AgentStatusReference.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #status(AgentStatusReference)
*/
default Builder status(Consumer status) {
return status(AgentStatusReference.builder().applyMutation(status).build());
}
/**
*
* A map of available slots by channel. The key is a channel name. The value is an integer: the available number
* of slots.
*
*
* @param availableSlotsByChannel
* A map of available slots by channel. The key is a channel name. The value is an integer: the available
* number of slots.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder availableSlotsByChannelWithStrings(Map availableSlotsByChannel);
/**
*
* A map of available slots by channel. The key is a channel name. The value is an integer: the available number
* of slots.
*
*
* @param availableSlotsByChannel
* A map of available slots by channel. The key is a channel name. The value is an integer: the available
* number of slots.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder availableSlotsByChannel(Map availableSlotsByChannel);
/**
*
* A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum number of
* slots. This is calculated from MediaConcurrency
* of the RoutingProfile
assigned to the agent.
*
*
* @param maxSlotsByChannel
* A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum
* number of slots. This is calculated from MediaConcurrency of the RoutingProfile
assigned to the agent.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder maxSlotsByChannelWithStrings(Map maxSlotsByChannel);
/**
*
* A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum number of
* slots. This is calculated from MediaConcurrency
* of the RoutingProfile
assigned to the agent.
*
*
* @param maxSlotsByChannel
* A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum
* number of slots. This is calculated from MediaConcurrency of the RoutingProfile
assigned to the agent.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder maxSlotsByChannel(Map maxSlotsByChannel);
/**
*
* A map of active slots by channel. The key is a channel name. The value is an integer: the number of active
* slots.
*
*
* @param activeSlotsByChannel
* A map of active slots by channel. The key is a channel name. The value is an integer: the number of
* active slots.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder activeSlotsByChannelWithStrings(Map activeSlotsByChannel);
/**
*
* A map of active slots by channel. The key is a channel name. The value is an integer: the number of active
* slots.
*
*
* @param activeSlotsByChannel
* A map of active slots by channel. The key is a channel name. The value is an integer: the number of
* active slots.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder activeSlotsByChannel(Map activeSlotsByChannel);
/**
*
* A list of contact reference information.
*
*
* @param contacts
* A list of contact reference information.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder contacts(Collection contacts);
/**
*
* A list of contact reference information.
*
*
* @param contacts
* A list of contact reference information.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder contacts(AgentContactReference... contacts);
/**
*
* A list of contact reference information.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.connect.model.AgentContactReference.Builder} avoiding the need to
* create one manually via {@link software.amazon.awssdk.services.connect.model.AgentContactReference#builder()}
* .
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.connect.model.AgentContactReference.Builder#build()} is called
* immediately and its result is passed to {@link #contacts(List)}.
*
* @param contacts
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.connect.model.AgentContactReference.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #contacts(java.util.Collection)
*/
Builder contacts(Consumer... contacts);
/**
*
* The Next status of the agent.
*
*
* @param nextStatus
* The Next status of the agent.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nextStatus(String nextStatus);
}
static final class BuilderImpl implements Builder {
private UserReference user;
private RoutingProfileReference routingProfile;
private HierarchyPathReference hierarchyPath;
private AgentStatusReference status;
private Map availableSlotsByChannel = DefaultSdkAutoConstructMap.getInstance();
private Map maxSlotsByChannel = DefaultSdkAutoConstructMap.getInstance();
private Map activeSlotsByChannel = DefaultSdkAutoConstructMap.getInstance();
private List contacts = DefaultSdkAutoConstructList.getInstance();
private String nextStatus;
private BuilderImpl() {
}
private BuilderImpl(UserData model) {
user(model.user);
routingProfile(model.routingProfile);
hierarchyPath(model.hierarchyPath);
status(model.status);
availableSlotsByChannelWithStrings(model.availableSlotsByChannel);
maxSlotsByChannelWithStrings(model.maxSlotsByChannel);
activeSlotsByChannelWithStrings(model.activeSlotsByChannel);
contacts(model.contacts);
nextStatus(model.nextStatus);
}
public final UserReference.Builder getUser() {
return user != null ? user.toBuilder() : null;
}
public final void setUser(UserReference.BuilderImpl user) {
this.user = user != null ? user.build() : null;
}
@Override
public final Builder user(UserReference user) {
this.user = user;
return this;
}
public final RoutingProfileReference.Builder getRoutingProfile() {
return routingProfile != null ? routingProfile.toBuilder() : null;
}
public final void setRoutingProfile(RoutingProfileReference.BuilderImpl routingProfile) {
this.routingProfile = routingProfile != null ? routingProfile.build() : null;
}
@Override
public final Builder routingProfile(RoutingProfileReference routingProfile) {
this.routingProfile = routingProfile;
return this;
}
public final HierarchyPathReference.Builder getHierarchyPath() {
return hierarchyPath != null ? hierarchyPath.toBuilder() : null;
}
public final void setHierarchyPath(HierarchyPathReference.BuilderImpl hierarchyPath) {
this.hierarchyPath = hierarchyPath != null ? hierarchyPath.build() : null;
}
@Override
public final Builder hierarchyPath(HierarchyPathReference hierarchyPath) {
this.hierarchyPath = hierarchyPath;
return this;
}
public final AgentStatusReference.Builder getStatus() {
return status != null ? status.toBuilder() : null;
}
public final void setStatus(AgentStatusReference.BuilderImpl status) {
this.status = status != null ? status.build() : null;
}
@Override
public final Builder status(AgentStatusReference status) {
this.status = status;
return this;
}
public final Map getAvailableSlotsByChannel() {
if (availableSlotsByChannel instanceof SdkAutoConstructMap) {
return null;
}
return availableSlotsByChannel;
}
public final void setAvailableSlotsByChannel(Map availableSlotsByChannel) {
this.availableSlotsByChannel = ChannelToCountMapCopier.copy(availableSlotsByChannel);
}
@Override
public final Builder availableSlotsByChannelWithStrings(Map availableSlotsByChannel) {
this.availableSlotsByChannel = ChannelToCountMapCopier.copy(availableSlotsByChannel);
return this;
}
@Override
public final Builder availableSlotsByChannel(Map availableSlotsByChannel) {
this.availableSlotsByChannel = ChannelToCountMapCopier.copyEnumToString(availableSlotsByChannel);
return this;
}
public final Map getMaxSlotsByChannel() {
if (maxSlotsByChannel instanceof SdkAutoConstructMap) {
return null;
}
return maxSlotsByChannel;
}
public final void setMaxSlotsByChannel(Map maxSlotsByChannel) {
this.maxSlotsByChannel = ChannelToCountMapCopier.copy(maxSlotsByChannel);
}
@Override
public final Builder maxSlotsByChannelWithStrings(Map maxSlotsByChannel) {
this.maxSlotsByChannel = ChannelToCountMapCopier.copy(maxSlotsByChannel);
return this;
}
@Override
public final Builder maxSlotsByChannel(Map maxSlotsByChannel) {
this.maxSlotsByChannel = ChannelToCountMapCopier.copyEnumToString(maxSlotsByChannel);
return this;
}
public final Map getActiveSlotsByChannel() {
if (activeSlotsByChannel instanceof SdkAutoConstructMap) {
return null;
}
return activeSlotsByChannel;
}
public final void setActiveSlotsByChannel(Map activeSlotsByChannel) {
this.activeSlotsByChannel = ChannelToCountMapCopier.copy(activeSlotsByChannel);
}
@Override
public final Builder activeSlotsByChannelWithStrings(Map activeSlotsByChannel) {
this.activeSlotsByChannel = ChannelToCountMapCopier.copy(activeSlotsByChannel);
return this;
}
@Override
public final Builder activeSlotsByChannel(Map activeSlotsByChannel) {
this.activeSlotsByChannel = ChannelToCountMapCopier.copyEnumToString(activeSlotsByChannel);
return this;
}
public final List getContacts() {
List result = AgentContactReferenceListCopier.copyToBuilder(this.contacts);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setContacts(Collection contacts) {
this.contacts = AgentContactReferenceListCopier.copyFromBuilder(contacts);
}
@Override
public final Builder contacts(Collection contacts) {
this.contacts = AgentContactReferenceListCopier.copy(contacts);
return this;
}
@Override
@SafeVarargs
public final Builder contacts(AgentContactReference... contacts) {
contacts(Arrays.asList(contacts));
return this;
}
@Override
@SafeVarargs
public final Builder contacts(Consumer... contacts) {
contacts(Stream.of(contacts).map(c -> AgentContactReference.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final String getNextStatus() {
return nextStatus;
}
public final void setNextStatus(String nextStatus) {
this.nextStatus = nextStatus;
}
@Override
public final Builder nextStatus(String nextStatus) {
this.nextStatus = nextStatus;
return this;
}
@Override
public UserData build() {
return new UserData(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}