Skip to content

Generate 9 more S3 Operations #3895

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

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

peterrsongg
Copy link
Contributor

@peterrsongg peterrsongg commented Jun 27, 2025

Description

Generates 9 more operations to conclude phase 1. I had to add a customization to exclude members from property generation but not from the marshallers because of PartDetail which inherits from PartETag. PartETag contains the excluded members.

I also updated the RestXmlExceptionUnmarshaller.tt file to get the Id2 and CfId which is unique to S3, as well as update the exception shapes themselves to add the constructor which takes these values in its constructor.

One change from this is that PutBucketPolicy's payload is set to request.Content instead of request.ContentStream. I've done a sanity check to make sure it still works. Per the model since the payload is a string, there is no need to wrap it in a memory stream. Also the payload member doesn't target the streaming trait so there is no need to stream it either.

One other minor change is that Tagging in PutBucketTagging was automatically initialized if it was null. This was a one-off customization we had that I intentionally left out to remove another customization hook. If we feel we want this added back, we can do that, but I will call this out as a breaking change.

Motivation and Context

Testing

DRY_RUN-2df7b27d-b938-44c2-aa9d-64c1ce797bf7

AssemblyComparer AWSSDK.S3.New.dll: Message Amazon.S3.Model.NoSuchUploadException/MethodAdded: New method System.Void .ctor(System.String, System.Exception, Amazon.Runtime.ErrorType, System.String, System.String, System.Net.HttpStatusCode, System.String, System.String) in Amazon.S3.Model.NoSuchUploadException
AssemblyComparer AWSSDK.S3.New.dll: Error Amazon.S3.Model.PartDetail/MethodRemoved: Missing method System.DateTime get_LastModified() in Amazon.S3.Model.PartDetail
AssemblyComparer AWSSDK.S3.New.dll: Message Amazon.S3.Model.PartDetail/MethodAdded: New method System.Nullable<System.DateTime> get_LastModified() in Amazon.S3.Model.PartDetail
AssemblyComparer AWSSDK.S3.New.dll: Error Amazon.S3.Model.PartDetail/MethodRemoved: Missing method System.Void set_LastModified(System.DateTime) in Amazon.S3.Model.PartDetail
AssemblyComparer AWSSDK.S3.New.dll: Message Amazon.S3.Model.PartDetail/MethodAdded: New method System.Void set_LastModified(System.Nullable<System.DateTime>) in Amazon.S3.Model.PartDetail
AssemblyComparer AWSSDK.S3.New.dll: Message Amazon.S3.Model.PutObjectTaggingRequest/MethodAdded: New method System.Void set_ContentMD5(System.String) in Amazon.S3.Model.PutObjectTaggingRequest
AssemblyComparer AWSSDK.S3.New.dll: Message Amazon.S3.Model.PutObjectTaggingRequest/MethodAdded: New method System.String get_ContentMD5() in Amazon.S3.Model.PutObjectTaggingRequest
AssemblyComparer AWSSDK.S3.New.dll: Message Amazon.S3.Model.NoSuchKeyException/MethodAdded: New method System.Void .ctor(System.String, System.Exception, Amazon.Runtime.ErrorType, System.String, System.String, System.Net.HttpStatusCode, System.String, System.String) in Amazon.S3.Model.NoSuchKeyException
    var putBucketPolicyResponse = await s3Client.PutBucketPolicyAsync(new PutBucketPolicyRequest
    {
        BucketName = bucketName,
        Policy = 
"""
{
"Version":"2008-10-17",
"Id":"test-put-bucket-policy",
"Statement" : [
    {
        "Effect":"Allow",
        "Sid":"1", 
        "Principal" : {
            "AWS": "arn:aws:iam::<account_id>:***"
        },
        "Action":["s3:*"],
        "Resource":"arn:aws:s3:::<bucket_name>*"
    }
    ]
}
"""
    }).ConfigureAwait(false);

executed successfully with flipping request.ContentStream to request.Content

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

…PutObjectLockConfiguration, PutObjectRetention, PutObjectTagging, and PutPublicAccessBlock. Update s3 exception tt files
@peterrsongg peterrsongg added the v4 label Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant