public static async IAsyncEnumerable <S3Upload> ListAllMultipartUploadsAsync(this IS3BucketClient client, string bucketName, [EnumeratorCancellation] CancellationToken token = default)
        {
            Validator.RequireNotNull(client);
            Validator.RequireNotNull(bucketName);

            string uploadIdMarker = null;
            ListMultipartUploadsResponse response;

            do
            {
                if (token.IsCancellationRequested)
                {
                    break;
                }

                string marker = uploadIdMarker;
                response = await client.ListMultipartUploadsAsync(bucketName, req => req.UploadIdMarker = marker, token).ConfigureAwait(false);

                foreach (S3Upload responseObject in response.Uploads)
                {
                    yield return(responseObject);
                }

                uploadIdMarker = response.NextUploadIdMarker;
            } while (response.IsTruncated);
        }
Beispiel #2
0
 public Task <ListMultipartUploadsResponse> ListMultipartUploadsAsync(string bucketName, Action <ListMultipartUploadsRequest> config = null, CancellationToken token = default)
 {
     return(_bucketClient.ListMultipartUploadsAsync(bucketName, config, token));
 }