Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for RequestPayer property in TransferUtility BaseDownloadRequest class. #3309

Conversation

ashishdhingra
Copy link
Contributor

Description

Added support for RequestPayer property in TransferUtility BaseDownloadRequest class.

Motivation and Context

Fixes #3301

Testing

Tested locally by setting cross account access (refer https://repost.aws/knowledge-center/cross-account-access-s3) and enabling Request Payer in the bucket. Used Visual Studio debug session to first replicate the issue and then validate the fix using code below:

try
{
    IAmazonS3 s3Client = new AmazonS3Client("<<access-key-id>>", "<<secret-id>>", <<bucket-regionendpoint>>);
    var transferUtil = new TransferUtility(s3Client);
    await transferUtil.DownloadAsync(new TransferUtilityDownloadRequest
    {
        BucketName = "<<bucket-name>>",
        Key = "<<key-name>>",
        FilePath = @"<<absolute-file-path>>",
        RequestPayer = RequestPayer.Requester
    });
}
catch (Exception ex)
{
    await Console.Out.WriteLineAsync(ex.Message);
    throw;
}

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@ashishdhingra ashishdhingra force-pushed the user/ashdhin/TransferUtilityDownload-RequestPayer-Issue3301 branch from e4ff0a5 to 4fe49eb Compare April 30, 2024 18:47
@ashishdhingra ashishdhingra force-pushed the user/ashdhin/TransferUtilityDownload-RequestPayer-Issue3301 branch from 4fe49eb to 95a6daa Compare May 1, 2024 16:57
@ashishdhingra ashishdhingra force-pushed the user/ashdhin/TransferUtilityDownload-RequestPayer-Issue3301 branch from 95a6daa to 00442db Compare May 1, 2024 16:57
@ashishdhingra ashishdhingra requested a review from dscpinheiro May 1, 2024 16:58
@boblodgett boblodgett requested a review from muhammad-othman May 1, 2024 17:33
@ashishdhingra ashishdhingra merged commit dfb9dd3 into main-staging May 1, 2024
1 check passed
@ashishdhingra ashishdhingra deleted the user/ashdhin/TransferUtilityDownload-RequestPayer-Issue3301 branch May 1, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants