Table of Contents

Class DeleteObjectsRequest

Namespace
Amazon.S3.Model
Assembly
AWSSDK.S3.dll

Container for the parameters to the DeleteObjects operation.

This operation enables you to delete multiple objects from a bucket using a single HTTP request. You may specify up to 1000 keys.

public class DeleteObjectsRequest : AmazonWebServiceRequest
Inheritance
DeleteObjectsRequest

Constructors

DeleteObjectsRequest()

public DeleteObjectsRequest()

Properties

BucketName

The bucket name containing the objects to delete.

When using this API with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this operation using an access point through the AWS SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using Access Points in the Amazon Simple Storage Service Developer Guide.

When using this API with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this operation using S3 on Outposts through the AWS SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon Simple Storage Service Developer Guide.

public string BucketName { get; set; }

Property Value

string

BypassGovernanceRetention

Gets and sets the property BypassGovernanceRetention.

Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. You must have sufficient permissions to perform this operation.

public bool BypassGovernanceRetention { get; set; }

Property Value

bool

ExpectedBucketOwner

The account id of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

public string ExpectedBucketOwner { get; set; }

Property Value

string

MfaCodes

The MfaCodes Tuple associates the Serial Number and the current Token/Code displayed on the Multi-Factor Authentication device associated with your AWS Account.

public MfaCodes MfaCodes { get; set; }

Property Value

MfaCodes

Remarks

This is a required property for this request if:

  1. EnableMfaDelete was configured on the bucket containing this object's version.
  2. You are deleting an object's version

Objects

List of object keys to delete.

public List<KeyVersion> Objects { get; set; }

Property Value

List<KeyVersion>

Quiet

Toggles between Quiet and Verbose mode for the operation. If set to true (Quiet mode), the response includes only those keys for objects on which the delete operation failed.

public bool Quiet { get; set; }

Property Value

bool

Remarks

By default this property is false and keys for both successful deletes and failures are returned in the response.

RequestPayer

Confirms that the requester knows that she or he will be charged for the list objects request. Bucket owners need not specify this parameter in their requests.

public RequestPayer RequestPayer { get; set; }

Property Value

RequestPayer

Methods

AddKey(string)

Add a key to the set of keys of objects to be deleted.

public void AddKey(string key)

Parameters

key string

Object key

AddKey(string, string)

Add a key and a version to be deleted.

public void AddKey(string key, string version)

Parameters

key string

Key of the object to be deleted.

version string

Version of the object to be deleted.