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

Fixes codegen for multiple account ids #4608

Merged
merged 1 commit into from Nov 2, 2022

Conversation

sbiscigl
Copy link
Contributor

@sbiscigl sbiscigl commented Nov 2, 2022

For changes to files under the /model/ folder, and manual edits to autogenerated code (e.g. /service/s3/api.go) please create an Issue instead of a PR for those type of changes.

If there is an existing bug or feature this PR is answers please reference it here.

When a model has multiple elements where if $elem.AccountIDMemberWithARN is true it will create the same function signature for each element

func (s {{ $.ShapeName }}) updateAccountID(accountId string) (interface{}, error) {

This updates the function signature to take the shape name into account

func (s {{ $.ShapeName }}) update{{ $name }}(accountId string) (interface{}, error) {

@@ -76,11 +76,15 @@ const accountIDWithARNShapeTmplDef = `
{{ range $_, $name := $.MemberNames -}}
{{ $elem := index $.MemberRefs $name -}}
{{ if $elem.AccountIDMemberWithARN -}}
{{ $FunctionName := $name }}
{{ if eq $name "AccountId" }}
{{ $FunctionName = "AccountID" }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have to change AccountId to AccountID to support backwards compatibility. if we wanted to drop it, we could removed this if statement.

@sbiscigl sbiscigl merged commit aeeca02 into aws:main Nov 2, 2022
@sbiscigl sbiscigl deleted the fix-codegen-accountid branch November 2, 2022 19:32
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.

None yet

2 participants