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;
 
 
Container for the parameters to the DeleteAccessKey operation.

Deletes the access key associated with the specified user.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request. Because this action works for access keys under the AWS account, you can use this action to manage root credentials even if the AWS account has no associated users.

 
 public class DeleteAccessKeyRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of the user whose key you want to delete.

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

 
     private String userName;

    
The access key ID for the access key ID and secret access key you want to delete.

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

 
     private String accessKeyId;

    
Default constructor for a new DeleteAccessKeyRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public DeleteAccessKeyRequest() {}
    
    
Constructs a new DeleteAccessKeyRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
userName The name of the user whose key you want to delete.
accessKeyId The access key ID for the access key ID and secret access key you want to delete.
 
     public DeleteAccessKeyRequest(String userNameString accessKeyId) {
         setUserName(userName);
         setAccessKeyId(accessKeyId);
     }

    
The name of the user whose key you want to delete.

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

Returns:
The name of the user whose key you want to delete.
 
     public String getUserName() {
         return ;
     }
    
    
The name of the user whose key you want to delete.

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

Parameters:
userName The name of the user whose key you want to delete.
 
     public void setUserName(String userName) {
        this. = userName;
    }
    
    
The name of the user whose key you want to delete.

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

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

Parameters:
userName The name of the user whose key you want to delete.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DeleteAccessKeyRequest withUserName(String userName) {
        this. = userName;
        return this;
    }

    
The access key ID for the access key ID and secret access key you want to delete.

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

Returns:
The access key ID for the access key ID and secret access key you want to delete.
    public String getAccessKeyId() {
        return ;
    }
    
    
The access key ID for the access key ID and secret access key you want to delete.

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

Parameters:
accessKeyId The access key ID for the access key ID and secret access key you want to delete.
    public void setAccessKeyId(String accessKeyId) {
        this. = accessKeyId;
    }
    
    
The access key ID for the access key ID and secret access key you want to delete.

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

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

Parameters:
accessKeyId The access key ID for the access key ID and secret access key you want to delete.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DeleteAccessKeyRequest withAccessKeyId(String accessKeyId) {
        this. = accessKeyId;
        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 (getUserName() != nullsb.append("UserName: " + getUserName() + ",");
        if (getAccessKeyId() != nullsb.append("AccessKeyId: " + getAccessKeyId() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); 
        hashCode = prime * hashCode + ((getAccessKeyId() == null) ? 0 : getAccessKeyId().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DeleteAccessKeyRequest == falsereturn false;
        DeleteAccessKeyRequest other = (DeleteAccessKeyRequest)obj;
        
        if (other.getUserName() == null ^ this.getUserName() == nullreturn false;
        if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == falsereturn false
        if (other.getAccessKeyId() == null ^ this.getAccessKeyId() == nullreturn false;
        if (other.getAccessKeyId() != null && other.getAccessKeyId().equals(this.getAccessKeyId()) == falsereturn false
        return true;
    }
    
    @Override
    public DeleteAccessKeyRequest clone() {
        
            return (DeleteAccessKeyRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X