Internal class used to pass the parameters for DeleteS3BucketWithObjects operation.
Esempio n. 1
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteS3BucketWithObjects operation.
        /// DeleteS3BucketWithObjects deletes an S3 bucket which contains objects.
        /// An S3 bucket which contains objects cannot be deleted until all the objects
        /// in it are deleted. This method deletes all the objects in the specified
        /// bucket and then deletes the bucket itself.
        /// </summary>
        /// <param name="bucketName">The bucket to be deleted.</param>
        /// <param name="s3Client">The Amazon S3 Client to use for S3 specific operations.</param>
        /// <param name="deleteOptions">>Options to control the behavior of the delete operation.</param>
        /// <param name="updateCallback">An callback that is invoked to send updates while delete operation is in progress.</param>
        /// <param name="token">token to check if the operation has been request to cancel.</param>
        /// <returns>An IAsyncCancelableResult that can be used to poll or wait for results, or both;
        /// this value is also needed when invoking EndDeleteS3BucketWithObjects. IAsyncCancelableResult can also
        /// be used to cancel the operation while it's in progress.</returns>
        public static Task DeleteS3BucketWithObjectsAsync(IAmazonS3 s3Client, string bucketName,
                                                          S3DeleteBucketWithObjectsOptions deleteOptions, Action <S3DeleteBucketWithObjectsUpdate> updateCallback, CancellationToken token)
        {
            var request = new S3DeleteBucketWithObjectsRequest
            {
                BucketName     = bucketName,
                DeleteOptions  = deleteOptions,
                UpdateCallback = updateCallback,
                S3Client       = s3Client
            };

            return(InvokeDeleteS3BucketWithObjects(request, token));
        }
Esempio n. 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteS3BucketWithObjects operation.
        /// DeleteS3BucketWithObjects deletes an S3 bucket which contains objects.
        /// An S3 bucket which contains objects cannot be deleted until all the objects
        /// in it are deleted. This method deletes all the objects in the specified
        /// bucket and then deletes the bucket itself.
        /// </summary>
        /// <param name="bucketName">The bucket to be deleted.</param>
        /// <param name="s3Client">The Amazon S3 Client to use for S3 specific operations.</param>
        /// <param name="deleteOptions">>Options to control the behavior of the delete operation.</param>
        /// <param name="updateCallback">An callback that is invoked to send updates while delete operation is in progress.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the AsyncState property.</param>
        /// <returns>An IAsyncCancelableResult that can be used to poll or wait for results, or both;
        /// this value is also needed when invoking EndDeleteS3BucketWithObjects. IAsyncCancelableResult can also
        /// be used to cancel the operation while it's in progress.</returns>
        public static IAsyncCancelableResult BeginDeleteS3BucketWithObjects(IAmazonS3 s3Client, string bucketName,
                                                                            S3DeleteBucketWithObjectsOptions deleteOptions, Action <S3DeleteBucketWithObjectsUpdate> updateCallback, AsyncCallback callback, object state)
        {
            var asyncResult = new AsyncCancelableResult(callback, state);

            var request = new S3DeleteBucketWithObjectsRequest
            {
                AsyncCancelableResult = asyncResult,
                BucketName            = bucketName,
                DeleteOptions         = deleteOptions,
                UpdateCallback        = updateCallback,
                S3Client = s3Client
            };

            ThreadPool.QueueUserWorkItem(InvokeDeleteS3BucketWithObjects, request);
            return(asyncResult);
        }
Esempio n. 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteS3BucketWithObjects operation. 
        /// DeleteS3BucketWithObjects deletes an S3 bucket which contains objects.
        /// An S3 bucket which contains objects cannot be deleted until all the objects 
        /// in it are deleted. This method deletes all the objects in the specified 
        /// bucket and then deletes the bucket itself.
        /// </summary>
        /// <param name="bucketName">The bucket to be deleted.</param>
        /// <param name="s3Client">The Amazon S3 Client to use for S3 specific operations.</param>
        /// <param name="deleteOptions">>Options to control the behavior of the delete operation.</param>
        /// <param name="updateCallback">An callback that is invoked to send updates while delete operation is in progress.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the AsyncState property.</param>
        /// <returns>An IAsyncCancelableResult that can be used to poll or wait for results, or both; 
        /// this value is also needed when invoking EndDeleteS3BucketWithObjects. IAsyncCancelableResult can also 
        /// be used to cancel the operation while it's in progress.</returns>
        public static IAsyncCancelableResult BeginDeleteS3BucketWithObjects(string bucketName, AmazonS3 s3Client,
            S3DeleteBucketWithObjectsOptions deleteOptions,Action<S3DeleteBucketWithObjectsUpdate> updateCallback, AsyncCallback callback, object state)
        {
            var asyncResult = new AsyncCancelableResult(callback, state);

            var request = new S3DeleteBucketWithObjectsRequest
            {
                AsyncCancelableResult = asyncResult,
                BucketName = bucketName,
                DeleteOptions = deleteOptions,
                UpdateCallback=updateCallback,
                S3Client = s3Client
            };

            ThreadPool.QueueUserWorkItem(InvokeDeleteS3BucketWithObjects, request);
            return asyncResult;
        }
Esempio n. 4
0
 /// <summary>
 /// Initiates the asynchronous execution of the DeleteS3BucketWithObjects operation. 
 /// DeleteS3BucketWithObjects deletes an S3 bucket which contains objects.
 /// An S3 bucket which contains objects cannot be deleted until all the objects 
 /// in it are deleted. This method deletes all the objects in the specified 
 /// bucket and then deletes the bucket itself.
 /// </summary>
 /// <param name="bucketName">The bucket to be deleted.</param>
 /// <param name="s3Client">The Amazon S3 Client to use for S3 specific operations.</param>
 /// <param name="deleteOptions">>Options to control the behavior of the delete operation.</param>
 /// <param name="updateCallback">An callback that is invoked to send updates while delete operation is in progress.</param>
 /// <param name="token">token to check if the operation has been request to cancel.</param>
 /// <returns>An IAsyncCancelableResult that can be used to poll or wait for results, or both; 
 /// this value is also needed when invoking EndDeleteS3BucketWithObjects. IAsyncCancelableResult can also 
 /// be used to cancel the operation while it's in progress.</returns>
 public static  Task DeleteS3BucketWithObjectsAsync(IAmazonS3 s3Client, string bucketName,
      S3DeleteBucketWithObjectsOptions deleteOptions, Action<S3DeleteBucketWithObjectsUpdate> updateCallback, CancellationToken token)
 {
     var request = new S3DeleteBucketWithObjectsRequest
     {
         BucketName = bucketName,
         DeleteOptions = deleteOptions,
         UpdateCallback = updateCallback,
         S3Client = s3Client
     };
     return InvokeDeleteS3BucketWithObjects(request, token);
 }