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

fix: adds comment with explicit hostname change #94

Merged
merged 5 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion samples/snippets/batch_process_documents_sample_v1beta3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ def batch_process_documents(
timeout: int = 300,
):

client = documentai.DocumentProcessorServiceClient()
# You must set the api_endpoint if you use a location other than 'us', e.g.:
opts = {}
if location == "eu":
opts = {"api_endpoint": "eu-documentai.googleapis.com"}

client = documentai.DocumentProcessorServiceClient(client_options=opts)

destination_uri = f"{gcs_output_uri}/{gcs_output_uri_prefix}/"

Expand Down
8 changes: 6 additions & 2 deletions samples/snippets/process_document_sample_v1beta3.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ def process_document_sample(
):
from google.cloud import documentai_v1beta3 as documentai

# Instantiates a client
client = documentai.DocumentProcessorServiceClient()
# You must set the api_endpoint if you use a location other than 'us', e.g.:
opts = {}
if location == "eu":
opts = {"api_endpoint": "eu-documentai.googleapis.com"}

client = documentai.DocumentProcessorServiceClient(client_options=opts)

# The full resource name of the processor, e.g.:
# projects/project-id/locations/location/processor/processor-id
Expand Down
8 changes: 7 additions & 1 deletion samples/snippets/quickstart_sample_v1beta3.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@


def quickstart(project_id: str, location: str, processor_id: str, file_path: str):
client = documentai.DocumentProcessorServiceClient()

# You must set the api_endpoint if you use a location other than 'us', e.g.:
opts = {}
if location == "eu":
opts = {"api_endpoint": "eu-documentai.googleapis.com"}

client = documentai.DocumentProcessorServiceClient(client_options=opts)

# The full resource name of the processor, e.g.:
# projects/project-id/locations/location/processor/processor-id
Expand Down