From 03aabddd963f7c0507e351f81f5995aa8fb761bf Mon Sep 17 00:00:00 2001 From: Tianzi Cai Date: Fri, 26 Jul 2019 10:23:30 -0700 Subject: [PATCH] Pub/Sub: document regional endpoint (#8789) * document client_options * show an example that sets client_options --- pubsub/google/cloud/pubsub_v1/publisher/client.py | 3 +++ pubsub/google/cloud/pubsub_v1/subscriber/client.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pubsub/google/cloud/pubsub_v1/publisher/client.py b/pubsub/google/cloud/pubsub_v1/publisher/client.py index b837de24c6f0..006bf509d24b 100644 --- a/pubsub/google/cloud/pubsub_v1/publisher/client.py +++ b/pubsub/google/cloud/pubsub_v1/publisher/client.py @@ -58,6 +58,9 @@ class Client(object): Before being passed along to the GAPIC constructor, a channel may be added if ``credentials`` are passed explicitly or if the Pub / Sub emulator is detected as running. + Regional endpoints can be set via `client_options` that takes a + single key-value pair that defines the endpoint, i.e. + `client_options={"api_endpoint": REGIONAL_ENDPOINT}` """ _batch_class = thread.Batch diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/client.py b/pubsub/google/cloud/pubsub_v1/subscriber/client.py index f2e8faa4fcf5..7dbb425caf66 100644 --- a/pubsub/google/cloud/pubsub_v1/subscriber/client.py +++ b/pubsub/google/cloud/pubsub_v1/subscriber/client.py @@ -53,6 +53,9 @@ class Client(object): :class:`~.gapic.pubsub.v1.subscriber_client.SubscriberClient`. Generally, you should not need to set additional keyword arguments. + Regional endpoints can be set via `client_options` that takes a + single key-value pair that defines the endpoint, i.e. + `client_options={"api_endpoint": REGIONAL_ENDPOINT}`. """ def __init__(self, **kwargs):