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

Initiates the copy of an AMI from the specified source region to the current region. You specify the destination region by using its endpoint when making the request. AMIs that use encrypted EBS snapshots cannot be copied with this method.

For more information, see Copying AMIs in the Amazon Elastic Compute Cloud User Guide .

 
The name of the region that contains the AMI to copy.
 
     private String sourceRegion;

    
The ID of the AMI to copy.
 
     private String sourceImageId;

    
The name of the new AMI in the destination region.
 
     private String name;

    
A description for the new AMI in the destination region.
 
     private String description;

    
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.
 
     private String clientToken;

    
The name of the region that contains the AMI to copy.

Returns:
The name of the region that contains the AMI to copy.
 
     public String getSourceRegion() {
         return ;
     }
    
    
The name of the region that contains the AMI to copy.

Parameters:
sourceRegion The name of the region that contains the AMI to copy.
 
     public void setSourceRegion(String sourceRegion) {
         this. = sourceRegion;
     }
    
    
The name of the region that contains the AMI to copy.

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

Parameters:
sourceRegion The name of the region that contains the AMI to copy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CopyImageRequest withSourceRegion(String sourceRegion) {
         this. = sourceRegion;
        return this;
    }

    
The ID of the AMI to copy.

Returns:
The ID of the AMI to copy.
    public String getSourceImageId() {
        return ;
    }
    
    
The ID of the AMI to copy.

Parameters:
sourceImageId The ID of the AMI to copy.
    public void setSourceImageId(String sourceImageId) {
        this. = sourceImageId;
    }
    
    
The ID of the AMI to copy.

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

Parameters:
sourceImageId The ID of the AMI to copy.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopyImageRequest withSourceImageId(String sourceImageId) {
        this. = sourceImageId;
        return this;
    }

    
The name of the new AMI in the destination region.

Returns:
The name of the new AMI in the destination region.
    public String getName() {
        return ;
    }
    
    
The name of the new AMI in the destination region.

Parameters:
name The name of the new AMI in the destination region.
    public void setName(String name) {
        this. = name;
    }
    
    
The name of the new AMI in the destination region.

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

Parameters:
name The name of the new AMI in the destination region.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopyImageRequest withName(String name) {
        this. = name;
        return this;
    }

    
A description for the new AMI in the destination region.

Returns:
A description for the new AMI in the destination region.
    public String getDescription() {
        return ;
    }
    
    
A description for the new AMI in the destination region.

Parameters:
description A description for the new AMI in the destination region.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A description for the new AMI in the destination region.

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

Parameters:
description A description for the new AMI in the destination region.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopyImageRequest withDescription(String description) {
        this. = description;
        return this;
    }

    
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

Returns:
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.
    public String getClientToken() {
        return ;
    }
    
    
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

Parameters:
clientToken Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.
    public void setClientToken(String clientToken) {
        this. = clientToken;
    }
    
    
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

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

Parameters:
clientToken Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopyImageRequest withClientToken(String clientToken) {
        this. = clientToken;
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        Request<CopyImageRequestrequest = new CopyImageRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
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 (getSourceRegion() != nullsb.append("SourceRegion: " + getSourceRegion() + ",");
        if (getSourceImageId() != nullsb.append("SourceImageId: " + getSourceImageId() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getClientToken() != nullsb.append("ClientToken: " + getClientToken() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSourceRegion() == null) ? 0 : getSourceRegion().hashCode()); 
        hashCode = prime * hashCode + ((getSourceImageId() == null) ? 0 : getSourceImageId().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CopyImageRequest == falsereturn false;
        CopyImageRequest other = (CopyImageRequest)obj;
        
        if (other.getSourceRegion() == null ^ this.getSourceRegion() == nullreturn false;
        if (other.getSourceRegion() != null && other.getSourceRegion().equals(this.getSourceRegion()) == falsereturn false
        if (other.getSourceImageId() == null ^ this.getSourceImageId() == nullreturn false;
        if (other.getSourceImageId() != null && other.getSourceImageId().equals(this.getSourceImageId()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        return true;
    }
    
    @Override
    public CopyImageRequest clone() {
        
            return (CopyImageRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X