com.amazonaws.services.appstream.model.User Maven / Gradle / Ivy
Show all versions of aws-java-sdk-appstream Show documentation
/*
* Copyright 2019-2024 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.appstream.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes a user in the user pool.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class User implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ARN of the user.
*
*/
private String arn;
/**
*
* The email address of the user.
*
*
*
* Users' email addresses are case-sensitive.
*
*
*/
private String userName;
/**
*
* Specifies whether the user in the user pool is enabled.
*
*/
private Boolean enabled;
/**
*
* The status of the user in the user pool. The status can be one of the following:
*
*
* -
*
* UNCONFIRMED – The user is created but not confirmed.
*
*
* -
*
* CONFIRMED – The user is confirmed.
*
*
* -
*
* ARCHIVED – The user is no longer active.
*
*
* -
*
* COMPROMISED – The user is disabled because of a potential security threat.
*
*
* -
*
* UNKNOWN – The user status is not known.
*
*
*
*/
private String status;
/**
*
* The first name, or given name, of the user.
*
*/
private String firstName;
/**
*
* The last name, or surname, of the user.
*
*/
private String lastName;
/**
*
* The date and time the user was created in the user pool.
*
*/
private java.util.Date createdTime;
/**
*
* The authentication type for the user.
*
*/
private String authenticationType;
/**
*
* The ARN of the user.
*
*
* @param arn
* The ARN of the user.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The ARN of the user.
*
*
* @return The ARN of the user.
*/
public String getArn() {
return this.arn;
}
/**
*
* The ARN of the user.
*
*
* @param arn
* The ARN of the user.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public User withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The email address of the user.
*
*
*
* Users' email addresses are case-sensitive.
*
*
*
* @param userName
* The email address of the user.
*
* Users' email addresses are case-sensitive.
*
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
*
* The email address of the user.
*
*
*
* Users' email addresses are case-sensitive.
*
*
*
* @return The email address of the user.
*
* Users' email addresses are case-sensitive.
*
*/
public String getUserName() {
return this.userName;
}
/**
*
* The email address of the user.
*
*
*
* Users' email addresses are case-sensitive.
*
*
*
* @param userName
* The email address of the user.
*
* Users' email addresses are case-sensitive.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public User withUserName(String userName) {
setUserName(userName);
return this;
}
/**
*
* Specifies whether the user in the user pool is enabled.
*
*
* @param enabled
* Specifies whether the user in the user pool is enabled.
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
*
* Specifies whether the user in the user pool is enabled.
*
*
* @return Specifies whether the user in the user pool is enabled.
*/
public Boolean getEnabled() {
return this.enabled;
}
/**
*
* Specifies whether the user in the user pool is enabled.
*
*
* @param enabled
* Specifies whether the user in the user pool is enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public User withEnabled(Boolean enabled) {
setEnabled(enabled);
return this;
}
/**
*
* Specifies whether the user in the user pool is enabled.
*
*
* @return Specifies whether the user in the user pool is enabled.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
*
* The status of the user in the user pool. The status can be one of the following:
*
*
* -
*
* UNCONFIRMED – The user is created but not confirmed.
*
*
* -
*
* CONFIRMED – The user is confirmed.
*
*
* -
*
* ARCHIVED – The user is no longer active.
*
*
* -
*
* COMPROMISED – The user is disabled because of a potential security threat.
*
*
* -
*
* UNKNOWN – The user status is not known.
*
*
*
*
* @param status
* The status of the user in the user pool. The status can be one of the following:
*
* -
*
* UNCONFIRMED – The user is created but not confirmed.
*
*
* -
*
* CONFIRMED – The user is confirmed.
*
*
* -
*
* ARCHIVED – The user is no longer active.
*
*
* -
*
* COMPROMISED – The user is disabled because of a potential security threat.
*
*
* -
*
* UNKNOWN – The user status is not known.
*
*
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the user in the user pool. The status can be one of the following:
*
*
* -
*
* UNCONFIRMED – The user is created but not confirmed.
*
*
* -
*
* CONFIRMED – The user is confirmed.
*
*
* -
*
* ARCHIVED – The user is no longer active.
*
*
* -
*
* COMPROMISED – The user is disabled because of a potential security threat.
*
*
* -
*
* UNKNOWN – The user status is not known.
*
*
*
*
* @return The status of the user in the user pool. The status can be one of the following:
*
* -
*
* UNCONFIRMED – The user is created but not confirmed.
*
*
* -
*
* CONFIRMED – The user is confirmed.
*
*
* -
*
* ARCHIVED – The user is no longer active.
*
*
* -
*
* COMPROMISED – The user is disabled because of a potential security threat.
*
*
* -
*
* UNKNOWN – The user status is not known.
*
*
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the user in the user pool. The status can be one of the following:
*
*
* -
*
* UNCONFIRMED – The user is created but not confirmed.
*
*
* -
*
* CONFIRMED – The user is confirmed.
*
*
* -
*
* ARCHIVED – The user is no longer active.
*
*
* -
*
* COMPROMISED – The user is disabled because of a potential security threat.
*
*
* -
*
* UNKNOWN – The user status is not known.
*
*
*
*
* @param status
* The status of the user in the user pool. The status can be one of the following:
*
* -
*
* UNCONFIRMED – The user is created but not confirmed.
*
*
* -
*
* CONFIRMED – The user is confirmed.
*
*
* -
*
* ARCHIVED – The user is no longer active.
*
*
* -
*
* COMPROMISED – The user is disabled because of a potential security threat.
*
*
* -
*
* UNKNOWN – The user status is not known.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public User withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The first name, or given name, of the user.
*
*
* @param firstName
* The first name, or given name, of the user.
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
*
* The first name, or given name, of the user.
*
*
* @return The first name, or given name, of the user.
*/
public String getFirstName() {
return this.firstName;
}
/**
*
* The first name, or given name, of the user.
*
*
* @param firstName
* The first name, or given name, of the user.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public User withFirstName(String firstName) {
setFirstName(firstName);
return this;
}
/**
*
* The last name, or surname, of the user.
*
*
* @param lastName
* The last name, or surname, of the user.
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
*
* The last name, or surname, of the user.
*
*
* @return The last name, or surname, of the user.
*/
public String getLastName() {
return this.lastName;
}
/**
*
* The last name, or surname, of the user.
*
*
* @param lastName
* The last name, or surname, of the user.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public User withLastName(String lastName) {
setLastName(lastName);
return this;
}
/**
*
* The date and time the user was created in the user pool.
*
*
* @param createdTime
* The date and time the user was created in the user pool.
*/
public void setCreatedTime(java.util.Date createdTime) {
this.createdTime = createdTime;
}
/**
*
* The date and time the user was created in the user pool.
*
*
* @return The date and time the user was created in the user pool.
*/
public java.util.Date getCreatedTime() {
return this.createdTime;
}
/**
*
* The date and time the user was created in the user pool.
*
*
* @param createdTime
* The date and time the user was created in the user pool.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public User withCreatedTime(java.util.Date createdTime) {
setCreatedTime(createdTime);
return this;
}
/**
*
* The authentication type for the user.
*
*
* @param authenticationType
* The authentication type for the user.
* @see AuthenticationType
*/
public void setAuthenticationType(String authenticationType) {
this.authenticationType = authenticationType;
}
/**
*
* The authentication type for the user.
*
*
* @return The authentication type for the user.
* @see AuthenticationType
*/
public String getAuthenticationType() {
return this.authenticationType;
}
/**
*
* The authentication type for the user.
*
*
* @param authenticationType
* The authentication type for the user.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AuthenticationType
*/
public User withAuthenticationType(String authenticationType) {
setAuthenticationType(authenticationType);
return this;
}
/**
*
* The authentication type for the user.
*
*
* @param authenticationType
* The authentication type for the user.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AuthenticationType
*/
public User withAuthenticationType(AuthenticationType authenticationType) {
this.authenticationType = authenticationType.toString();
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getUserName() != null)
sb.append("UserName: ").append("***Sensitive Data Redacted***").append(",");
if (getEnabled() != null)
sb.append("Enabled: ").append(getEnabled()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getFirstName() != null)
sb.append("FirstName: ").append("***Sensitive Data Redacted***").append(",");
if (getLastName() != null)
sb.append("LastName: ").append("***Sensitive Data Redacted***").append(",");
if (getCreatedTime() != null)
sb.append("CreatedTime: ").append(getCreatedTime()).append(",");
if (getAuthenticationType() != null)
sb.append("AuthenticationType: ").append(getAuthenticationType());
sb.append("}");
return sb.toString();
}
@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.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.getEnabled() == null ^ this.getEnabled() == null)
return false;
if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == 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.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.getCreatedTime() == null ^ this.getCreatedTime() == null)
return false;
if (other.getCreatedTime() != null && other.getCreatedTime().equals(this.getCreatedTime()) == false)
return false;
if (other.getAuthenticationType() == null ^ this.getAuthenticationType() == null)
return false;
if (other.getAuthenticationType() != null && other.getAuthenticationType().equals(this.getAuthenticationType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode());
hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getFirstName() == null) ? 0 : getFirstName().hashCode());
hashCode = prime * hashCode + ((getLastName() == null) ? 0 : getLastName().hashCode());
hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
hashCode = prime * hashCode + ((getAuthenticationType() == null) ? 0 : getAuthenticationType().hashCode());
return hashCode;
}
@Override
public User clone() {
try {
return (User) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.appstream.model.transform.UserMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}