@@ -58,7 +58,7 @@ def test_list_entries_no_paging(self):
5858
5959 from google .api .monitored_resource_pb2 import MonitoredResource
6060 from google .gax import INITIAL_PAGE
61- from google .logging .v2 .log_entry_pb2 import LogEntry
61+ from google .cloud . grpc . logging .v2 .log_entry_pb2 import LogEntry
6262
6363 from google .cloud ._helpers import _datetime_to_pb_timestamp
6464 from google .cloud ._helpers import UTC
@@ -103,8 +103,9 @@ def test_list_entries_no_paging(self):
103103 self .assertIsNone (entry .severity )
104104 self .assertIsNone (entry .http_request )
105105
106- projects , filter_ , order_by , page_size , options = (
106+ resource_names , projects , filter_ , order_by , page_size , options = (
107107 gax_api ._list_log_entries_called_with )
108+ self .assertEqual (resource_names , [])
108109 self .assertEqual (projects , [self .PROJECT ])
109110 self .assertEqual (filter_ , self .FILTER )
110111 self .assertEqual (order_by , DESCENDING )
@@ -115,7 +116,7 @@ def _list_entries_with_paging_helper(self, payload, struct_pb):
115116 import datetime
116117
117118 from google .api .monitored_resource_pb2 import MonitoredResource
118- from google .logging .v2 .log_entry_pb2 import LogEntry
119+ from google .cloud . grpc . logging .v2 .log_entry_pb2 import LogEntry
119120 from google .cloud ._helpers import _datetime_to_pb_timestamp
120121 from google .cloud ._helpers import UTC
121122 from google .cloud ._testing import _GAXPageIterator
@@ -158,8 +159,9 @@ def _list_entries_with_paging_helper(self, payload, struct_pb):
158159 self .assertIsNone (entry .severity )
159160 self .assertIsNone (entry .http_request )
160161
161- projects , filter_ , order_by , page_size , options = (
162+ resource_names , projects , filter_ , order_by , page_size , options = (
162163 gax_api ._list_log_entries_called_with )
164+ self .assertEqual (resource_names , [])
163165 self .assertEqual (projects , [self .PROJECT ])
164166 self .assertEqual (filter_ , '' )
165167 self .assertEqual (order_by , '' )
@@ -205,8 +207,9 @@ def test_list_entries_with_paging_nested_payload(self):
205207
206208 def _make_log_entry_with_extras (self , labels , iid , type_url , now ):
207209 from google .api .monitored_resource_pb2 import MonitoredResource
208- from google .logging .v2 .log_entry_pb2 import LogEntry
209- from google .logging .v2 .log_entry_pb2 import LogEntryOperation
210+ from google .cloud .grpc .logging .v2 .log_entry_pb2 import LogEntry
211+ from google .cloud .grpc .logging .v2 .log_entry_pb2 import (
212+ LogEntryOperation )
210213 from google .logging .type .http_request_pb2 import HttpRequest
211214 from google .logging .type .log_severity_pb2 import WARNING
212215 from google .protobuf .any_pb2 import Any
@@ -311,16 +314,17 @@ def test_list_entries_with_extra_properties(self):
311314 'cacheHit' : entry_pb .http_request .cache_hit ,
312315 })
313316
314- projects , filter_ , order_by , page_size , options = (
317+ resource_names , projects , filter_ , order_by , page_size , options = (
315318 gax_api ._list_log_entries_called_with )
319+ self .assertEqual (resource_names , [])
316320 self .assertEqual (projects , [self .PROJECT ])
317321 self .assertEqual (filter_ , '' )
318322 self .assertEqual (order_by , '' )
319323 self .assertEqual (page_size , SIZE )
320324 self .assertEqual (options .page_token , TOKEN )
321325
322326 def test_write_entries_single (self ):
323- from google .logging .v2 .log_entry_pb2 import LogEntry
327+ from google .cloud . grpc . logging .v2 .log_entry_pb2 import LogEntry
324328 TEXT = 'TEXT'
325329 ENTRY = {
326330 'logName' : self .LOG_PATH ,
@@ -353,7 +357,7 @@ def test_write_entries_w_extra_properties(self):
353357 # pylint: disable=too-many-statements
354358 from datetime import datetime
355359 from google .logging .type .log_severity_pb2 import WARNING
356- from google .logging .v2 .log_entry_pb2 import LogEntry
360+ from google .cloud . grpc . logging .v2 .log_entry_pb2 import LogEntry
357361 from google .cloud ._helpers import UTC , _pb_timestamp_to_datetime
358362 NOW = datetime .utcnow ().replace (tzinfo = UTC )
359363 TEXT = 'TEXT'
@@ -448,7 +452,7 @@ def _write_entries_multiple_helper(self, json_payload, json_struct_pb):
448452 # pylint: disable=too-many-statements
449453 import datetime
450454 from google .logging .type .log_severity_pb2 import WARNING
451- from google .logging .v2 .log_entry_pb2 import LogEntry
455+ from google .cloud . grpc . logging .v2 .log_entry_pb2 import LogEntry
452456 from google .protobuf .any_pb2 import Any
453457 from google .cloud ._helpers import _datetime_to_rfc3339 , UTC
454458 TEXT = 'TEXT'
@@ -616,7 +620,7 @@ def test_ctor(self):
616620 def test_list_sinks_no_paging (self ):
617621 import six
618622 from google .gax import INITIAL_PAGE
619- from google .logging .v2 .logging_config_pb2 import LogSink
623+ from google .cloud . grpc . logging .v2 .logging_config_pb2 import LogSink
620624 from google .cloud ._testing import _GAXPageIterator
621625 from google .cloud .logging .sink import Sink
622626
@@ -651,7 +655,7 @@ def test_list_sinks_no_paging(self):
651655 self .assertEqual (options .page_token , INITIAL_PAGE )
652656
653657 def test_list_sinks_w_paging (self ):
654- from google .logging .v2 .logging_config_pb2 import LogSink
658+ from google .cloud . grpc . logging .v2 .logging_config_pb2 import LogSink
655659 from google .cloud ._testing import _GAXPageIterator
656660 from google .cloud .logging .sink import Sink
657661
@@ -707,7 +711,7 @@ def test_sink_create_conflict(self):
707711 self .DESTINATION_URI )
708712
709713 def test_sink_create_ok (self ):
710- from google .logging .v2 .logging_config_pb2 import LogSink
714+ from google .cloud . grpc . logging .v2 .logging_config_pb2 import LogSink
711715 gax_api = _GAXSinksAPI ()
712716 api = self ._make_one (gax_api , None )
713717
@@ -740,7 +744,7 @@ def test_sink_get_miss(self):
740744 api .sink_get (self .PROJECT , self .SINK_NAME )
741745
742746 def test_sink_get_hit (self ):
743- from google .logging .v2 .logging_config_pb2 import LogSink
747+ from google .cloud . grpc . logging .v2 .logging_config_pb2 import LogSink
744748
745749 RESPONSE = {
746750 'name' : self .SINK_PATH ,
@@ -782,7 +786,7 @@ def test_sink_update_miss(self):
782786 self .DESTINATION_URI )
783787
784788 def test_sink_update_hit (self ):
785- from google .logging .v2 .logging_config_pb2 import LogSink
789+ from google .cloud . grpc . logging .v2 .logging_config_pb2 import LogSink
786790
787791 response = LogSink (name = self .SINK_NAME ,
788792 destination = self .DESTINATION_URI ,
@@ -848,7 +852,7 @@ def test_ctor(self):
848852 def test_list_metrics_no_paging (self ):
849853 import six
850854 from google .gax import INITIAL_PAGE
851- from google .logging .v2 .logging_metrics_pb2 import LogMetric
855+ from google .cloud . grpc . logging .v2 .logging_metrics_pb2 import LogMetric
852856 from google .cloud ._testing import _GAXPageIterator
853857 from google .cloud .logging .metric import Metric
854858
@@ -883,7 +887,7 @@ def test_list_metrics_no_paging(self):
883887 self .assertEqual (options .page_token , INITIAL_PAGE )
884888
885889 def test_list_metrics_w_paging (self ):
886- from google .logging .v2 .logging_metrics_pb2 import LogMetric
890+ from google .cloud . grpc . logging .v2 .logging_metrics_pb2 import LogMetric
887891 from google .cloud ._testing import _GAXPageIterator
888892 from google .cloud .logging .metric import Metric
889893
@@ -939,7 +943,7 @@ def test_metric_create_conflict(self):
939943 self .DESCRIPTION )
940944
941945 def test_metric_create_ok (self ):
942- from google .logging .v2 .logging_metrics_pb2 import LogMetric
946+ from google .cloud . grpc . logging .v2 .logging_metrics_pb2 import LogMetric
943947 gax_api = _GAXMetricsAPI ()
944948 api = self ._make_one (gax_api , None )
945949
@@ -972,7 +976,7 @@ def test_metric_get_miss(self):
972976 api .metric_get (self .PROJECT , self .METRIC_NAME )
973977
974978 def test_metric_get_hit (self ):
975- from google .logging .v2 .logging_metrics_pb2 import LogMetric
979+ from google .cloud . grpc . logging .v2 .logging_metrics_pb2 import LogMetric
976980
977981 RESPONSE = {
978982 'name' : self .METRIC_PATH ,
@@ -1014,7 +1018,7 @@ def test_metric_update_miss(self):
10141018 self .DESCRIPTION )
10151019
10161020 def test_metric_update_hit (self ):
1017- from google .logging .v2 .logging_metrics_pb2 import LogMetric
1021+ from google .cloud . grpc . logging .v2 .logging_metrics_pb2 import LogMetric
10181022
10191023 response = LogMetric (name = self .METRIC_NAME ,
10201024 description = self .DESCRIPTION ,
@@ -1093,7 +1097,7 @@ def generated_api(channel=None):
10931097
10941098 patch = mock .patch .multiple (
10951099 'google.cloud.logging._gax' ,
1096- LoggingServiceV2Api = generated_api ,
1100+ LoggingServiceV2Client = generated_api ,
10971101 make_secure_channel = make_channel )
10981102 with patch :
10991103 logging_api = self ._call_fut (client )
@@ -1139,7 +1143,7 @@ def generated_api(channel=None):
11391143
11401144 patch = mock .patch .multiple (
11411145 'google.cloud.logging._gax' ,
1142- MetricsServiceV2Api = generated_api ,
1146+ MetricsServiceV2Client = generated_api ,
11431147 make_secure_channel = make_channel )
11441148 with patch :
11451149 metrics_api = self ._call_fut (client )
@@ -1185,7 +1189,7 @@ def generated_api(channel=None):
11851189
11861190 patch = mock .patch .multiple (
11871191 'google.cloud.logging._gax' ,
1188- ConfigServiceV2Api = generated_api ,
1192+ ConfigServiceV2Client = generated_api ,
11891193 make_secure_channel = make_channel )
11901194 with patch :
11911195 sinks_api = self ._call_fut (client )
@@ -1204,9 +1208,11 @@ class _GAXLoggingAPI(_GAXBaseAPI):
12041208 _delete_not_found = False
12051209
12061210 def list_log_entries (
1207- self , projects , filter_ , order_by , page_size , options ):
1211+ self , resource_names , project_ids , filter_ ,
1212+ order_by , page_size , options ):
12081213 self ._list_log_entries_called_with = (
1209- projects , filter_ , order_by , page_size , options )
1214+ resource_names , project_ids , filter_ ,
1215+ order_by , page_size , options )
12101216 return self ._list_log_entries_response
12111217
12121218 def write_log_entries (self , entries , log_name , resource , labels ,
0 commit comments