Skip to content

Commit

Permalink
feat(billingbudgets): undeprecate resource name helper methods, add …
Browse files Browse the repository at this point in the history
…2.7 deprecation warning (via synth) (#10038)
  • Loading branch information
yoshi-automation authored and busunkim96 committed Jan 8, 2020
1 parent 6c8e68e commit fd51c33
Show file tree
Hide file tree
Showing 3 changed files with 3,431 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,23 @@


from __future__ import absolute_import
import sys
import warnings

from google.cloud.billing_budgets_v1beta1 import types
from google.cloud.billing_budgets_v1beta1.gapic import budget_service_client
from google.cloud.billing_budgets_v1beta1.gapic import enums


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 BudgetServiceClient(budget_service_client.BudgetServiceClient):
__doc__ = budget_service_client.BudgetServiceClient.__doc__
enums = enums
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,14 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def billing_account_path(cls, billing_account):
"""DEPRECATED. Return a fully-qualified billing_account string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified billing_account string."""
return google.api_core.path_template.expand(
"billingAccounts/{billing_account}", billing_account=billing_account
)

@classmethod
def budget_path(cls, billing_account, budget):
"""DEPRECATED. Return a fully-qualified budget string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified budget string."""
return google.api_core.path_template.expand(
"billingAccounts/{billing_account}/budgets/{budget}",
billing_account=billing_account,
Expand Down
Loading

0 comments on commit fd51c33

Please sign in to comment.