/* * 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 the identity of a user. *

*/ public class UserIdentityInfo implements Serializable { /** *

* The first name. This is required if you are using Amazon Connect or SAML * for identity management. *

*

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

* The last name. This is required if you are using Amazon Connect or SAML * for identity management. *

*

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

* The email address. If you are using SAML for identity management and * include this parameter, an error is returned. *

*/ private String email; /** *

* The user's secondary email address. If you provide a secondary email, the * user receives email notifications - other than password reset * notifications - to this email address instead of to their primary email * address. *

*

* Pattern: * (?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63} *

*/ private String secondaryEmail; /** *

* The user's mobile number. *

*

* Constraints:
* Pattern: \\+[1-9]\\d{1,14}$
*/ private String mobile; /** *

* The first name. This is required if you are using Amazon Connect or SAML * for identity management. *

*

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

* The first name. This is required if you are using Amazon Connect * or SAML for identity management. *

*/ public String getFirstName() { return firstName; } /** *

* The first name. This is required if you are using Amazon Connect or SAML * for identity management. *

*

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

* The first name. This is required if you are using Amazon * Connect or SAML for identity management. *

*/ public void setFirstName(String firstName) { this.firstName = firstName; } /** *

* The first name. This is required if you are using Amazon Connect or SAML * for identity management. *

*

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

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

* The first name. This is required if you are using Amazon * Connect or SAML for identity management. *

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

* The last name. This is required if you are using Amazon Connect or SAML * for identity management. *

*

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

* The last name. This is required if you are using Amazon Connect * or SAML for identity management. *

*/ public String getLastName() { return lastName; } /** *

* The last name. This is required if you are using Amazon Connect or SAML * for identity management. *

*

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

* The last name. This is required if you are using Amazon * Connect or SAML for identity management. *

*/ public void setLastName(String lastName) { this.lastName = lastName; } /** *

* The last name. This is required if you are using Amazon Connect or SAML * for identity management. *

*

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

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

* The last name. This is required if you are using Amazon * Connect or SAML for identity management. *

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

* The email address. If you are using SAML for identity management and * include this parameter, an error is returned. *

* * @return

* The email address. If you are using SAML for identity management * and include this parameter, an error is returned. *

*/ public String getEmail() { return email; } /** *

* The email address. If you are using SAML for identity management and * include this parameter, an error is returned. *

* * @param email

* The email address. If you are using SAML for identity * management and include this parameter, an error is returned. *

*/ public void setEmail(String email) { this.email = email; } /** *

* The email address. If you are using SAML for identity management and * include this parameter, an error is returned. *

*

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

* The email address. If you are using SAML for identity * management and include this parameter, an error is returned. *

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

* The user's secondary email address. If you provide a secondary email, the * user receives email notifications - other than password reset * notifications - to this email address instead of to their primary email * address. *

*

* Pattern: * (?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63} *

* * @return

* The user's secondary email address. If you provide a secondary * email, the user receives email notifications - other than * password reset notifications - to this email address instead of * to their primary email address. *

*

* Pattern: * (?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63} *

*/ public String getSecondaryEmail() { return secondaryEmail; } /** *

* The user's secondary email address. If you provide a secondary email, the * user receives email notifications - other than password reset * notifications - to this email address instead of to their primary email * address. *

*

* Pattern: * (?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63} *

* * @param secondaryEmail

* The user's secondary email address. If you provide a secondary * email, the user receives email notifications - other than * password reset notifications - to this email address instead * of to their primary email address. *

*

* Pattern: * (?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63} *

*/ public void setSecondaryEmail(String secondaryEmail) { this.secondaryEmail = secondaryEmail; } /** *

* The user's secondary email address. If you provide a secondary email, the * user receives email notifications - other than password reset * notifications - to this email address instead of to their primary email * address. *

*

* Pattern: * (?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63} *

*

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

* The user's secondary email address. If you provide a secondary * email, the user receives email notifications - other than * password reset notifications - to this email address instead * of to their primary email address. *

*

* Pattern: * (?=^.{0,265}$)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63} *

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

* The user's mobile number. *

*

* Constraints:
* Pattern: \\+[1-9]\\d{1,14}$
* * @return

* The user's mobile number. *

*/ public String getMobile() { return mobile; } /** *

* The user's mobile number. *

*

* Constraints:
* Pattern: \\+[1-9]\\d{1,14}$
* * @param mobile

* The user's mobile number. *

*/ public void setMobile(String mobile) { this.mobile = mobile; } /** *

* The user's mobile number. *

*

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

* Constraints:
* Pattern: \\+[1-9]\\d{1,14}$
* * @param mobile

* The user's mobile number. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UserIdentityInfo withMobile(String mobile) { this.mobile = mobile; 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 (getFirstName() != null) sb.append("FirstName: " + getFirstName() + ","); if (getLastName() != null) sb.append("LastName: " + getLastName() + ","); if (getEmail() != null) sb.append("Email: " + getEmail() + ","); if (getSecondaryEmail() != null) sb.append("SecondaryEmail: " + getSecondaryEmail() + ","); if (getMobile() != null) sb.append("Mobile: " + getMobile()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFirstName() == null) ? 0 : getFirstName().hashCode()); hashCode = prime * hashCode + ((getLastName() == null) ? 0 : getLastName().hashCode()); hashCode = prime * hashCode + ((getEmail() == null) ? 0 : getEmail().hashCode()); hashCode = prime * hashCode + ((getSecondaryEmail() == null) ? 0 : getSecondaryEmail().hashCode()); hashCode = prime * hashCode + ((getMobile() == null) ? 0 : getMobile().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UserIdentityInfo == false) return false; UserIdentityInfo other = (UserIdentityInfo) obj; if (other.getFirstName() == null ^ this.getFirstName() == null) return false; if (other.getFirstName() != null && other.getFirstName().equals(this.getFirstName()) == false) return false; if (other.getLastName() == null ^ this.getLastName() == null) return false; if (other.getLastName() != null && other.getLastName().equals(this.getLastName()) == false) return false; if (other.getEmail() == null ^ this.getEmail() == null) return false; if (other.getEmail() != null && other.getEmail().equals(this.getEmail()) == false) return false; if (other.getSecondaryEmail() == null ^ this.getSecondaryEmail() == null) return false; if (other.getSecondaryEmail() != null && other.getSecondaryEmail().equals(this.getSecondaryEmail()) == false) return false; if (other.getMobile() == null ^ this.getMobile() == null) return false; if (other.getMobile() != null && other.getMobile().equals(this.getMobile()) == false) return false; return true; } }