Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import re
from collections import OrderedDict
from typing import (
Any,
Callable,
Dict,
Mapping,
Expand All @@ -39,10 +40,7 @@

from google.pubsub_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]

import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
Expand Down Expand Up @@ -552,7 +550,7 @@ async def sample_update_topic():

async def publish(
self,
request: Optional[Union[pubsub.PublishRequest, dict]] = None,
request: Optional[Union[pubsub.PublishRequest, Dict[str, Any]]] = None,
*,
topic: Optional[str] = None,
messages: Optional[MutableSequence[pubsub.PubsubMessage]] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from collections import OrderedDict
from http import HTTPStatus
from typing import (
Any,
Callable,
Dict,
Mapping,
Expand Down Expand Up @@ -49,10 +50,7 @@

from google.pubsub_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object, None] # type: ignore
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]

try:
from google.api_core import client_logging # type: ignore
Expand Down Expand Up @@ -1062,7 +1060,7 @@ def sample_update_topic():

def publish(
self,
request: Optional[Union[pubsub.PublishRequest, dict]] = None,
request: Optional[Union[pubsub.PublishRequest, Dict[str, Any]]] = None,
*,
topic: Optional[str] = None,
messages: Optional[MutableSequence[pubsub.PubsubMessage]] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
from typing import Union

from google.api_core.timeout import ConstantTimeout, ExponentialTimeout

from .pubsub import (
AcknowledgeRequest,
AIInference,
Expand Down Expand Up @@ -91,10 +93,9 @@
)

TimeoutType = Union[
int,
float,
"google.api_core.timeout.ConstantTimeout",
"google.api_core.timeout.ExponentialTimeout",
ConstantTimeout,
ExponentialTimeout,
Comment thread
ishaangandhi marked this conversation as resolved.
]
"""The type of the timeout parameter of publisher client methods."""

Expand Down
Loading