11# -*- coding: utf-8 -*-
22#
3- # Copyright 2019 Google LLC
3+ # Copyright 2020 Google LLC
44#
55# Licensed under the Apache License, Version 2.0 (the "License");
66# you may not use this file except in compliance with the License.
4444
4545
4646_GAPIC_LIBRARY_VERSION = pkg_resources .get_distribution (
47- "google-cloud-monitoring" ,
47+ "google-cloud-monitoring"
4848).version
4949
5050
@@ -90,12 +90,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9090
9191 @classmethod
9292 def alert_policy_path (cls , project , alert_policy ):
93- """DEPRECATED. Return a fully-qualified alert_policy string."""
94- warnings .warn (
95- "Resource name helper functions are deprecated." ,
96- PendingDeprecationWarning ,
97- stacklevel = 1 ,
98- )
93+ """Return a fully-qualified alert_policy string."""
9994 return google .api_core .path_template .expand (
10095 "projects/{project}/alertPolicies/{alert_policy}" ,
10196 project = project ,
@@ -104,12 +99,7 @@ def alert_policy_path(cls, project, alert_policy):
10499
105100 @classmethod
106101 def alert_policy_condition_path (cls , project , alert_policy , condition ):
107- """DEPRECATED. Return a fully-qualified alert_policy_condition string."""
108- warnings .warn (
109- "Resource name helper functions are deprecated." ,
110- PendingDeprecationWarning ,
111- stacklevel = 1 ,
112- )
102+ """Return a fully-qualified alert_policy_condition string."""
113103 return google .api_core .path_template .expand (
114104 "projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}" ,
115105 project = project ,
@@ -119,14 +109,9 @@ def alert_policy_condition_path(cls, project, alert_policy, condition):
119109
120110 @classmethod
121111 def project_path (cls , project ):
122- """DEPRECATED. Return a fully-qualified project string."""
123- warnings .warn (
124- "Resource name helper functions are deprecated." ,
125- PendingDeprecationWarning ,
126- stacklevel = 1 ,
127- )
112+ """Return a fully-qualified project string."""
128113 return google .api_core .path_template .expand (
129- "projects/{project}" , project = project ,
114+ "projects/{project}" , project = project
130115 )
131116
132117 def __init__ (
@@ -216,12 +201,12 @@ def __init__(
216201 self .transport = transport
217202 else :
218203 self .transport = alert_policy_service_grpc_transport .AlertPolicyServiceGrpcTransport (
219- address = api_endpoint , channel = channel , credentials = credentials ,
204+ address = api_endpoint , channel = channel , credentials = credentials
220205 )
221206
222207 if client_info is None :
223208 client_info = google .api_core .gapic_v1 .client_info .ClientInfo (
224- gapic_version = _GAPIC_LIBRARY_VERSION ,
209+ gapic_version = _GAPIC_LIBRARY_VERSION
225210 )
226211 else :
227212 client_info .gapic_version = _GAPIC_LIBRARY_VERSION
@@ -232,7 +217,7 @@ def __init__(
232217 # (Ordinarily, these are the defaults specified in the `*_config.py`
233218 # file next to this one.)
234219 self ._method_configs = google .api_core .gapic_v1 .config .parse_method_configs (
235- client_config ["interfaces" ][self ._INTERFACE_NAME ],
220+ client_config ["interfaces" ][self ._INTERFACE_NAME ]
236221 )
237222
238223 # Save a dictionary of cached API call functions.
@@ -337,7 +322,7 @@ def list_alert_policies(
337322 )
338323
339324 request = alert_service_pb2 .ListAlertPoliciesRequest (
340- name = name , filter = filter_ , order_by = order_by , page_size = page_size ,
325+ name = name , filter = filter_ , order_by = order_by , page_size = page_size
341326 )
342327 if metadata is None :
343328 metadata = []
@@ -423,7 +408,7 @@ def get_alert_policy(
423408 client_info = self ._client_info ,
424409 )
425410
426- request = alert_service_pb2 .GetAlertPolicyRequest (name = name , )
411+ request = alert_service_pb2 .GetAlertPolicyRequest (name = name )
427412 if metadata is None :
428413 metadata = []
429414 metadata = list (metadata )
@@ -513,7 +498,7 @@ def create_alert_policy(
513498 )
514499
515500 request = alert_service_pb2 .CreateAlertPolicyRequest (
516- name = name , alert_policy = alert_policy ,
501+ name = name , alert_policy = alert_policy
517502 )
518503 if metadata is None :
519504 metadata = []
@@ -587,7 +572,7 @@ def delete_alert_policy(
587572 client_info = self ._client_info ,
588573 )
589574
590- request = alert_service_pb2 .DeleteAlertPolicyRequest (name = name , )
575+ request = alert_service_pb2 .DeleteAlertPolicyRequest (name = name )
591576 if metadata is None :
592577 metadata = []
593578 metadata = list (metadata )
@@ -696,7 +681,7 @@ def update_alert_policy(
696681 )
697682
698683 request = alert_service_pb2 .UpdateAlertPolicyRequest (
699- alert_policy = alert_policy , update_mask = update_mask ,
684+ alert_policy = alert_policy , update_mask = update_mask
700685 )
701686 if metadata is None :
702687 metadata = []
0 commit comments