AWSSDK.IntegrationTests.S3.S3TestUtils.ListVersionsHelper C# (CSharp) Method

ListVersionsHelper() public static method

public static ListVersionsHelper ( AmazonS3Client client, string bucketName ) : List
client Amazon.S3.AmazonS3Client
bucketName string
return List
        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;
        }