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

Commit

Permalink
chore: use gapic-generator-python 0.53.4 (#110)
Browse files Browse the repository at this point in the history
- [ ] 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: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent 036591a commit a294177
Show file tree
Hide file tree
Showing 26 changed files with 146 additions and 543 deletions.
Expand Up @@ -19,13 +19,15 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.workflows.executions_v1.services.executions import pagers
from google.cloud.workflows.executions_v1.types import executions
from google.protobuf import timestamp_pb2 # type: ignore
Expand Down Expand Up @@ -162,10 +164,10 @@ def __init__(

async def list_executions(
self,
request: executions.ListExecutionsRequest = None,
request: Union[executions.ListExecutionsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListExecutionsAsyncPager:
Expand All @@ -176,7 +178,7 @@ async def list_executions(
first).
Args:
request (:class:`google.cloud.workflows.executions_v1.types.ListExecutionsRequest`):
request (Union[google.cloud.workflows.executions_v1.types.ListExecutionsRequest, dict]):
The request object. Request for the
[ListExecutions][]
method.
Expand Down Expand Up @@ -250,19 +252,19 @@ async def list_executions(

async def create_execution(
self,
request: executions.CreateExecutionRequest = None,
request: Union[executions.CreateExecutionRequest, dict] = None,
*,
parent: str = None,
execution: executions.Execution = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
r"""Creates a new execution using the latest revision of
the given workflow.
Args:
request (:class:`google.cloud.workflows.executions_v1.types.CreateExecutionRequest`):
request (Union[google.cloud.workflows.executions_v1.types.CreateExecutionRequest, dict]):
The request object. Request for the
[CreateExecution][google.cloud.workflows.executions.v1.Executions.CreateExecution]
method.
Expand Down Expand Up @@ -335,17 +337,17 @@ async def create_execution(

async def get_execution(
self,
request: executions.GetExecutionRequest = None,
request: Union[executions.GetExecutionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
r"""Returns an execution of the given name.
Args:
request (:class:`google.cloud.workflows.executions_v1.types.GetExecutionRequest`):
request (Union[google.cloud.workflows.executions_v1.types.GetExecutionRequest, dict]):
The request object. Request for the
[GetExecution][google.cloud.workflows.executions.v1.Executions.GetExecution]
method.
Expand Down Expand Up @@ -408,17 +410,17 @@ async def get_execution(

async def cancel_execution(
self,
request: executions.CancelExecutionRequest = None,
request: Union[executions.CancelExecutionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
r"""Cancels an execution of the given name.
Args:
request (:class:`google.cloud.workflows.executions_v1.types.CancelExecutionRequest`):
request (Union[google.cloud.workflows.executions_v1.types.CancelExecutionRequest, dict]):
The request object. Request for the
[CancelExecution][google.cloud.workflows.executions.v1.Executions.CancelExecution]
method.
Expand Down
Expand Up @@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.workflows.executions_v1.services.executions import pagers
from google.cloud.workflows.executions_v1.types import executions
from google.protobuf import timestamp_pb2 # type: ignore
Expand Down Expand Up @@ -371,7 +373,7 @@ def list_executions(
request: Union[executions.ListExecutionsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListExecutionsPager:
Expand Down Expand Up @@ -460,7 +462,7 @@ def create_execution(
*,
parent: str = None,
execution: executions.Execution = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
Expand Down Expand Up @@ -544,7 +546,7 @@ def get_execution(
request: Union[executions.GetExecutionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
Expand Down Expand Up @@ -617,7 +619,7 @@ def cancel_execution(
request: Union[executions.CancelExecutionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
Expand Down
Expand Up @@ -15,7 +15,6 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources

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

try:
# google.auth.__version__ was added in 1.26.0
_GOOGLE_AUTH_VERSION = google.auth.__version__
except AttributeError:
try: # try pkg_resources if it is available
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None


class ExecutionsTransport(abc.ABC):
"""Abstract transport class for Executions."""
Expand Down Expand Up @@ -93,7 +83,7 @@ def __init__(
host += ":443"
self._host = host

scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Expand Down Expand Up @@ -126,29 +116,6 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
def _get_scopes_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Optional[Sequence[str]]]:
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""

scopes_kwargs = {}

if _GOOGLE_AUTH_VERSION and (
packaging.version.parse(_GOOGLE_AUTH_VERSION)
>= packaging.version.parse("1.25.0")
):
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
else:
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}

return scopes_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand Down
Expand Up @@ -20,7 +20,6 @@
from google.api_core import grpc_helpers_async # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import packaging.version

import grpc # type: ignore
from grpc.experimental import aio # type: ignore
Expand Down
Expand Up @@ -19,13 +19,15 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.workflows.executions_v1beta.services.executions import pagers
from google.cloud.workflows.executions_v1beta.types import executions
from google.protobuf import timestamp_pb2 # type: ignore
Expand Down Expand Up @@ -163,10 +165,10 @@ def __init__(

async def list_executions(
self,
request: executions.ListExecutionsRequest = None,
request: Union[executions.ListExecutionsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListExecutionsAsyncPager:
Expand All @@ -177,7 +179,7 @@ async def list_executions(
first).
Args:
request (:class:`google.cloud.workflows.executions_v1beta.types.ListExecutionsRequest`):
request (Union[google.cloud.workflows.executions_v1beta.types.ListExecutionsRequest, dict]):
The request object. Request for the
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
Expand Down Expand Up @@ -251,19 +253,19 @@ async def list_executions(

async def create_execution(
self,
request: executions.CreateExecutionRequest = None,
request: Union[executions.CreateExecutionRequest, dict] = None,
*,
parent: str = None,
execution: executions.Execution = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
r"""Creates a new execution using the latest revision of
the given workflow.
Args:
request (:class:`google.cloud.workflows.executions_v1beta.types.CreateExecutionRequest`):
request (Union[google.cloud.workflows.executions_v1beta.types.CreateExecutionRequest, dict]):
The request object. Request for the
[CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
method.
Expand Down Expand Up @@ -336,17 +338,17 @@ async def create_execution(

async def get_execution(
self,
request: executions.GetExecutionRequest = None,
request: Union[executions.GetExecutionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
r"""Returns an execution of the given name.
Args:
request (:class:`google.cloud.workflows.executions_v1beta.types.GetExecutionRequest`):
request (Union[google.cloud.workflows.executions_v1beta.types.GetExecutionRequest, dict]):
The request object. Request for the
[GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution]
method.
Expand Down Expand Up @@ -409,17 +411,17 @@ async def get_execution(

async def cancel_execution(
self,
request: executions.CancelExecutionRequest = None,
request: Union[executions.CancelExecutionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
r"""Cancels an execution of the given name.
Args:
request (:class:`google.cloud.workflows.executions_v1beta.types.CancelExecutionRequest`):
request (Union[google.cloud.workflows.executions_v1beta.types.CancelExecutionRequest, dict]):
The request object. Request for the
[CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
method.
Expand Down
Expand Up @@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.workflows.executions_v1beta.services.executions import pagers
from google.cloud.workflows.executions_v1beta.types import executions
from google.protobuf import timestamp_pb2 # type: ignore
Expand Down Expand Up @@ -372,7 +374,7 @@ def list_executions(
request: Union[executions.ListExecutionsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListExecutionsPager:
Expand Down Expand Up @@ -461,7 +463,7 @@ def create_execution(
*,
parent: str = None,
execution: executions.Execution = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
Expand Down Expand Up @@ -545,7 +547,7 @@ def get_execution(
request: Union[executions.GetExecutionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
Expand Down Expand Up @@ -618,7 +620,7 @@ def cancel_execution(
request: Union[executions.CancelExecutionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> executions.Execution:
Expand Down

0 comments on commit a294177

Please sign in to comment.