Amazon.S3.AmazonS3Client.ListVersionsAsync C# (CSharp) Метод

ListVersionsAsync() публичный Метод

Initiates the asynchronous execution of the ListVersions operation.
public ListVersionsAsync ( ListVersionsRequest request, System cancellationToken = default(CancellationToken) ) : Task
request ListVersionsRequest Container for the necessary parameters to execute the ListVersions operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
Результат Task
        public Task<ListVersionsResponse> ListVersionsAsync(ListVersionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ListVersionsRequestMarshaller();
            var unmarshaller = ListVersionsResponseUnmarshaller.Instance;

            return InvokeAsync<ListVersionsRequest,ListVersionsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }

Same methods

AmazonS3Client::ListVersionsAsync ( string bucketName, System cancellationToken = default(CancellationToken) ) : Task
AmazonS3Client::ListVersionsAsync ( string bucketName, string prefix, System cancellationToken = default(CancellationToken) ) : Task
AmazonS3Client::ListVersionsAsync ( ListVersionsRequest request, ListVersionsResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
AmazonS3Client::ListVersionsAsync ( string bucketName, ListVersionsResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
AmazonS3Client::ListVersionsAsync ( string bucketName, string prefix, ListVersionsResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

Пример #1
0
        public static List<S3ObjectVersion> ListVersionsHelper(AmazonS3Client client, string bucketName)
        {
            AutoResetEvent ars = new AutoResetEvent(false);
            Exception responseException = new Exception();
            List<S3ObjectVersion> s3ObjectVersions = null;
            client.ListVersionsAsync(new ListVersionsRequest()
            {
                BucketName = bucketName
            }, (response) =>
            {
                responseException = response.Exception;
                if (responseException == null)
                {
                    s3ObjectVersions = response.Response.Versions;
                }
                ars.Set();
            }, new AsyncOptions { ExecuteCallbackOnMainThread = false });

            ars.WaitOne();
            if (responseException != null)
            {
                throw responseException;
            }
            return s3ObjectVersions;
        }
AmazonS3Client