Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(diregapic): s/bazel/bazelisk/ in DIREGAPIC build GitHub action #1064

Merged
merged 23 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e0d9682
feat: add `ingestion_data_source_settings` field to `Topic`
gcf-owl-bot[bot] Jan 23, 2024
ba95938
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 23, 2024
1737beb
feat: add enforce_in_transit fields and optional annotations
gcf-owl-bot[bot] Jan 24, 2024
f78592d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 24, 2024
6cf84db
feat: Allow users to explicitly configure universe domain
gcf-owl-bot[bot] Jan 31, 2024
07a63b5
Merge branch 'main' into owl-bot-copy
mukund-ananthu Feb 2, 2024
a5dfa0c
Merge branch 'main' into owl-bot-copy
mukund-ananthu Feb 2, 2024
0f02f34
fix: Resolve AttributeError 'Credentials' object has no attribute 'un…
gcf-owl-bot[bot] Feb 2, 2024
f0fbfa1
fix(diregapic): s/bazel/bazelisk/ in DIREGAPIC build GitHub action
gcf-owl-bot[bot] Feb 7, 2024
378e757
Merge branch 'main' into owl-bot-copy
mukund-ananthu Feb 7, 2024
03f3d48
update replacement in owlbot.py
parthea Feb 7, 2024
6b8db12
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 7, 2024
906cab7
Merge branch 'main' into owl-bot-copy
mukund-ananthu Feb 8, 2024
726d60d
Merge branch 'main' into owl-bot-copy
mukund-ananthu Feb 8, 2024
40b5182
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 8, 2024
97f5959
Merge branch 'owl-bot-copy' of https://github.com/googleapis/python-p…
gcf-owl-bot[bot] Feb 8, 2024
5ed4cc7
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 8, 2024
1d517a2
Merge branch 'owl-bot-copy' of https://github.com/googleapis/python-p…
gcf-owl-bot[bot] Feb 8, 2024
4d75f73
Merge branch 'main' into owl-bot-copy
mukund-ananthu Feb 8, 2024
284ba21
Merge branch 'main' into owl-bot-copy
mukund-ananthu Feb 8, 2024
6ed4334
Merge branch 'main' into owl-bot-copy
mukund-ananthu Feb 9, 2024
a4413f7
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 9, 2024
7e6c06b
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Feb 9, 2024
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
2 changes: 1 addition & 1 deletion google/cloud/pubsub_v1/publisher/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def on_publish_done(future):
transport = self._transport
base_retry = transport._wrapped_methods[transport.publish]._retry
retry = base_retry.with_deadline(2.0**32)
else:
elif retry is not None:
retry = retry.with_deadline(2.0**32)

# Delegate the publishing to the sequencer.
Expand Down
2 changes: 2 additions & 0 deletions google/pubsub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from google.pubsub_v1.types.pubsub import GetSnapshotRequest
from google.pubsub_v1.types.pubsub import GetSubscriptionRequest
from google.pubsub_v1.types.pubsub import GetTopicRequest
from google.pubsub_v1.types.pubsub import IngestionDataSourceSettings
from google.pubsub_v1.types.pubsub import ListSnapshotsRequest
from google.pubsub_v1.types.pubsub import ListSnapshotsResponse
from google.pubsub_v1.types.pubsub import ListSubscriptionsRequest
Expand Down Expand Up @@ -112,6 +113,7 @@
"GetSnapshotRequest",
"GetSubscriptionRequest",
"GetTopicRequest",
"IngestionDataSourceSettings",
"ListSnapshotsRequest",
"ListSnapshotsResponse",
"ListSubscriptionsRequest",
Expand Down
2 changes: 2 additions & 0 deletions google/pubsub_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from .types.pubsub import GetSnapshotRequest
from .types.pubsub import GetSubscriptionRequest
from .types.pubsub import GetTopicRequest
from .types.pubsub import IngestionDataSourceSettings
from .types.pubsub import ListSnapshotsRequest
from .types.pubsub import ListSnapshotsResponse
from .types.pubsub import ListSubscriptionsRequest
Expand Down Expand Up @@ -113,6 +114,7 @@
"GetSnapshotRequest",
"GetSubscriptionRequest",
"GetTopicRequest",
"IngestionDataSourceSettings",
"ListSchemaRevisionsRequest",
"ListSchemaRevisionsResponse",
"ListSchemasRequest",
Expand Down
107 changes: 91 additions & 16 deletions google/pubsub_v1/services/publisher/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
from google.oauth2 import service_account # type: ignore

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

from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
Expand All @@ -61,8 +61,12 @@ class PublisherAsyncClient:

_client: PublisherClient

# Copy defaults from the synchronous client for use here.
# Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
DEFAULT_ENDPOINT = PublisherClient.DEFAULT_ENDPOINT
DEFAULT_MTLS_ENDPOINT = PublisherClient.DEFAULT_MTLS_ENDPOINT
_DEFAULT_ENDPOINT_TEMPLATE = PublisherClient._DEFAULT_ENDPOINT_TEMPLATE
_DEFAULT_UNIVERSE = PublisherClient._DEFAULT_UNIVERSE

schema_path = staticmethod(PublisherClient.schema_path)
parse_schema_path = staticmethod(PublisherClient.parse_schema_path)
Expand Down Expand Up @@ -167,6 +171,25 @@ def transport(self) -> PublisherTransport:
"""
return self._client.transport

@property
def api_endpoint(self):
"""Return the API endpoint used by the client instance.

Returns:
str: The API endpoint used by the client instance.
"""
return self._client._api_endpoint

@property
def universe_domain(self) -> str:
"""Return the universe domain used by the client instance.

Returns:
str: The universe domain used
by the client instance.
"""
return self._client._universe_domain

get_transport_class = functools.partial(
type(PublisherClient).get_transport_class, type(PublisherClient)
)
Expand All @@ -179,7 +202,7 @@ def __init__(
client_options: Optional[ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the publisher client.
"""Instantiates the publisher async client.

Args:
credentials (Optional[google.auth.credentials.Credentials]): The
Expand All @@ -190,23 +213,38 @@ def __init__(
transport (Union[str, ~.PublisherTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (ClientOptions): Custom options for the client. It
won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
environment variable can also be used to override the endpoint:
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
Custom options for the client.

1. The ``api_endpoint`` property can be used to override the
default endpoint provided by the client when ``transport`` is
not explicitly provided. Only if this property is not set and
``transport`` was not explicitly provided, the endpoint is
determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
variable, which have one of the following values:
"always" (always use the default mTLS endpoint), "never" (always
use the default regular endpoint) and "auto" (auto switch to the
default mTLS endpoint if client certificate is present, this is
the default value). However, the ``api_endpoint`` property takes
precedence if provided.
(2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
use the default regular endpoint) and "auto" (auto-switch to the
default mTLS endpoint if client certificate is present; this is
the default value).

2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
is "true", then the ``client_cert_source`` property can be used
to provide client certificate for mutual TLS transport. If
to provide a client certificate for mTLS transport. If
not provided, the default SSL client certificate will be used if
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
set, no client certificate will be used.

3. The ``universe_domain`` property can be used to override the
default "googleapis.com" universe. Note that ``api_endpoint``
property still takes precedence; and ``universe_domain`` is
currently not supported for mTLS.

client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.

Raises:
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
creation failed for any reason.
Expand Down Expand Up @@ -324,6 +362,9 @@ async def sample_create_topic():
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand All @@ -345,7 +386,8 @@ async def update_topic(
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.Topic:
r"""Updates an existing topic. Note that certain
r"""Updates an existing topic by updating the fields
specified in the update mask. Note that certain
properties of a topic are not modifiable.

.. code-block:: python
Expand Down Expand Up @@ -452,6 +494,9 @@ async def sample_update_topic():
),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -555,7 +600,7 @@ async def sample_publish():
default_retry=retries.AsyncRetry(
initial=0.1,
maximum=60.0,
multiplier=4.0,
multiplier=4,
predicate=retries.if_exception_type(
core_exceptions.Aborted,
core_exceptions.Cancelled,
Expand All @@ -577,6 +622,9 @@ async def sample_publish():
gapic_v1.routing_header.to_grpc_metadata((("topic", request.topic),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -688,6 +736,9 @@ async def sample_get_topic():
gapic_v1.routing_header.to_grpc_metadata((("topic", request.topic),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -804,6 +855,9 @@ async def sample_list_topics():
gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -931,6 +985,9 @@ async def sample_list_topic_subscriptions():
gapic_v1.routing_header.to_grpc_metadata((("topic", request.topic),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -1062,6 +1119,9 @@ async def sample_list_topic_snapshots():
gapic_v1.routing_header.to_grpc_metadata((("topic", request.topic),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -1178,6 +1238,9 @@ async def sample_delete_topic():
gapic_v1.routing_header.to_grpc_metadata((("topic", request.topic),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
await rpc(
request,
Expand Down Expand Up @@ -1271,6 +1334,9 @@ async def sample_detach_subscription():
),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -1391,6 +1457,9 @@ async def set_iam_policy(
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -1513,6 +1582,9 @@ async def get_iam_policy(
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -1573,6 +1645,9 @@ async def test_iam_permissions(
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
Expand Down
Loading