Skip to content

Commit d51f832

Browse files
gcf-owl-bot[bot]partheaohmayr
authored
feat: Allow users to explicitly configure universe domain (#12240)
- [ ] Regenerate this pull request now. chore: Update gapic-generator-python to v1.14.0 PiperOrigin-RevId: 603108274 Source-Link: googleapis/googleapis@3d83e36 Source-Link: googleapis/googleapis-gen@baf5e9b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3cvLk93bEJvdC55YW1sIiwiaCI6ImJhZjVlOWJiYjE0YTc2OGIyYjRjOWVhZTlmZWI3OGYxOGYxNzU3ZmEifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiYmFmNWU5YmJiMTRhNzY4YjJiNGM5ZWFlOWZlYjc4ZjE4ZjE3NTdmYSJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRscC8uT3dsQm90LnlhbWwiLCJoIjoiYmFmNWU5YmJiMTRhNzY4YjJiNGM5ZWFlOWZlYjc4ZjE4ZjE3NTdmYSJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRtcy8uT3dsQm90LnlhbWwiLCJoIjoiYmFmNWU5YmJiMTRhNzY4YjJiNGM5ZWFlOWZlYjc4ZjE4ZjE3NTdmYSJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6ImJhZjVlOWJiYjE0YTc2OGIyYjRjOWVhZTlmZWI3OGYxOGYxNzU3ZmEifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvbWFpbnMvLk93bEJvdC55YW1sIiwiaCI6ImJhZjVlOWJiYjE0YTc2OGIyYjRjOWVhZTlmZWI3OGYxOGYxNzU3ZmEifQ== Copy-Tag: eyJwIjoic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]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: omair <omairn@google.com>
1 parent e14d4b1 commit d51f832

File tree

676 files changed

+87015
-23778
lines changed

Some content is hidden

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

676 files changed

+87015
-23778
lines changed

packages/google-cloud-dialogflow/google/cloud/dialogflow/gapic_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.27.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/gapic_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.27.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/async_client.py

+94-14
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
from google.cloud.dialogflow_v2 import gapic_version as package_version
3939

4040
try:
41-
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
41+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]
4242
except AttributeError: # pragma: NO COVER
43-
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore
43+
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
4444

4545
from google.api_core import operation # type: ignore
4646
from google.api_core import operation_async # type: ignore
@@ -64,8 +64,12 @@ class AgentsAsyncClient:
6464

6565
_client: AgentsClient
6666

67+
# Copy defaults from the synchronous client for use here.
68+
# Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
6769
DEFAULT_ENDPOINT = AgentsClient.DEFAULT_ENDPOINT
6870
DEFAULT_MTLS_ENDPOINT = AgentsClient.DEFAULT_MTLS_ENDPOINT
71+
_DEFAULT_ENDPOINT_TEMPLATE = AgentsClient._DEFAULT_ENDPOINT_TEMPLATE
72+
_DEFAULT_UNIVERSE = AgentsClient._DEFAULT_UNIVERSE
6973

7074
agent_path = staticmethod(AgentsClient.agent_path)
7175
parse_agent_path = staticmethod(AgentsClient.parse_agent_path)
@@ -162,6 +166,25 @@ def transport(self) -> AgentsTransport:
162166
"""
163167
return self._client.transport
164168

169+
@property
170+
def api_endpoint(self):
171+
"""Return the API endpoint used by the client instance.
172+
173+
Returns:
174+
str: The API endpoint used by the client instance.
175+
"""
176+
return self._client._api_endpoint
177+
178+
@property
179+
def universe_domain(self) -> str:
180+
"""Return the universe domain used by the client instance.
181+
182+
Returns:
183+
str: The universe domain used
184+
by the client instance.
185+
"""
186+
return self._client._universe_domain
187+
165188
get_transport_class = functools.partial(
166189
type(AgentsClient).get_transport_class, type(AgentsClient)
167190
)
@@ -174,7 +197,7 @@ def __init__(
174197
client_options: Optional[ClientOptions] = None,
175198
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
176199
) -> None:
177-
"""Instantiates the agents client.
200+
"""Instantiates the agents async client.
178201
179202
Args:
180203
credentials (Optional[google.auth.credentials.Credentials]): The
@@ -185,23 +208,38 @@ def __init__(
185208
transport (Union[str, ~.AgentsTransport]): The
186209
transport to use. If set to None, a transport is chosen
187210
automatically.
188-
client_options (ClientOptions): Custom options for the client. It
189-
won't take effect if a ``transport`` instance is provided.
190-
(1) The ``api_endpoint`` property can be used to override the
191-
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
192-
environment variable can also be used to override the endpoint:
211+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
212+
Custom options for the client.
213+
214+
1. The ``api_endpoint`` property can be used to override the
215+
default endpoint provided by the client when ``transport`` is
216+
not explicitly provided. Only if this property is not set and
217+
``transport`` was not explicitly provided, the endpoint is
218+
determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
219+
variable, which have one of the following values:
193220
"always" (always use the default mTLS endpoint), "never" (always
194-
use the default regular endpoint) and "auto" (auto switch to the
195-
default mTLS endpoint if client certificate is present, this is
196-
the default value). However, the ``api_endpoint`` property takes
197-
precedence if provided.
198-
(2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
221+
use the default regular endpoint) and "auto" (auto-switch to the
222+
default mTLS endpoint if client certificate is present; this is
223+
the default value).
224+
225+
2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
199226
is "true", then the ``client_cert_source`` property can be used
200-
to provide client certificate for mutual TLS transport. If
227+
to provide a client certificate for mTLS transport. If
201228
not provided, the default SSL client certificate will be used if
202229
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
203230
set, no client certificate will be used.
204231
232+
3. The ``universe_domain`` property can be used to override the
233+
default "googleapis.com" universe. Note that ``api_endpoint``
234+
property still takes precedence; and ``universe_domain`` is
235+
currently not supported for mTLS.
236+
237+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
238+
The client info used to send a user-agent string along with
239+
API requests. If ``None``, then default info will be used.
240+
Generally, you only need to set this if you're developing
241+
your own client library.
242+
205243
Raises:
206244
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
207245
creation failed for any reason.
@@ -313,6 +351,9 @@ async def sample_get_agent():
313351
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
314352
)
315353

354+
# Validate the universe domain.
355+
self._client._validate_universe_domain()
356+
316357
# Send the request.
317358
response = await rpc(
318359
request,
@@ -434,6 +475,9 @@ async def sample_set_agent():
434475
),
435476
)
436477

478+
# Validate the universe domain.
479+
self._client._validate_universe_domain()
480+
437481
# Send the request.
438482
response = await rpc(
439483
request,
@@ -527,6 +571,9 @@ async def sample_delete_agent():
527571
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
528572
)
529573

574+
# Validate the universe domain.
575+
self._client._validate_universe_domain()
576+
530577
# Send the request.
531578
await rpc(
532579
request,
@@ -636,6 +683,9 @@ async def sample_search_agents():
636683
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
637684
)
638685

686+
# Validate the universe domain.
687+
self._client._validate_universe_domain()
688+
639689
# Send the request.
640690
response = await rpc(
641691
request,
@@ -775,6 +825,9 @@ async def sample_train_agent():
775825
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
776826
)
777827

828+
# Validate the universe domain.
829+
self._client._validate_universe_domain()
830+
778831
# Send the request.
779832
response = await rpc(
780833
request,
@@ -902,6 +955,9 @@ async def sample_export_agent():
902955
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
903956
)
904957

958+
# Validate the universe domain.
959+
self._client._validate_universe_domain()
960+
905961
# Send the request.
906962
response = await rpc(
907963
request,
@@ -1033,6 +1089,9 @@ async def sample_import_agent():
10331089
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
10341090
)
10351091

1092+
# Validate the universe domain.
1093+
self._client._validate_universe_domain()
1094+
10361095
# Send the request.
10371096
response = await rpc(
10381097
request,
@@ -1162,6 +1221,9 @@ async def sample_restore_agent():
11621221
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
11631222
)
11641223

1224+
# Validate the universe domain.
1225+
self._client._validate_universe_domain()
1226+
11651227
# Send the request.
11661228
response = await rpc(
11671229
request,
@@ -1252,6 +1314,9 @@ async def sample_get_validation_result():
12521314
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
12531315
)
12541316

1317+
# Validate the universe domain.
1318+
self._client._validate_universe_domain()
1319+
12551320
# Send the request.
12561321
response = await rpc(
12571322
request,
@@ -1306,6 +1371,9 @@ async def list_operations(
13061371
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
13071372
)
13081373

1374+
# Validate the universe domain.
1375+
self._client._validate_universe_domain()
1376+
13091377
# Send the request.
13101378
response = await rpc(
13111379
request,
@@ -1360,6 +1428,9 @@ async def get_operation(
13601428
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
13611429
)
13621430

1431+
# Validate the universe domain.
1432+
self._client._validate_universe_domain()
1433+
13631434
# Send the request.
13641435
response = await rpc(
13651436
request,
@@ -1417,6 +1488,9 @@ async def cancel_operation(
14171488
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
14181489
)
14191490

1491+
# Validate the universe domain.
1492+
self._client._validate_universe_domain()
1493+
14201494
# Send the request.
14211495
await rpc(
14221496
request,
@@ -1468,6 +1542,9 @@ async def get_location(
14681542
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
14691543
)
14701544

1545+
# Validate the universe domain.
1546+
self._client._validate_universe_domain()
1547+
14711548
# Send the request.
14721549
response = await rpc(
14731550
request,
@@ -1522,6 +1599,9 @@ async def list_locations(
15221599
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
15231600
)
15241601

1602+
# Validate the universe domain.
1603+
self._client._validate_universe_domain()
1604+
15251605
# Send the request.
15261606
response = await rpc(
15271607
request,

0 commit comments

Comments
 (0)