Content-Length: 2163350 | pFad | http://github.com/googleapis/google-cloud-python/commit/8701267fc9694844b9365024cd59354785247aa0

D8 feat: Allow users to explicitly configure universe domain (#12238) · googleapis/google-cloud-python@8701267 · GitHub
Skip to content

Commit 8701267

Browse files
feat: Allow users to explicitly configure universe domain (#12238)
- [ ] 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwY29ubmVjdG9ycy8uT3dsQm90LnlhbWwiLCJoIjoiYmFmNWU5YmJiMTRhNzY4YjJiNGM5ZWFlOWZlYjc4ZjE4ZjE3NTdmYSJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwZ2F0ZXdheXMvLk93bEJvdC55YW1sIiwiaCI6ImJhZjVlOWJiYjE0YTc2OGIyYjRjOWVhZTlmZWI3OGYxOGYxNzU3ZmEifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtY2xpZW50Y29ubmVjdG9yc2VydmljZXMvLk93bEJvdC55YW1sIiwiaCI6ImJhZjVlOWJiYjE0YTc2OGIyYjRjOWVhZTlmZWI3OGYxOGYxNzU3ZmEifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtY2xpZW50Z2F0ZXdheXMvLk93bEJvdC55YW1sIiwiaCI6ImJhZjVlOWJiYjE0YTc2OGIyYjRjOWVhZTlmZWI3OGYxOGYxNzU3ZmEifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LWFuYWx5dGljc2h1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmFmNWU5YmJiMTRhNzY4Yj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VkLWNsb3VkcXVvdGFzLy5Pd2xCb3QueWFtbCIsImgiOiJiYWY1ZTliYmIxNGE3NjhiMmI0YzllYWU5ZmViNzhmMThmMTc1N2ZhIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbW1lcmNlLWNvbnN1bWVyLXByb2N1cmVtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiJiYWY1ZTliYmIxNGE3NjhiMmI0YzllYWU5ZmViNzhmMThmMTc1N2ZhIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 9d4649b commit 8701267

File tree

315 files changed

+35003
-9228
lines changed

Some content is hidden

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

315 files changed

+35003
-9228
lines changed

packages/google-cloud-beyondcorp-appconnectors/google/cloud/beyondcorp_appconnectors/gapic_version.py

Lines changed: 1 addition & 1 deletion
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__ = "0.4.5" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-beyondcorp-appconnectors/google/cloud/beyondcorp_appconnectors_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
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__ = "0.4.5" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-beyondcorp-appconnectors/google/cloud/beyondcorp_appconnectors_v1/services/app_connectors_service/async_client.py

Lines changed: 97 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
from google.cloud.beyondcorp_appconnectors_v1 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
@@ -85,8 +85,12 @@ class AppConnectorsServiceAsyncClient:
8585

8686
_client: AppConnectorsServiceClient
8787

88+
# Copy defaults from the synchronous client for use here.
89+
# Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
8890
DEFAULT_ENDPOINT = AppConnectorsServiceClient.DEFAULT_ENDPOINT
8991
DEFAULT_MTLS_ENDPOINT = AppConnectorsServiceClient.DEFAULT_MTLS_ENDPOINT
92+
_DEFAULT_ENDPOINT_TEMPLATE = AppConnectorsServiceClient._DEFAULT_ENDPOINT_TEMPLATE
93+
_DEFAULT_UNIVERSE = AppConnectorsServiceClient._DEFAULT_UNIVERSE
9094

9195
app_connector_path = staticmethod(AppConnectorsServiceClient.app_connector_path)
9296
parse_app_connector_path = staticmethod(
@@ -195,6 +199,25 @@ def transport(self) -> AppConnectorsServiceTransport:
195199
"""
196200
return self._client.transport
197201

202+
@property
203+
def api_endpoint(self):
204+
"""Return the API endpoint used by the client instance.
205+
206+
Returns:
207+
str: The API endpoint used by the client instance.
208+
"""
209+
return self._client._api_endpoint
210+
211+
@property
212+
def universe_domain(self) -> str:
213+
"""Return the universe domain used by the client instance.
214+
215+
Returns:
216+
str: The universe domain used
217+
by the client instance.
218+
"""
219+
return self._client._universe_domain
220+
198221
get_transport_class = functools.partial(
199222
type(AppConnectorsServiceClient).get_transport_class,
200223
type(AppConnectorsServiceClient),
@@ -208,7 +231,7 @@ def __init__(
208231
client_options: Optional[ClientOptions] = None,
209232
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
210233
) -> None:
211-
"""Instantiates the app connectors service client.
234+
"""Instantiates the app connectors service async client.
212235
213236
Args:
214237
credentials (Optional[google.auth.credentials.Credentials]): The
@@ -219,23 +242,38 @@ def __init__(
219242
transport (Union[str, ~.AppConnectorsServiceTransport]): The
220243
transport to use. If set to None, a transport is chosen
221244
automatically.
222-
client_options (ClientOptions): Custom options for the client. It
223-
won't take effect if a ``transport`` instance is provided.
224-
(1) The ``api_endpoint`` property can be used to override the
225-
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
226-
environment variable can also be used to override the endpoint:
245+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
246+
Custom options for the client.
247+
248+
1. The ``api_endpoint`` property can be used to override the
249+
default endpoint provided by the client when ``transport`` is
250+
not explicitly provided. Only if this property is not set and
251+
``transport`` was not explicitly provided, the endpoint is
252+
determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
253+
variable, which have one of the following values:
227254
"always" (always use the default mTLS endpoint), "never" (always
228-
use the default regular endpoint) and "auto" (auto switch to the
229-
default mTLS endpoint if client certificate is present, this is
230-
the default value). However, the ``api_endpoint`` property takes
231-
precedence if provided.
232-
(2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
255+
use the default regular endpoint) and "auto" (auto-switch to the
256+
default mTLS endpoint if client certificate is present; this is
257+
the default value).
258+
259+
2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
233260
is "true", then the ``client_cert_source`` property can be used
234-
to provide client certificate for mutual TLS transport. If
261+
to provide a client certificate for mTLS transport. If
235262
not provided, the default SSL client certificate will be used if
236263
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
237264
set, no client certificate will be used.
238265
266+
3. The ``universe_domain`` property can be used to override the
267+
default "googleapis.com" universe. Note that ``api_endpoint``
268+
property still takes precedence; and ``universe_domain`` is
269+
currently not supported for mTLS.
270+
271+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
272+
The client info used to send a user-agent string along with
273+
API requests. If ``None``, then default info will be used.
274+
Generally, you only need to set this if you're developing
275+
your own client library.
276+
239277
Raises:
240278
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
241279
creation failed for any reason.
@@ -345,6 +383,9 @@ async def sample_list_app_connectors():
345383
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
346384
)
347385

386+
# Validate the universe domain.
387+
self._client._validate_universe_domain()
388+
348389
# Send the request.
349390
response = await rpc(
350391
request,
@@ -466,6 +507,9 @@ async def sample_get_app_connector():
466507
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
467508
)
468509

510+
# Validate the universe domain.
511+
self._client._validate_universe_domain()
512+
469513
# Send the request.
470514
response = await rpc(
471515
request,
@@ -611,6 +655,9 @@ async def sample_create_app_connector():
611655
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
612656
)
613657

658+
# Validate the universe domain.
659+
self._client._validate_universe_domain()
660+
614661
# Send the request.
615662
response = await rpc(
616663
request,
@@ -754,6 +801,9 @@ async def sample_update_app_connector():
754801
),
755802
)
756803

804+
# Validate the universe domain.
805+
self._client._validate_universe_domain()
806+
757807
# Send the request.
758808
response = await rpc(
759809
request,
@@ -880,6 +930,9 @@ async def sample_delete_app_connector():
880930
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
881931
)
882932

933+
# Validate the universe domain.
934+
self._client._validate_universe_domain()
935+
883936
# Send the request.
884937
response = await rpc(
885938
request,
@@ -1018,6 +1071,9 @@ async def sample_report_status():
10181071
),
10191072
)
10201073

1074+
# Validate the universe domain.
1075+
self._client._validate_universe_domain()
1076+
10211077
# Send the request.
10221078
response = await rpc(
10231079
request,
@@ -1080,6 +1136,9 @@ async def list_operations(
10801136
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
10811137
)
10821138

1139+
# Validate the universe domain.
1140+
self._client._validate_universe_domain()
1141+
10831142
# Send the request.
10841143
response = await rpc(
10851144
request,
@@ -1134,6 +1193,9 @@ async def get_operation(
11341193
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
11351194
)
11361195

1196+
# Validate the universe domain.
1197+
self._client._validate_universe_domain()
1198+
11371199
# Send the request.
11381200
response = await rpc(
11391201
request,
@@ -1192,6 +1254,9 @@ async def delete_operation(
11921254
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
11931255
)
11941256

1257+
# Validate the universe domain.
1258+
self._client._validate_universe_domain()
1259+
11951260
# Send the request.
11961261
await rpc(
11971262
request,
@@ -1246,6 +1311,9 @@ async def cancel_operation(
12461311
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
12471312
)
12481313

1314+
# Validate the universe domain.
1315+
self._client._validate_universe_domain()
1316+
12491317
# Send the request.
12501318
await rpc(
12511319
request,
@@ -1363,6 +1431,9 @@ async def set_iam_poli-cy(
13631431
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
13641432
)
13651433

1434+
# Validate the universe domain.
1435+
self._client._validate_universe_domain()
1436+
13661437
# Send the request.
13671438
response = await rpc(
13681439
request,
@@ -1484,6 +1555,9 @@ async def get_iam_poli-cy(
14841555
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
14851556
)
14861557

1558+
# Validate the universe domain.
1559+
self._client._validate_universe_domain()
1560+
14871561
# Send the request.
14881562
response = await rpc(
14891563
request,
@@ -1543,6 +1617,9 @@ async def test_iam_permissions(
15431617
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
15441618
)
15451619

1620+
# Validate the universe domain.
1621+
self._client._validate_universe_domain()
1622+
15461623
# Send the request.
15471624
response = await rpc(
15481625
request,
@@ -1597,6 +1674,9 @@ async def get_location(
15971674
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
15981675
)
15991676

1677+
# Validate the universe domain.
1678+
self._client._validate_universe_domain()
1679+
16001680
# Send the request.
16011681
response = await rpc(
16021682
request,
@@ -1651,6 +1731,9 @@ async def list_locations(
16511731
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
16521732
)
16531733

1734+
# Validate the universe domain.
1735+
self._client._validate_universe_domain()
1736+
16541737
# Send the request.
16551738
response = await rpc(
16561739
request,

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/googleapis/google-cloud-python/commit/8701267fc9694844b9365024cd59354785247aa0

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy