Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 1578a2a

Browse files
chore(docs): add docstrings for api_audience and interceptor (#2571)
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 98137d0 commit 1578a2a

File tree

45 files changed

+186
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+186
-0
lines changed

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/base.py.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ class {{ service.name }}Transport(abc.ABC):
103103
your own client library.
104104
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
105105
be used for service account credentials.
106+
api_audience (Optional[str]): The intended audience for the API calls
107+
to the service that will be set when using certain 3rd party
108+
authentication flows. Audience is typically a resource identifier.
109+
If not set, the host value will be used as a default.
106110
"""
107111
{% if service.any_extended_operations_methods %}
108112
self._extended_operations_services: Dict[str, Any] = {}

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc.py.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
169169
your own client library.
170170
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
171171
be used for service account credentials.
172+
api_audience (Optional[str]): The intended audience for the API calls
173+
to the service that will be set when using certain 3rd party
174+
authentication flows. Audience is typically a resource identifier.
175+
If not set, the host value will be used as a default.
172176

173177
Raises:
174178
google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc_asyncio.py.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ class {{ service.grpc_asyncio_transport_name }}({{ service.name }}Transport):
218218
your own client library.
219219
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
220220
be used for service account credentials.
221+
api_audience (Optional[str]): The intended audience for the API calls
222+
to the service that will be set when using certain 3rd party
223+
authentication flows. Audience is typically a resource identifier.
224+
If not set, the host value will be used as a default.
221225

222226
Raises:
223227
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ class {{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
135135
url_scheme: the protocol scheme for the API endpoint. Normally
136136
"https", but for testing or local servers,
137137
"http" can be specified.
138+
interceptor (Optional[{{ service.name }}RestInterceptor]): Interceptor used
139+
to manipulate requests, request metadata, and responses.
140+
api_audience (Optional[str]): The intended audience for the API calls
141+
to the service that will be set when using certain 3rd party
142+
authentication flows. Audience is typically a resource identifier.
143+
If not set, the host value will be used as a default.
138144
"""
139145
# Run the base constructor
140146
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest_asyncio.py.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ class Async{{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
134134
url_scheme (str): the protocol scheme for the API endpoint. Normally
135135
"https", but for testing or local servers,
136136
"http" can be specified.
137+
interceptor (Optional[Async{{ service.name }}RestInterceptor]): Interceptor used
138+
to manipulate requests, request metadata, and responses.
137139
"""
138140
# Run the base constructor
139141
super().__init__(

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def __init__(
8383
your own client library.
8484
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
8585
be used for service account credentials.
86+
api_audience (Optional[str]): The intended audience for the API calls
87+
to the service that will be set when using certain 3rd party
88+
authentication flows. Audience is typically a resource identifier.
89+
If not set, the host value will be used as a default.
8690
"""
8791

8892
# Save the scopes.

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/grpc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ def __init__(self, *,
178178
your own client library.
179179
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
180180
be used for service account credentials.
181+
api_audience (Optional[str]): The intended audience for the API calls
182+
to the service that will be set when using certain 3rd party
183+
authentication flows. Audience is typically a resource identifier.
184+
If not set, the host value will be used as a default.
181185
182186
Raises:
183187
google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/grpc_asyncio.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ def __init__(self, *,
226226
your own client library.
227227
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
228228
be used for service account credentials.
229+
api_audience (Optional[str]): The intended audience for the API calls
230+
to the service that will be set when using certain 3rd party
231+
authentication flows. Audience is typically a resource identifier.
232+
If not set, the host value will be used as a default.
229233
230234
Raises:
231235
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/rest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,12 @@ def __init__(self, *,
11241124
url_scheme: the protocol scheme for the API endpoint. Normally
11251125
"https", but for testing or local servers,
11261126
"http" can be specified.
1127+
interceptor (Optional[AssetServiceRestInterceptor]): Interceptor used
1128+
to manipulate requests, request metadata, and responses.
1129+
api_audience (Optional[str]): The intended audience for the API calls
1130+
to the service that will be set when using certain 3rd party
1131+
authentication flows. Audience is typically a resource identifier.
1132+
If not set, the host value will be used as a default.
11271133
"""
11281134
# Run the base constructor
11291135
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.

tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/transports/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ def __init__(
8080
your own client library.
8181
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
8282
be used for service account credentials.
83+
api_audience (Optional[str]): The intended audience for the API calls
84+
to the service that will be set when using certain 3rd party
85+
authentication flows. Audience is typically a resource identifier.
86+
If not set, the host value will be used as a default.
8387
"""
8488

8589
# Save the scopes.

0 commit comments

Comments
 (0)