1
1
# -*- coding: utf-8 -*-
2
2
#
3
- # Copyright 2019 Google LLC
3
+ # Copyright 2020 Google LLC
4
4
#
5
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
6
# you may not use this file except in compliance with the License.
44
44
45
45
46
46
_GAPIC_LIBRARY_VERSION = pkg_resources .get_distribution (
47
- "google-cloud-monitoring" ,
47
+ "google-cloud-monitoring"
48
48
).version
49
49
50
50
@@ -90,12 +90,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
90
90
91
91
@classmethod
92
92
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."""
99
94
return google .api_core .path_template .expand (
100
95
"projects/{project}/alertPolicies/{alert_policy}" ,
101
96
project = project ,
@@ -104,12 +99,7 @@ def alert_policy_path(cls, project, alert_policy):
104
99
105
100
@classmethod
106
101
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."""
113
103
return google .api_core .path_template .expand (
114
104
"projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}" ,
115
105
project = project ,
@@ -119,14 +109,9 @@ def alert_policy_condition_path(cls, project, alert_policy, condition):
119
109
120
110
@classmethod
121
111
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."""
128
113
return google .api_core .path_template .expand (
129
- "projects/{project}" , project = project ,
114
+ "projects/{project}" , project = project
130
115
)
131
116
132
117
def __init__ (
@@ -216,12 +201,12 @@ def __init__(
216
201
self .transport = transport
217
202
else :
218
203
self .transport = alert_policy_service_grpc_transport .AlertPolicyServiceGrpcTransport (
219
- address = api_endpoint , channel = channel , credentials = credentials ,
204
+ address = api_endpoint , channel = channel , credentials = credentials
220
205
)
221
206
222
207
if client_info is None :
223
208
client_info = google .api_core .gapic_v1 .client_info .ClientInfo (
224
- gapic_version = _GAPIC_LIBRARY_VERSION ,
209
+ gapic_version = _GAPIC_LIBRARY_VERSION
225
210
)
226
211
else :
227
212
client_info .gapic_version = _GAPIC_LIBRARY_VERSION
@@ -232,7 +217,7 @@ def __init__(
232
217
# (Ordinarily, these are the defaults specified in the `*_config.py`
233
218
# file next to this one.)
234
219
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 ]
236
221
)
237
222
238
223
# Save a dictionary of cached API call functions.
@@ -337,7 +322,7 @@ def list_alert_policies(
337
322
)
338
323
339
324
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
341
326
)
342
327
if metadata is None :
343
328
metadata = []
@@ -423,7 +408,7 @@ def get_alert_policy(
423
408
client_info = self ._client_info ,
424
409
)
425
410
426
- request = alert_service_pb2 .GetAlertPolicyRequest (name = name , )
411
+ request = alert_service_pb2 .GetAlertPolicyRequest (name = name )
427
412
if metadata is None :
428
413
metadata = []
429
414
metadata = list (metadata )
@@ -513,7 +498,7 @@ def create_alert_policy(
513
498
)
514
499
515
500
request = alert_service_pb2 .CreateAlertPolicyRequest (
516
- name = name , alert_policy = alert_policy ,
501
+ name = name , alert_policy = alert_policy
517
502
)
518
503
if metadata is None :
519
504
metadata = []
@@ -587,7 +572,7 @@ def delete_alert_policy(
587
572
client_info = self ._client_info ,
588
573
)
589
574
590
- request = alert_service_pb2 .DeleteAlertPolicyRequest (name = name , )
575
+ request = alert_service_pb2 .DeleteAlertPolicyRequest (name = name )
591
576
if metadata is None :
592
577
metadata = []
593
578
metadata = list (metadata )
@@ -696,7 +681,7 @@ def update_alert_policy(
696
681
)
697
682
698
683
request = alert_service_pb2 .UpdateAlertPolicyRequest (
699
- alert_policy = alert_policy , update_mask = update_mask ,
684
+ alert_policy = alert_policy , update_mask = update_mask
700
685
)
701
686
if metadata is None :
702
687
metadata = []
0 commit comments