Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
fix(talent): deprecate resource name helper methods (via synth) (#9844)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and busunkim96 committed Nov 19, 2019
1 parent 27e23ca commit 56c7a87
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 27 deletions.
14 changes: 12 additions & 2 deletions google/cloud/talent_v4beta1/gapic/application_service_client.py
Expand Up @@ -81,7 +81,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def application_path(cls, project, tenant, profile, application):
"""Return a fully-qualified application string."""
"""DEPRECATED. Return a fully-qualified application string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/profiles/{profile}/applications/{application}",
project=project,
Expand All @@ -92,7 +97,12 @@ def application_path(cls, project, tenant, profile, application):

@classmethod
def profile_path(cls, project, tenant, profile):
"""Return a fully-qualified profile string."""
"""DEPRECATED. Return a fully-qualified profile string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/profiles/{profile}",
project=project,
Expand Down
28 changes: 24 additions & 4 deletions google/cloud/talent_v4beta1/gapic/company_service_client.py
Expand Up @@ -79,7 +79,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def company_path(cls, project, tenant, company):
"""Return a fully-qualified company string."""
"""DEPRECATED. Return a fully-qualified company string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/companies/{company}",
project=project,
Expand All @@ -89,21 +94,36 @@ def company_path(cls, project, tenant, company):

@classmethod
def company_without_tenant_path(cls, project, company):
"""Return a fully-qualified company_without_tenant string."""
"""DEPRECATED. Return a fully-qualified company_without_tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
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."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
"""DEPRECATED. Return a fully-qualified tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
)
Expand Down
28 changes: 24 additions & 4 deletions google/cloud/talent_v4beta1/gapic/completion_client.py
Expand Up @@ -79,7 +79,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def company_path(cls, project, tenant, company):
"""Return a fully-qualified company string."""
"""DEPRECATED. Return a fully-qualified company string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/companies/{company}",
project=project,
Expand All @@ -89,21 +94,36 @@ def company_path(cls, project, tenant, company):

@classmethod
def company_without_tenant_path(cls, project, company):
"""Return a fully-qualified company_without_tenant string."""
"""DEPRECATED. Return a fully-qualified company_without_tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
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."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
"""DEPRECATED. Return a fully-qualified tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
)
Expand Down
14 changes: 12 additions & 2 deletions google/cloud/talent_v4beta1/gapic/event_service_client.py
Expand Up @@ -82,14 +82,24 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
"""DEPRECATED. Return a fully-qualified tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
)
Expand Down
42 changes: 36 additions & 6 deletions google/cloud/talent_v4beta1/gapic/job_service_client.py
Expand Up @@ -93,7 +93,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def company_path(cls, project, tenant, company):
"""Return a fully-qualified company string."""
"""DEPRECATED. Return a fully-qualified company string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/companies/{company}",
project=project,
Expand All @@ -103,14 +108,24 @@ def company_path(cls, project, tenant, company):

@classmethod
def company_without_tenant_path(cls, project, company):
"""Return a fully-qualified company_without_tenant string."""
"""DEPRECATED. Return a fully-qualified company_without_tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
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."""
"""DEPRECATED. Return a fully-qualified job string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/jobs/{jobs}",
project=project,
Expand All @@ -120,21 +135,36 @@ def job_path(cls, project, tenant, jobs):

@classmethod
def job_without_tenant_path(cls, project, jobs):
"""Return a fully-qualified job_without_tenant string."""
"""DEPRECATED. Return a fully-qualified job_without_tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
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."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
"""DEPRECATED. Return a fully-qualified tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
)
Expand Down
14 changes: 12 additions & 2 deletions google/cloud/talent_v4beta1/gapic/profile_service_client.py
Expand Up @@ -97,7 +97,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def profile_path(cls, project, tenant, profile):
"""Return a fully-qualified profile string."""
"""DEPRECATED. Return a fully-qualified profile string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/profiles/{profile}",
project=project,
Expand All @@ -107,7 +112,12 @@ def profile_path(cls, project, tenant, profile):

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
"""DEPRECATED. Return a fully-qualified tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
)
Expand Down
14 changes: 12 additions & 2 deletions google/cloud/talent_v4beta1/gapic/tenant_service_client.py
Expand Up @@ -97,14 +97,24 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def tenant_path(cls, project, tenant):
"""Return a fully-qualified tenant string."""
"""DEPRECATED. Return a fully-qualified tenant string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
)
Expand Down
10 changes: 5 additions & 5 deletions synth.metadata
@@ -1,19 +1,19 @@
{
"updateTime": "2019-11-12T13:41:12.564647Z",
"updateTime": "2019-11-19T13:36:53.978549Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.41.1",
"dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e"
"version": "0.42.1",
"dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8",
"internalRef": "279774957"
"sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a",
"internalRef": "281088257"
}
},
{
Expand Down

0 comments on commit 56c7a87

Please sign in to comment.