Skip to content
Permalink
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
  • Loading branch information
gcf-owl-bot[bot] committed Aug 12, 2021
1 parent c7b965b commit 090bcc568a2f448c00a0062bc0a3eddddc8ded87
@@ -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
)
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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(
@@ -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():
@@ -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),
@@ -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():

0 comments on commit 090bcc5

Please sign in to comment.