AWS SDK for .NET Documentation
DeleteObjectsResponse Class
AmazonAmazon.S3.ModelDeleteObjectsResponse Did this page help you?   Yes   No    Tell us about it...
The DeleteObjectsResponse contains a list of successful deletes, as well as any headers returned by S3.
Declaration Syntax
C#
public class DeleteObjectsResponse : S3Response
Members
All MembersConstructorsMethodsProperties



IconMemberDescription
DeleteObjectsResponse()()()()
Initializes a new instance of the DeleteObjectsResponse class

AmazonId2
Gets and sets the AmazonId2 property. This property corresponds to the x-amz-id-2 header in the HTTP response from the Amazon S3 service. The value of this header is used for internal troubleshooting purposes.
(Inherited from S3Response.)
DeletedObjects
Gets and sets the DeletedObjects property. A list of successful deletes. Set only when Quiet=false on DeleteObjectsRequest.

Dispose()()()()
Disposes of all managed and unmanaged resources.
(Inherited from S3Response.)
Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()()
Gets the type of the current instance.
(Inherited from Object.)
Headers
Gets and sets the Headers property. Information like the request-id, the amz-id-2 are retrieved fro the Headers and presented to the user via properties of the response object.
(Inherited from S3Response.)
Metadata
Gets and sets the Metadata property.
(Inherited from S3Response.)
RequestId
Gets and sets the RequestId property.
(Inherited from S3Response.)
ResponseStream
Gets and sets the ResponseStream property. This property only has a valid value for GetObjectResponses. In order to use this stream without leaking the underlying resource, please wrap access to the stream within a using block.
CopyC#
(Inherited from S3Response.)
ResponseXml
Gets and sets the ResponseXml property. This is the original xml response received from S3
(Inherited from S3Response.)
StatusCode
Gets the HTTP Status code from the service response.
(Inherited from S3Response.)
ToString()()()()
String Representation of this object. Overrides Object.ToString()
(Inherited from S3Response.)
Examples

This example shows how to delete multiple objects in a single request.
Note that the call may not delete all objects. In that case, an exception will be thrown. This exception will contain the list of encountered delete errors.

CopyDeleteObjects sample
// Create a client
AmazonS3Client client = new AmazonS3Client();

// Create a DeleteObject request
DeleteObjectsRequest request = new DeleteObjectsRequest
{
    BucketName = "SampleBucket",
    Keys = new List<KeyVersion>
    {
        new KeyVersion("Item1"),
        // Versioned item
        new KeyVersion("Item2", "Rej8CiBxcZKVK81cLr39j27Y5FVXghDK"),
        // Item in subdirectory
        new KeyVersion("Logs/error.txt")
    }
};

try
{
    // Issue request
    DeleteObjectsResponse response = client.DeleteObjects(request);
}
catch (DeleteObjectsException doe)
{
    // Catch error and list error details
    DeleteObjectsErrorResponse errorResponse = doe.ErrorResponse;

    foreach (DeletedObject deletedObject in errorResponse.DeletedObjects)
    {
        Console.WriteLine("Deleted item " + deletedObject.Key);
    }
    foreach (DeleteError deleteError in errorResponse.DeleteErrors)
    {
        Console.WriteLine("Error deleting item " + deleteError.Key);
        Console.WriteLine(" Code - " + deleteError.Code);
        Console.WriteLine(" Message - " + deleteError.Message);
    }
}
Inheritance Hierarchy

Assembly: AWSSDK (Module: AWSSDK) Version: 1.5.60.0 (1.5.60.0)