googleapis / google-cloud-cpp

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

Determine best mechanism for setting service level metadata in generated libraries. #14000

Open scotthart opened 6 months ago

scotthart commented 6 months ago

With the added support for google.api.api_version, an optional annotation, the generator needs to emit code that sets this (when specified) in the generated metadata decorator. It currently sets it as part of *Metadata::SetMetadata, but this might not be the best place. One option would be to pass this value to the metadata helper functions as another parameter, similar to api_client_header. another option would be to create a collection of known at compile time metadata pairs and pass that to the metadata helper function.

scotthart commented 3 weeks ago

Verify both REST and gRPC support has been added. Potentially, could use some refactoring.