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

com.amazonaws.services.cloudtrail.model.DataResource Maven / Gradle / Ivy

/*
 * Copyright 2012-2017 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.cloudtrail.model;

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

/**
 * 

* The Amazon S3 objects that you specify in your event selectors for your trail to log data events. Data events are * object-level API operations that access S3 objects, such as GetObject, DeleteObject, and * PutObject. You can specify up to 250 S3 buckets and object prefixes for a trail. *

*

* Example *

*
    *
  1. *

    * You create an event selector for a trail and specify an S3 bucket and an empty prefix, such as * arn:aws:s3:::bucket-1/. *

    *
  2. *
  3. *

    * You upload an image file to bucket-1. *

    *
  4. *
  5. *

    * The PutObject API operation occurs on an object in the S3 bucket that you specified in the event * selector. The trail processes and logs the event. *

    *
  6. *
  7. *

    * You upload another image file to a different S3 bucket named arn:aws:s3:::bucket-2. *

    *
  8. *
  9. *

    * The event occurs on an object in an S3 bucket that you didn't specify in the event selector. The trail doesn’t log * the event. *

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

* The resource type in which you want to log data events. You can specify only the following value: * AWS::S3::Object. *

*/ private String type; /** *

* A list of ARN-like strings for the specified S3 objects. *

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 bucket that * match the prefix. *

*/ private com.amazonaws.internal.SdkInternalList values; /** *

* The resource type in which you want to log data events. You can specify only the following value: * AWS::S3::Object. *

* * @param type * The resource type in which you want to log data events. You can specify only the following value: * AWS::S3::Object. */ public void setType(String type) { this.type = type; } /** *

* The resource type in which you want to log data events. You can specify only the following value: * AWS::S3::Object. *

* * @return The resource type in which you want to log data events. You can specify only the following value: * AWS::S3::Object. */ public String getType() { return this.type; } /** *

* The resource type in which you want to log data events. You can specify only the following value: * AWS::S3::Object. *

* * @param type * The resource type in which you want to log data events. You can specify only the following value: * AWS::S3::Object. * @return Returns a reference to this object so that method calls can be chained together. */ public DataResource withType(String type) { setType(type); return this; } /** *

* A list of ARN-like strings for the specified S3 objects. *

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 bucket that * match the prefix. *

* * @return A list of ARN-like strings for the specified S3 objects.

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 * bucket that match the prefix. */ public java.util.List getValues() { if (values == null) { values = new com.amazonaws.internal.SdkInternalList(); } return values; } /** *

* A list of ARN-like strings for the specified S3 objects. *

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 bucket that * match the prefix. *

* * @param values * A list of ARN-like strings for the specified S3 objects.

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 * bucket that match the prefix. */ public void setValues(java.util.Collection values) { if (values == null) { this.values = null; return; } this.values = new com.amazonaws.internal.SdkInternalList(values); } /** *

* A list of ARN-like strings for the specified S3 objects. *

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 bucket that * match the prefix. *

*

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

* * @param values * A list of ARN-like strings for the specified S3 objects.

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 * bucket that match the prefix. * @return Returns a reference to this object so that method calls can be chained together. */ public DataResource withValues(String... values) { if (this.values == null) { setValues(new com.amazonaws.internal.SdkInternalList(values.length)); } for (String ele : values) { this.values.add(ele); } return this; } /** *

* A list of ARN-like strings for the specified S3 objects. *

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 bucket that * match the prefix. *

* * @param values * A list of ARN-like strings for the specified S3 objects.

*

* To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as * arn:aws:s3:::bucket-1/. The trail logs data events for all objects in this S3 bucket. *

*

* To log data events for specific objects, specify the S3 bucket and object prefix such as * arn:aws:s3:::bucket-1/example-images. The trail logs data events for objects in this S3 * bucket that match the prefix. * @return Returns a reference to this object so that method calls can be chained together. */ public DataResource withValues(java.util.Collection values) { setValues(values); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getValues() != null) sb.append("Values: ").append(getValues()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DataResource == false) return false; DataResource other = (DataResource) obj; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getValues() == null ^ this.getValues() == null) return false; if (other.getValues() != null && other.getValues().equals(this.getValues()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getValues() == null) ? 0 : getValues().hashCode()); return hashCode; } @Override public DataResource clone() { try { return (DataResource) 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.cloudtrail.model.transform.DataResourceMarshaller.getInstance().marshall(this, protocolMarshaller); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy