Skip to content

Commit dd5eb3e

Browse files
fix: mark Document.Entity.type as REQUIRED in all versions (#317)
- [ ] Regenerate this pull request now. fix: remove Document.Entity.bounding_poly_for_demo_frontend from v1beta2 PiperOrigin-RevId: 444656928 Source-Link: googleapis/googleapis@a0d4c5c Source-Link: googleapis/googleapis-gen@d3a3f6d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDNhM2Y2ZGRlMThlYzM3MjFmY2ViYTkzM2U0MzI3YTdiNmRkMmMyZCJ9 chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: googleapis/googleapis@f91b6cf Source-Link: googleapis/googleapis-gen@16eb360 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9
1 parent 6c1fea7 commit dd5eb3e

File tree

9 files changed

+102
-112
lines changed

9 files changed

+102
-112
lines changed

packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/async_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ async def process_document(
238238
239239
from google.cloud import documentai_v1
240240
241-
def sample_process_document():
241+
async def sample_process_document():
242242
# Create a client
243-
client = documentai_v1.DocumentProcessorServiceClient()
243+
client = documentai_v1.DocumentProcessorServiceAsyncClient()
244244
245245
# Initialize request argument(s)
246246
inline_document = documentai_v1.Document()
@@ -252,7 +252,7 @@ def sample_process_document():
252252
)
253253
254254
# Make the request
255-
response = client.process_document(request=request)
255+
response = await client.process_document(request=request)
256256
257257
# Handle the response
258258
print(response)
@@ -348,9 +348,9 @@ async def batch_process_documents(
348348
349349
from google.cloud import documentai_v1
350350
351-
def sample_batch_process_documents():
351+
async def sample_batch_process_documents():
352352
# Create a client
353-
client = documentai_v1.DocumentProcessorServiceClient()
353+
client = documentai_v1.DocumentProcessorServiceAsyncClient()
354354
355355
# Initialize request argument(s)
356356
request = documentai_v1.BatchProcessRequest(
@@ -362,7 +362,7 @@ def sample_batch_process_documents():
362362
363363
print("Waiting for operation to complete...")
364364
365-
response = operation.result()
365+
response = await operation.result()
366366
367367
# Handle the response
368368
print(response)
@@ -469,9 +469,9 @@ async def review_document(
469469
470470
from google.cloud import documentai_v1
471471
472-
def sample_review_document():
472+
async def sample_review_document():
473473
# Create a client
474-
client = documentai_v1.DocumentProcessorServiceClient()
474+
client = documentai_v1.DocumentProcessorServiceAsyncClient()
475475
476476
# Initialize request argument(s)
477477
inline_document = documentai_v1.Document()
@@ -487,7 +487,7 @@ def sample_review_document():
487487
488488
print("Waiting for operation to complete...")
489489
490-
response = operation.result()
490+
response = await operation.result()
491491
492492
# Handle the response
493493
print(response)

packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ class Entity(proto.Message):
875875
into the
876876
[Document.text][google.cloud.documentai.v1.Document.text].
877877
type_ (str):
878-
Entity type from a schema e.g. ``Address``.
878+
Required. Entity type from a schema e.g. ``Address``.
879879
mention_text (str):
880880
Optional. Text value in the document e.g.
881881
``1600 Amphitheatre Pkwy``. If the entity is not present in

packages/google-cloud-documentai/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ async def batch_process_documents(
232232
233233
from google.cloud import documentai_v1beta2
234234
235-
def sample_batch_process_documents():
235+
async def sample_batch_process_documents():
236236
# Create a client
237-
client = documentai_v1beta2.DocumentUnderstandingServiceClient()
237+
client = documentai_v1beta2.DocumentUnderstandingServiceAsyncClient()
238238
239239
# Initialize request argument(s)
240240
requests = documentai_v1beta2.ProcessDocumentRequest()
@@ -250,7 +250,7 @@ def sample_batch_process_documents():
250250
251251
print("Waiting for operation to complete...")
252252
253-
response = operation.result()
253+
response = await operation.result()
254254
255255
# Handle the response
256256
print(response)
@@ -355,9 +355,9 @@ async def process_document(
355355
356356
from google.cloud import documentai_v1beta2
357357
358-
def sample_process_document():
358+
async def sample_process_document():
359359
# Create a client
360-
client = documentai_v1beta2.DocumentUnderstandingServiceClient()
360+
client = documentai_v1beta2.DocumentUnderstandingServiceAsyncClient()
361361
362362
# Initialize request argument(s)
363363
input_config = documentai_v1beta2.InputConfig()
@@ -369,7 +369,7 @@ def sample_process_document():
369369
)
370370
371371
# Make the request
372-
response = client.process_document(request=request)
372+
response = await client.process_document(request=request)
373373
374374
# Handle the response
375375
print(response)

packages/google-cloud-documentai/google/cloud/documentai_v1beta2/types/document.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ class Entity(proto.Message):
773773
Provenance of the entity. Text anchor indexing into the
774774
[Document.text][google.cloud.documentai.v1beta2.Document.text].
775775
type_ (str):
776-
Entity type from a schema e.g. ``Address``.
776+
Required. Entity type from a schema e.g. ``Address``.
777777
mention_text (str):
778778
Text value in the document e.g. ``1600 Amphitheatre Pkwy``.
779779
mention_id (str):
@@ -788,11 +788,6 @@ class Entity(proto.Message):
788788
id (str):
789789
Optional. Canonical id. This will be a unique
790790
value in the entity list for this document.
791-
bounding_poly_for_demo_frontend (google.cloud.documentai_v1beta2.types.BoundingPoly):
792-
Optional. Temporary field to store the
793-
bounding poly for short-term POCs. Used by the
794-
frontend only. Do not use before you talk to
795-
ybo@ and lukasr@.
796791
"""
797792

798793
text_anchor = proto.Field(
@@ -825,11 +820,6 @@ class Entity(proto.Message):
825820
proto.STRING,
826821
number=7,
827822
)
828-
bounding_poly_for_demo_frontend = proto.Field(
829-
proto.MESSAGE,
830-
number=8,
831-
message=geometry.BoundingPoly,
832-
)
833823

834824
class EntityRelation(proto.Message):
835825
r"""Relationship between

packages/google-cloud-documentai/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ async def process_document(
250250
251251
from google.cloud import documentai_v1beta3
252252
253-
def sample_process_document():
253+
async def sample_process_document():
254254
# Create a client
255-
client = documentai_v1beta3.DocumentProcessorServiceClient()
255+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
256256
257257
# Initialize request argument(s)
258258
inline_document = documentai_v1beta3.Document()
@@ -264,7 +264,7 @@ def sample_process_document():
264264
)
265265
266266
# Make the request
267-
response = client.process_document(request=request)
267+
response = await client.process_document(request=request)
268268
269269
# Handle the response
270270
print(response)
@@ -360,9 +360,9 @@ async def batch_process_documents(
360360
361361
from google.cloud import documentai_v1beta3
362362
363-
def sample_batch_process_documents():
363+
async def sample_batch_process_documents():
364364
# Create a client
365-
client = documentai_v1beta3.DocumentProcessorServiceClient()
365+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
366366
367367
# Initialize request argument(s)
368368
request = documentai_v1beta3.BatchProcessRequest(
@@ -374,7 +374,7 @@ def sample_batch_process_documents():
374374
375375
print("Waiting for operation to complete...")
376376
377-
response = operation.result()
377+
response = await operation.result()
378378
379379
# Handle the response
380380
print(response)
@@ -482,17 +482,17 @@ async def fetch_processor_types(
482482
483483
from google.cloud import documentai_v1beta3
484484
485-
def sample_fetch_processor_types():
485+
async def sample_fetch_processor_types():
486486
# Create a client
487-
client = documentai_v1beta3.DocumentProcessorServiceClient()
487+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
488488
489489
# Initialize request argument(s)
490490
request = documentai_v1beta3.FetchProcessorTypesRequest(
491491
parent="parent_value",
492492
)
493493
494494
# Make the request
495-
response = client.fetch_processor_types(request=request)
495+
response = await client.fetch_processor_types(request=request)
496496
497497
# Handle the response
498498
print(response)
@@ -578,9 +578,9 @@ async def list_processors(
578578
579579
from google.cloud import documentai_v1beta3
580580
581-
def sample_list_processors():
581+
async def sample_list_processors():
582582
# Create a client
583-
client = documentai_v1beta3.DocumentProcessorServiceClient()
583+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
584584
585585
# Initialize request argument(s)
586586
request = documentai_v1beta3.ListProcessorsRequest(
@@ -591,7 +591,7 @@ def sample_list_processors():
591591
page_result = client.list_processors(request=request)
592592
593593
# Handle the response
594-
for response in page_result:
594+
async for response in page_result:
595595
print(response)
596596
597597
Args:
@@ -690,17 +690,17 @@ async def create_processor(
690690
691691
from google.cloud import documentai_v1beta3
692692
693-
def sample_create_processor():
693+
async def sample_create_processor():
694694
# Create a client
695-
client = documentai_v1beta3.DocumentProcessorServiceClient()
695+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
696696
697697
# Initialize request argument(s)
698698
request = documentai_v1beta3.CreateProcessorRequest(
699699
parent="parent_value",
700700
)
701701
702702
# Make the request
703-
response = client.create_processor(request=request)
703+
response = await client.create_processor(request=request)
704704
705705
# Handle the response
706706
print(response)
@@ -803,9 +803,9 @@ async def delete_processor(
803803
804804
from google.cloud import documentai_v1beta3
805805
806-
def sample_delete_processor():
806+
async def sample_delete_processor():
807807
# Create a client
808-
client = documentai_v1beta3.DocumentProcessorServiceClient()
808+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
809809
810810
# Initialize request argument(s)
811811
request = documentai_v1beta3.DeleteProcessorRequest(
@@ -817,7 +817,7 @@ def sample_delete_processor():
817817
818818
print("Waiting for operation to complete...")
819819
820-
response = operation.result()
820+
response = await operation.result()
821821
822822
# Handle the response
823823
print(response)
@@ -922,9 +922,9 @@ async def enable_processor(
922922
923923
from google.cloud import documentai_v1beta3
924924
925-
def sample_enable_processor():
925+
async def sample_enable_processor():
926926
# Create a client
927-
client = documentai_v1beta3.DocumentProcessorServiceClient()
927+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
928928
929929
# Initialize request argument(s)
930930
request = documentai_v1beta3.EnableProcessorRequest(
@@ -936,7 +936,7 @@ def sample_enable_processor():
936936
937937
print("Waiting for operation to complete...")
938938
939-
response = operation.result()
939+
response = await operation.result()
940940
941941
# Handle the response
942942
print(response)
@@ -1010,9 +1010,9 @@ async def disable_processor(
10101010
10111011
from google.cloud import documentai_v1beta3
10121012
1013-
def sample_disable_processor():
1013+
async def sample_disable_processor():
10141014
# Create a client
1015-
client = documentai_v1beta3.DocumentProcessorServiceClient()
1015+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
10161016
10171017
# Initialize request argument(s)
10181018
request = documentai_v1beta3.DisableProcessorRequest(
@@ -1024,7 +1024,7 @@ def sample_disable_processor():
10241024
10251025
print("Waiting for operation to complete...")
10261026
1027-
response = operation.result()
1027+
response = await operation.result()
10281028
10291029
# Handle the response
10301030
print(response)
@@ -1100,9 +1100,9 @@ async def review_document(
11001100
11011101
from google.cloud import documentai_v1beta3
11021102
1103-
def sample_review_document():
1103+
async def sample_review_document():
11041104
# Create a client
1105-
client = documentai_v1beta3.DocumentProcessorServiceClient()
1105+
client = documentai_v1beta3.DocumentProcessorServiceAsyncClient()
11061106
11071107
# Initialize request argument(s)
11081108
inline_document = documentai_v1beta3.Document()
@@ -1118,7 +1118,7 @@ def sample_review_document():
11181118
11191119
print("Waiting for operation to complete...")
11201120
1121-
response = operation.result()
1121+
response = await operation.result()
11221122
11231123
# Handle the response
11241124
print(response)

packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ class Entity(proto.Message):
880880
into the
881881
[Document.text][google.cloud.documentai.v1beta3.Document.text].
882882
type_ (str):
883-
Entity type from a schema e.g. ``Address``.
883+
Required. Entity type from a schema e.g. ``Address``.
884884
mention_text (str):
885885
Optional. Text value in the document e.g.
886886
``1600 Amphitheatre Pkwy``. If the entity is not present in

0 commit comments

Comments
 (0)