Skip to content

Commit 21e4ff3

Browse files
yoshi-automationbusunkim96
authored andcommitted
feat(phishingprotection): undeprecate resource name helper methods, add 2.7 deprecation warning (via synth) (#10048)
1 parent e04d1db commit 21e4ff3

File tree

3 files changed

+3418
-11
lines changed

3 files changed

+3418
-11
lines changed

phishingprotection/google/cloud/phishingprotection_v1beta1/__init__.py

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

1717

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

2022
from google.cloud.phishingprotection_v1beta1 import types
2123
from google.cloud.phishingprotection_v1beta1.gapic import (
2224
phishing_protection_service_client,
2325
)
2426

2527

28+
if sys.version_info[:2] == (2, 7):
29+
message = (
30+
"A future version of this library will drop support for Python 2.7."
31+
"More details about Python 2 support for Google Cloud Client Libraries"
32+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
33+
)
34+
warnings.warn(message, DeprecationWarning)
35+
36+
2637
class PhishingProtectionServiceClient(
2738
phishing_protection_service_client.PhishingProtectionServiceClient
2839
):

phishingprotection/google/cloud/phishingprotection_v1beta1/gapic/phishing_protection_service_client.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7878

7979
@classmethod
8080
def project_path(cls, project):
81-
"""DEPRECATED. Return a fully-qualified project string."""
82-
warnings.warn(
83-
"Resource name helper functions are deprecated.",
84-
PendingDeprecationWarning,
85-
stacklevel=1,
86-
)
81+
"""Return a fully-qualified project string."""
8782
return google.api_core.path_template.expand(
8883
"projects/{project}", project=project
8984
)

0 commit comments

Comments
 (0)