Skip to content

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 a4fa353 commit e08bd44
Show file tree
Hide file tree
Showing 3 changed files with 1,156 additions and 1,150 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit e08bd44

Please sign in to comment.