Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 090bcc5

Browse files
fix(v1beta2): Update DocumentUnderstandingService default_host from a regional endpoint to non-regional (#195)
Committer: @nicain PiperOrigin-RevId: 390219495 Source-Link: googleapis/googleapis@09a6183 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6a6d8a449edb378a9d352716cafea8af5e5756f0
1 parent c7b965b commit 090bcc5

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

google/cloud/documentai_v1beta2/services/document_understanding_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _get_default_mtls_endpoint(api_endpoint):
115115

116116
return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com")
117117

118-
DEFAULT_ENDPOINT = "us-documentai.googleapis.com"
118+
DEFAULT_ENDPOINT = "documentai.googleapis.com"
119119
DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore
120120
DEFAULT_ENDPOINT
121121
)

google/cloud/documentai_v1beta2/services/document_understanding_service/transports/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class DocumentUnderstandingServiceTransport(abc.ABC):
5555

5656
AUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",)
5757

58-
DEFAULT_HOST: str = "us-documentai.googleapis.com"
58+
DEFAULT_HOST: str = "documentai.googleapis.com"
5959

6060
def __init__(
6161
self,

google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class DocumentUnderstandingServiceGrpcTransport(DocumentUnderstandingServiceTran
5151
def __init__(
5252
self,
5353
*,
54-
host: str = "us-documentai.googleapis.com",
54+
host: str = "documentai.googleapis.com",
5555
credentials: ga_credentials.Credentials = None,
5656
credentials_file: str = None,
5757
scopes: Sequence[str] = None,
@@ -181,7 +181,7 @@ def __init__(
181181
@classmethod
182182
def create_channel(
183183
cls,
184-
host: str = "us-documentai.googleapis.com",
184+
host: str = "documentai.googleapis.com",
185185
credentials: ga_credentials.Credentials = None,
186186
credentials_file: str = None,
187187
scopes: Optional[Sequence[str]] = None,

google/cloud/documentai_v1beta2/services/document_understanding_service/transports/grpc_asyncio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class DocumentUnderstandingServiceGrpcAsyncIOTransport(
5656
@classmethod
5757
def create_channel(
5858
cls,
59-
host: str = "us-documentai.googleapis.com",
59+
host: str = "documentai.googleapis.com",
6060
credentials: ga_credentials.Credentials = None,
6161
credentials_file: Optional[str] = None,
6262
scopes: Optional[Sequence[str]] = None,
@@ -99,7 +99,7 @@ def create_channel(
9999
def __init__(
100100
self,
101101
*,
102-
host: str = "us-documentai.googleapis.com",
102+
host: str = "documentai.googleapis.com",
103103
credentials: ga_credentials.Credentials = None,
104104
credentials_file: Optional[str] = None,
105105
scopes: Optional[Sequence[str]] = None,

tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_document_understanding_service_client_from_service_account_info(client_
131131
assert client.transport._credentials == creds
132132
assert isinstance(client, client_class)
133133

134-
assert client.transport._host == "us-documentai.googleapis.com:443"
134+
assert client.transport._host == "documentai.googleapis.com:443"
135135

136136

137137
@pytest.mark.parametrize(
@@ -177,7 +177,7 @@ def test_document_understanding_service_client_from_service_account_file(client_
177177
assert client.transport._credentials == creds
178178
assert isinstance(client, client_class)
179179

180-
assert client.transport._host == "us-documentai.googleapis.com:443"
180+
assert client.transport._host == "documentai.googleapis.com:443"
181181

182182

183183
def test_document_understanding_service_client_get_transport_class():
@@ -1175,13 +1175,13 @@ def test_document_understanding_service_transport_create_channel(
11751175
transport_class(quota_project_id="octopus", scopes=["1", "2"])
11761176

11771177
create_channel.assert_called_with(
1178-
"us-documentai.googleapis.com:443",
1178+
"documentai.googleapis.com:443",
11791179
credentials=creds,
11801180
credentials_file=None,
11811181
quota_project_id="octopus",
11821182
default_scopes=("https://www.googleapis.com/auth/cloud-platform",),
11831183
scopes=["1", "2"],
1184-
default_host="us-documentai.googleapis.com",
1184+
default_host="documentai.googleapis.com",
11851185
ssl_credentials=None,
11861186
options=[
11871187
("grpc.max_send_message_length", -1),
@@ -1241,20 +1241,20 @@ def test_document_understanding_service_host_no_port():
12411241
client = DocumentUnderstandingServiceClient(
12421242
credentials=ga_credentials.AnonymousCredentials(),
12431243
client_options=client_options.ClientOptions(
1244-
api_endpoint="us-documentai.googleapis.com"
1244+
api_endpoint="documentai.googleapis.com"
12451245
),
12461246
)
1247-
assert client.transport._host == "us-documentai.googleapis.com:443"
1247+
assert client.transport._host == "documentai.googleapis.com:443"
12481248

12491249

12501250
def test_document_understanding_service_host_with_port():
12511251
client = DocumentUnderstandingServiceClient(
12521252
credentials=ga_credentials.AnonymousCredentials(),
12531253
client_options=client_options.ClientOptions(
1254-
api_endpoint="us-documentai.googleapis.com:8000"
1254+
api_endpoint="documentai.googleapis.com:8000"
12551255
),
12561256
)
1257-
assert client.transport._host == "us-documentai.googleapis.com:8000"
1257+
assert client.transport._host == "documentai.googleapis.com:8000"
12581258

12591259

12601260
def test_document_understanding_service_grpc_transport_channel():

0 commit comments

Comments
 (0)