Skip to content

Commit

Permalink
chore(internal/gapicgen): update microgen v0.32.0 (#6521)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed Aug 16, 2022
1 parent 70d562f commit 81a43d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/gapicgen/cmd/genbot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN go install github.com/golang/protobuf/protoc-gen-go@v1.5.2 && \
go install golang.org/x/lint/golint@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install honnef.co/go/tools/cmd/staticcheck@latest && \
go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.31.2
go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.32.0
ENV PATH="${PATH}:/root/go/bin"

# Source: http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3
Expand Down
6 changes: 6 additions & 0 deletions internal/gapicgen/generator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ type MicrogenConfig struct {
// ImportPath plus the specified suffix separated by a "/", and using the
// same Pkg value.
StubsDir string

// NumericEnumsEnabled indicates, for REST GAPICs, if requests should be
// generated to send the $alt=json;enum-encoding=int system parameter with
// every API call. This should only be enabled for services that are
// up-to-date enough to support such a system parameter.
NumericEnumsEnabled bool
}

var MicrogenGapicConfigs = []*MicrogenConfig{
Expand Down
3 changes: 3 additions & 0 deletions internal/gapicgen/generator/gapics.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ func (g *GapicGenerator) microgen(conf *MicrogenConfig) error {
if len(conf.Transports) > 0 {
args = append(args, "--go_gapic_opt", fmt.Sprintf("transport=%s", strings.Join(conf.Transports, "+")))
}
if conf.NumericEnumsEnabled {
args = append(args, "--go_gapic_opt", "rest-numeric-enums")
}
// This is a bummer way of toggling diregapic generation, but it compute is the only one for the near term.
if conf.Pkg == "compute" {
args = append(args, "--go_gapic_opt", "diregapic")
Expand Down

0 comments on commit 81a43d7

Please sign in to comment.