Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.identitymanagement.model;
 

Contains information about an IAM user, including all the user's policies and all the IAM groups the user is in.

This data type is used as a response element in the GetAccountAuthorizationDetails action.

 
 public class UserDetail implements SerializableCloneable {

    
The path to the user. For more information about paths, see IAM Identifiers in the Using IAM guide.

Constraints:
Length: 1 - 512
Pattern: (\u002F)|(\u002F[\u0021-\u007F]+\u002F)

 
     private String path;

    
The friendly name identifying the user.

Constraints:
Length: 1 - 64
Pattern: [\w+=,.@-]*

 
     private String userName;

    
The stable and unique string identifying the user. For more information about IDs, see IAM Identifiers in the Using IAM guide.

Constraints:
Length: 16 - 32
Pattern: [\w]*

 
     private String userId;

    
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Constraints:
Length: 20 - 2048

 
     private String arn;

    
The date and time, in ISO 8601 date-time format, when the user was created.
 
     private java.util.Date createDate;

    
A list of the inline policies embedded in the user.
 
A list of IAM groups that the user is in.
 
A list of the managed policies attached to the user.
 
The path to the user. For more information about paths, see IAM Identifiers in the Using IAM guide.

Constraints:
Length: 1 - 512
Pattern: (\u002F)|(\u002F[\u0021-\u007F]+\u002F)

Returns:
The path to the user. For more information about paths, see IAM Identifiers in the Using IAM guide.
    public String getPath() {
        return ;
    }
    
    
The path to the user. For more information about paths, see IAM Identifiers in the Using IAM guide.

Constraints:
Length: 1 - 512
Pattern: (\u002F)|(\u002F[\u0021-\u007F]+\u002F)

Parameters:
path The path to the user. For more information about paths, see IAM Identifiers in the Using IAM guide.
    public void setPath(String path) {
        this. = path;
    }
    
    
The path to the user. For more information about paths, see IAM Identifiers in the Using IAM guide.

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

Constraints:
Length: 1 - 512
Pattern: (\u002F)|(\u002F[\u0021-\u007F]+\u002F)

Parameters:
path The path to the user. For more information about paths, see IAM Identifiers in the Using IAM guide.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withPath(String path) {
        this. = path;
        return this;
    }

    
The friendly name identifying the user.

Constraints:
Length: 1 - 64
Pattern: [\w+=,.@-]*

Returns:
The friendly name identifying the user.
    public String getUserName() {
        return ;
    }
    
    
The friendly name identifying the user.

Constraints:
Length: 1 - 64
Pattern: [\w+=,.@-]*

Parameters:
userName The friendly name identifying the user.
    public void setUserName(String userName) {
        this. = userName;
    }
    
    
The friendly name identifying the user.

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

Constraints:
Length: 1 - 64
Pattern: [\w+=,.@-]*

Parameters:
userName The friendly name identifying the user.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withUserName(String userName) {
        this. = userName;
        return this;
    }

    
The stable and unique string identifying the user. For more information about IDs, see IAM Identifiers in the Using IAM guide.

Constraints:
Length: 16 - 32
Pattern: [\w]*

Returns:
The stable and unique string identifying the user. For more information about IDs, see IAM Identifiers in the Using IAM guide.
    public String getUserId() {
        return ;
    }
    
    
The stable and unique string identifying the user. For more information about IDs, see IAM Identifiers in the Using IAM guide.

Constraints:
Length: 16 - 32
Pattern: [\w]*

Parameters:
userId The stable and unique string identifying the user. For more information about IDs, see IAM Identifiers in the Using IAM guide.
    public void setUserId(String userId) {
        this. = userId;
    }
    
    
The stable and unique string identifying the user. For more information about IDs, see IAM Identifiers in the Using IAM guide.

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

Constraints:
Length: 16 - 32
Pattern: [\w]*

Parameters:
userId The stable and unique string identifying the user. For more information about IDs, see IAM Identifiers in the Using IAM guide.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withUserId(String userId) {
        this. = userId;
        return this;
    }

    
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Constraints:
Length: 20 - 2048

Returns:
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

    public String getArn() {
        return ;
    }
    
    
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Constraints:
Length: 20 - 2048

Parameters:
arn The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

    public void setArn(String arn) {
        this. = arn;
    }
    
    
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

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

Constraints:
Length: 20 - 2048

Parameters:
arn The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withArn(String arn) {
        this. = arn;
        return this;
    }

    
The date and time, in ISO 8601 date-time format, when the user was created.

Returns:
The date and time, in ISO 8601 date-time format, when the user was created.
    public java.util.Date getCreateDate() {
        return ;
    }
    
    
The date and time, in ISO 8601 date-time format, when the user was created.

Parameters:
createDate The date and time, in ISO 8601 date-time format, when the user was created.
    public void setCreateDate(java.util.Date createDate) {
        this. = createDate;
    }
    
    
The date and time, in ISO 8601 date-time format, when the user was created.

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

Parameters:
createDate The date and time, in ISO 8601 date-time format, when the user was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withCreateDate(java.util.Date createDate) {
        this. = createDate;
        return this;
    }

    
A list of the inline policies embedded in the user.

Returns:
A list of the inline policies embedded in the user.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of the inline policies embedded in the user.

Parameters:
userPolicyList A list of the inline policies embedded in the user.
    public void setUserPolicyList(java.util.Collection<PolicyDetailuserPolicyList) {
        if (userPolicyList == null) {
            this. = null;
            return;
        }
        userPolicyListCopy.addAll(userPolicyList);
        this. = userPolicyListCopy;
    }
    
    
A list of the inline policies embedded in the user.

NOTE: This method appends the values to the existing list (if any). Use setUserPolicyList(java.util.Collection) or withUserPolicyList(java.util.Collection) if you want to override the existing values.

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

Parameters:
userPolicyList A list of the inline policies embedded in the user.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withUserPolicyList(PolicyDetail... userPolicyList) {
        if (getUserPolicyList() == nullsetUserPolicyList(new java.util.ArrayList<PolicyDetail>(userPolicyList.length));
        for (PolicyDetail value : userPolicyList) {
            getUserPolicyList().add(value);
        }
        return this;
    }
    
    
A list of the inline policies embedded in the user.

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

Parameters:
userPolicyList A list of the inline policies embedded in the user.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withUserPolicyList(java.util.Collection<PolicyDetailuserPolicyList) {
        if (userPolicyList == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<PolicyDetailuserPolicyListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<PolicyDetail>(userPolicyList.size());
            userPolicyListCopy.addAll(userPolicyList);
            this. = userPolicyListCopy;
        }
        return this;
    }

    
A list of IAM groups that the user is in.

Returns:
A list of IAM groups that the user is in.
    public java.util.List<StringgetGroupList() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of IAM groups that the user is in.

Parameters:
groupList A list of IAM groups that the user is in.
    public void setGroupList(java.util.Collection<StringgroupList) {
        if (groupList == null) {
            this. = null;
            return;
        }
        groupListCopy.addAll(groupList);
        this. = groupListCopy;
    }
    
    
A list of IAM groups that the user is in.

NOTE: This method appends the values to the existing list (if any). Use setGroupList(java.util.Collection) or withGroupList(java.util.Collection) if you want to override the existing values.

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

Parameters:
groupList A list of IAM groups that the user is in.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withGroupList(String... groupList) {
        if (getGroupList() == nullsetGroupList(new java.util.ArrayList<String>(groupList.length));
        for (String value : groupList) {
            getGroupList().add(value);
        }
        return this;
    }
    
    
A list of IAM groups that the user is in.

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

Parameters:
groupList A list of IAM groups that the user is in.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withGroupList(java.util.Collection<StringgroupList) {
        if (groupList == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringgroupListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(groupList.size());
            groupListCopy.addAll(groupList);
            this. = groupListCopy;
        }
        return this;
    }

    
A list of the managed policies attached to the user.

Returns:
A list of the managed policies attached to the user.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of the managed policies attached to the user.

Parameters:
attachedManagedPolicies A list of the managed policies attached to the user.
    public void setAttachedManagedPolicies(java.util.Collection<AttachedPolicyattachedManagedPolicies) {
        if (attachedManagedPolicies == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<AttachedPolicyattachedManagedPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<AttachedPolicy>(attachedManagedPolicies.size());
        attachedManagedPoliciesCopy.addAll(attachedManagedPolicies);
        this. = attachedManagedPoliciesCopy;
    }
    
    
A list of the managed policies attached to the user.

NOTE: This method appends the values to the existing list (if any). Use setAttachedManagedPolicies(java.util.Collection) or withAttachedManagedPolicies(java.util.Collection) if you want to override the existing values.

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

Parameters:
attachedManagedPolicies A list of the managed policies attached to the user.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withAttachedManagedPolicies(AttachedPolicy... attachedManagedPolicies) {
        if (getAttachedManagedPolicies() == nullsetAttachedManagedPolicies(new java.util.ArrayList<AttachedPolicy>(attachedManagedPolicies.length));
        for (AttachedPolicy value : attachedManagedPolicies) {
            getAttachedManagedPolicies().add(value);
        }
        return this;
    }
    
    
A list of the managed policies attached to the user.

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

Parameters:
attachedManagedPolicies A list of the managed policies attached to the user.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UserDetail withAttachedManagedPolicies(java.util.Collection<AttachedPolicyattachedManagedPolicies) {
        if (attachedManagedPolicies == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<AttachedPolicyattachedManagedPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<AttachedPolicy>(attachedManagedPolicies.size());
            attachedManagedPoliciesCopy.addAll(attachedManagedPolicies);
            this. = attachedManagedPoliciesCopy;
        }
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getPath() != nullsb.append("Path: " + getPath() + ",");
        if (getUserName() != nullsb.append("UserName: " + getUserName() + ",");
        if (getUserId() != nullsb.append("UserId: " + getUserId() + ",");
        if (getArn() != nullsb.append("Arn: " + getArn() + ",");
        if (getCreateDate() != nullsb.append("CreateDate: " + getCreateDate() + ",");
        if (getUserPolicyList() != nullsb.append("UserPolicyList: " + getUserPolicyList() + ",");
        if (getGroupList() != nullsb.append("GroupList: " + getGroupList() + ",");
        if (getAttachedManagedPolicies() != nullsb.append("AttachedManagedPolicies: " + getAttachedManagedPolicies() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode()); 
        hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); 
        hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); 
        hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); 
        hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); 
        hashCode = prime * hashCode + ((getUserPolicyList() == null) ? 0 : getUserPolicyList().hashCode()); 
        hashCode = prime * hashCode + ((getGroupList() == null) ? 0 : getGroupList().hashCode()); 
        hashCode = prime * hashCode + ((getAttachedManagedPolicies() == null) ? 0 : getAttachedManagedPolicies().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof UserDetail == falsereturn false;
        UserDetail other = (UserDetail)obj;
        
        if (other.getPath() == null ^ this.getPath() == nullreturn false;
        if (other.getPath() != null && other.getPath().equals(this.getPath()) == falsereturn false
        if (other.getUserName() == null ^ this.getUserName() == nullreturn false;
        if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == falsereturn false
        if (other.getUserId() == null ^ this.getUserId() == nullreturn false;
        if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == falsereturn false
        if (other.getArn() == null ^ this.getArn() == nullreturn false;
        if (other.getArn() != null && other.getArn().equals(this.getArn()) == falsereturn false
        if (other.getCreateDate() == null ^ this.getCreateDate() == nullreturn false;
        if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == falsereturn false
        if (other.getUserPolicyList() == null ^ this.getUserPolicyList() == nullreturn false;
        if (other.getUserPolicyList() != null && other.getUserPolicyList().equals(this.getUserPolicyList()) == falsereturn false
        if (other.getGroupList() == null ^ this.getGroupList() == nullreturn false;
        if (other.getGroupList() != null && other.getGroupList().equals(this.getGroupList()) == falsereturn false
        if (other.getAttachedManagedPolicies() == null ^ this.getAttachedManagedPolicies() == nullreturn false;
        if (other.getAttachedManagedPolicies() != null && other.getAttachedManagedPolicies().equals(this.getAttachedManagedPolicies()) == falsereturn false
        return true;
    }
    
    @Override
    public UserDetail clone() {
        try {
            return (UserDetailsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X