|
16 | 16 | from collections import OrderedDict |
17 | 17 | import functools |
18 | 18 | import re |
19 | | -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union |
20 | | -import pkg_resources |
| 19 | +from typing import ( |
| 20 | + Dict, |
| 21 | + Mapping, |
| 22 | + MutableMapping, |
| 23 | + MutableSequence, |
| 24 | + Optional, |
| 25 | + Sequence, |
| 26 | + Tuple, |
| 27 | + Type, |
| 28 | + Union, |
| 29 | +) |
| 30 | + |
| 31 | +from google.cloud.errorreporting_v1beta1 import gapic_version as package_version |
21 | 32 |
|
22 | 33 | from google.api_core.client_options import ClientOptions |
23 | 34 | from google.api_core import exceptions as core_exceptions |
@@ -160,9 +171,9 @@ def transport(self) -> ErrorGroupServiceTransport: |
160 | 171 | def __init__( |
161 | 172 | self, |
162 | 173 | *, |
163 | | - credentials: ga_credentials.Credentials = None, |
| 174 | + credentials: Optional[ga_credentials.Credentials] = None, |
164 | 175 | transport: Union[str, ErrorGroupServiceTransport] = "grpc_asyncio", |
165 | | - client_options: ClientOptions = None, |
| 176 | + client_options: Optional[ClientOptions] = None, |
166 | 177 | client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, |
167 | 178 | ) -> None: |
168 | 179 | """Instantiates the error group service client. |
@@ -206,11 +217,11 @@ def __init__( |
206 | 217 |
|
207 | 218 | async def get_group( |
208 | 219 | self, |
209 | | - request: Union[error_group_service.GetGroupRequest, dict] = None, |
| 220 | + request: Optional[Union[error_group_service.GetGroupRequest, dict]] = None, |
210 | 221 | *, |
211 | | - group_name: str = None, |
| 222 | + group_name: Optional[str] = None, |
212 | 223 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
213 | | - timeout: float = None, |
| 224 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
214 | 225 | metadata: Sequence[Tuple[str, str]] = (), |
215 | 226 | ) -> common.ErrorGroup: |
216 | 227 | r"""Get the specified group. |
@@ -242,7 +253,7 @@ async def sample_get_group(): |
242 | 253 | print(response) |
243 | 254 |
|
244 | 255 | Args: |
245 | | - request (Union[google.cloud.errorreporting_v1beta1.types.GetGroupRequest, dict]): |
| 256 | + request (Optional[Union[google.cloud.errorreporting_v1beta1.types.GetGroupRequest, dict]]): |
246 | 257 | The request object. A request to return an individual |
247 | 258 | group. |
248 | 259 | group_name (:class:`str`): |
@@ -314,11 +325,11 @@ async def sample_get_group(): |
314 | 325 |
|
315 | 326 | async def update_group( |
316 | 327 | self, |
317 | | - request: Union[error_group_service.UpdateGroupRequest, dict] = None, |
| 328 | + request: Optional[Union[error_group_service.UpdateGroupRequest, dict]] = None, |
318 | 329 | *, |
319 | | - group: common.ErrorGroup = None, |
| 330 | + group: Optional[common.ErrorGroup] = None, |
320 | 331 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
321 | | - timeout: float = None, |
| 332 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
322 | 333 | metadata: Sequence[Tuple[str, str]] = (), |
323 | 334 | ) -> common.ErrorGroup: |
324 | 335 | r"""Replace the data for the specified group. |
@@ -350,7 +361,7 @@ async def sample_update_group(): |
350 | 361 | print(response) |
351 | 362 |
|
352 | 363 | Args: |
353 | | - request (Union[google.cloud.errorreporting_v1beta1.types.UpdateGroupRequest, dict]): |
| 364 | + request (Optional[Union[google.cloud.errorreporting_v1beta1.types.UpdateGroupRequest, dict]]): |
354 | 365 | The request object. A request to replace the existing |
355 | 366 | data for the given group. |
356 | 367 | group (:class:`google.cloud.errorreporting_v1beta1.types.ErrorGroup`): |
@@ -423,14 +434,9 @@ async def __aexit__(self, exc_type, exc, tb): |
423 | 434 | await self.transport.close() |
424 | 435 |
|
425 | 436 |
|
426 | | -try: |
427 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
428 | | - gapic_version=pkg_resources.get_distribution( |
429 | | - "google-cloud-errorreporting", |
430 | | - ).version, |
431 | | - ) |
432 | | -except pkg_resources.DistributionNotFound: |
433 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 437 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 438 | + gapic_version=package_version.__version__ |
| 439 | +) |
434 | 440 |
|
435 | 441 |
|
436 | 442 | __all__ = ("ErrorGroupServiceAsyncClient",) |
0 commit comments