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

Commit

Permalink
feat(iam): undeprecate resource name helper methods, add 2.7 deprecat…
Browse files Browse the repository at this point in the history
…ion warning (via synth) (#10043)
  • Loading branch information
yoshi-automation authored and busunkim96 committed Jan 8, 2020
1 parent a53ae67 commit 0a23a84
Show file tree
Hide file tree
Showing 3 changed files with 1,156 additions and 1,150 deletions.
11 changes: 11 additions & 0 deletions google/cloud/iam_credentials_v1/__init__.py
Expand Up @@ -16,11 +16,22 @@


from __future__ import absolute_import
import sys
import warnings

from google.cloud.iam_credentials_v1 import types
from google.cloud.iam_credentials_v1.gapic import iam_credentials_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 IAMCredentialsClient(iam_credentials_client.IAMCredentialsClient):
__doc__ = iam_credentials_client.IAMCredentialsClient.__doc__

Expand Down
Expand Up @@ -83,12 +83,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):

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

0 comments on commit 0a23a84

Please sign in to comment.