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 UploadSigningCertificate operation.

Uploads an X.509 signing certificate and associates it with the specified user. Some AWS services use X.509 signing certificates to validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is Active .

If the UserName field is not specified, the user name is determined implicitly based on the AWS access key ID used to sign 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.

NOTE:Because the body of a X.509 certificate can be large, you should use POST rather than GET when calling UploadSigningCertificate. For information about setting up signatures and authorization through the API, go to Signing AWS API Requests in the AWS General Reference. For general information about using the Query API with IAM, go to Making Query Requests in the Using IAMguide.

 
 public class UploadSigningCertificateRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of the user the signing certificate is for.

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

 
     private String userName;

    
The contents of the signing certificate.

Constraints:
Length: 1 - 16384
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

 
     private String certificateBody;

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

Parameters:
certificateBody The contents of the signing certificate.
 
     public UploadSigningCertificateRequest(String certificateBody) {
         setCertificateBody(certificateBody);
     }

    
The name of the user the signing certificate is for.

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

Returns:
The name of the user the signing certificate is for.
 
     public String getUserName() {
         return ;
     }
    
    
The name of the user the signing certificate is for.

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

Parameters:
userName The name of the user the signing certificate is for.
    public void setUserName(String userName) {
        this. = userName;
    }
    
    
The name of the user the signing certificate is for.

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 the signing certificate is for.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = userName;
        return this;
    }

    
The contents of the signing certificate.

Constraints:
Length: 1 - 16384
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Returns:
The contents of the signing certificate.
    public String getCertificateBody() {
        return ;
    }
    
    
The contents of the signing certificate.

Constraints:
Length: 1 - 16384
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
certificateBody The contents of the signing certificate.
    public void setCertificateBody(String certificateBody) {
        this. = certificateBody;
    }
    
    
The contents of the signing certificate.

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

Constraints:
Length: 1 - 16384
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
certificateBody The contents of the signing certificate.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UploadSigningCertificateRequest withCertificateBody(String certificateBody) {
        this. = certificateBody;
        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 (getCertificateBody() != nullsb.append("CertificateBody: " + getCertificateBody() );
        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 + ((getCertificateBody() == null) ? 0 : getCertificateBody().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof UploadSigningCertificateRequest == falsereturn false;
        
        if (other.getUserName() == null ^ this.getUserName() == nullreturn false;
        if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == falsereturn false
        if (other.getCertificateBody() == null ^ this.getCertificateBody() == nullreturn false;
        if (other.getCertificateBody() != null && other.getCertificateBody().equals(this.getCertificateBody()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (UploadSigningCertificateRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X