Skip to content
Permalink
Browse files
chore: use gapic-generator-python 0.53.4 (#52)
- [ ] 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
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent 7519550 commit f509558fe1967d7b0fc65c27a1a0f498bddaa915
@@ -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.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.eventarc_v1.services.eventarc import pagers
@@ -168,17 +170,17 @@ def __init__(

async def get_trigger(
self,
request: eventarc.GetTriggerRequest = None,
request: Union[eventarc.GetTriggerRequest, 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]] = (),
) -> trigger.Trigger:
r"""Get a single trigger.
Args:
request (:class:`google.cloud.eventarc_v1.types.GetTriggerRequest`):
request (Union[google.cloud.eventarc_v1.types.GetTriggerRequest, dict]):
The request object. The request message for the
GetTrigger method.
name (:class:`str`):
@@ -239,17 +241,17 @@ async def get_trigger(

async def list_triggers(
self,
request: eventarc.ListTriggersRequest = None,
request: Union[eventarc.ListTriggersRequest, 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.ListTriggersAsyncPager:
r"""List triggers.
Args:
request (:class:`google.cloud.eventarc_v1.types.ListTriggersRequest`):
request (Union[google.cloud.eventarc_v1.types.ListTriggersRequest, dict]):
The request object. The request message for the
ListTriggers method.
parent (:class:`str`):
@@ -319,20 +321,20 @@ async def list_triggers(

async def create_trigger(
self,
request: eventarc.CreateTriggerRequest = None,
request: Union[eventarc.CreateTriggerRequest, dict] = None,
*,
parent: str = None,
trigger: gce_trigger.Trigger = None,
trigger_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Create a new trigger in a particular project and
location.
Args:
request (:class:`google.cloud.eventarc_v1.types.CreateTriggerRequest`):
request (Union[google.cloud.eventarc_v1.types.CreateTriggerRequest, dict]):
The request object. The request message for the
CreateTrigger method.
parent (:class:`str`):
@@ -420,19 +422,19 @@ async def create_trigger(

async def update_trigger(
self,
request: eventarc.UpdateTriggerRequest = None,
request: Union[eventarc.UpdateTriggerRequest, dict] = None,
*,
trigger: gce_trigger.Trigger = None,
update_mask: field_mask_pb2.FieldMask = None,
allow_missing: bool = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Update a single trigger.
Args:
request (:class:`google.cloud.eventarc_v1.types.UpdateTriggerRequest`):
request (Union[google.cloud.eventarc_v1.types.UpdateTriggerRequest, dict]):
The request object. The request message for the
UpdateTrigger method.
trigger (:class:`google.cloud.eventarc_v1.types.Trigger`):
@@ -525,18 +527,18 @@ async def update_trigger(

async def delete_trigger(
self,
request: eventarc.DeleteTriggerRequest = None,
request: Union[eventarc.DeleteTriggerRequest, dict] = None,
*,
name: str = None,
allow_missing: bool = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Delete a single trigger.
Args:
request (:class:`google.cloud.eventarc_v1.types.DeleteTriggerRequest`):
request (Union[google.cloud.eventarc_v1.types.DeleteTriggerRequest, dict]):
The request object. The request message for the
DeleteTrigger method.
name (:class:`str`):
@@ -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.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.eventarc_v1.services.eventarc import pagers
@@ -380,7 +382,7 @@ def get_trigger(
request: Union[eventarc.GetTriggerRequest, 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]] = (),
) -> trigger.Trigger:
@@ -451,7 +453,7 @@ def list_triggers(
request: Union[eventarc.ListTriggersRequest, 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.ListTriggersPager:
@@ -533,7 +535,7 @@ def create_trigger(
parent: str = None,
trigger: gce_trigger.Trigger = None,
trigger_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
@@ -634,7 +636,7 @@ def update_trigger(
trigger: gce_trigger.Trigger = None,
update_mask: field_mask_pb2.FieldMask = None,
allow_missing: bool = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
@@ -738,7 +740,7 @@ def delete_trigger(
*,
name: str = None,
allow_missing: bool = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
@@ -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
@@ -38,15 +37,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 EventarcTransport(abc.ABC):
"""Abstract transport class for Eventarc."""
@@ -96,7 +86,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
@@ -129,29 +119,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 = {
@@ -182,7 +149,7 @@ def close(self):
raise NotImplementedError()

@property
def operations_client(self) -> operations_v1.OperationsClient:
def operations_client(self):
"""Return the client designed to process long-running operations."""
raise NotImplementedError()

@@ -115,7 +115,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
@@ -21,7 +21,6 @@
from google.api_core import operations_v1 # 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
@@ -162,7 +161,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
@@ -126,11 +126,14 @@ class EventFilter(proto.Message):
class Destination(proto.Message):
r"""Represents a target of an invocation over HTTP.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
cloud_run (google.cloud.eventarc_v1.types.CloudRun):
Cloud Run fully-managed service that receives
the events. The service should be running in the
same project of the trigger.
This field is a member of `oneof`_ ``descriptor``.
"""

cloud_run = proto.Field(
@@ -142,10 +145,14 @@ class Transport(proto.Message):
r"""Represents the transport intermediaries created for the
trigger in order to deliver events.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
pubsub (google.cloud.eventarc_v1.types.Pubsub):
The Pub/Sub topic and subscription used by
Eventarc as delivery intermediary.
This field is a member of `oneof`_ ``intermediary``.
"""

pubsub = proto.Field(
@@ -29,9 +29,8 @@
# NOTE: Maintainers, please do not require google-api-core>=2.x.x
# Until this issue is closed
# https://github.com/googleapis/google-cloud-python/issues/10566
"google-api-core[grpc] >= 1.26.0, <3.0.0dev",
"google-api-core[grpc] >= 1.28.0, <3.0.0dev",
"proto-plus >= 1.15.0",
"packaging >= 14.3",
]

package_root = os.path.abspath(os.path.dirname(__file__))
@@ -4,7 +4,5 @@
# Pin the version to the lower bound.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
# Then this file should have google-cloud-foo==1.14.0
google-api-core==1.26.0
google-api-core==1.28.0
proto-plus==1.15.0
packaging==14.3
google-auth==1.24.0 # TODO: remove when google-auth>=1.25.0 si transitively required through google-api-core

0 comments on commit f509558

Please sign in to comment.