Skip to content

Commit feefced

Browse files
yoshi-automationbusunkim96
authored andcommitted
feat(iam): undeprecate resource name helper methods, add 2.7 deprecation warning (via synth) (#10043)
1 parent fa33be7 commit feefced

File tree

3 files changed

+1156
-1150
lines changed

3 files changed

+1156
-1150
lines changed

iam/google/cloud/iam_credentials_v1/__init__.py

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

1717

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

2022
from google.cloud.iam_credentials_v1 import types
2123
from google.cloud.iam_credentials_v1.gapic import iam_credentials_client
2224

2325

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

iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py

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

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

0 commit comments

Comments
 (0)