Skip to content

Commit

Permalink
Add path-construction helpers to GAPIC clients (via synth). (#8632)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and tseaver committed Jul 10, 2019
1 parent b891624 commit 2562eaa
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ def company_path(cls, project, tenant, company):
company=company,
)

@classmethod
def company_without_tenant_path(cls, project, company):
"""Return a fully-qualified company_without_tenant string."""
return google.api_core.path_template.expand(
"projects/{project}/companies/{company}", project=project, company=company
)

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ def company_path(cls, project, tenant, company):
company=company,
)

@classmethod
def company_without_tenant_path(cls, project, company):
"""Return a fully-qualified company_without_tenant string."""
return google.api_core.path_template.expand(
"projects/{project}/companies/{company}", project=project, company=company
)

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ def from_service_account_file(cls, filename, *args, **kwargs):

from_service_account_json = from_service_account_file

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ def company_path(cls, project, tenant, company):
company=company,
)

@classmethod
def company_without_tenant_path(cls, project, company):
"""Return a fully-qualified company_without_tenant string."""
return google.api_core.path_template.expand(
"projects/{project}/companies/{company}", project=project, company=company
)

@classmethod
def job_path(cls, project, tenant, jobs):
"""Return a fully-qualified job string."""
Expand All @@ -112,6 +119,20 @@ def job_path(cls, project, tenant, jobs):
jobs=jobs,
)

@classmethod
def job_without_tenant_path(cls, project, jobs):
"""Return a fully-qualified job_without_tenant string."""
return google.api_core.path_template.expand(
"projects/{project}/jobs/{jobs}", project=project, jobs=jobs
)

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
Expand Down
10 changes: 5 additions & 5 deletions packages/google-cloud-talent/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-07-03T12:39:55.307403Z",
"updateTime": "2019-07-10T12:28:53.668819Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.29.3",
"dockerImage": "googleapis/artman@sha256:8900f94a81adaab0238965aa8a7b3648791f4f3a95ee65adc6a56cfcc3753101"
"version": "0.29.4",
"dockerImage": "googleapis/artman@sha256:63f21e83cb92680b7001dc381069e962c9e6dee314fd8365ac554c07c89221fb"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "69916b6ffbb7717fa009033351777d0c9909fb79",
"internalRef": "256241904"
"sha": "16c0ea3cde17a897ba04b7b94d9bf4dd57e3227e",
"internalRef": "257239177"
}
},
{
Expand Down

0 comments on commit 2562eaa

Please sign in to comment.