Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(talent): undeprecate resource name helpers, add 2.7 sunset warning (via synth) #10050

Merged
merged 1 commit into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions talent/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
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 talent/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 talent/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 talent/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 talent/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 talent/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 talent/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