Amazon.S3.AmazonS3Client.DeleteObjectsAsync C# (CSharp) Method

DeleteObjectsAsync() public method

Initiates the asynchronous execution of the DeleteObjects operation.
public DeleteObjectsAsync ( DeleteObjectsRequest request, System cancellationToken = default(CancellationToken) ) : Task
request Amazon.S3.Model.DeleteObjectsRequest Container for the necessary parameters to execute the DeleteObjects operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
        public Task<DeleteObjectsResponse> DeleteObjectsAsync(DeleteObjectsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteObjectsRequestMarshaller();
            var unmarshaller = DeleteObjectsResponseUnmarshaller.Instance;

            return InvokeAsync<DeleteObjectsRequest,DeleteObjectsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }

Same methods

AmazonS3Client::DeleteObjectsAsync ( DeleteObjectsRequest request, DeleteObjectsResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

コード例 #1
0
ファイル: S3TestUtils.cs プロジェクト: aws/aws-sdk-net
 public static void DeleteObjectHelper(AmazonS3Client client, string bucketName, string key, string versionId = null)
 {
     Exception responseException = null;
     AutoResetEvent ars = new AutoResetEvent(false);
     client.DeleteObjectsAsync(new DeleteObjectsRequest()
     {
         BucketName = bucketName,
         Objects = new List<KeyVersion> { new KeyVersion() { Key = key, VersionId = versionId } }
     }, (response) =>
     {
         responseException = response.Exception;
         ars.Set();
     }, new AsyncOptions { ExecuteCallbackOnMainThread = false });
     ars.WaitOne();
     Assert.IsNull(responseException);
 }
All Usage Examples Of Amazon.S3.AmazonS3Client::DeleteObjectsAsync
AmazonS3Client