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

Commit 1c6e3ee

Browse files
yoshi-automationbusunkim96
authored andcommitted
feat(talent): undeprecate resource name helpers, add 2.7 sunset warning (via synth) (#10050)
1 parent e5787eb commit 1c6e3ee

File tree

9 files changed

+3658
-137
lines changed

9 files changed

+3658
-137
lines changed

google/cloud/talent_v4beta1/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717

1818
from __future__ import absolute_import
19+
import sys
20+
import warnings
1921

2022
from google.cloud.talent_v4beta1 import types
2123
from google.cloud.talent_v4beta1.gapic import application_service_client
@@ -28,6 +30,15 @@
2830
from google.cloud.talent_v4beta1.gapic import tenant_service_client
2931

3032

33+
if sys.version_info[:2] == (2, 7):
34+
message = (
35+
"A future version of this library will drop support for Python 2.7."
36+
"More details about Python 2 support for Google Cloud Client Libraries"
37+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
38+
)
39+
warnings.warn(message, DeprecationWarning)
40+
41+
3142
class ApplicationServiceClient(application_service_client.ApplicationServiceClient):
3243
__doc__ = application_service_client.ApplicationServiceClient.__doc__
3344
enums = enums

google/cloud/talent_v4beta1/gapic/application_service_client.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8181

8282
@classmethod
8383
def application_path(cls, project, tenant, profile, application):
84-
"""DEPRECATED. Return a fully-qualified application string."""
85-
warnings.warn(
86-
"Resource name helper functions are deprecated.",
87-
PendingDeprecationWarning,
88-
stacklevel=1,
89-
)
84+
"""Return a fully-qualified application string."""
9085
return google.api_core.path_template.expand(
9186
"projects/{project}/tenants/{tenant}/profiles/{profile}/applications/{application}",
9287
project=project,
@@ -97,12 +92,7 @@ def application_path(cls, project, tenant, profile, application):
9792

9893
@classmethod
9994
def profile_path(cls, project, tenant, profile):
100-
"""DEPRECATED. Return a fully-qualified profile string."""
101-
warnings.warn(
102-
"Resource name helper functions are deprecated.",
103-
PendingDeprecationWarning,
104-
stacklevel=1,
105-
)
95+
"""Return a fully-qualified profile string."""
10696
return google.api_core.path_template.expand(
10797
"projects/{project}/tenants/{tenant}/profiles/{profile}",
10898
project=project,

google/cloud/talent_v4beta1/gapic/company_service_client.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7979

8080
@classmethod
8181
def company_path(cls, project, tenant, company):
82-
"""DEPRECATED. Return a fully-qualified company string."""
83-
warnings.warn(
84-
"Resource name helper functions are deprecated.",
85-
PendingDeprecationWarning,
86-
stacklevel=1,
87-
)
82+
"""Return a fully-qualified company string."""
8883
return google.api_core.path_template.expand(
8984
"projects/{project}/tenants/{tenant}/companies/{company}",
9085
project=project,
@@ -94,36 +89,21 @@ def company_path(cls, project, tenant, company):
9489

9590
@classmethod
9691
def company_without_tenant_path(cls, project, company):
97-
"""DEPRECATED. Return a fully-qualified company_without_tenant string."""
98-
warnings.warn(
99-
"Resource name helper functions are deprecated.",
100-
PendingDeprecationWarning,
101-
stacklevel=1,
102-
)
92+
"""Return a fully-qualified company_without_tenant string."""
10393
return google.api_core.path_template.expand(
10494
"projects/{project}/companies/{company}", project=project, company=company
10595
)
10696

10797
@classmethod
10898
def project_path(cls, project):
109-
"""DEPRECATED. Return a fully-qualified project string."""
110-
warnings.warn(
111-
"Resource name helper functions are deprecated.",
112-
PendingDeprecationWarning,
113-
stacklevel=1,
114-
)
99+
"""Return a fully-qualified project string."""
115100
return google.api_core.path_template.expand(
116101
"projects/{project}", project=project
117102
)
118103

119104
@classmethod
120105
def tenant_path(cls, project, tenant):
121-
"""DEPRECATED. Return a fully-qualified tenant string."""
122-
warnings.warn(
123-
"Resource name helper functions are deprecated.",
124-
PendingDeprecationWarning,
125-
stacklevel=1,
126-
)
106+
"""Return a fully-qualified tenant string."""
127107
return google.api_core.path_template.expand(
128108
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
129109
)

google/cloud/talent_v4beta1/gapic/completion_client.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7979

8080
@classmethod
8181
def company_path(cls, project, tenant, company):
82-
"""DEPRECATED. Return a fully-qualified company string."""
83-
warnings.warn(
84-
"Resource name helper functions are deprecated.",
85-
PendingDeprecationWarning,
86-
stacklevel=1,
87-
)
82+
"""Return a fully-qualified company string."""
8883
return google.api_core.path_template.expand(
8984
"projects/{project}/tenants/{tenant}/companies/{company}",
9085
project=project,
@@ -94,36 +89,21 @@ def company_path(cls, project, tenant, company):
9489

9590
@classmethod
9691
def company_without_tenant_path(cls, project, company):
97-
"""DEPRECATED. Return a fully-qualified company_without_tenant string."""
98-
warnings.warn(
99-
"Resource name helper functions are deprecated.",
100-
PendingDeprecationWarning,
101-
stacklevel=1,
102-
)
92+
"""Return a fully-qualified company_without_tenant string."""
10393
return google.api_core.path_template.expand(
10494
"projects/{project}/companies/{company}", project=project, company=company
10595
)
10696

10797
@classmethod
10898
def project_path(cls, project):
109-
"""DEPRECATED. Return a fully-qualified project string."""
110-
warnings.warn(
111-
"Resource name helper functions are deprecated.",
112-
PendingDeprecationWarning,
113-
stacklevel=1,
114-
)
99+
"""Return a fully-qualified project string."""
115100
return google.api_core.path_template.expand(
116101
"projects/{project}", project=project
117102
)
118103

119104
@classmethod
120105
def tenant_path(cls, project, tenant):
121-
"""DEPRECATED. Return a fully-qualified tenant string."""
122-
warnings.warn(
123-
"Resource name helper functions are deprecated.",
124-
PendingDeprecationWarning,
125-
stacklevel=1,
126-
)
106+
"""Return a fully-qualified tenant string."""
127107
return google.api_core.path_template.expand(
128108
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
129109
)

google/cloud/talent_v4beta1/gapic/event_service_client.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,14 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8282

8383
@classmethod
8484
def project_path(cls, project):
85-
"""DEPRECATED. Return a fully-qualified project string."""
86-
warnings.warn(
87-
"Resource name helper functions are deprecated.",
88-
PendingDeprecationWarning,
89-
stacklevel=1,
90-
)
85+
"""Return a fully-qualified project string."""
9186
return google.api_core.path_template.expand(
9287
"projects/{project}", project=project
9388
)
9489

9590
@classmethod
9691
def tenant_path(cls, project, tenant):
97-
"""DEPRECATED. Return a fully-qualified tenant string."""
98-
warnings.warn(
99-
"Resource name helper functions are deprecated.",
100-
PendingDeprecationWarning,
101-
stacklevel=1,
102-
)
92+
"""Return a fully-qualified tenant string."""
10393
return google.api_core.path_template.expand(
10494
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
10595
)

google/cloud/talent_v4beta1/gapic/job_service_client.py

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9393

9494
@classmethod
9595
def company_path(cls, project, tenant, company):
96-
"""DEPRECATED. Return a fully-qualified company string."""
97-
warnings.warn(
98-
"Resource name helper functions are deprecated.",
99-
PendingDeprecationWarning,
100-
stacklevel=1,
101-
)
96+
"""Return a fully-qualified company string."""
10297
return google.api_core.path_template.expand(
10398
"projects/{project}/tenants/{tenant}/companies/{company}",
10499
project=project,
@@ -108,24 +103,14 @@ def company_path(cls, project, tenant, company):
108103

109104
@classmethod
110105
def company_without_tenant_path(cls, project, company):
111-
"""DEPRECATED. Return a fully-qualified company_without_tenant string."""
112-
warnings.warn(
113-
"Resource name helper functions are deprecated.",
114-
PendingDeprecationWarning,
115-
stacklevel=1,
116-
)
106+
"""Return a fully-qualified company_without_tenant string."""
117107
return google.api_core.path_template.expand(
118108
"projects/{project}/companies/{company}", project=project, company=company
119109
)
120110

121111
@classmethod
122112
def job_path(cls, project, tenant, jobs):
123-
"""DEPRECATED. Return a fully-qualified job string."""
124-
warnings.warn(
125-
"Resource name helper functions are deprecated.",
126-
PendingDeprecationWarning,
127-
stacklevel=1,
128-
)
113+
"""Return a fully-qualified job string."""
129114
return google.api_core.path_template.expand(
130115
"projects/{project}/tenants/{tenant}/jobs/{jobs}",
131116
project=project,
@@ -135,36 +120,21 @@ def job_path(cls, project, tenant, jobs):
135120

136121
@classmethod
137122
def job_without_tenant_path(cls, project, jobs):
138-
"""DEPRECATED. Return a fully-qualified job_without_tenant string."""
139-
warnings.warn(
140-
"Resource name helper functions are deprecated.",
141-
PendingDeprecationWarning,
142-
stacklevel=1,
143-
)
123+
"""Return a fully-qualified job_without_tenant string."""
144124
return google.api_core.path_template.expand(
145125
"projects/{project}/jobs/{jobs}", project=project, jobs=jobs
146126
)
147127

148128
@classmethod
149129
def project_path(cls, project):
150-
"""DEPRECATED. Return a fully-qualified project string."""
151-
warnings.warn(
152-
"Resource name helper functions are deprecated.",
153-
PendingDeprecationWarning,
154-
stacklevel=1,
155-
)
130+
"""Return a fully-qualified project string."""
156131
return google.api_core.path_template.expand(
157132
"projects/{project}", project=project
158133
)
159134

160135
@classmethod
161136
def tenant_path(cls, project, tenant):
162-
"""DEPRECATED. Return a fully-qualified tenant string."""
163-
warnings.warn(
164-
"Resource name helper functions are deprecated.",
165-
PendingDeprecationWarning,
166-
stacklevel=1,
167-
)
137+
"""Return a fully-qualified tenant string."""
168138
return google.api_core.path_template.expand(
169139
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
170140
)

google/cloud/talent_v4beta1/gapic/profile_service_client.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9797

9898
@classmethod
9999
def profile_path(cls, project, tenant, profile):
100-
"""DEPRECATED. Return a fully-qualified profile string."""
101-
warnings.warn(
102-
"Resource name helper functions are deprecated.",
103-
PendingDeprecationWarning,
104-
stacklevel=1,
105-
)
100+
"""Return a fully-qualified profile string."""
106101
return google.api_core.path_template.expand(
107102
"projects/{project}/tenants/{tenant}/profiles/{profile}",
108103
project=project,
@@ -112,12 +107,7 @@ def profile_path(cls, project, tenant, profile):
112107

113108
@classmethod
114109
def tenant_path(cls, project, tenant):
115-
"""DEPRECATED. Return a fully-qualified tenant string."""
116-
warnings.warn(
117-
"Resource name helper functions are deprecated.",
118-
PendingDeprecationWarning,
119-
stacklevel=1,
120-
)
110+
"""Return a fully-qualified tenant string."""
121111
return google.api_core.path_template.expand(
122112
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
123113
)

google/cloud/talent_v4beta1/gapic/tenant_service_client.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,14 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9797

9898
@classmethod
9999
def project_path(cls, project):
100-
"""DEPRECATED. Return a fully-qualified project string."""
101-
warnings.warn(
102-
"Resource name helper functions are deprecated.",
103-
PendingDeprecationWarning,
104-
stacklevel=1,
105-
)
100+
"""Return a fully-qualified project string."""
106101
return google.api_core.path_template.expand(
107102
"projects/{project}", project=project
108103
)
109104

110105
@classmethod
111106
def tenant_path(cls, project, tenant):
112-
"""DEPRECATED. Return a fully-qualified tenant string."""
113-
warnings.warn(
114-
"Resource name helper functions are deprecated.",
115-
PendingDeprecationWarning,
116-
stacklevel=1,
117-
)
107+
"""Return a fully-qualified tenant string."""
118108
return google.api_core.path_template.expand(
119109
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
120110
)

0 commit comments

Comments
 (0)