Skip to content

Conversation

peterrsongg
Copy link
Contributor

Description

In this PR i had more customization hooks to allow injecting code in specific places such as the getters, setters and private member declarations.

Motivation and Context

The reason I wanted to add more customization hooks is because, whenever possible we want to generate members of shapes. If we decide to exclude a member via the excludeMembers customization hook I added, then the docs for that shape won't be generated and we could easily miss a doc update for that member if the docs were to be updated. This makes it so that the member will still be generated since instead of moving that member to a custom partial of a class, we just inject the customized code.

Testing

Dry run DRY_RUN-32ff75b0-08bd-4a88-ae5f-18dc16d8e114

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

…, and private member declarations. Delete any unused custom code files.
get { return this.modifiedSinceDate ?? DateTime.SpecifyKind(default, DateTimeKind.Utc); }
set
{
if (value == null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure why this if else was here. Isn't this just the same thing as doing this.modifiedSinceDate=value? If not, i can inject this as well. but it seemed redundant

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if isn't needed.

/// 7232</a>.
/// </para>
/// </summary>
public DateTime? ModifiedSinceDate
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs are generated :)

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds new customization hooks for code generation in the AWS .NET SDK to allow injecting custom code into getters, setters, and private member declarations. The primary motivation is to enable generating members of shapes while still allowing custom implementation without losing documentation updates.

  • Adds new customization hooks for injecting code into property getters, setters, and private member declarations
  • Updates the S3 service to use these new hooks instead of custom partial classes
  • Removes unused custom partials for S3Grantee, LifecycleRule, and GetObjectMetadataRequest

Reviewed Changes

Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/src/Services/S3/Custom/Model/S3Grantee.cs Deleted custom partial class (now handled by code generation)
sdk/src/Services/S3/Custom/Model/LifecycleRule.cs Deleted custom partial class (now handled by code generation)
sdk/src/Services/S3/Custom/Model/GetObjectMetadataRequest.cs Deleted custom partial class (now handled by code generation)
generator/ServiceModels/s3/s3.customizations.json Added customization hooks to replace custom partials with generated code
generator/ServiceClientGeneratorLib/Generators/SourceFiles/StructureGenerator.tt Modified template to support new code injection hooks
generator/ServiceClientGeneratorLib/Generators/SourceFiles/StructureGenerator.cs Generated code changes from template updates
generator/ServiceClientGeneratorLib/Generators/BaseGenerator.tt Added helper method for writing injected XML code
generator/ServiceClientGeneratorLib/Generators/BaseGenerator.cs Generated code changes from template updates
generator/ServiceClientGeneratorLib/Customizations.cs Added new customization properties for code injection
generator/.DevConfigs/34a3fc68-a145-4312-b55e-e9490ea8c7db.json Added dev config file for patch version update

@peterrsongg peterrsongg merged commit 5a13648 into development Aug 29, 2025
3 checks passed
@peterrsongg peterrsongg deleted the petesong/generate-s3-cleanup branch August 29, 2025 17:11
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