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

Commit

Permalink
feat(talent): undeprecate resource name helpers, add 2.7 sunset warni…
Browse files Browse the repository at this point in the history
…ng (via synth) (#10050)
  • Loading branch information
yoshi-automation authored and busunkim96 committed Jan 8, 2020
1 parent e5787eb commit 1c6e3ee
Show file tree
Hide file tree
Showing 9 changed files with 3,658 additions and 137 deletions.
11 changes: 11 additions & 0 deletions google/cloud/talent_v4beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@


from __future__ import absolute_import
import sys
import warnings

from google.cloud.talent_v4beta1 import types
from google.cloud.talent_v4beta1.gapic import application_service_client
Expand All @@ -28,6 +30,15 @@
from google.cloud.talent_v4beta1.gapic import tenant_service_client


if sys.version_info[:2] == (2, 7):
message = (
"A future version of this library will drop support for Python 2.7."
"More details about Python 2 support for Google Cloud Client Libraries"
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
)
warnings.warn(message, DeprecationWarning)


class ApplicationServiceClient(application_service_client.ApplicationServiceClient):
__doc__ = application_service_client.ApplicationServiceClient.__doc__
enums = enums
Expand Down
14 changes: 2 additions & 12 deletions google/cloud/talent_v4beta1/gapic/application_service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

0 comments on commit 1c6e3ee

Please sign in to comment.