googleapis / google-api-go-client

Auto-generated Google APIs for Go.
https://pkg.go.dev/google.golang.org/api
BSD 3-Clause "New" or "Revised" License
3.9k stars 1.11k forks source link

feat: support structpb.Struct as req/resp #2632

Closed codyoss closed 1 month ago

codyoss commented 1 month ago

There are some APIs that have started to use this type for the request and/or respsonse. Similar to how we had to specially handle protos HTTP body we need a good translation for this type as well. map[string]any seemed like the best fit as that is the input needed to create a Struct. The other choice would have been a googleapis.RawMessage. RawMessage is used today when a field would be of type Struct, but this is a less convient type, and less precise type, to use than a map directly.

Fixes: #2601