googleapis / google-cloud-cpp

C++ Client Libraries for Google Cloud Services
https://cloud.google.com/
Apache License 2.0
546 stars 365 forks source link

Support `google.cloud.location.Locations` and maybe other mixins #11694

Open coryan opened 1 year ago

coryan commented 1 year ago

A number of services include the Locations mixin:

https://github.com/googleapis/googleapis/blob/117be9dfdf65ff766a794c8b85d5d7480a1fd83d/google/cloud/location/locations.proto#L29-L32

These mixins do not appear in the .proto file, they only seem to appear in the YAML file:

https://github.com/googleapis/googleapis/blob/117be9dfdf65ff766a794c8b85d5d7480a1fd83d/google/cloud/clouddms/v1/datamigration_v1.yaml#L6-L10

But they are part of the service and included in the API configuration:

https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations

https://cloud.google.com/kms/docs/reference/rpc/google.cloud.location

I think the generator needs to support these. It is unclear if these methods should be part of the *Client , or there should be a common google::cloud::LocationClient with suitable endpoint defaults. Or some other solution. The first step is to write some kind of design doc.

coryan commented 11 months ago

We should do this, but needs some design.

scotthart commented 5 months ago

Still want to do this as part of other improvements to generated libraries.

cuiy0006 commented 2 weeks ago

Design:

Submit: