Skip to content

Commit bfafb35

Browse files
chore: Re-generated to pick up changes from googleapis. (#198)
* chore: update gapic-generator-python PiperOrigin-RevId: 355923884 Source-Author: Google APIs <[email protected]> Source-Date: Fri Feb 5 14:04:52 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: 5e3dacee19405529b841b53797df799c2383536c Source-Link: googleapis/googleapis@5e3dace * chore: update gapic-generator-python to 0.40.11 PiperOrigin-RevId: 359562873 Source-Author: Google APIs <[email protected]> Source-Date: Thu Feb 25 10:52:32 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: 07932bb995e7dc91b43620ea8402c6668c7d102c Source-Link: googleapis/googleapis@07932bb
1 parent 24b4789 commit bfafb35

File tree

12 files changed

+709
-26
lines changed

12 files changed

+709
-26
lines changed

google/cloud/logging_v2/services/config_service_v2/async_client.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,36 @@ class ConfigServiceV2AsyncClient:
9090
ConfigServiceV2Client.parse_common_location_path
9191
)
9292

93-
from_service_account_info = ConfigServiceV2Client.from_service_account_info
94-
from_service_account_file = ConfigServiceV2Client.from_service_account_file
93+
@classmethod
94+
def from_service_account_info(cls, info: dict, *args, **kwargs):
95+
"""Creates an instance of this client using the provided credentials info.
96+
97+
Args:
98+
info (dict): The service account private key info.
99+
args: Additional arguments to pass to the constructor.
100+
kwargs: Additional arguments to pass to the constructor.
101+
102+
Returns:
103+
ConfigServiceV2AsyncClient: The constructed client.
104+
"""
105+
return ConfigServiceV2Client.from_service_account_info.__func__(ConfigServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
106+
107+
@classmethod
108+
def from_service_account_file(cls, filename: str, *args, **kwargs):
109+
"""Creates an instance of this client using the provided credentials
110+
file.
111+
112+
Args:
113+
filename (str): The path to the service account private key json
114+
file.
115+
args: Additional arguments to pass to the constructor.
116+
kwargs: Additional arguments to pass to the constructor.
117+
118+
Returns:
119+
ConfigServiceV2AsyncClient: The constructed client.
120+
"""
121+
return ConfigServiceV2Client.from_service_account_file.__func__(ConfigServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
122+
95123
from_service_account_json = from_service_account_file
96124

97125
@property

google/cloud/logging_v2/services/config_service_v2/pagers.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@
1515
# limitations under the License.
1616
#
1717

18-
from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
18+
from typing import (
19+
Any,
20+
AsyncIterable,
21+
Awaitable,
22+
Callable,
23+
Iterable,
24+
Sequence,
25+
Tuple,
26+
Optional,
27+
)
1928

2029
from google.cloud.logging_v2.types import logging_config
2130

google/cloud/logging_v2/services/logging_service_v2/async_client.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,36 @@ class LoggingServiceV2AsyncClient:
8787
LoggingServiceV2Client.parse_common_location_path
8888
)
8989

90-
from_service_account_info = LoggingServiceV2Client.from_service_account_info
91-
from_service_account_file = LoggingServiceV2Client.from_service_account_file
90+
@classmethod
91+
def from_service_account_info(cls, info: dict, *args, **kwargs):
92+
"""Creates an instance of this client using the provided credentials info.
93+
94+
Args:
95+
info (dict): The service account private key info.
96+
args: Additional arguments to pass to the constructor.
97+
kwargs: Additional arguments to pass to the constructor.
98+
99+
Returns:
100+
LoggingServiceV2AsyncClient: The constructed client.
101+
"""
102+
return LoggingServiceV2Client.from_service_account_info.__func__(LoggingServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
103+
104+
@classmethod
105+
def from_service_account_file(cls, filename: str, *args, **kwargs):
106+
"""Creates an instance of this client using the provided credentials
107+
file.
108+
109+
Args:
110+
filename (str): The path to the service account private key json
111+
file.
112+
args: Additional arguments to pass to the constructor.
113+
kwargs: Additional arguments to pass to the constructor.
114+
115+
Returns:
116+
LoggingServiceV2AsyncClient: The constructed client.
117+
"""
118+
return LoggingServiceV2Client.from_service_account_file.__func__(LoggingServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
119+
92120
from_service_account_json = from_service_account_file
93121

94122
@property

google/cloud/logging_v2/services/logging_service_v2/client.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,10 @@ def write_log_entries(
578578
request.log_name = log_name
579579
if resource is not None:
580580
request.resource = resource
581-
582-
if labels:
583-
request.labels.update(labels)
584-
585-
if entries:
586-
request.entries.extend(entries)
581+
if labels is not None:
582+
request.labels = labels
583+
if entries is not None:
584+
request.entries = entries
587585

588586
# Wrap the RPC method; this adds retry and timeout information,
589587
# and friendly error handling.
@@ -699,14 +697,13 @@ def list_log_entries(
699697
# If we have keyword arguments corresponding to fields on the
700698
# request, apply these.
701699

700+
if resource_names is not None:
701+
request.resource_names = resource_names
702702
if filter is not None:
703703
request.filter = filter
704704
if order_by is not None:
705705
request.order_by = order_by
706706

707-
if resource_names:
708-
request.resource_names.extend(resource_names)
709-
710707
# Wrap the RPC method; this adds retry and timeout information,
711708
# and friendly error handling.
712709
rpc = self._transport._wrapped_methods[self._transport.list_log_entries]

google/cloud/logging_v2/services/logging_service_v2/pagers.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@
1515
# limitations under the License.
1616
#
1717

18-
from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
18+
from typing import (
19+
Any,
20+
AsyncIterable,
21+
Awaitable,
22+
Callable,
23+
Iterable,
24+
Sequence,
25+
Tuple,
26+
Optional,
27+
)
1928

2029
from google.api import monitored_resource_pb2 as monitored_resource # type: ignore
2130
from google.cloud.logging_v2.types import log_entry

google/cloud/logging_v2/services/metrics_service_v2/async_client.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,36 @@ class MetricsServiceV2AsyncClient:
8080
MetricsServiceV2Client.parse_common_location_path
8181
)
8282

83-
from_service_account_info = MetricsServiceV2Client.from_service_account_info
84-
from_service_account_file = MetricsServiceV2Client.from_service_account_file
83+
@classmethod
84+
def from_service_account_info(cls, info: dict, *args, **kwargs):
85+
"""Creates an instance of this client using the provided credentials info.
86+
87+
Args:
88+
info (dict): The service account private key info.
89+
args: Additional arguments to pass to the constructor.
90+
kwargs: Additional arguments to pass to the constructor.
91+
92+
Returns:
93+
MetricsServiceV2AsyncClient: The constructed client.
94+
"""
95+
return MetricsServiceV2Client.from_service_account_info.__func__(MetricsServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
96+
97+
@classmethod
98+
def from_service_account_file(cls, filename: str, *args, **kwargs):
99+
"""Creates an instance of this client using the provided credentials
100+
file.
101+
102+
Args:
103+
filename (str): The path to the service account private key json
104+
file.
105+
args: Additional arguments to pass to the constructor.
106+
kwargs: Additional arguments to pass to the constructor.
107+
108+
Returns:
109+
MetricsServiceV2AsyncClient: The constructed client.
110+
"""
111+
return MetricsServiceV2Client.from_service_account_file.__func__(MetricsServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
112+
85113
from_service_account_json = from_service_account_file
86114

87115
@property

google/cloud/logging_v2/services/metrics_service_v2/pagers.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@
1515
# limitations under the License.
1616
#
1717

18-
from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
18+
from typing import (
19+
Any,
20+
AsyncIterable,
21+
Awaitable,
22+
Callable,
23+
Iterable,
24+
Sequence,
25+
Tuple,
26+
Optional,
27+
)
1928

2029
from google.cloud.logging_v2.types import logging_metrics
2130

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "20712b8fe95001b312f62c6c5f33e3e3ec92cfaf",
15-
"internalRef": "354996675"
14+
"sha": "07932bb995e7dc91b43620ea8402c6668c7d102c",
15+
"internalRef": "359562873"
1616
}
1717
},
1818
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1+
# -*- coding: utf-8 -*-
12

3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#

0 commit comments

Comments
 (0)