API Core: Add client_options documentation. (#8834)
diff --git a/docs/client_options.rst b/docs/client_options.rst
new file mode 100644
index 0000000..da7c9a3
--- /dev/null
+++ b/docs/client_options.rst
@@ -0,0 +1,6 @@
+Client Options
+==========================
+
+.. automodule:: google.api_core.client_options
+ :members:
+ :show-inheritance:
diff --git a/docs/index.rst b/docs/index.rst
index 9dec6e8..67572a0 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -9,6 +9,7 @@
.. toctree::
auth
client_info
+ client_options
exceptions
futures
helpers
diff --git a/google/api_core/client_options.py b/google/api_core/client_options.py
index 580aba9..1144d2f 100644
--- a/google/api_core/client_options.py
+++ b/google/api_core/client_options.py
@@ -16,6 +16,27 @@
Client options provide a consistent interface for user options to be defined
across clients.
+
+You can pass a client options object to a client.
+
+.. code-block:: python
+
+ from google.api_core.client_options import ClientOptions
+ from google.cloud.vision_v1 import ImageAnnotatorClient
+
+ options = ClientOptions(api_endpoint="foo.googleapis.com")
+
+ client = ImageAnnotatorClient(client_options=options)
+
+You can also pass a dictionary.
+
+.. code-block:: python
+
+ from google.cloud.vision_v1 import ImageAnnotatorClient
+
+ client = ImageAnnotatorClient(client_options={"api_endpoint": "foo.googleapis.com"})
+
+
"""