public async Task <IEnumerable <S3FileKey> > GetAllKeysAsync(S3FolderKey filter) { if (filter == null) { throw new ArgumentNullException(nameof(filter)); } var result = new List <S3FileKey>(); var request = CreateRequest(filter); ListObjectsV2Response response; do { response = await AmazonS3.ListObjectsV2Async(request); var keys = ProcessResponse(response, filter); result.AddRange(keys); request.ContinuationToken = response.NextContinuationToken; } while (response.IsTruncated); return(result); }