/* * 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 CreateDiskRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The unique Lightsail disk name (e.g., my-disk). *

*/ private String diskName; /** *

* The Availability Zone where you want to create the disk (e.g., us-east-2a). Use the same * Availability Zone as the Lightsail instance to which you want to attach the disk. *

*

* Use the get regions operation to list the Availability Zones where Lightsail is currently available. *

*/ private String availabilityZone; /** *

* The size of the disk in GB (e.g., 32). *

*/ private Integer sizeInGb; /** *

* 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 that represent the add-ons to enable for the new disk. *

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

* The unique Lightsail disk name (e.g., my-disk). *

* * @param diskName * The unique Lightsail disk name (e.g., my-disk). */ public void setDiskName(String diskName) { this.diskName = diskName; } /** *

* The unique Lightsail disk name (e.g., my-disk). *

* * @return The unique Lightsail disk name (e.g., my-disk). */ public String getDiskName() { return this.diskName; } /** *

* The unique Lightsail disk name (e.g., my-disk). *

* * @param diskName * The unique Lightsail disk name (e.g., my-disk). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDiskRequest withDiskName(String diskName) { setDiskName(diskName); return this; } /** *

* The Availability Zone where you want to create the disk (e.g., us-east-2a). Use the same * Availability Zone as the Lightsail instance to which you want to attach the disk. *

*

* Use the get regions operation to list the Availability Zones where Lightsail is currently available. *

* * @param availabilityZone * The Availability Zone where you want to create the disk (e.g., us-east-2a). Use the same * Availability Zone as the Lightsail instance to which you want to attach the disk.

*

* Use the get regions operation to list the Availability Zones where Lightsail is currently * available. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** *

* The Availability Zone where you want to create the disk (e.g., us-east-2a). Use the same * Availability Zone as the Lightsail instance to which you want to attach the disk. *

*

* Use the get regions operation to list the Availability Zones where Lightsail is currently available. *

* * @return The Availability Zone where you want to create the disk (e.g., us-east-2a). Use the same * Availability Zone as the Lightsail instance to which you want to attach the disk.

*

* Use the get regions operation to list the Availability Zones where Lightsail is currently * available. */ public String getAvailabilityZone() { return this.availabilityZone; } /** *

* The Availability Zone where you want to create the disk (e.g., us-east-2a). Use the same * Availability Zone as the Lightsail instance to which you want to attach the disk. *

*

* Use the get regions operation to list the Availability Zones where Lightsail is currently available. *

* * @param availabilityZone * The Availability Zone where you want to create the disk (e.g., us-east-2a). Use the same * Availability Zone as the Lightsail instance to which you want to attach the disk.

*

* Use the get regions operation to list the Availability Zones where Lightsail is currently * available. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDiskRequest withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** *

* The size of the disk in GB (e.g., 32). *

* * @param sizeInGb * The size of the disk in GB (e.g., 32). */ public void setSizeInGb(Integer sizeInGb) { this.sizeInGb = sizeInGb; } /** *

* The size of the disk in GB (e.g., 32). *

* * @return The size of the disk in GB (e.g., 32). */ public Integer getSizeInGb() { return this.sizeInGb; } /** *

* The size of the disk in GB (e.g., 32). *

* * @param sizeInGb * The size of the disk in GB (e.g., 32). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDiskRequest withSizeInGb(Integer sizeInGb) { setSizeInGb(sizeInGb); 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 CreateDiskRequest 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 CreateDiskRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* An array of objects that represent the add-ons to enable for the new disk. *

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

* An array of objects that represent the add-ons to enable for the new disk. *

* * @param addOns * An array of objects that represent the add-ons to enable for the new disk. */ 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 that represent the add-ons to enable for the new disk. *

*

* 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 that represent the add-ons to enable for the new disk. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDiskRequest 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 that represent the add-ons to enable for the new disk. *

* * @param addOns * An array of objects that represent the add-ons to enable for the new disk. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDiskRequest withAddOns(java.util.Collection addOns) { setAddOns(addOns); 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 (getDiskName() != null) sb.append("DiskName: ").append(getDiskName()).append(","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getSizeInGb() != null) sb.append("SizeInGb: ").append(getSizeInGb()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getAddOns() != null) sb.append("AddOns: ").append(getAddOns()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateDiskRequest == false) return false; CreateDiskRequest other = (CreateDiskRequest) obj; if (other.getDiskName() == null ^ this.getDiskName() == null) return false; if (other.getDiskName() != null && other.getDiskName().equals(this.getDiskName()) == 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.getSizeInGb() == null ^ this.getSizeInGb() == null) return false; if (other.getSizeInGb() != null && other.getSizeInGb().equals(this.getSizeInGb()) == 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; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDiskName() == null) ? 0 : getDiskName().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getSizeInGb() == null) ? 0 : getSizeInGb().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getAddOns() == null) ? 0 : getAddOns().hashCode()); return hashCode; } @Override public CreateDiskRequest clone() { return (CreateDiskRequest) super.clone(); } }