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

Commit

Permalink
fix(v1beta2): Update DocumentUnderstandingService default_host from a…
Browse files Browse the repository at this point in the history
… regional endpoint to non-regional (#195)

Committer: @nicain
PiperOrigin-RevId: 390219495

Source-Link: googleapis/googleapis@09a6183

Source-Link: googleapis/googleapis-gen@6a6d8a4
  • Loading branch information
gcf-owl-bot[bot] committed Aug 12, 2021
1 parent c7b965b commit 090bcc5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Expand Up @@ -115,7 +115,7 @@ def _get_default_mtls_endpoint(api_endpoint):

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

DEFAULT_ENDPOINT = "us-documentai.googleapis.com"
DEFAULT_ENDPOINT = "documentai.googleapis.com"
DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore
DEFAULT_ENDPOINT
)
Expand Down
Expand Up @@ -55,7 +55,7 @@ class DocumentUnderstandingServiceTransport(abc.ABC):

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

DEFAULT_HOST: str = "us-documentai.googleapis.com"
DEFAULT_HOST: str = "documentai.googleapis.com"

def __init__(
self,
Expand Down
Expand Up @@ -51,7 +51,7 @@ class DocumentUnderstandingServiceGrpcTransport(DocumentUnderstandingServiceTran
def __init__(
self,
*,
host: str = "us-documentai.googleapis.com",
host: str = "documentai.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
scopes: Sequence[str] = None,
Expand Down Expand Up @@ -181,7 +181,7 @@ def __init__(
@classmethod
def create_channel(
cls,
host: str = "us-documentai.googleapis.com",
host: str = "documentai.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
scopes: Optional[Sequence[str]] = None,
Expand Down
Expand Up @@ -56,7 +56,7 @@ class DocumentUnderstandingServiceGrpcAsyncIOTransport(
@classmethod
def create_channel(
cls,
host: str = "us-documentai.googleapis.com",
host: str = "documentai.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
Expand Down Expand Up @@ -99,7 +99,7 @@ def create_channel(
def __init__(
self,
*,
host: str = "us-documentai.googleapis.com",
host: str = "documentai.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
Expand Down
Expand Up @@ -131,7 +131,7 @@ def test_document_understanding_service_client_from_service_account_info(client_
assert client.transport._credentials == creds
assert isinstance(client, client_class)

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


@pytest.mark.parametrize(
Expand Down Expand Up @@ -177,7 +177,7 @@ def test_document_understanding_service_client_from_service_account_file(client_
assert client.transport._credentials == creds
assert isinstance(client, client_class)

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


def test_document_understanding_service_client_get_transport_class():
Expand Down Expand Up @@ -1175,13 +1175,13 @@ def test_document_understanding_service_transport_create_channel(
transport_class(quota_project_id="octopus", scopes=["1", "2"])

create_channel.assert_called_with(
"us-documentai.googleapis.com:443",
"documentai.googleapis.com:443",
credentials=creds,
credentials_file=None,
quota_project_id="octopus",
default_scopes=("https://www.googleapis.com/auth/cloud-platform",),
scopes=["1", "2"],
default_host="us-documentai.googleapis.com",
default_host="documentai.googleapis.com",
ssl_credentials=None,
options=[
("grpc.max_send_message_length", -1),
Expand Down Expand Up @@ -1241,20 +1241,20 @@ def test_document_understanding_service_host_no_port():
client = DocumentUnderstandingServiceClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="us-documentai.googleapis.com"
api_endpoint="documentai.googleapis.com"
),
)
assert client.transport._host == "us-documentai.googleapis.com:443"
assert client.transport._host == "documentai.googleapis.com:443"


def test_document_understanding_service_host_with_port():
client = DocumentUnderstandingServiceClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="us-documentai.googleapis.com:8000"
api_endpoint="documentai.googleapis.com:8000"
),
)
assert client.transport._host == "us-documentai.googleapis.com:8000"
assert client.transport._host == "documentai.googleapis.com:8000"


def test_document_understanding_service_grpc_transport_channel():
Expand Down

0 comments on commit 090bcc5

Please sign in to comment.