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

Import single or multi-volume disk images or EBS snapshots into an Amazon Machine Image (AMI).

 
A description string for the import image task.
 
     private String description;

    
Information about the disk containers.
 
The license type to be used for the Amazon Machine Image (AMI) after importing.

Note: You may only use BYOL if you have existing licenses with rights to use these licenses in a third party cloud like AWS. For more information, see VM Import/Export Prerequisites in the Amazon Elastic Compute Cloud User Guide for Linux.

Valid values: AWS | BYOL

 
     private String licenseType;

    
The target hypervisor platform.

Valid values: xen

 
     private String hypervisor;

    
The architecture of the virtual machine.

Valid values: i386 | x86_64

 
     private String architecture;

    
The operating system of the virtual machine.

Valid values: Windows | Linux

 
     private String platform;

    
The client-specific data.
 
     private ClientData clientData;

    
The token to enable idempotency for VM import requests.
 
     private String clientToken;

    
The name of the role to use when not using the default role, 'vmimport'.
 
     private String roleName;

    
A description string for the import image task.

Returns:
A description string for the import image task.
 
     public String getDescription() {
         return ;
     }
    
    
A description string for the import image task.

Parameters:
description A description string for the import image task.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A description string for the import image task.

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

Parameters:
description A description string for the import image task.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ImportImageRequest withDescription(String description) {
        this. = description;
        return this;
    }

    
Information about the disk containers.

Returns:
Information about the disk containers.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Information about the disk containers.

Parameters:
diskContainers Information about the disk containers.
    public void setDiskContainers(java.util.Collection<ImageDiskContainerdiskContainers) {
        if (diskContainers == null) {
            this. = null;
            return;
        }
        diskContainersCopy.addAll(diskContainers);
        this. = diskContainersCopy;
    }
    
    
Information about the disk containers.

NOTE: This method appends the values to the existing list (if any). Use setDiskContainers(java.util.Collection) or withDiskContainers(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:
diskContainers Information about the disk containers.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ImportImageRequest withDiskContainers(ImageDiskContainer... diskContainers) {
        if (getDiskContainers() == nullsetDiskContainers(new java.util.ArrayList<ImageDiskContainer>(diskContainers.length));
        for (ImageDiskContainer value : diskContainers) {
            getDiskContainers().add(value);
        }
        return this;
    }
    
    
Information about the disk containers.

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

Parameters:
diskContainers Information about the disk containers.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (diskContainers == null) {
            this. = null;
        } else {
            diskContainersCopy.addAll(diskContainers);
            this. = diskContainersCopy;
        }
        return this;
    }

    
The license type to be used for the Amazon Machine Image (AMI) after importing.

Note: You may only use BYOL if you have existing licenses with rights to use these licenses in a third party cloud like AWS. For more information, see VM Import/Export Prerequisites in the Amazon Elastic Compute Cloud User Guide for Linux.

Valid values: AWS | BYOL

Returns:
The license type to be used for the Amazon Machine Image (AMI) after importing.

Note: You may only use BYOL if you have existing licenses with rights to use these licenses in a third party cloud like AWS. For more information, see VM Import/Export Prerequisites in the Amazon Elastic Compute Cloud User Guide for Linux.

Valid values: AWS | BYOL

    public String getLicenseType() {
        return ;
    }
    
    
The license type to be used for the Amazon Machine Image (AMI) after importing.

Note: You may only use BYOL if you have existing licenses with rights to use these licenses in a third party cloud like AWS. For more information, see VM Import/Export Prerequisites in the Amazon Elastic Compute Cloud User Guide for Linux.

Valid values: AWS | BYOL

Parameters:
licenseType The license type to be used for the Amazon Machine Image (AMI) after importing.

Note: You may only use BYOL if you have existing licenses with rights to use these licenses in a third party cloud like AWS. For more information, see VM Import/Export Prerequisites in the Amazon Elastic Compute Cloud User Guide for Linux.

Valid values: AWS | BYOL

    public void setLicenseType(String licenseType) {
        this. = licenseType;
    }
    
    
The license type to be used for the Amazon Machine Image (AMI) after importing.

Note: You may only use BYOL if you have existing licenses with rights to use these licenses in a third party cloud like AWS. For more information, see VM Import/Export Prerequisites in the Amazon Elastic Compute Cloud User Guide for Linux.

Valid values: AWS | BYOL

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

Parameters:
licenseType The license type to be used for the Amazon Machine Image (AMI) after importing.

Note: You may only use BYOL if you have existing licenses with rights to use these licenses in a third party cloud like AWS. For more information, see VM Import/Export Prerequisites in the Amazon Elastic Compute Cloud User Guide for Linux.

Valid values: AWS | BYOL

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

    
The target hypervisor platform.

Valid values: xen

Returns:
The target hypervisor platform.

Valid values: xen

    public String getHypervisor() {
        return ;
    }
    
    
The target hypervisor platform.

Valid values: xen

Parameters:
hypervisor The target hypervisor platform.

Valid values: xen

    public void setHypervisor(String hypervisor) {
        this. = hypervisor;
    }
    
    
The target hypervisor platform.

Valid values: xen

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

Parameters:
hypervisor The target hypervisor platform.

Valid values: xen

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

    
The architecture of the virtual machine.

Valid values: i386 | x86_64

Returns:
The architecture of the virtual machine.

Valid values: i386 | x86_64

    public String getArchitecture() {
        return ;
    }
    
    
The architecture of the virtual machine.

Valid values: i386 | x86_64

Parameters:
architecture The architecture of the virtual machine.

Valid values: i386 | x86_64

    public void setArchitecture(String architecture) {
        this. = architecture;
    }
    
    
The architecture of the virtual machine.

Valid values: i386 | x86_64

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

Parameters:
architecture The architecture of the virtual machine.

Valid values: i386 | x86_64

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

    
The operating system of the virtual machine.

Valid values: Windows | Linux

Returns:
The operating system of the virtual machine.

Valid values: Windows | Linux

    public String getPlatform() {
        return ;
    }
    
    
The operating system of the virtual machine.

Valid values: Windows | Linux

Parameters:
platform The operating system of the virtual machine.

Valid values: Windows | Linux

    public void setPlatform(String platform) {
        this. = platform;
    }
    
    
The operating system of the virtual machine.

Valid values: Windows | Linux

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

Parameters:
platform The operating system of the virtual machine.

Valid values: Windows | Linux

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

    
The client-specific data.

Returns:
The client-specific data.
    public ClientData getClientData() {
        return ;
    }
    
    
The client-specific data.

Parameters:
clientData The client-specific data.
    public void setClientData(ClientData clientData) {
        this. = clientData;
    }
    
    
The client-specific data.

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

Parameters:
clientData The client-specific data.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ImportImageRequest withClientData(ClientData clientData) {
        this. = clientData;
        return this;
    }

    
The token to enable idempotency for VM import requests.

Returns:
The token to enable idempotency for VM import requests.
    public String getClientToken() {
        return ;
    }
    
    
The token to enable idempotency for VM import requests.

Parameters:
clientToken The token to enable idempotency for VM import requests.
    public void setClientToken(String clientToken) {
        this. = clientToken;
    }
    
    
The token to enable idempotency for VM import requests.

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

Parameters:
clientToken The token to enable idempotency for VM import requests.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ImportImageRequest withClientToken(String clientToken) {
        this. = clientToken;
        return this;
    }

    
The name of the role to use when not using the default role, 'vmimport'.

Returns:
The name of the role to use when not using the default role, 'vmimport'.
    public String getRoleName() {
        return ;
    }
    
    
The name of the role to use when not using the default role, 'vmimport'.

Parameters:
roleName The name of the role to use when not using the default role, 'vmimport'.
    public void setRoleName(String roleName) {
        this. = roleName;
    }
    
    
The name of the role to use when not using the default role, 'vmimport'.

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

Parameters:
roleName The name of the role to use when not using the default role, 'vmimport'.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ImportImageRequest withRoleName(String roleName) {
        this. = roleName;
        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<ImportImageRequestrequest = new ImportImageRequestMarshaller().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 (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getDiskContainers() != nullsb.append("DiskContainers: " + getDiskContainers() + ",");
        if (getLicenseType() != nullsb.append("LicenseType: " + getLicenseType() + ",");
        if (getHypervisor() != nullsb.append("Hypervisor: " + getHypervisor() + ",");
        if (getArchitecture() != nullsb.append("Architecture: " + getArchitecture() + ",");
        if (getPlatform() != nullsb.append("Platform: " + getPlatform() + ",");
        if (getClientData() != nullsb.append("ClientData: " + getClientData() + ",");
        if (getClientToken() != nullsb.append("ClientToken: " + getClientToken() + ",");
        if (getRoleName() != nullsb.append("RoleName: " + getRoleName() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getDiskContainers() == null) ? 0 : getDiskContainers().hashCode()); 
        hashCode = prime * hashCode + ((getLicenseType() == null) ? 0 : getLicenseType().hashCode()); 
        hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode()); 
        hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); 
        hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); 
        hashCode = prime * hashCode + ((getClientData() == null) ? 0 : getClientData().hashCode()); 
        hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
        hashCode = prime * hashCode + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ImportImageRequest == falsereturn false;
        ImportImageRequest other = (ImportImageRequest)obj;
        
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getDiskContainers() == null ^ this.getDiskContainers() == nullreturn false;
        if (other.getDiskContainers() != null && other.getDiskContainers().equals(this.getDiskContainers()) == falsereturn false
        if (other.getLicenseType() == null ^ this.getLicenseType() == nullreturn false;
        if (other.getLicenseType() != null && other.getLicenseType().equals(this.getLicenseType()) == falsereturn false
        if (other.getHypervisor() == null ^ this.getHypervisor() == nullreturn false;
        if (other.getHypervisor() != null && other.getHypervisor().equals(this.getHypervisor()) == falsereturn false
        if (other.getArchitecture() == null ^ this.getArchitecture() == nullreturn false;
        if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == falsereturn false
        if (other.getPlatform() == null ^ this.getPlatform() == nullreturn false;
        if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == falsereturn false
        if (other.getClientData() == null ^ this.getClientData() == nullreturn false;
        if (other.getClientData() != null && other.getClientData().equals(this.getClientData()) == falsereturn false
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        if (other.getRoleName() == null ^ this.getRoleName() == nullreturn false;
        if (other.getRoleName() != null && other.getRoleName().equals(this.getRoleName()) == falsereturn false
        return true;
    }
    
    @Override
    public ImportImageRequest clone() {
        
            return (ImportImageRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X