Skip to content

Commit 81a43d7

Browse files
authored
chore(internal/gapicgen): update microgen v0.32.0 (#6521)
1 parent 70d562f commit 81a43d7

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

internal/gapicgen/cmd/genbot/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN go install github.com/golang/protobuf/[email protected] && \
2727
go install golang.org/x/lint/golint@latest && \
2828
go install golang.org/x/tools/cmd/goimports@latest && \
2929
go install honnef.co/go/tools/cmd/staticcheck@latest && \
30-
go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.31.2
30+
go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.32.0
3131
ENV PATH="${PATH}:/root/go/bin"
3232

3333
# Source: http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3

internal/gapicgen/generator/config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ type MicrogenConfig struct {
5656
// ImportPath plus the specified suffix separated by a "/", and using the
5757
// same Pkg value.
5858
StubsDir string
59+
60+
// NumericEnumsEnabled indicates, for REST GAPICs, if requests should be
61+
// generated to send the $alt=json;enum-encoding=int system parameter with
62+
// every API call. This should only be enabled for services that are
63+
// up-to-date enough to support such a system parameter.
64+
NumericEnumsEnabled bool
5965
}
6066

6167
var MicrogenGapicConfigs = []*MicrogenConfig{

internal/gapicgen/generator/gapics.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ func (g *GapicGenerator) microgen(conf *MicrogenConfig) error {
304304
if len(conf.Transports) > 0 {
305305
args = append(args, "--go_gapic_opt", fmt.Sprintf("transport=%s", strings.Join(conf.Transports, "+")))
306306
}
307+
if conf.NumericEnumsEnabled {
308+
args = append(args, "--go_gapic_opt", "rest-numeric-enums")
309+
}
307310
// This is a bummer way of toggling diregapic generation, but it compute is the only one for the near term.
308311
if conf.Pkg == "compute" {
309312
args = append(args, "--go_gapic_opt", "diregapic")

0 commit comments

Comments
 (0)