Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5916b6b

Browse files
authored
API Core: Add client_options documentation. (#8834)
1 parent d98184a commit 5916b6b

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

api_core/docs/client_options.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Client Options
2+
==========================
3+
4+
.. automodule:: google.api_core.client_options
5+
:members:
6+
:show-inheritance:

api_core/docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Core
99
.. toctree::
1010
auth
1111
client_info
12+
client_options
1213
exceptions
1314
futures
1415
helpers

api_core/google/api_core/client_options.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@
1616
1717
Client options provide a consistent interface for user options to be defined
1818
across clients.
19+
20+
You can pass a client options object to a client.
21+
22+
.. code-block:: python
23+
24+
from google.api_core.client_options import ClientOptions
25+
from google.cloud.vision_v1 import ImageAnnotatorClient
26+
27+
options = ClientOptions(api_endpoint="foo.googleapis.com")
28+
29+
client = ImageAnnotatorClient(client_options=options)
30+
31+
You can also pass a dictionary.
32+
33+
.. code-block:: python
34+
35+
from google.cloud.vision_v1 import ImageAnnotatorClient
36+
37+
client = ImageAnnotatorClient(client_options={"api_endpoint": "foo.googleapis.com"})
38+
39+
1940
"""
2041

2142

0 commit comments

Comments
 (0)