diff --git a/api_core/docs/client_options.rst b/api_core/docs/client_options.rst new file mode 100644 index 000000000000..da7c9a339bbd --- /dev/null +++ b/api_core/docs/client_options.rst @@ -0,0 +1,6 @@ +Client Options +========================== + +.. automodule:: google.api_core.client_options + :members: + :show-inheritance: diff --git a/api_core/docs/index.rst b/api_core/docs/index.rst index 9dec6e8e1de4..67572a0bbf96 100644 --- a/api_core/docs/index.rst +++ b/api_core/docs/index.rst @@ -9,6 +9,7 @@ Core .. toctree:: auth client_info + client_options exceptions futures helpers diff --git a/api_core/google/api_core/client_options.py b/api_core/google/api_core/client_options.py index 580aba9f50c3..1144d2f62a37 100644 --- a/api_core/google/api_core/client_options.py +++ b/api_core/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"}) + + """