/* * Copyright 2018-2023 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.lightsail.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateInstancesRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for * example: ["MyFirstInstance","MySecondInstance"] *

*/ private java.util.List instanceNames; /** *

* The Availability Zone in which to create your instance. Use the following format: us-east-2a (case * sensitive). You can get a list of Availability Zones by using the get regions * operation. Be sure to add the include Availability Zones parameter to your request. *

*/ private String availabilityZone; /** *

* (Deprecated) The name for your custom image. *

* *

* In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *

*
*/ @Deprecated private String customImageName; /** *

* The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0). * Use the get blueprints operation to return a list of available images (or blueprints). *

* *

* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with * existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when * they become outdated due to operating system updates or new application releases. *

*
*/ private String blueprintId; /** *

* The bundle of specification information for your virtual private server (or instance), including the * pricing plan (e.g., micro_1_0). *

*/ private String bundleId; /** *

* A launch script you can create that configures a server with additional user data. For example, you might want to * run apt-get -y update. *

* *

* Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and * CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses pkg. For a * complete list, see the Amazon Lightsail Developer Guide. *

*
*/ private String userData; /** *

* The name of your key pair. *

*/ private String keyPairName; /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

*/ private java.util.List tags; /** *

* An array of objects representing the add-ons to enable for the new instance. *

*/ private java.util.List addOns; /** *

* The IP address type for the instance. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

*/ private String ipAddressType; /** *

* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for * example: ["MyFirstInstance","MySecondInstance"] *

* * @return The names to use for your new Lightsail instances. Separate multiple values using quotation marks and * commas, for example: ["MyFirstInstance","MySecondInstance"] */ public java.util.List getInstanceNames() { return instanceNames; } /** *

* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for * example: ["MyFirstInstance","MySecondInstance"] *

* * @param instanceNames * The names to use for your new Lightsail instances. Separate multiple values using quotation marks and * commas, for example: ["MyFirstInstance","MySecondInstance"] */ public void setInstanceNames(java.util.Collection instanceNames) { if (instanceNames == null) { this.instanceNames = null; return; } this.instanceNames = new java.util.ArrayList(instanceNames); } /** *

* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for * example: ["MyFirstInstance","MySecondInstance"] *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setInstanceNames(java.util.Collection)} or {@link #withInstanceNames(java.util.Collection)} if you want * to override the existing values. *

* * @param instanceNames * The names to use for your new Lightsail instances. Separate multiple values using quotation marks and * commas, for example: ["MyFirstInstance","MySecondInstance"] * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withInstanceNames(String... instanceNames) { if (this.instanceNames == null) { setInstanceNames(new java.util.ArrayList(instanceNames.length)); } for (String ele : instanceNames) { this.instanceNames.add(ele); } return this; } /** *

* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for * example: ["MyFirstInstance","MySecondInstance"] *

* * @param instanceNames * The names to use for your new Lightsail instances. Separate multiple values using quotation marks and * commas, for example: ["MyFirstInstance","MySecondInstance"] * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withInstanceNames(java.util.Collection instanceNames) { setInstanceNames(instanceNames); return this; } /** *

* The Availability Zone in which to create your instance. Use the following format: us-east-2a (case * sensitive). You can get a list of Availability Zones by using the get regions * operation. Be sure to add the include Availability Zones parameter to your request. *

* * @param availabilityZone * The Availability Zone in which to create your instance. Use the following format: us-east-2a * (case sensitive). You can get a list of Availability Zones by using the get regions * operation. Be sure to add the include Availability Zones parameter to your request. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** *

* The Availability Zone in which to create your instance. Use the following format: us-east-2a (case * sensitive). You can get a list of Availability Zones by using the get regions * operation. Be sure to add the include Availability Zones parameter to your request. *

* * @return The Availability Zone in which to create your instance. Use the following format: us-east-2a * (case sensitive). You can get a list of Availability Zones by using the get regions * operation. Be sure to add the include Availability Zones parameter to your request. */ public String getAvailabilityZone() { return this.availabilityZone; } /** *

* The Availability Zone in which to create your instance. Use the following format: us-east-2a (case * sensitive). You can get a list of Availability Zones by using the get regions * operation. Be sure to add the include Availability Zones parameter to your request. *

* * @param availabilityZone * The Availability Zone in which to create your instance. Use the following format: us-east-2a * (case sensitive). You can get a list of Availability Zones by using the get regions * operation. Be sure to add the include Availability Zones parameter to your request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** *

* (Deprecated) The name for your custom image. *

* *

* In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *

*
* * @param customImageName * (Deprecated) The name for your custom image.

*

* In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *

*/ @Deprecated public void setCustomImageName(String customImageName) { this.customImageName = customImageName; } /** *

* (Deprecated) The name for your custom image. *

* *

* In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *

*
* * @return (Deprecated) The name for your custom image.

*

* In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *

*/ @Deprecated public String getCustomImageName() { return this.customImageName; } /** *

* (Deprecated) The name for your custom image. *

* *

* In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *

*
* * @param customImageName * (Deprecated) The name for your custom image.

*

* In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *

* @return Returns a reference to this object so that method calls can be chained together. */ @Deprecated public CreateInstancesRequest withCustomImageName(String customImageName) { setCustomImageName(customImageName); return this; } /** *

* The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0). * Use the get blueprints operation to return a list of available images (or blueprints). *

* *

* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with * existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when * they become outdated due to operating system updates or new application releases. *

*
* * @param blueprintId * The ID for a virtual private server image (e.g., app_wordpress_4_4 or * app_lamp_7_0). Use the get blueprints operation to return a list of available * images (or blueprints).

*

* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers * with existing instances and are not necessarily available to create new instances. Blueprints are marked * inactive when they become outdated due to operating system updates or new application releases. *

*/ public void setBlueprintId(String blueprintId) { this.blueprintId = blueprintId; } /** *

* The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0). * Use the get blueprints operation to return a list of available images (or blueprints). *

* *

* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with * existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when * they become outdated due to operating system updates or new application releases. *

*
* * @return The ID for a virtual private server image (e.g., app_wordpress_4_4 or * app_lamp_7_0). Use the get blueprints operation to return a list of available * images (or blueprints).

*

* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers * with existing instances and are not necessarily available to create new instances. Blueprints are marked * inactive when they become outdated due to operating system updates or new application releases. *

*/ public String getBlueprintId() { return this.blueprintId; } /** *

* The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0). * Use the get blueprints operation to return a list of available images (or blueprints). *

* *

* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with * existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when * they become outdated due to operating system updates or new application releases. *

*
* * @param blueprintId * The ID for a virtual private server image (e.g., app_wordpress_4_4 or * app_lamp_7_0). Use the get blueprints operation to return a list of available * images (or blueprints).

*

* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers * with existing instances and are not necessarily available to create new instances. Blueprints are marked * inactive when they become outdated due to operating system updates or new application releases. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withBlueprintId(String blueprintId) { setBlueprintId(blueprintId); return this; } /** *

* The bundle of specification information for your virtual private server (or instance), including the * pricing plan (e.g., micro_1_0). *

* * @param bundleId * The bundle of specification information for your virtual private server (or instance), including * the pricing plan (e.g., micro_1_0). */ public void setBundleId(String bundleId) { this.bundleId = bundleId; } /** *

* The bundle of specification information for your virtual private server (or instance), including the * pricing plan (e.g., micro_1_0). *

* * @return The bundle of specification information for your virtual private server (or instance), including * the pricing plan (e.g., micro_1_0). */ public String getBundleId() { return this.bundleId; } /** *

* The bundle of specification information for your virtual private server (or instance), including the * pricing plan (e.g., micro_1_0). *

* * @param bundleId * The bundle of specification information for your virtual private server (or instance), including * the pricing plan (e.g., micro_1_0). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withBundleId(String bundleId) { setBundleId(bundleId); return this; } /** *

* A launch script you can create that configures a server with additional user data. For example, you might want to * run apt-get -y update. *

* *

* Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and * CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses pkg. For a * complete list, see the Amazon Lightsail Developer Guide. *

*
* * @param userData * A launch script you can create that configures a server with additional user data. For example, you might * want to run apt-get -y update.

*

* Depending on the machine image you choose, the command to get software on your instance varies. Amazon * Linux and CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses * pkg. For a complete list, see the Amazon Lightsail Developer Guide. *

*/ public void setUserData(String userData) { this.userData = userData; } /** *

* A launch script you can create that configures a server with additional user data. For example, you might want to * run apt-get -y update. *

* *

* Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and * CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses pkg. For a * complete list, see the Amazon Lightsail Developer Guide. *

*
* * @return A launch script you can create that configures a server with additional user data. For example, you might * want to run apt-get -y update.

*

* Depending on the machine image you choose, the command to get software on your instance varies. Amazon * Linux and CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses * pkg. For a complete list, see the Amazon Lightsail Developer Guide. *

*/ public String getUserData() { return this.userData; } /** *

* A launch script you can create that configures a server with additional user data. For example, you might want to * run apt-get -y update. *

* *

* Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and * CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses pkg. For a * complete list, see the Amazon Lightsail Developer Guide. *

*
* * @param userData * A launch script you can create that configures a server with additional user data. For example, you might * want to run apt-get -y update.

*

* Depending on the machine image you choose, the command to get software on your instance varies. Amazon * Linux and CentOS use yum, Debian and Ubuntu use apt-get, and FreeBSD uses * pkg. For a complete list, see the Amazon Lightsail Developer Guide. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withUserData(String userData) { setUserData(userData); return this; } /** *

* The name of your key pair. *

* * @param keyPairName * The name of your key pair. */ public void setKeyPairName(String keyPairName) { this.keyPairName = keyPairName; } /** *

* The name of your key pair. *

* * @return The name of your key pair. */ public String getKeyPairName() { return this.keyPairName; } /** *

* The name of your key pair. *

* * @param keyPairName * The name of your key pair. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withKeyPairName(String keyPairName) { setKeyPairName(keyPairName); return this; } /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

* * @return The tag keys and optional values to add to the resource during create.

*

* Use the TagResource action to tag a resource after it's created. */ public java.util.List getTags() { return tags; } /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

* * @param tags * The tag keys and optional values to add to the resource during create.

*

* Use the TagResource action to tag a resource after it's created. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *

* * @param tags * The tag keys and optional values to add to the resource during create.

*

* Use the TagResource action to tag a resource after it's created. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

* * @param tags * The tag keys and optional values to add to the resource during create.

*

* Use the TagResource action to tag a resource after it's created. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* An array of objects representing the add-ons to enable for the new instance. *

* * @return An array of objects representing the add-ons to enable for the new instance. */ public java.util.List getAddOns() { return addOns; } /** *

* An array of objects representing the add-ons to enable for the new instance. *

* * @param addOns * An array of objects representing the add-ons to enable for the new instance. */ public void setAddOns(java.util.Collection addOns) { if (addOns == null) { this.addOns = null; return; } this.addOns = new java.util.ArrayList(addOns); } /** *

* An array of objects representing the add-ons to enable for the new instance. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setAddOns(java.util.Collection)} or {@link #withAddOns(java.util.Collection)} if you want to override the * existing values. *

* * @param addOns * An array of objects representing the add-ons to enable for the new instance. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withAddOns(AddOnRequest... addOns) { if (this.addOns == null) { setAddOns(new java.util.ArrayList(addOns.length)); } for (AddOnRequest ele : addOns) { this.addOns.add(ele); } return this; } /** *

* An array of objects representing the add-ons to enable for the new instance. *

* * @param addOns * An array of objects representing the add-ons to enable for the new instance. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withAddOns(java.util.Collection addOns) { setAddOns(addOns); return this; } /** *

* The IP address type for the instance. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

* * @param ipAddressType * The IP address type for the instance.

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. * @see IpAddressType */ public void setIpAddressType(String ipAddressType) { this.ipAddressType = ipAddressType; } /** *

* The IP address type for the instance. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

* * @return The IP address type for the instance.

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. * @see IpAddressType */ public String getIpAddressType() { return this.ipAddressType; } /** *

* The IP address type for the instance. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

* * @param ipAddressType * The IP address type for the instance.

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. * @return Returns a reference to this object so that method calls can be chained together. * @see IpAddressType */ public CreateInstancesRequest withIpAddressType(String ipAddressType) { setIpAddressType(ipAddressType); return this; } /** *

* The IP address type for the instance. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

* * @param ipAddressType * The IP address type for the instance.

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. * @return Returns a reference to this object so that method calls can be chained together. * @see IpAddressType */ public CreateInstancesRequest withIpAddressType(IpAddressType ipAddressType) { this.ipAddressType = ipAddressType.toString(); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getInstanceNames() != null) sb.append("InstanceNames: ").append(getInstanceNames()).append(","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getCustomImageName() != null) sb.append("CustomImageName: ").append(getCustomImageName()).append(","); if (getBlueprintId() != null) sb.append("BlueprintId: ").append(getBlueprintId()).append(","); if (getBundleId() != null) sb.append("BundleId: ").append(getBundleId()).append(","); if (getUserData() != null) sb.append("UserData: ").append(getUserData()).append(","); if (getKeyPairName() != null) sb.append("KeyPairName: ").append(getKeyPairName()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getAddOns() != null) sb.append("AddOns: ").append(getAddOns()).append(","); if (getIpAddressType() != null) sb.append("IpAddressType: ").append(getIpAddressType()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateInstancesRequest == false) return false; CreateInstancesRequest other = (CreateInstancesRequest) obj; if (other.getInstanceNames() == null ^ this.getInstanceNames() == null) return false; if (other.getInstanceNames() != null && other.getInstanceNames().equals(this.getInstanceNames()) == false) return false; if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null) return false; if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false) return false; if (other.getCustomImageName() == null ^ this.getCustomImageName() == null) return false; if (other.getCustomImageName() != null && other.getCustomImageName().equals(this.getCustomImageName()) == false) return false; if (other.getBlueprintId() == null ^ this.getBlueprintId() == null) return false; if (other.getBlueprintId() != null && other.getBlueprintId().equals(this.getBlueprintId()) == false) return false; if (other.getBundleId() == null ^ this.getBundleId() == null) return false; if (other.getBundleId() != null && other.getBundleId().equals(this.getBundleId()) == false) return false; if (other.getUserData() == null ^ this.getUserData() == null) return false; if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == false) return false; if (other.getKeyPairName() == null ^ this.getKeyPairName() == null) return false; if (other.getKeyPairName() != null && other.getKeyPairName().equals(this.getKeyPairName()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getAddOns() == null ^ this.getAddOns() == null) return false; if (other.getAddOns() != null && other.getAddOns().equals(this.getAddOns()) == false) return false; if (other.getIpAddressType() == null ^ this.getIpAddressType() == null) return false; if (other.getIpAddressType() != null && other.getIpAddressType().equals(this.getIpAddressType()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInstanceNames() == null) ? 0 : getInstanceNames().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getCustomImageName() == null) ? 0 : getCustomImageName().hashCode()); hashCode = prime * hashCode + ((getBlueprintId() == null) ? 0 : getBlueprintId().hashCode()); hashCode = prime * hashCode + ((getBundleId() == null) ? 0 : getBundleId().hashCode()); hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode()); hashCode = prime * hashCode + ((getKeyPairName() == null) ? 0 : getKeyPairName().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getAddOns() == null) ? 0 : getAddOns().hashCode()); hashCode = prime * hashCode + ((getIpAddressType() == null) ? 0 : getIpAddressType().hashCode()); return hashCode; } @Override public CreateInstancesRequest clone() { return (CreateInstancesRequest) super.clone(); } }