/* * 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; /** *

* Contains information about a user account for an Amazon Connect instance. *

*/ public class User implements Serializable { /** *

* The identifier of the user account. *

*/ private String id; /** *

* The Amazon Resource Name (ARN) of the user account. *

*/ private String arn; /** *

* The user name assigned to the user account. *

*

* Constraints:
* Length: 1 - 100
*/ private String username; /** *

* Information about the user identity. *

*/ private UserIdentityInfo identityInfo; /** *

* Information about the phone configuration for the user. *

*/ private UserPhoneConfig phoneConfig; /** *

* The identifier of the user account in the directory used for identity * management. *

*/ private String directoryUserId; /** *

* The identifiers of the security profiles for the user. *

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

* The identifier of the routing profile for the user. *

*/ private String routingProfileId; /** *

* The identifier of the hierarchy group for the user. *

*/ private String hierarchyGroupId; /** *

* The tags. *

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

* The identifier of the user account. *

* * @return

* The identifier of the user account. *

*/ public String getId() { return id; } /** *

* The identifier of the user account. *

* * @param id

* The identifier of the user account. *

*/ public void setId(String id) { this.id = id; } /** *

* The identifier of the user account. *

*

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

* The identifier of the user account. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withId(String id) { this.id = id; return this; } /** *

* The Amazon Resource Name (ARN) of the user account. *

* * @return

* The Amazon Resource Name (ARN) of the user account. *

*/ public String getArn() { return arn; } /** *

* The Amazon Resource Name (ARN) of the user account. *

* * @param arn

* The Amazon Resource Name (ARN) of the user account. *

*/ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the user account. *

*

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

* The Amazon Resource Name (ARN) of the user account. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withArn(String arn) { this.arn = arn; return this; } /** *

* The user name assigned to the user account. *

*

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

* The user name assigned to the user account. *

*/ public String getUsername() { return username; } /** *

* The user name assigned to the user account. *

*

* Constraints:
* Length: 1 - 100
* * @param username

* The user name assigned to the user account. *

*/ public void setUsername(String username) { this.username = username; } /** *

* The user name assigned to the user account. *

*

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

* Constraints:
* Length: 1 - 100
* * @param username

* The user name assigned to the user account. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withUsername(String username) { this.username = username; return this; } /** *

* Information about the user identity. *

* * @return

* Information about the user identity. *

*/ public UserIdentityInfo getIdentityInfo() { return identityInfo; } /** *

* Information about the user identity. *

* * @param identityInfo

* Information about the user identity. *

*/ public void setIdentityInfo(UserIdentityInfo identityInfo) { this.identityInfo = identityInfo; } /** *

* Information about the user identity. *

*

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

* Information about the user identity. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withIdentityInfo(UserIdentityInfo identityInfo) { this.identityInfo = identityInfo; return this; } /** *

* Information about the phone configuration for the user. *

* * @return

* Information about the phone configuration for the user. *

*/ public UserPhoneConfig getPhoneConfig() { return phoneConfig; } /** *

* Information about the phone configuration for the user. *

* * @param phoneConfig

* Information about the phone configuration for the user. *

*/ public void setPhoneConfig(UserPhoneConfig phoneConfig) { this.phoneConfig = phoneConfig; } /** *

* Information about the phone configuration for the user. *

*

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

* Information about the phone configuration for the user. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withPhoneConfig(UserPhoneConfig phoneConfig) { this.phoneConfig = phoneConfig; return this; } /** *

* The identifier of the user account in the directory used for identity * management. *

* * @return

* The identifier of the user account in the directory used for * identity management. *

*/ public String getDirectoryUserId() { return directoryUserId; } /** *

* The identifier of the user account in the directory used for identity * management. *

* * @param directoryUserId

* The identifier of the user account in the directory used for * identity management. *

*/ public void setDirectoryUserId(String directoryUserId) { this.directoryUserId = directoryUserId; } /** *

* The identifier of the user account in the directory used for identity * management. *

*

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

* The identifier of the user account in the directory used for * identity management. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withDirectoryUserId(String directoryUserId) { this.directoryUserId = directoryUserId; return this; } /** *

* The identifiers of the security profiles for the user. *

* * @return

* The identifiers of the security profiles for the user. *

*/ public java.util.List getSecurityProfileIds() { return securityProfileIds; } /** *

* The identifiers of the security profiles for the user. *

* * @param securityProfileIds

* The identifiers of the security profiles for the user. *

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

* The identifiers of the security profiles for the user. *

*

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

* The identifiers of the security profiles for the user. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withSecurityProfileIds(String... securityProfileIds) { if (getSecurityProfileIds() == null) { this.securityProfileIds = new java.util.ArrayList(securityProfileIds.length); } for (String value : securityProfileIds) { this.securityProfileIds.add(value); } return this; } /** *

* The identifiers of the security profiles for the user. *

*

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

* The identifiers of the security profiles for the user. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withSecurityProfileIds(java.util.Collection securityProfileIds) { setSecurityProfileIds(securityProfileIds); return this; } /** *

* The identifier of the routing profile for the user. *

* * @return

* The identifier of the routing profile for the user. *

*/ public String getRoutingProfileId() { return routingProfileId; } /** *

* The identifier of the routing profile for the user. *

* * @param routingProfileId

* The identifier of the routing profile for the user. *

*/ public void setRoutingProfileId(String routingProfileId) { this.routingProfileId = routingProfileId; } /** *

* The identifier of the routing profile for the user. *

*

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

* The identifier of the routing profile for the user. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withRoutingProfileId(String routingProfileId) { this.routingProfileId = routingProfileId; return this; } /** *

* The identifier of the hierarchy group for the user. *

* * @return

* The identifier of the hierarchy group for the user. *

*/ public String getHierarchyGroupId() { return hierarchyGroupId; } /** *

* The identifier of the hierarchy group for the user. *

* * @param hierarchyGroupId

* The identifier of the hierarchy group for the user. *

*/ public void setHierarchyGroupId(String hierarchyGroupId) { this.hierarchyGroupId = hierarchyGroupId; } /** *

* The identifier of the hierarchy group for the user. *

*

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

* The identifier of the hierarchy group for the user. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withHierarchyGroupId(String hierarchyGroupId) { this.hierarchyGroupId = hierarchyGroupId; return this; } /** *

* The tags. *

* * @return

* The tags. *

*/ public java.util.Map getTags() { return tags; } /** *

* The tags. *

* * @param tags

* The tags. *

*/ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* The tags. *

*

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

* The tags. *

* @return A reference to this updated object so that method calls can be * chained together. */ public User withTags(java.util.Map tags) { this.tags = tags; return this; } /** *

* The tags. *

*

* The method adds a new key-value pair into Tags 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 Tags. * @param value The corresponding value of the entry to be added into Tags. * @return A reference to this updated object so that method calls can be * chained together. */ public User addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. *

* Returns a reference to this object so that method calls can be chained * together. */ public User clearTagsEntries() { this.tags = null; 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 (getId() != null) sb.append("Id: " + getId() + ","); if (getArn() != null) sb.append("Arn: " + getArn() + ","); if (getUsername() != null) sb.append("Username: " + getUsername() + ","); if (getIdentityInfo() != null) sb.append("IdentityInfo: " + getIdentityInfo() + ","); if (getPhoneConfig() != null) sb.append("PhoneConfig: " + getPhoneConfig() + ","); if (getDirectoryUserId() != null) sb.append("DirectoryUserId: " + getDirectoryUserId() + ","); if (getSecurityProfileIds() != null) sb.append("SecurityProfileIds: " + getSecurityProfileIds() + ","); if (getRoutingProfileId() != null) sb.append("RoutingProfileId: " + getRoutingProfileId() + ","); if (getHierarchyGroupId() != null) sb.append("HierarchyGroupId: " + getHierarchyGroupId() + ","); if (getTags() != null) sb.append("Tags: " + getTags()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode()); hashCode = prime * hashCode + ((getIdentityInfo() == null) ? 0 : getIdentityInfo().hashCode()); hashCode = prime * hashCode + ((getPhoneConfig() == null) ? 0 : getPhoneConfig().hashCode()); hashCode = prime * hashCode + ((getDirectoryUserId() == null) ? 0 : getDirectoryUserId().hashCode()); hashCode = prime * hashCode + ((getSecurityProfileIds() == null) ? 0 : getSecurityProfileIds().hashCode()); hashCode = prime * hashCode + ((getRoutingProfileId() == null) ? 0 : getRoutingProfileId().hashCode()); hashCode = prime * hashCode + ((getHierarchyGroupId() == null) ? 0 : getHierarchyGroupId().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof User == false) return false; User other = (User) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getUsername() == null ^ this.getUsername() == null) return false; if (other.getUsername() != null && other.getUsername().equals(this.getUsername()) == false) return false; if (other.getIdentityInfo() == null ^ this.getIdentityInfo() == null) return false; if (other.getIdentityInfo() != null && other.getIdentityInfo().equals(this.getIdentityInfo()) == false) return false; if (other.getPhoneConfig() == null ^ this.getPhoneConfig() == null) return false; if (other.getPhoneConfig() != null && other.getPhoneConfig().equals(this.getPhoneConfig()) == false) return false; if (other.getDirectoryUserId() == null ^ this.getDirectoryUserId() == null) return false; if (other.getDirectoryUserId() != null && other.getDirectoryUserId().equals(this.getDirectoryUserId()) == false) return false; if (other.getSecurityProfileIds() == null ^ this.getSecurityProfileIds() == null) return false; if (other.getSecurityProfileIds() != null && other.getSecurityProfileIds().equals(this.getSecurityProfileIds()) == false) return false; if (other.getRoutingProfileId() == null ^ this.getRoutingProfileId() == null) return false; if (other.getRoutingProfileId() != null && other.getRoutingProfileId().equals(this.getRoutingProfileId()) == false) return false; if (other.getHierarchyGroupId() == null ^ this.getHierarchyGroupId() == null) return false; if (other.getHierarchyGroupId() != null && other.getHierarchyGroupId().equals(this.getHierarchyGroupId()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } }