Skip to content

Commit

Permalink
private/model/api: Generate enum shape functions to retrieve all valu…
Browse files Browse the repository at this point in the history
…es (#3447)

Fixes #3441 by adding a new XXX_Values function for each API enum type that returns a slice of enum values, e.g `DomainStatus_Values`.
  • Loading branch information
bflad committed Aug 11, 2020
1 parent 57dd90c commit 88938cf
Show file tree
Hide file tree
Showing 216 changed files with 34,361 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### SDK Features

### SDK Enhancements
* `codegen`: Add XXX_Values functions for getting slice of API enums by type.
* Fixes [#3441](https://github.com/aws/aws-sdk-go/issues/3441) by adding a new XXX_Values function for each API enum type that returns a slice of enum values, e.g `DomainStatus_Values`.

### SDK Bugs
10 changes: 10 additions & 0 deletions private/model/api/shape.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,16 @@ const (
{{ end }}
)
{{/* Enum iterators use non-idomatic _Values suffix to avoid naming collisions with other generated types, and enum values */}}
// {{ $.ShapeName }}_Values returns all elements of the {{ $.ShapeName }} enum
func {{ $.ShapeName }}_Values() []string {
return []string{
{{ range $index, $elem := $.Enum -}}
{{ index $.EnumConsts $index }},
{{ end }}
}
}
`))

// GoCode returns the rendered Go code for the Shape.
Expand Down
8 changes: 8 additions & 0 deletions private/protocol/ec2query/build_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions private/protocol/ec2query/unmarshal_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions private/protocol/jsonrpc/build_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions private/protocol/jsonrpc/unmarshal_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions private/protocol/query/build_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions private/protocol/query/unmarshal_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions private/protocol/restjson/build_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions private/protocol/restjson/unmarshal_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions private/protocol/restxml/build_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions private/protocol/restxml/unmarshal_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions service/accessanalyzer/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 88938cf

Please sign in to comment.