/* * 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 DeleteBucketRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The name of the bucket to delete. *
** Use the GetBuckets action * to get a list of bucket names that you can specify. *
*/ private String bucketName; /** ** A Boolean value that indicates whether to force delete the bucket. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, distributions, * or software that use the issued access keys. *
** The name of the bucket to delete. *
** Use the GetBuckets action * to get a list of bucket names that you can specify. *
* * @param bucketName * The name of the bucket to delete. ** Use the GetBuckets * action to get a list of bucket names that you can specify. */ public void setBucketName(String bucketName) { this.bucketName = bucketName; } /** *
* The name of the bucket to delete. *
** Use the GetBuckets action * to get a list of bucket names that you can specify. *
* * @return The name of the bucket to delete. ** Use the GetBuckets * action to get a list of bucket names that you can specify. */ public String getBucketName() { return this.bucketName; } /** *
* The name of the bucket to delete. *
** Use the GetBuckets action * to get a list of bucket names that you can specify. *
* * @param bucketName * The name of the bucket to delete. ** Use the GetBuckets * action to get a list of bucket names that you can specify. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteBucketRequest withBucketName(String bucketName) { setBucketName(bucketName); return this; } /** *
* A Boolean value that indicates whether to force delete the bucket. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, distributions, * or software that use the issued access keys. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, * distributions, or software that use the issued access keys. *
*/ public void setForceDelete(Boolean forceDelete) { this.forceDelete = forceDelete; } /** ** A Boolean value that indicates whether to force delete the bucket. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, distributions, * or software that use the issued access keys. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, * distributions, or software that use the issued access keys. *
*/ public Boolean getForceDelete() { return this.forceDelete; } /** ** A Boolean value that indicates whether to force delete the bucket. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, distributions, * or software that use the issued access keys. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, * distributions, or software that use the issued access keys. *
* @return Returns a reference to this object so that method calls can be chained together. */ public DeleteBucketRequest withForceDelete(Boolean forceDelete) { setForceDelete(forceDelete); return this; } /** ** A Boolean value that indicates whether to force delete the bucket. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, distributions, * or software that use the issued access keys. *
** You must force delete the bucket if it has one of the following conditions: *
** The bucket is the origin of a distribution. *
** The bucket has instances that were granted access to it using the SetResourceAccessForBucket action. *
** The bucket has objects. *
** The bucket has access keys. *
** Force deleting a bucket might impact other resources that rely on the bucket, such as instances, * distributions, or software that use the issued access keys. *
*/ public Boolean isForceDelete() { return this.forceDelete; } /** * 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 (getForceDelete() != null) sb.append("ForceDelete: ").append(getForceDelete()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteBucketRequest == false) return false; DeleteBucketRequest other = (DeleteBucketRequest) obj; if (other.getBucketName() == null ^ this.getBucketName() == null) return false; if (other.getBucketName() != null && other.getBucketName().equals(this.getBucketName()) == false) return false; if (other.getForceDelete() == null ^ this.getForceDelete() == null) return false; if (other.getForceDelete() != null && other.getForceDelete().equals(this.getForceDelete()) == 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 + ((getForceDelete() == null) ? 0 : getForceDelete().hashCode()); return hashCode; } @Override public DeleteBucketRequest clone() { return (DeleteBucketRequest) super.clone(); } }