/* * 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 CreateBucketRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The name for the bucket. *
** For more information about bucket names, see Bucket * naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide. *
*/ private String bucketName; /** ** The ID of the bundle to use for the bucket. *
** A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. *
** Use the * GetBucketBundles action to get a list of bundle IDs that you can specify. *
** Use the * UpdateBucketBundle action to change the bundle after the bucket is created. *
*/ private String bundleId; /** ** The tag keys and optional values to add to the bucket during creation. *
** Use the TagResource action * to tag the bucket after it's created. *
*/ private java.util.List* A Boolean value that indicates whether to enable versioning of objects in the bucket. *
** For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide. *
*/ private Boolean enableObjectVersioning; /** ** The name for the bucket. *
** For more information about bucket names, see Bucket * naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide. *
* * @param bucketName * The name for the bucket. ** For more information about bucket names, see Bucket naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide. */ public void setBucketName(String bucketName) { this.bucketName = bucketName; } /** *
* The name for the bucket. *
** For more information about bucket names, see Bucket * naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide. *
* * @return The name for the bucket. ** For more information about bucket names, see Bucket naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide. */ public String getBucketName() { return this.bucketName; } /** *
* The name for the bucket. *
** For more information about bucket names, see Bucket * naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide. *
* * @param bucketName * The name for the bucket. ** For more information about bucket names, see Bucket naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateBucketRequest withBucketName(String bucketName) { setBucketName(bucketName); return this; } /** *
* The ID of the bundle to use for the bucket. *
** A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. *
** Use the * GetBucketBundles action to get a list of bundle IDs that you can specify. *
** Use the * UpdateBucketBundle action to change the bundle after the bucket is created. *
* * @param bundleId * The ID of the bundle to use for the bucket. ** A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. *
** Use the * GetBucketBundles action to get a list of bundle IDs that you can specify. *
** Use the UpdateBucketBundle action to change the bundle after the bucket is created. */ public void setBundleId(String bundleId) { this.bundleId = bundleId; } /** *
* The ID of the bundle to use for the bucket. *
** A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. *
** Use the * GetBucketBundles action to get a list of bundle IDs that you can specify. *
** Use the * UpdateBucketBundle action to change the bundle after the bucket is created. *
* * @return The ID of the bundle to use for the bucket. ** A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. *
** Use the GetBucketBundles action to get a list of bundle IDs that you can specify. *
** Use the UpdateBucketBundle action to change the bundle after the bucket is created. */ public String getBundleId() { return this.bundleId; } /** *
* The ID of the bundle to use for the bucket. *
** A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. *
** Use the * GetBucketBundles action to get a list of bundle IDs that you can specify. *
** Use the * UpdateBucketBundle action to change the bundle after the bucket is created. *
* * @param bundleId * The ID of the bundle to use for the bucket. ** A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. *
** Use the * GetBucketBundles action to get a list of bundle IDs that you can specify. *
** Use the UpdateBucketBundle action to change the bundle after the bucket is created. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateBucketRequest withBundleId(String bundleId) { setBundleId(bundleId); return this; } /** *
* The tag keys and optional values to add to the bucket during creation. *
** Use the TagResource action * to tag the bucket after it's created. *
* * @return The tag keys and optional values to add to the bucket during creation. *
* Use the TagResource
* action to tag the bucket after it's created.
*/
public java.util.List
* The tag keys and optional values to add to the bucket during creation.
*
* Use the TagResource action
* to tag the bucket after it's created.
*
* Use the TagResource
* action to tag the bucket after it's created.
*/
public void setTags(java.util.Collection
* The tag keys and optional values to add to the bucket during creation.
*
* Use the TagResource action
* to tag the bucket 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.
*
* Use the TagResource
* action to tag the bucket after it's created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateBucketRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList
* The tag keys and optional values to add to the bucket during creation.
*
* Use the TagResource action
* to tag the bucket after it's created.
*
* Use the TagResource
* action to tag the bucket after it's created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateBucketRequest withTags(java.util.Collection
* A Boolean value that indicates whether to enable versioning of objects in the bucket.
*
* For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail
* Developer Guide.
*
* For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide. */ public void setEnableObjectVersioning(Boolean enableObjectVersioning) { this.enableObjectVersioning = enableObjectVersioning; } /** *
* A Boolean value that indicates whether to enable versioning of objects in the bucket. *
** For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide. *
* * @return A Boolean value that indicates whether to enable versioning of objects in the bucket. ** For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide. */ public Boolean getEnableObjectVersioning() { return this.enableObjectVersioning; } /** *
* A Boolean value that indicates whether to enable versioning of objects in the bucket. *
** For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide. *
* * @param enableObjectVersioning * A Boolean value that indicates whether to enable versioning of objects in the bucket. ** For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateBucketRequest withEnableObjectVersioning(Boolean enableObjectVersioning) { setEnableObjectVersioning(enableObjectVersioning); return this; } /** *
* A Boolean value that indicates whether to enable versioning of objects in the bucket. *
** For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide. *
* * @return A Boolean value that indicates whether to enable versioning of objects in the bucket. ** For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide. */ public Boolean isEnableObjectVersioning() { return this.enableObjectVersioning; } /** * 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 (getBucketName() != null) sb.append("BucketName: ").append(getBucketName()).append(","); if (getBundleId() != null) sb.append("BundleId: ").append(getBundleId()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getEnableObjectVersioning() != null) sb.append("EnableObjectVersioning: ").append(getEnableObjectVersioning()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateBucketRequest == false) return false; CreateBucketRequest other = (CreateBucketRequest) obj; if (other.getBucketName() == null ^ this.getBucketName() == null) return false; if (other.getBucketName() != null && other.getBucketName().equals(this.getBucketName()) == 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.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getEnableObjectVersioning() == null ^ this.getEnableObjectVersioning() == null) return false; if (other.getEnableObjectVersioning() != null && other.getEnableObjectVersioning().equals(this.getEnableObjectVersioning()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBucketName() == null) ? 0 : getBucketName().hashCode()); hashCode = prime * hashCode + ((getBundleId() == null) ? 0 : getBundleId().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getEnableObjectVersioning() == null) ? 0 : getEnableObjectVersioning().hashCode()); return hashCode; } @Override public CreateBucketRequest clone() { return (CreateBucketRequest) super.clone(); } }