All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.macie2.model.S3Bucket Maven / Gradle / Ivy

/*
 * Copyright 2016-2021 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.macie2.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Provides information about an S3 bucket that a finding applies to. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class S3Bucket implements Serializable, Cloneable, StructuredPojo { /** *

* Specifies whether the bucket policy for the bucket requires server-side encryption of objects when objects are * uploaded to the bucket. Possible values are: *

*
    *
  • *

    * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include the * x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

    *
  • *
  • *

    * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include the * x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or aws:kms. *

    *
  • *
  • *

    * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of objects. *

    *
  • *
*/ private String allowsUnencryptedObjectUploads; /** *

* The Amazon Resource Name (ARN) of the bucket. *

*/ private String arn; /** *

* The date and time, in UTC and extended ISO 8601 format, when the bucket was created. *

*/ private java.util.Date createdAt; /** *

* The type of server-side encryption that's used by default to encrypt objects in the bucket. *

*/ private ServerSideEncryption defaultServerSideEncryption; /** *

* The name of the bucket. *

*/ private String name; /** *

* The display name and AWS account ID for the user who owns the bucket. *

*/ private S3BucketOwner owner; /** *

* The permissions settings that determine whether the bucket is publicly accessible. *

*/ private BucketPublicAccess publicAccess; /** *

* The tags that are associated with the bucket. *

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

* Specifies whether the bucket policy for the bucket requires server-side encryption of objects when objects are * uploaded to the bucket. Possible values are: *

*
    *
  • *

    * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include the * x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

    *
  • *
  • *

    * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include the * x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or aws:kms. *

    *
  • *
  • *

    * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of objects. *

    *
  • *
* * @param allowsUnencryptedObjectUploads * Specifies whether the bucket policy for the bucket requires server-side encryption of objects when objects * are uploaded to the bucket. Possible values are:

*
    *
  • *

    * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include * the x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

    *
  • *
  • *

    * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include the * x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or * aws:kms. *

    *
  • *
  • *

    * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of * objects. *

    *
  • * @see AllowsUnencryptedObjectUploads */ public void setAllowsUnencryptedObjectUploads(String allowsUnencryptedObjectUploads) { this.allowsUnencryptedObjectUploads = allowsUnencryptedObjectUploads; } /** *

    * Specifies whether the bucket policy for the bucket requires server-side encryption of objects when objects are * uploaded to the bucket. Possible values are: *

    *
      *
    • *

      * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include the * x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

      *
    • *
    • *

      * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include the * x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or aws:kms. *

      *
    • *
    • *

      * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of objects. *

      *
    • *
    * * @return Specifies whether the bucket policy for the bucket requires server-side encryption of objects when * objects are uploaded to the bucket. Possible values are:

    *
      *
    • *

      * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include * the x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

      *
    • *
    • *

      * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include * the x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or * aws:kms. *

      *
    • *
    • *

      * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of * objects. *

      *
    • * @see AllowsUnencryptedObjectUploads */ public String getAllowsUnencryptedObjectUploads() { return this.allowsUnencryptedObjectUploads; } /** *

      * Specifies whether the bucket policy for the bucket requires server-side encryption of objects when objects are * uploaded to the bucket. Possible values are: *

      *
        *
      • *

        * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include the * x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

        *
      • *
      • *

        * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include the * x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or aws:kms. *

        *
      • *
      • *

        * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of objects. *

        *
      • *
      * * @param allowsUnencryptedObjectUploads * Specifies whether the bucket policy for the bucket requires server-side encryption of objects when objects * are uploaded to the bucket. Possible values are:

      *
        *
      • *

        * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include * the x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

        *
      • *
      • *

        * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include the * x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or * aws:kms. *

        *
      • *
      • *

        * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of * objects. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. * @see AllowsUnencryptedObjectUploads */ public S3Bucket withAllowsUnencryptedObjectUploads(String allowsUnencryptedObjectUploads) { setAllowsUnencryptedObjectUploads(allowsUnencryptedObjectUploads); return this; } /** *

        * Specifies whether the bucket policy for the bucket requires server-side encryption of objects when objects are * uploaded to the bucket. Possible values are: *

        *
          *
        • *

          * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include the * x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

          *
        • *
        • *

          * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include the * x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or aws:kms. *

          *
        • *
        • *

          * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of objects. *

          *
        • *
        * * @param allowsUnencryptedObjectUploads * Specifies whether the bucket policy for the bucket requires server-side encryption of objects when objects * are uploaded to the bucket. Possible values are:

        *
          *
        • *

          * FALSE - The bucket policy requires server-side encryption of new objects. PutObject requests must include * the x-amz-server-side-encryption header and the value for that header must be AES256 or aws:kms. *

          *
        • *
        • *

          * TRUE - The bucket doesn't have a bucket policy or it has a bucket policy that doesn't require server-side * encryption of new objects. If a bucket policy exists, it doesn't require PutObject requests to include the * x-amz-server-side-encryption header and it doesn't require the value for that header to be AES256 or * aws:kms. *

          *
        • *
        • *

          * UNKNOWN - Amazon Macie can't determine whether the bucket policy requires server-side encryption of * objects. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. * @see AllowsUnencryptedObjectUploads */ public S3Bucket withAllowsUnencryptedObjectUploads(AllowsUnencryptedObjectUploads allowsUnencryptedObjectUploads) { this.allowsUnencryptedObjectUploads = allowsUnencryptedObjectUploads.toString(); return this; } /** *

          * The Amazon Resource Name (ARN) of the bucket. *

          * * @param arn * The Amazon Resource Name (ARN) of the bucket. */ public void setArn(String arn) { this.arn = arn; } /** *

          * The Amazon Resource Name (ARN) of the bucket. *

          * * @return The Amazon Resource Name (ARN) of the bucket. */ public String getArn() { return this.arn; } /** *

          * The Amazon Resource Name (ARN) of the bucket. *

          * * @param arn * The Amazon Resource Name (ARN) of the bucket. * @return Returns a reference to this object so that method calls can be chained together. */ public S3Bucket withArn(String arn) { setArn(arn); return this; } /** *

          * The date and time, in UTC and extended ISO 8601 format, when the bucket was created. *

          * * @param createdAt * The date and time, in UTC and extended ISO 8601 format, when the bucket was created. */ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** *

          * The date and time, in UTC and extended ISO 8601 format, when the bucket was created. *

          * * @return The date and time, in UTC and extended ISO 8601 format, when the bucket was created. */ public java.util.Date getCreatedAt() { return this.createdAt; } /** *

          * The date and time, in UTC and extended ISO 8601 format, when the bucket was created. *

          * * @param createdAt * The date and time, in UTC and extended ISO 8601 format, when the bucket was created. * @return Returns a reference to this object so that method calls can be chained together. */ public S3Bucket withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; } /** *

          * The type of server-side encryption that's used by default to encrypt objects in the bucket. *

          * * @param defaultServerSideEncryption * The type of server-side encryption that's used by default to encrypt objects in the bucket. */ public void setDefaultServerSideEncryption(ServerSideEncryption defaultServerSideEncryption) { this.defaultServerSideEncryption = defaultServerSideEncryption; } /** *

          * The type of server-side encryption that's used by default to encrypt objects in the bucket. *

          * * @return The type of server-side encryption that's used by default to encrypt objects in the bucket. */ public ServerSideEncryption getDefaultServerSideEncryption() { return this.defaultServerSideEncryption; } /** *

          * The type of server-side encryption that's used by default to encrypt objects in the bucket. *

          * * @param defaultServerSideEncryption * The type of server-side encryption that's used by default to encrypt objects in the bucket. * @return Returns a reference to this object so that method calls can be chained together. */ public S3Bucket withDefaultServerSideEncryption(ServerSideEncryption defaultServerSideEncryption) { setDefaultServerSideEncryption(defaultServerSideEncryption); return this; } /** *

          * The name of the bucket. *

          * * @param name * The name of the bucket. */ public void setName(String name) { this.name = name; } /** *

          * The name of the bucket. *

          * * @return The name of the bucket. */ public String getName() { return this.name; } /** *

          * The name of the bucket. *

          * * @param name * The name of the bucket. * @return Returns a reference to this object so that method calls can be chained together. */ public S3Bucket withName(String name) { setName(name); return this; } /** *

          * The display name and AWS account ID for the user who owns the bucket. *

          * * @param owner * The display name and AWS account ID for the user who owns the bucket. */ public void setOwner(S3BucketOwner owner) { this.owner = owner; } /** *

          * The display name and AWS account ID for the user who owns the bucket. *

          * * @return The display name and AWS account ID for the user who owns the bucket. */ public S3BucketOwner getOwner() { return this.owner; } /** *

          * The display name and AWS account ID for the user who owns the bucket. *

          * * @param owner * The display name and AWS account ID for the user who owns the bucket. * @return Returns a reference to this object so that method calls can be chained together. */ public S3Bucket withOwner(S3BucketOwner owner) { setOwner(owner); return this; } /** *

          * The permissions settings that determine whether the bucket is publicly accessible. *

          * * @param publicAccess * The permissions settings that determine whether the bucket is publicly accessible. */ public void setPublicAccess(BucketPublicAccess publicAccess) { this.publicAccess = publicAccess; } /** *

          * The permissions settings that determine whether the bucket is publicly accessible. *

          * * @return The permissions settings that determine whether the bucket is publicly accessible. */ public BucketPublicAccess getPublicAccess() { return this.publicAccess; } /** *

          * The permissions settings that determine whether the bucket is publicly accessible. *

          * * @param publicAccess * The permissions settings that determine whether the bucket is publicly accessible. * @return Returns a reference to this object so that method calls can be chained together. */ public S3Bucket withPublicAccess(BucketPublicAccess publicAccess) { setPublicAccess(publicAccess); return this; } /** *

          * The tags that are associated with the bucket. *

          * * @return The tags that are associated with the bucket. */ public java.util.List getTags() { return tags; } /** *

          * The tags that are associated with the bucket. *

          * * @param tags * The tags that are associated with the bucket. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

          * The tags that are associated with the bucket. *

          *

          * 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 tags that are associated with the bucket. * @return Returns a reference to this object so that method calls can be chained together. */ public S3Bucket withTags(KeyValuePair... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (KeyValuePair ele : tags) { this.tags.add(ele); } return this; } /** *

          * The tags that are associated with the bucket. *

          * * @param tags * The tags that are associated with the bucket. * @return Returns a reference to this object so that method calls can be chained together. */ public S3Bucket withTags(java.util.Collection tags) { setTags(tags); 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 (getAllowsUnencryptedObjectUploads() != null) sb.append("AllowsUnencryptedObjectUploads: ").append(getAllowsUnencryptedObjectUploads()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getDefaultServerSideEncryption() != null) sb.append("DefaultServerSideEncryption: ").append(getDefaultServerSideEncryption()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getOwner() != null) sb.append("Owner: ").append(getOwner()).append(","); if (getPublicAccess() != null) sb.append("PublicAccess: ").append(getPublicAccess()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof S3Bucket == false) return false; S3Bucket other = (S3Bucket) obj; if (other.getAllowsUnencryptedObjectUploads() == null ^ this.getAllowsUnencryptedObjectUploads() == null) return false; if (other.getAllowsUnencryptedObjectUploads() != null && other.getAllowsUnencryptedObjectUploads().equals(this.getAllowsUnencryptedObjectUploads()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getDefaultServerSideEncryption() == null ^ this.getDefaultServerSideEncryption() == null) return false; if (other.getDefaultServerSideEncryption() != null && other.getDefaultServerSideEncryption().equals(this.getDefaultServerSideEncryption()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getOwner() == null ^ this.getOwner() == null) return false; if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false) return false; if (other.getPublicAccess() == null ^ this.getPublicAccess() == null) return false; if (other.getPublicAccess() != null && other.getPublicAccess().equals(this.getPublicAccess()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAllowsUnencryptedObjectUploads() == null) ? 0 : getAllowsUnencryptedObjectUploads().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getDefaultServerSideEncryption() == null) ? 0 : getDefaultServerSideEncryption().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode()); hashCode = prime * hashCode + ((getPublicAccess() == null) ? 0 : getPublicAccess().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public S3Bucket clone() { try { return (S3Bucket) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.macie2.model.transform.S3BucketMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy