@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class DataResource extends Object implements Serializable, Cloneable, StructuredPojo
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
You create an event selector for a trail and specify an S3 bucket and an empty prefix, such as
arn:aws:s3:::bucket-1/
.
You upload an image file to bucket-1
.
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.
You upload another image file to a different S3 bucket named arn:aws:s3:::bucket-2
.
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.
Constructor and Description |
---|
DataResource() |
Modifier and Type | Method and Description |
---|---|
DataResource |
clone() |
boolean |
equals(Object obj) |
String |
getType()
The resource type in which you want to log data events.
|
List<String> |
getValues()
A list of ARN-like strings for the specified S3 objects.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setType(String type)
The resource type in which you want to log data events.
|
void |
setValues(Collection<String> values)
A list of ARN-like strings for the specified S3 objects.
|
String |
toString()
Returns a string representation of this object; useful for testing and debugging.
|
DataResource |
withType(String type)
The resource type in which you want to log data events.
|
DataResource |
withValues(Collection<String> values)
A list of ARN-like strings for the specified S3 objects.
|
DataResource |
withValues(String... values)
A list of ARN-like strings for the specified S3 objects.
|
public void setType(String type)
The resource type in which you want to log data events. You can specify only the following value:
AWS::S3::Object
.
type
- The resource type in which you want to log data events. You can specify only the following value:
AWS::S3::Object
.public String getType()
The resource type in which you want to log data events. You can specify only the following value:
AWS::S3::Object
.
AWS::S3::Object
.public DataResource withType(String type)
The resource type in which you want to log data events. You can specify only the following value:
AWS::S3::Object
.
type
- The resource type in which you want to log data events. You can specify only the following value:
AWS::S3::Object
.public List<String> getValues()
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.
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(Collection<String> 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.
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 DataResource withValues(String... 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
setValues(java.util.Collection)
or withValues(java.util.Collection)
if you want to override the
existing values.
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 DataResource withValues(Collection<String> 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.
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 String toString()
toString
in class Object
Object.toString()
public DataResource clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.