Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Fixes codegen for multiple account ids#4608

Merged
sbiscigl merged 1 commit intoaws:mainfrom
sbiscigl:fix-codegen-accountid
Nov 2, 2022
Merged

Fixes codegen for multiple account ids#4608
sbiscigl merged 1 commit intoaws:mainfrom
sbiscigl:fix-codegen-accountid

Conversation

@sbiscigl
Copy link
Copy Markdown
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) {

@sbiscigl sbiscigl force-pushed the fix-codegen-accountid branch from 859fc78 to 2993610 Compare November 2, 2022 16:54
{{ if $elem.AccountIDMemberWithARN -}}
{{ $FunctionName := $name }}
{{ if eq $name "AccountId" }}
{{ $FunctionName = "AccountID" }}
Copy link
Copy Markdown
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 force-pushed the fix-codegen-accountid branch from 2993610 to fbad6e2 Compare November 2, 2022 17:04
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants