/* * Copyright 2010-2023 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 com.amazonaws.services.connect.model; import java.io.Serializable; /** *

* Data for a user. *

*/ public class UserData implements Serializable { /** *

* Information about the user for the data that is returned. It contains the * resourceId and ARN of the user. *

*/ private UserReference user; /** *

* Information about the routing profile that is assigned to the user. *

*/ private RoutingProfileReference routingProfile; /** *

* Contains information about the levels of a hierarchy group assigned to a * user. *

*/ private HierarchyPathReference 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. *

*/ private AgentStatusReference status; /** *

* A map of available slots by channel. The key is a channel name. The value * is an integer: the available number of slots. *

*/ private java.util.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. *

*/ private java.util.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. *

*/ private java.util.Map activeSlotsByChannel; /** *

* A list of contact reference information. *

*/ private java.util.List contacts; /** *

* The Next status of the agent. *

*

* Constraints:
* Length: 1 - 127
*/ private String 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 UserReference getUser() { return user; } /** *

* 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. *

*/ public void setUser(UserReference user) { this.user = user; } /** *

* Information about the user for the data that is returned. It contains the * resourceId and ARN of the user. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param user

* Information about the user for the data that is returned. It * contains the resourceId and ARN of the user. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UserData withUser(UserReference user) { this.user = user; return this; } /** *

* Information about the routing profile that is assigned to the user. *

* * @return

* Information about the routing profile that is assigned to the * user. *

*/ public RoutingProfileReference getRoutingProfile() { return routingProfile; } /** *

* Information about the routing profile that is assigned to the user. *

* * @param routingProfile

* Information about the routing profile that is assigned to the * user. *

*/ public void setRoutingProfile(RoutingProfileReference routingProfile) { this.routingProfile = routingProfile; } /** *

* Information about the routing profile that is assigned to the user. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param routingProfile

* Information about the routing profile that is assigned to the * user. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UserData withRoutingProfile(RoutingProfileReference routingProfile) { this.routingProfile = routingProfile; return this; } /** *

* 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 HierarchyPathReference getHierarchyPath() { return hierarchyPath; } /** *

* 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. *

*/ public void setHierarchyPath(HierarchyPathReference hierarchyPath) { this.hierarchyPath = hierarchyPath; } /** *

* Contains information about the levels of a hierarchy group assigned to a * user. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param hierarchyPath

* Contains information about the levels of a hierarchy group * assigned to a user. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UserData withHierarchyPath(HierarchyPathReference hierarchyPath) { this.hierarchyPath = hierarchyPath; return this; } /** *

* 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 AgentStatusReference getStatus() { return 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. *

* * @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. *

*/ public void setStatus(AgentStatusReference status) { this.status = 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. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @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 A reference to this updated object so that method calls can be * chained together. */ public UserData withStatus(AgentStatusReference status) { this.status = status; return this; } /** *

* A map of available slots by channel. The key is a channel name. The value * is an integer: the available number of slots. *

* * @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 java.util.Map getAvailableSlotsByChannel() { return 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. *

*/ public void setAvailableSlotsByChannel(java.util.Map availableSlotsByChannel) { this.availableSlotsByChannel = availableSlotsByChannel; } /** *

* A map of available slots by channel. The key is a channel name. The value * is an integer: the available number of slots. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @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 A reference to this updated object so that method calls can be * chained together. */ public UserData withAvailableSlotsByChannel( java.util.Map availableSlotsByChannel) { this.availableSlotsByChannel = availableSlotsByChannel; return this; } /** *

* A map of available slots by channel. The key is a channel name. The value * is an integer: the available number of slots. *

*

* The method adds a new key-value pair into AvailableSlotsByChannel * parameter, and returns a reference to this object so that method calls * can be chained together. * * @param key The key of the entry to be added into AvailableSlotsByChannel. * @param value The corresponding value of the entry to be added into * AvailableSlotsByChannel. * @return A reference to this updated object so that method calls can be * chained together. */ public UserData addAvailableSlotsByChannelEntry(String key, Integer value) { if (null == this.availableSlotsByChannel) { this.availableSlotsByChannel = new java.util.HashMap(); } if (this.availableSlotsByChannel.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.availableSlotsByChannel.put(key, value); return this; } /** * Removes all the entries added into AvailableSlotsByChannel. *

* Returns a reference to this object so that method calls can be chained * together. */ public UserData clearAvailableSlotsByChannelEntries() { this.availableSlotsByChannel = null; return this; } /** *

* 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

* 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 java.util.Map getMaxSlotsByChannel() { return 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. *

*/ public void setMaxSlotsByChannel(java.util.Map maxSlotsByChannel) { this.maxSlotsByChannel = 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. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @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 A reference to this updated object so that method calls can be * chained together. */ public UserData withMaxSlotsByChannel(java.util.Map maxSlotsByChannel) { this.maxSlotsByChannel = maxSlotsByChannel; return this; } /** *

* 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. *

*

* The method adds a new key-value pair into MaxSlotsByChannel parameter, * and returns a reference to this object so that method calls can be * chained together. * * @param key The key of the entry to be added into MaxSlotsByChannel. * @param value The corresponding value of the entry to be added into * MaxSlotsByChannel. * @return A reference to this updated object so that method calls can be * chained together. */ public UserData addMaxSlotsByChannelEntry(String key, Integer value) { if (null == this.maxSlotsByChannel) { this.maxSlotsByChannel = new java.util.HashMap(); } if (this.maxSlotsByChannel.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.maxSlotsByChannel.put(key, value); return this; } /** * Removes all the entries added into MaxSlotsByChannel. *

* Returns a reference to this object so that method calls can be chained * together. */ public UserData clearMaxSlotsByChannelEntries() { this.maxSlotsByChannel = null; return this; } /** *

* A map of active slots by channel. The key is a channel name. The value is * an integer: the number of active slots. *

* * @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 java.util.Map getActiveSlotsByChannel() { return 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. *

*/ public void setActiveSlotsByChannel(java.util.Map activeSlotsByChannel) { this.activeSlotsByChannel = activeSlotsByChannel; } /** *

* A map of active slots by channel. The key is a channel name. The value is * an integer: the number of active slots. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @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 A reference to this updated object so that method calls can be * chained together. */ public UserData withActiveSlotsByChannel(java.util.Map activeSlotsByChannel) { this.activeSlotsByChannel = activeSlotsByChannel; return this; } /** *

* A map of active slots by channel. The key is a channel name. The value is * an integer: the number of active slots. *

*

* The method adds a new key-value pair into ActiveSlotsByChannel parameter, * and returns a reference to this object so that method calls can be * chained together. * * @param key The key of the entry to be added into ActiveSlotsByChannel. * @param value The corresponding value of the entry to be added into * ActiveSlotsByChannel. * @return A reference to this updated object so that method calls can be * chained together. */ public UserData addActiveSlotsByChannelEntry(String key, Integer value) { if (null == this.activeSlotsByChannel) { this.activeSlotsByChannel = new java.util.HashMap(); } if (this.activeSlotsByChannel.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.activeSlotsByChannel.put(key, value); return this; } /** * Removes all the entries added into ActiveSlotsByChannel. *

* Returns a reference to this object so that method calls can be chained * together. */ public UserData clearActiveSlotsByChannelEntries() { this.activeSlotsByChannel = null; return this; } /** *

* A list of contact reference information. *

* * @return

* A list of contact reference information. *

*/ public java.util.List getContacts() { return contacts; } /** *

* A list of contact reference information. *

* * @param contacts

* A list of contact reference information. *

*/ public void setContacts(java.util.Collection contacts) { if (contacts == null) { this.contacts = null; return; } this.contacts = new java.util.ArrayList(contacts); } /** *

* A list of contact reference information. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param contacts

* A list of contact reference information. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UserData withContacts(AgentContactReference... contacts) { if (getContacts() == null) { this.contacts = new java.util.ArrayList(contacts.length); } for (AgentContactReference value : contacts) { this.contacts.add(value); } return this; } /** *

* A list of contact reference information. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param contacts

* A list of contact reference information. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UserData withContacts(java.util.Collection contacts) { setContacts(contacts); return this; } /** *

* The Next status of the agent. *

*

* Constraints:
* Length: 1 - 127
* * @return

* The Next status of the agent. *

*/ public String getNextStatus() { return nextStatus; } /** *

* The Next status of the agent. *

*

* Constraints:
* Length: 1 - 127
* * @param nextStatus

* The Next status of the agent. *

*/ public void setNextStatus(String nextStatus) { this.nextStatus = nextStatus; } /** *

* The Next status of the agent. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 127
* * @param nextStatus

* The Next status of the agent. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UserData withNextStatus(String nextStatus) { this.nextStatus = nextStatus; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getUser() != null) sb.append("User: " + getUser() + ","); if (getRoutingProfile() != null) sb.append("RoutingProfile: " + getRoutingProfile() + ","); if (getHierarchyPath() != null) sb.append("HierarchyPath: " + getHierarchyPath() + ","); if (getStatus() != null) sb.append("Status: " + getStatus() + ","); if (getAvailableSlotsByChannel() != null) sb.append("AvailableSlotsByChannel: " + getAvailableSlotsByChannel() + ","); if (getMaxSlotsByChannel() != null) sb.append("MaxSlotsByChannel: " + getMaxSlotsByChannel() + ","); if (getActiveSlotsByChannel() != null) sb.append("ActiveSlotsByChannel: " + getActiveSlotsByChannel() + ","); if (getContacts() != null) sb.append("Contacts: " + getContacts() + ","); if (getNextStatus() != null) sb.append("NextStatus: " + getNextStatus()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUser() == null) ? 0 : getUser().hashCode()); hashCode = prime * hashCode + ((getRoutingProfile() == null) ? 0 : getRoutingProfile().hashCode()); hashCode = prime * hashCode + ((getHierarchyPath() == null) ? 0 : getHierarchyPath().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getAvailableSlotsByChannel() == null) ? 0 : getAvailableSlotsByChannel() .hashCode()); hashCode = prime * hashCode + ((getMaxSlotsByChannel() == null) ? 0 : getMaxSlotsByChannel().hashCode()); hashCode = prime * hashCode + ((getActiveSlotsByChannel() == null) ? 0 : getActiveSlotsByChannel().hashCode()); hashCode = prime * hashCode + ((getContacts() == null) ? 0 : getContacts().hashCode()); hashCode = prime * hashCode + ((getNextStatus() == null) ? 0 : getNextStatus().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UserData == false) return false; UserData other = (UserData) obj; if (other.getUser() == null ^ this.getUser() == null) return false; if (other.getUser() != null && other.getUser().equals(this.getUser()) == false) return false; if (other.getRoutingProfile() == null ^ this.getRoutingProfile() == null) return false; if (other.getRoutingProfile() != null && other.getRoutingProfile().equals(this.getRoutingProfile()) == false) return false; if (other.getHierarchyPath() == null ^ this.getHierarchyPath() == null) return false; if (other.getHierarchyPath() != null && other.getHierarchyPath().equals(this.getHierarchyPath()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getAvailableSlotsByChannel() == null ^ this.getAvailableSlotsByChannel() == null) return false; if (other.getAvailableSlotsByChannel() != null && other.getAvailableSlotsByChannel().equals(this.getAvailableSlotsByChannel()) == false) return false; if (other.getMaxSlotsByChannel() == null ^ this.getMaxSlotsByChannel() == null) return false; if (other.getMaxSlotsByChannel() != null && other.getMaxSlotsByChannel().equals(this.getMaxSlotsByChannel()) == false) return false; if (other.getActiveSlotsByChannel() == null ^ this.getActiveSlotsByChannel() == null) return false; if (other.getActiveSlotsByChannel() != null && other.getActiveSlotsByChannel().equals(this.getActiveSlotsByChannel()) == false) return false; if (other.getContacts() == null ^ this.getContacts() == null) return false; if (other.getContacts() != null && other.getContacts().equals(this.getContacts()) == false) return false; if (other.getNextStatus() == null ^ this.getNextStatus() == null) return false; if (other.getNextStatus() != null && other.getNextStatus().equals(this.getNextStatus()) == false) return false; return true; } }