Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

Generate common resource path helpers via google/cloud/common_resources.proto #586

Closed

Description

@busunkim96

https://github.com/googleapis/googleapis/blob/master/google/cloud/common_resources.proto

I was visiting the Node chat and learned of the existence of the above file. Can we use it somehow to get more resource helpers methods into all the libraries? (the two with projects would be most useful I think)

  • "projects/{project}"
  • "organizations/{organization}"
  • "folders/{folder}"
  • "billingAccounts/{billing_account}"
  • "projects/{project}/locations/{location}"

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Sep 3, 2020
  2. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    generatorBugs, features, and so forth pertaining to the generated client surface
    on Sep 8, 2020
  3. software-dov commented on Sep 16, 2020

    @software-dov
    Contributor

    This should be straightforward and easy. There are a couple of potential gotchas:

    1. The path definitions in common_resources.proto don't have messages associated. This will require a little bit of rework in the generator logic and template.
    2. The correct thing to do would be to have common_resources.proto imported and then to use the descriptors to generate paths. I don't think we can do that by the time the generator plugin runs, so we'll need to just hack it in.
    3. There's a potential for name conflicts. One way to deal with this is to ignore it until a problem arises; another is to have a common disambiguation string, e.g. def common_project_path and def parse_common_project_path. Neither option seems great, but I'm leaning towards the second.

    What do other people think? @vam-google @busunkim96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

generatorBugs, features, and so forth pertaining to the generated client surfacepriority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions