Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit a294177

Browse files
chore: use gapic-generator-python 0.53.4 (#110)
- [ ] Regenerate this pull request now. docs: list oneofs in docstring fix(deps): require google-api-core >= 1.28.0 fix(deps): drop packaging dependency committer: busunkim96@ PiperOrigin-RevId: 406468269 Source-Link: googleapis/googleapis@83d81b0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2ff001fbacb9e77e71d734de5f955c05fdae8526 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
1 parent 036591a commit a294177

File tree

26 files changed

+146
-543
lines changed

26 files changed

+146
-543
lines changed

google/cloud/workflows/executions_v1/services/executions/async_client.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
from typing import Dict, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

22-
import google.api_core.client_options as ClientOptions # type: ignore
22+
from google.api_core.client_options import ClientOptions # type: ignore
2323
from google.api_core import exceptions as core_exceptions # type: ignore
2424
from google.api_core import gapic_v1 # type: ignore
2525
from google.api_core import retry as retries # type: ignore
2626
from google.auth import credentials as ga_credentials # type: ignore
2727
from google.oauth2 import service_account # type: ignore
2828

29+
OptionalRetry = Union[retries.Retry, object]
30+
2931
from google.cloud.workflows.executions_v1.services.executions import pagers
3032
from google.cloud.workflows.executions_v1.types import executions
3133
from google.protobuf import timestamp_pb2 # type: ignore
@@ -162,10 +164,10 @@ def __init__(
162164

163165
async def list_executions(
164166
self,
165-
request: executions.ListExecutionsRequest = None,
167+
request: Union[executions.ListExecutionsRequest, dict] = None,
166168
*,
167169
parent: str = None,
168-
retry: retries.Retry = gapic_v1.method.DEFAULT,
170+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
169171
timeout: float = None,
170172
metadata: Sequence[Tuple[str, str]] = (),
171173
) -> pagers.ListExecutionsAsyncPager:
@@ -176,7 +178,7 @@ async def list_executions(
176178
first).
177179
178180
Args:
179-
request (:class:`google.cloud.workflows.executions_v1.types.ListExecutionsRequest`):
181+
request (Union[google.cloud.workflows.executions_v1.types.ListExecutionsRequest, dict]):
180182
The request object. Request for the
181183
[ListExecutions][]
182184
method.
@@ -250,19 +252,19 @@ async def list_executions(
250252

251253
async def create_execution(
252254
self,
253-
request: executions.CreateExecutionRequest = None,
255+
request: Union[executions.CreateExecutionRequest, dict] = None,
254256
*,
255257
parent: str = None,
256258
execution: executions.Execution = None,
257-
retry: retries.Retry = gapic_v1.method.DEFAULT,
259+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
258260
timeout: float = None,
259261
metadata: Sequence[Tuple[str, str]] = (),
260262
) -> executions.Execution:
261263
r"""Creates a new execution using the latest revision of
262264
the given workflow.
263265
264266
Args:
265-
request (:class:`google.cloud.workflows.executions_v1.types.CreateExecutionRequest`):
267+
request (Union[google.cloud.workflows.executions_v1.types.CreateExecutionRequest, dict]):
266268
The request object. Request for the
267269
[CreateExecution][google.cloud.workflows.executions.v1.Executions.CreateExecution]
268270
method.
@@ -335,17 +337,17 @@ async def create_execution(
335337

336338
async def get_execution(
337339
self,
338-
request: executions.GetExecutionRequest = None,
340+
request: Union[executions.GetExecutionRequest, dict] = None,
339341
*,
340342
name: str = None,
341-
retry: retries.Retry = gapic_v1.method.DEFAULT,
343+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
342344
timeout: float = None,
343345
metadata: Sequence[Tuple[str, str]] = (),
344346
) -> executions.Execution:
345347
r"""Returns an execution of the given name.
346348
347349
Args:
348-
request (:class:`google.cloud.workflows.executions_v1.types.GetExecutionRequest`):
350+
request (Union[google.cloud.workflows.executions_v1.types.GetExecutionRequest, dict]):
349351
The request object. Request for the
350352
[GetExecution][google.cloud.workflows.executions.v1.Executions.GetExecution]
351353
method.
@@ -408,17 +410,17 @@ async def get_execution(
408410

409411
async def cancel_execution(
410412
self,
411-
request: executions.CancelExecutionRequest = None,
413+
request: Union[executions.CancelExecutionRequest, dict] = None,
412414
*,
413415
name: str = None,
414-
retry: retries.Retry = gapic_v1.method.DEFAULT,
416+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
415417
timeout: float = None,
416418
metadata: Sequence[Tuple[str, str]] = (),
417419
) -> executions.Execution:
418420
r"""Cancels an execution of the given name.
419421
420422
Args:
421-
request (:class:`google.cloud.workflows.executions_v1.types.CancelExecutionRequest`):
423+
request (Union[google.cloud.workflows.executions_v1.types.CancelExecutionRequest, dict]):
422424
The request object. Request for the
423425
[CancelExecution][google.cloud.workflows.executions.v1.Executions.CancelExecution]
424426
method.

google/cloud/workflows/executions_v1/services/executions/client.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3131
from google.oauth2 import service_account # type: ignore
3232

33+
OptionalRetry = Union[retries.Retry, object]
34+
3335
from google.cloud.workflows.executions_v1.services.executions import pagers
3436
from google.cloud.workflows.executions_v1.types import executions
3537
from google.protobuf import timestamp_pb2 # type: ignore
@@ -371,7 +373,7 @@ def list_executions(
371373
request: Union[executions.ListExecutionsRequest, dict] = None,
372374
*,
373375
parent: str = None,
374-
retry: retries.Retry = gapic_v1.method.DEFAULT,
376+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
375377
timeout: float = None,
376378
metadata: Sequence[Tuple[str, str]] = (),
377379
) -> pagers.ListExecutionsPager:
@@ -460,7 +462,7 @@ def create_execution(
460462
*,
461463
parent: str = None,
462464
execution: executions.Execution = None,
463-
retry: retries.Retry = gapic_v1.method.DEFAULT,
465+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
464466
timeout: float = None,
465467
metadata: Sequence[Tuple[str, str]] = (),
466468
) -> executions.Execution:
@@ -544,7 +546,7 @@ def get_execution(
544546
request: Union[executions.GetExecutionRequest, dict] = None,
545547
*,
546548
name: str = None,
547-
retry: retries.Retry = gapic_v1.method.DEFAULT,
549+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
548550
timeout: float = None,
549551
metadata: Sequence[Tuple[str, str]] = (),
550552
) -> executions.Execution:
@@ -617,7 +619,7 @@ def cancel_execution(
617619
request: Union[executions.CancelExecutionRequest, dict] = None,
618620
*,
619621
name: str = None,
620-
retry: retries.Retry = gapic_v1.method.DEFAULT,
622+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
621623
timeout: float = None,
622624
metadata: Sequence[Tuple[str, str]] = (),
623625
) -> executions.Execution:

google/cloud/workflows/executions_v1/services/executions/transports/base.py

+1-34
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#
1616
import abc
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
18-
import packaging.version
1918
import pkg_resources
2019

2120
import google.auth # type: ignore
@@ -35,15 +34,6 @@
3534
except pkg_resources.DistributionNotFound:
3635
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
3736

38-
try:
39-
# google.auth.__version__ was added in 1.26.0
40-
_GOOGLE_AUTH_VERSION = google.auth.__version__
41-
except AttributeError:
42-
try: # try pkg_resources if it is available
43-
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
44-
except pkg_resources.DistributionNotFound: # pragma: NO COVER
45-
_GOOGLE_AUTH_VERSION = None
46-
4737

4838
class ExecutionsTransport(abc.ABC):
4939
"""Abstract transport class for Executions."""
@@ -93,7 +83,7 @@ def __init__(
9383
host += ":443"
9484
self._host = host
9585

96-
scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
86+
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9787

9888
# Save the scopes.
9989
self._scopes = scopes
@@ -126,29 +116,6 @@ def __init__(
126116
# Save the credentials.
127117
self._credentials = credentials
128118

129-
# TODO(busunkim): This method is in the base transport
130-
# to avoid duplicating code across the transport classes. These functions
131-
# should be deleted once the minimum required versions of google-auth is increased.
132-
133-
# TODO: Remove this function once google-auth >= 1.25.0 is required
134-
@classmethod
135-
def _get_scopes_kwargs(
136-
cls, host: str, scopes: Optional[Sequence[str]]
137-
) -> Dict[str, Optional[Sequence[str]]]:
138-
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""
139-
140-
scopes_kwargs = {}
141-
142-
if _GOOGLE_AUTH_VERSION and (
143-
packaging.version.parse(_GOOGLE_AUTH_VERSION)
144-
>= packaging.version.parse("1.25.0")
145-
):
146-
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
147-
else:
148-
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}
149-
150-
return scopes_kwargs
151-
152119
def _prep_wrapped_messages(self, client_info):
153120
# Precompute the wrapped methods.
154121
self._wrapped_methods = {

google/cloud/workflows/executions_v1/services/executions/transports/grpc_asyncio.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from google.api_core import grpc_helpers_async # type: ignore
2121
from google.auth import credentials as ga_credentials # type: ignore
2222
from google.auth.transport.grpc import SslCredentials # type: ignore
23-
import packaging.version
2423

2524
import grpc # type: ignore
2625
from grpc.experimental import aio # type: ignore

google/cloud/workflows/executions_v1beta/services/executions/async_client.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
from typing import Dict, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

22-
import google.api_core.client_options as ClientOptions # type: ignore
22+
from google.api_core.client_options import ClientOptions # type: ignore
2323
from google.api_core import exceptions as core_exceptions # type: ignore
2424
from google.api_core import gapic_v1 # type: ignore
2525
from google.api_core import retry as retries # type: ignore
2626
from google.auth import credentials as ga_credentials # type: ignore
2727
from google.oauth2 import service_account # type: ignore
2828

29+
OptionalRetry = Union[retries.Retry, object]
30+
2931
from google.cloud.workflows.executions_v1beta.services.executions import pagers
3032
from google.cloud.workflows.executions_v1beta.types import executions
3133
from google.protobuf import timestamp_pb2 # type: ignore
@@ -163,10 +165,10 @@ def __init__(
163165

164166
async def list_executions(
165167
self,
166-
request: executions.ListExecutionsRequest = None,
168+
request: Union[executions.ListExecutionsRequest, dict] = None,
167169
*,
168170
parent: str = None,
169-
retry: retries.Retry = gapic_v1.method.DEFAULT,
171+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
170172
timeout: float = None,
171173
metadata: Sequence[Tuple[str, str]] = (),
172174
) -> pagers.ListExecutionsAsyncPager:
@@ -177,7 +179,7 @@ async def list_executions(
177179
first).
178180
179181
Args:
180-
request (:class:`google.cloud.workflows.executions_v1beta.types.ListExecutionsRequest`):
182+
request (Union[google.cloud.workflows.executions_v1beta.types.ListExecutionsRequest, dict]):
181183
The request object. Request for the
182184
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
183185
method.
@@ -251,19 +253,19 @@ async def list_executions(
251253

252254
async def create_execution(
253255
self,
254-
request: executions.CreateExecutionRequest = None,
256+
request: Union[executions.CreateExecutionRequest, dict] = None,
255257
*,
256258
parent: str = None,
257259
execution: executions.Execution = None,
258-
retry: retries.Retry = gapic_v1.method.DEFAULT,
260+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
259261
timeout: float = None,
260262
metadata: Sequence[Tuple[str, str]] = (),
261263
) -> executions.Execution:
262264
r"""Creates a new execution using the latest revision of
263265
the given workflow.
264266
265267
Args:
266-
request (:class:`google.cloud.workflows.executions_v1beta.types.CreateExecutionRequest`):
268+
request (Union[google.cloud.workflows.executions_v1beta.types.CreateExecutionRequest, dict]):
267269
The request object. Request for the
268270
[CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
269271
method.
@@ -336,17 +338,17 @@ async def create_execution(
336338

337339
async def get_execution(
338340
self,
339-
request: executions.GetExecutionRequest = None,
341+
request: Union[executions.GetExecutionRequest, dict] = None,
340342
*,
341343
name: str = None,
342-
retry: retries.Retry = gapic_v1.method.DEFAULT,
344+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
343345
timeout: float = None,
344346
metadata: Sequence[Tuple[str, str]] = (),
345347
) -> executions.Execution:
346348
r"""Returns an execution of the given name.
347349
348350
Args:
349-
request (:class:`google.cloud.workflows.executions_v1beta.types.GetExecutionRequest`):
351+
request (Union[google.cloud.workflows.executions_v1beta.types.GetExecutionRequest, dict]):
350352
The request object. Request for the
351353
[GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution]
352354
method.
@@ -409,17 +411,17 @@ async def get_execution(
409411

410412
async def cancel_execution(
411413
self,
412-
request: executions.CancelExecutionRequest = None,
414+
request: Union[executions.CancelExecutionRequest, dict] = None,
413415
*,
414416
name: str = None,
415-
retry: retries.Retry = gapic_v1.method.DEFAULT,
417+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
416418
timeout: float = None,
417419
metadata: Sequence[Tuple[str, str]] = (),
418420
) -> executions.Execution:
419421
r"""Cancels an execution of the given name.
420422
421423
Args:
422-
request (:class:`google.cloud.workflows.executions_v1beta.types.CancelExecutionRequest`):
424+
request (Union[google.cloud.workflows.executions_v1beta.types.CancelExecutionRequest, dict]):
423425
The request object. Request for the
424426
[CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
425427
method.

google/cloud/workflows/executions_v1beta/services/executions/client.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3131
from google.oauth2 import service_account # type: ignore
3232

33+
OptionalRetry = Union[retries.Retry, object]
34+
3335
from google.cloud.workflows.executions_v1beta.services.executions import pagers
3436
from google.cloud.workflows.executions_v1beta.types import executions
3537
from google.protobuf import timestamp_pb2 # type: ignore
@@ -372,7 +374,7 @@ def list_executions(
372374
request: Union[executions.ListExecutionsRequest, dict] = None,
373375
*,
374376
parent: str = None,
375-
retry: retries.Retry = gapic_v1.method.DEFAULT,
377+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
376378
timeout: float = None,
377379
metadata: Sequence[Tuple[str, str]] = (),
378380
) -> pagers.ListExecutionsPager:
@@ -461,7 +463,7 @@ def create_execution(
461463
*,
462464
parent: str = None,
463465
execution: executions.Execution = None,
464-
retry: retries.Retry = gapic_v1.method.DEFAULT,
466+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
465467
timeout: float = None,
466468
metadata: Sequence[Tuple[str, str]] = (),
467469
) -> executions.Execution:
@@ -545,7 +547,7 @@ def get_execution(
545547
request: Union[executions.GetExecutionRequest, dict] = None,
546548
*,
547549
name: str = None,
548-
retry: retries.Retry = gapic_v1.method.DEFAULT,
550+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
549551
timeout: float = None,
550552
metadata: Sequence[Tuple[str, str]] = (),
551553
) -> executions.Execution:
@@ -618,7 +620,7 @@ def cancel_execution(
618620
request: Union[executions.CancelExecutionRequest, dict] = None,
619621
*,
620622
name: str = None,
621-
retry: retries.Retry = gapic_v1.method.DEFAULT,
623+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
622624
timeout: float = None,
623625
metadata: Sequence[Tuple[str, str]] = (),
624626
) -> executions.Execution:

0 commit comments

Comments
 (0)