google-cloud-cpp icon indicating copy to clipboard operation
google-cloud-cpp copied to clipboard

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

Open coryan opened this issue 2 years ago • 4 comments

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 avatar May 22 '23 20:05 coryan

We should do this, but needs some design.

coryan avatar Oct 04 '23 19:10 coryan

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

scotthart avatar Mar 27 '24 19:03 scotthart

Design:

  • [x] Design doc of C++ microgenerator service mixin
  • [x] Draft the microgenerator code changes

Submit:

  • [x] Add mixin utils to support extract mixin info from config files
  • [x] Change http option utils to handle urls from mixin methods
  • [x] Change standalone_main to add mixin headers to client libraries
  • [x] Modify is_longrunning_operation to support operations mixin
  • [x] Change descriptor_utils to support mixin in both method and service vars
  • [x] Make *_generator.cc support mixin methods
  • [x] Load mixin methods in make_generators.cc
  • [x] Add manual code changes for Pubsub
  • [x] Generate the mixin code in libraries by batch

cuiy0006 avatar Sep 04 '24 17:09 cuiy0006

The mixin is done. There is a followup issue #14762 to add tests for mixin.

cuiy0006 avatar Oct 04 '24 16:10 cuiy0006