From 61256d1728e17dc8b04cd4166e286a4f76c6018a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 13:27:30 -0500 Subject: [PATCH 1/2] docs: Add documentation for enums (#448) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: https://github.com/googleapis/googleapis/commit/a391fd1dac18dfdfa00c18c8404f2c3a6ff8e98e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../document_processor_service/client.py | 2 +- google/cloud/documentai_v1/types/document.py | 89 ++++++++++++++++++- .../types/document_processor_service.py | 67 +++++++++++++- .../documentai_v1/types/document_schema.py | 16 ++++ .../documentai_v1/types/operation_metadata.py | 17 +++- google/cloud/documentai_v1/types/processor.py | 61 ++++++++++++- .../document_understanding_service/client.py | 2 +- .../documentai_v1beta2/types/document.py | 69 +++++++++++++- .../types/document_understanding.py | 20 ++++- .../document_processor_service/client.py | 2 +- .../documentai_v1beta3/types/document.py | 89 ++++++++++++++++++- .../types/document_processor_service.py | 84 +++++++++++++++-- .../types/document_schema.py | 16 ++++ .../documentai_v1beta3/types/evaluation.py | 18 +++- .../types/operation_metadata.py | 17 +++- .../documentai_v1beta3/types/processor.py | 61 ++++++++++++- ...t_metadata_google.cloud.documentai.v1.json | 2 +- ...adata_google.cloud.documentai.v1beta2.json | 2 +- ...adata_google.cloud.documentai.v1beta3.json | 2 +- 19 files changed, 604 insertions(+), 32 deletions(-) diff --git a/google/cloud/documentai_v1/services/document_processor_service/client.py b/google/cloud/documentai_v1/services/document_processor_service/client.py index 165cce11..255b9828 100644 --- a/google/cloud/documentai_v1/services/document_processor_service/client.py +++ b/google/cloud/documentai_v1/services/document_processor_service/client.py @@ -2623,7 +2623,7 @@ def sample_review_document(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "DocumentProcessorServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/documentai_v1/types/document.py b/google/cloud/documentai_v1/types/document.py index 6e1090aa..00ad692c 100644 --- a/google/cloud/documentai_v1/types/document.py +++ b/google/cloud/documentai_v1/types/document.py @@ -396,7 +396,25 @@ class Layout(proto.Message): """ class Orientation(proto.Enum): - r"""Detected human reading orientation.""" + r"""Detected human reading orientation. + + Values: + ORIENTATION_UNSPECIFIED (0): + Unspecified orientation. + PAGE_UP (1): + Orientation is aligned with page up. + PAGE_RIGHT (2): + Orientation is aligned with page right. + Turn the head 90 degrees clockwise from upright + to read. + PAGE_DOWN (3): + Orientation is aligned with page down. + Turn the head 180 degrees from upright to read. + PAGE_LEFT (4): + Orientation is aligned with page left. + Turn the head 90 degrees counterclockwise from + upright to read. + """ ORIENTATION_UNSPECIFIED = 0 PAGE_UP = 1 PAGE_RIGHT = 2 @@ -551,7 +569,19 @@ class DetectedBreak(proto.Message): """ class Type(proto.Enum): - r"""Enum to denote the type of break found.""" + r"""Enum to denote the type of break found. + + Values: + TYPE_UNSPECIFIED (0): + Unspecified break type. + SPACE (1): + A single whitespace. + WIDE_SPACE (2): + A wider whitespace. + HYPHEN (3): + A hyphen that indicates that a token has been + split across lines. + """ TYPE_UNSPECIFIED = 0 SPACE = 1 WIDE_SPACE = 2 @@ -1344,7 +1374,40 @@ class PageRef(proto.Message): """ class LayoutType(proto.Enum): - r"""The type of layout that is being referenced.""" + r"""The type of layout that is being referenced. + + Values: + LAYOUT_TYPE_UNSPECIFIED (0): + Layout Unspecified. + BLOCK (1): + References a + [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] + element. + PARAGRAPH (2): + References a + [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] + element. + LINE (3): + References a + [Page.lines][google.cloud.documentai.v1.Document.Page.lines] + element. + TOKEN (4): + References a + [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] + element. + VISUAL_ELEMENT (5): + References a + [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] + element. + TABLE (6): + Refrrences a + [Page.tables][google.cloud.documentai.v1.Document.Page.tables] + element. + FORM_FIELD (7): + References a + [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] + element. + """ LAYOUT_TYPE_UNSPECIFIED = 0 BLOCK = 1 PARAGRAPH = 2 @@ -1404,6 +1467,26 @@ class Provenance(proto.Message): class OperationType(proto.Enum): r"""If a processor or agent does an explicit operation on existing elements. + + Values: + OPERATION_TYPE_UNSPECIFIED (0): + Operation type unspecified. If no operation is specified a + provenance entry is simply used to match against a + ``parent``. + ADD (1): + Add an element. + REMOVE (2): + Remove an element identified by ``parent``. + REPLACE (3): + Replace an element identified by ``parent``. + EVAL_REQUESTED (4): + Request human review for the element identified by + ``parent``. + EVAL_APPROVED (5): + Element is reviewed and approved at human + review, confidence will be set to 1.0. + EVAL_SKIPPED (6): + Element is skipped in the validation process. """ OPERATION_TYPE_UNSPECIFIED = 0 ADD = 1 diff --git a/google/cloud/documentai_v1/types/document_processor_service.py b/google/cloud/documentai_v1/types/document_processor_service.py index c830a017..ec45701e 100644 --- a/google/cloud/documentai_v1/types/document_processor_service.py +++ b/google/cloud/documentai_v1/types/document_processor_service.py @@ -161,7 +161,27 @@ class HumanReviewStatus(proto.Message): """ class State(proto.Enum): - r"""The final state of human review on a processed document.""" + r"""The final state of human review on a processed document. + + Values: + STATE_UNSPECIFIED (0): + Human review state is unspecified. Most + likely due to an internal error. + SKIPPED (1): + Human review is skipped for the document. + This can happen because human review is not + enabled on the processor or the processing + request has been set to skip this document. + VALIDATION_PASSED (2): + Human review validation is triggered and + passed, so no review is needed. + IN_PROGRESS (3): + Human review validation is triggered and the + document is under review. + ERROR (4): + Some error happened during triggering human review, see the + [state_message] for details. + """ STATE_UNSPECIFIED = 0 SKIPPED = 1 VALIDATION_PASSED = 2 @@ -272,7 +292,25 @@ class BatchProcessMetadata(proto.Message): """ class State(proto.Enum): - r"""Possible states of the batch processing operation.""" + r"""Possible states of the batch processing operation. + + Values: + STATE_UNSPECIFIED (0): + The default value. This value is used if the + state is omitted. + WAITING (1): + Request operation is waiting for scheduling. + RUNNING (2): + Request is being processed. + SUCCEEDED (3): + The batch processing completed successfully. + CANCELLING (4): + The batch processing was being cancelled. + CANCELLED (5): + The batch processing was cancelled. + FAILED (6): + The batch processing has failed. + """ STATE_UNSPECIFIED = 0 WAITING = 1 RUNNING = 2 @@ -918,7 +956,17 @@ class ReviewDocumentRequest(proto.Message): """ class Priority(proto.Enum): - r"""The priority level of the human review task.""" + r"""The priority level of the human review task. + + Values: + DEFAULT (0): + The default priority level. + URGENT (1): + The urgent priority level. The labeling + manager should allocate labeler resource to the + urgent task queue to respect this priority + level. + """ DEFAULT = 0 URGENT = 1 @@ -963,7 +1011,18 @@ class ReviewDocumentResponse(proto.Message): """ class State(proto.Enum): - r"""Possible states of the review operation.""" + r"""Possible states of the review operation. + + Values: + STATE_UNSPECIFIED (0): + The default value. This value is used if the + state is omitted. + REJECTED (1): + The review operation is rejected by the + reviewer. + SUCCEEDED (2): + The review operation is succeeded. + """ STATE_UNSPECIFIED = 0 REJECTED = 1 SUCCEEDED = 2 diff --git a/google/cloud/documentai_v1/types/document_schema.py b/google/cloud/documentai_v1/types/document_schema.py index f81539dc..2a2bba61 100644 --- a/google/cloud/documentai_v1/types/document_schema.py +++ b/google/cloud/documentai_v1/types/document_schema.py @@ -119,6 +119,22 @@ class OccurrenceType(proto.Enum): r"""Types of occurrences of the entity type in the document. Note: this represents the number of instances of an entity types, not number of mentions of a given entity instance. + + Values: + OCCURRENCE_TYPE_UNSPECIFIED (0): + Unspecified occurrence type. + OPTIONAL_ONCE (1): + There will be zero or one instance of this + entity type. + OPTIONAL_MULTIPLE (2): + The entity type will appear zero or multiple + times. + REQUIRED_ONCE (3): + The entity type will only appear exactly + once. + REQUIRED_MULTIPLE (4): + The entity type will appear once or more + times. """ OCCURRENCE_TYPE_UNSPECIFIED = 0 OPTIONAL_ONCE = 1 diff --git a/google/cloud/documentai_v1/types/operation_metadata.py b/google/cloud/documentai_v1/types/operation_metadata.py index cf69485d..406d5581 100644 --- a/google/cloud/documentai_v1/types/operation_metadata.py +++ b/google/cloud/documentai_v1/types/operation_metadata.py @@ -44,7 +44,22 @@ class CommonOperationMetadata(proto.Message): """ class State(proto.Enum): - r"""State of the longrunning operation.""" + r"""State of the longrunning operation. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + RUNNING (1): + Operation is still running. + CANCELLING (2): + Operation is being cancelled. + SUCCEEDED (3): + Operation succeeded. + FAILED (4): + Operation failed. + CANCELLED (5): + Operation is cancelled. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 CANCELLING = 2 diff --git a/google/cloud/documentai_v1/types/processor.py b/google/cloud/documentai_v1/types/processor.py index 876b04e1..b61d11f0 100644 --- a/google/cloud/documentai_v1/types/processor.py +++ b/google/cloud/documentai_v1/types/processor.py @@ -64,7 +64,30 @@ class ProcessorVersion(proto.Message): """ class State(proto.Enum): - r"""The possible states of the processor version.""" + r"""The possible states of the processor version. + + Values: + STATE_UNSPECIFIED (0): + The processor version is in an unspecified + state. + DEPLOYED (1): + The processor version is deployed and can be + used for processing. + DEPLOYING (2): + The processor version is being deployed. + UNDEPLOYED (3): + The processor version is not deployed and + cannot be used for processing. + UNDEPLOYING (4): + The processor version is being undeployed. + CREATING (5): + The processor version is being created. + DELETING (6): + The processor version is being deleted. + FAILED (7): + The processor version failed and is in an + indeterminate state. + """ STATE_UNSPECIFIED = 0 DEPLOYED = 1 DEPLOYING = 2 @@ -171,7 +194,41 @@ class Processor(proto.Message): """ class State(proto.Enum): - r"""The possible states of the processor.""" + r"""The possible states of the processor. + + Values: + STATE_UNSPECIFIED (0): + The processor is in an unspecified state. + ENABLED (1): + The processor is enabled, i.e., has an + enabled version which can currently serve + processing requests and all the feature + dependencies have been successfully initialized. + DISABLED (2): + The processor is disabled. + ENABLING (3): + The processor is being enabled, will become ``ENABLED`` if + successful. + DISABLING (4): + The processor is being disabled, will become ``DISABLED`` if + successful. + CREATING (5): + The processor is being created, will become either + ``ENABLED`` (for successful creation) or ``FAILED`` (for + failed ones). Once a processor is in this state, it can then + be used for document processing, but the feature + dependencies of the processor might not be fully created + yet. + FAILED (6): + The processor failed during creation or + initialization of feature dependencies. The user + should delete the processor and recreate one as + all the functionalities of the processor are + disabled. + DELETING (7): + The processor is being deleted, will be + removed if successful. + """ STATE_UNSPECIFIED = 0 ENABLED = 1 DISABLED = 2 diff --git a/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py b/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py index de52e8a8..1e1496e9 100644 --- a/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py +++ b/google/cloud/documentai_v1beta2/services/document_understanding_service/client.py @@ -646,7 +646,7 @@ def sample_process_document(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "DocumentUnderstandingServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/documentai_v1beta2/types/document.py b/google/cloud/documentai_v1beta2/types/document.py index 89633a8c..541ad865 100644 --- a/google/cloud/documentai_v1beta2/types/document.py +++ b/google/cloud/documentai_v1beta2/types/document.py @@ -340,7 +340,25 @@ class Layout(proto.Message): """ class Orientation(proto.Enum): - r"""Detected human reading orientation.""" + r"""Detected human reading orientation. + + Values: + ORIENTATION_UNSPECIFIED (0): + Unspecified orientation. + PAGE_UP (1): + Orientation is aligned with page up. + PAGE_RIGHT (2): + Orientation is aligned with page right. + Turn the head 90 degrees clockwise from upright + to read. + PAGE_DOWN (3): + Orientation is aligned with page down. + Turn the head 180 degrees from upright to read. + PAGE_LEFT (4): + Orientation is aligned with page left. + Turn the head 90 degrees counterclockwise from + upright to read. + """ ORIENTATION_UNSPECIFIED = 0 PAGE_UP = 1 PAGE_RIGHT = 2 @@ -479,7 +497,19 @@ class DetectedBreak(proto.Message): """ class Type(proto.Enum): - r"""Enum to denote the type of break found.""" + r"""Enum to denote the type of break found. + + Values: + TYPE_UNSPECIFIED (0): + Unspecified break type. + SPACE (1): + A single whitespace. + WIDE_SPACE (2): + A wider whitespace. + HYPHEN (3): + A hyphen that indicates that a token has been + split across lines. + """ TYPE_UNSPECIFIED = 0 SPACE = 1 WIDE_SPACE = 2 @@ -961,7 +991,40 @@ class PageRef(proto.Message): """ class LayoutType(proto.Enum): - r"""The type of layout that is being referenced.""" + r"""The type of layout that is being referenced. + + Values: + LAYOUT_TYPE_UNSPECIFIED (0): + Layout Unspecified. + BLOCK (1): + References a + [Page.blocks][google.cloud.documentai.v1beta2.Document.Page.blocks] + element. + PARAGRAPH (2): + References a + [Page.paragraphs][google.cloud.documentai.v1beta2.Document.Page.paragraphs] + element. + LINE (3): + References a + [Page.lines][google.cloud.documentai.v1beta2.Document.Page.lines] + element. + TOKEN (4): + References a + [Page.tokens][google.cloud.documentai.v1beta2.Document.Page.tokens] + element. + VISUAL_ELEMENT (5): + References a + [Page.visual_elements][google.cloud.documentai.v1beta2.Document.Page.visual_elements] + element. + TABLE (6): + Refrrences a + [Page.tables][google.cloud.documentai.v1beta2.Document.Page.tables] + element. + FORM_FIELD (7): + References a + [Page.form_fields][google.cloud.documentai.v1beta2.Document.Page.form_fields] + element. + """ LAYOUT_TYPE_UNSPECIFIED = 0 BLOCK = 1 PARAGRAPH = 2 diff --git a/google/cloud/documentai_v1beta2/types/document_understanding.py b/google/cloud/documentai_v1beta2/types/document_understanding.py index 2c38cff7..725d48e3 100644 --- a/google/cloud/documentai_v1beta2/types/document_understanding.py +++ b/google/cloud/documentai_v1beta2/types/document_understanding.py @@ -540,7 +540,25 @@ class OperationMetadata(proto.Message): """ class State(proto.Enum): - r"""""" + r""" + + Values: + STATE_UNSPECIFIED (0): + The default value. This value is used if the + state is omitted. + ACCEPTED (1): + Request is received. + WAITING (2): + Request operation is waiting for scheduling. + RUNNING (3): + Request is being processed. + SUCCEEDED (4): + The batch processing completed successfully. + CANCELLED (5): + The batch processing was cancelled. + FAILED (6): + The batch processing has failed. + """ STATE_UNSPECIFIED = 0 ACCEPTED = 1 WAITING = 2 diff --git a/google/cloud/documentai_v1beta3/services/document_processor_service/client.py b/google/cloud/documentai_v1beta3/services/document_processor_service/client.py index 77f1fe8e..b07d558f 100644 --- a/google/cloud/documentai_v1beta3/services/document_processor_service/client.py +++ b/google/cloud/documentai_v1beta3/services/document_processor_service/client.py @@ -3139,7 +3139,7 @@ def sample_list_evaluations(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "DocumentProcessorServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/documentai_v1beta3/types/document.py b/google/cloud/documentai_v1beta3/types/document.py index 7525315b..aac98f6a 100644 --- a/google/cloud/documentai_v1beta3/types/document.py +++ b/google/cloud/documentai_v1beta3/types/document.py @@ -396,7 +396,25 @@ class Layout(proto.Message): """ class Orientation(proto.Enum): - r"""Detected human reading orientation.""" + r"""Detected human reading orientation. + + Values: + ORIENTATION_UNSPECIFIED (0): + Unspecified orientation. + PAGE_UP (1): + Orientation is aligned with page up. + PAGE_RIGHT (2): + Orientation is aligned with page right. + Turn the head 90 degrees clockwise from upright + to read. + PAGE_DOWN (3): + Orientation is aligned with page down. + Turn the head 180 degrees from upright to read. + PAGE_LEFT (4): + Orientation is aligned with page left. + Turn the head 90 degrees counterclockwise from + upright to read. + """ ORIENTATION_UNSPECIFIED = 0 PAGE_UP = 1 PAGE_RIGHT = 2 @@ -554,7 +572,19 @@ class DetectedBreak(proto.Message): """ class Type(proto.Enum): - r"""Enum to denote the type of break found.""" + r"""Enum to denote the type of break found. + + Values: + TYPE_UNSPECIFIED (0): + Unspecified break type. + SPACE (1): + A single whitespace. + WIDE_SPACE (2): + A wider whitespace. + HYPHEN (3): + A hyphen that indicates that a token has been + split across lines. + """ TYPE_UNSPECIFIED = 0 SPACE = 1 WIDE_SPACE = 2 @@ -1348,7 +1378,40 @@ class PageRef(proto.Message): """ class LayoutType(proto.Enum): - r"""The type of layout that is being referenced.""" + r"""The type of layout that is being referenced. + + Values: + LAYOUT_TYPE_UNSPECIFIED (0): + Layout Unspecified. + BLOCK (1): + References a + [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks] + element. + PARAGRAPH (2): + References a + [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] + element. + LINE (3): + References a + [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] + element. + TOKEN (4): + References a + [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] + element. + VISUAL_ELEMENT (5): + References a + [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] + element. + TABLE (6): + Refrrences a + [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] + element. + FORM_FIELD (7): + References a + [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] + element. + """ LAYOUT_TYPE_UNSPECIFIED = 0 BLOCK = 1 PARAGRAPH = 2 @@ -1408,6 +1471,26 @@ class Provenance(proto.Message): class OperationType(proto.Enum): r"""If a processor or agent does an explicit operation on existing elements. + + Values: + OPERATION_TYPE_UNSPECIFIED (0): + Operation type unspecified. If no operation is specified a + provenance entry is simply used to match against a + ``parent``. + ADD (1): + Add an element. + REMOVE (2): + Remove an element identified by ``parent``. + REPLACE (3): + Replace an element identified by ``parent``. + EVAL_REQUESTED (4): + Request human review for the element identified by + ``parent``. + EVAL_APPROVED (5): + Element is reviewed and approved at human + review, confidence will be set to 1.0. + EVAL_SKIPPED (6): + Element is skipped in the validation process. """ OPERATION_TYPE_UNSPECIFIED = 0 ADD = 1 diff --git a/google/cloud/documentai_v1beta3/types/document_processor_service.py b/google/cloud/documentai_v1beta3/types/document_processor_service.py index 61d83f21..22af3e2f 100644 --- a/google/cloud/documentai_v1beta3/types/document_processor_service.py +++ b/google/cloud/documentai_v1beta3/types/document_processor_service.py @@ -203,7 +203,27 @@ class HumanReviewStatus(proto.Message): """ class State(proto.Enum): - r"""The final state of human review on a processed document.""" + r"""The final state of human review on a processed document. + + Values: + STATE_UNSPECIFIED (0): + Human review state is unspecified. Most + likely due to an internal error. + SKIPPED (1): + Human review is skipped for the document. + This can happen because human review is not + enabled on the processor or the processing + request has been set to skip this document. + VALIDATION_PASSED (2): + Human review validation is triggered and + passed, so no review is needed. + IN_PROGRESS (3): + Human review validation is triggered and the + document is under review. + ERROR (4): + Some error happened during triggering human review, see the + [state_message] for details. + """ STATE_UNSPECIFIED = 0 SKIPPED = 1 VALIDATION_PASSED = 2 @@ -384,7 +404,25 @@ class BatchProcessMetadata(proto.Message): """ class State(proto.Enum): - r"""Possible states of the batch processing operation.""" + r"""Possible states of the batch processing operation. + + Values: + STATE_UNSPECIFIED (0): + The default value. This value is used if the + state is omitted. + WAITING (1): + Request operation is waiting for scheduling. + RUNNING (2): + Request is being processed. + SUCCEEDED (3): + The batch processing completed successfully. + CANCELLING (4): + The batch processing was being cancelled. + CANCELLED (5): + The batch processing was cancelled. + FAILED (6): + The batch processing has failed. + """ STATE_UNSPECIFIED = 0 WAITING = 1 RUNNING = 2 @@ -1200,7 +1238,17 @@ class ReviewDocumentRequest(proto.Message): """ class Priority(proto.Enum): - r"""The priority level of the human review task.""" + r"""The priority level of the human review task. + + Values: + DEFAULT (0): + The default priority level. + URGENT (1): + The urgent priority level. The labeling + manager should allocate labeler resource to the + urgent task queue to respect this priority + level. + """ DEFAULT = 0 URGENT = 1 @@ -1250,7 +1298,18 @@ class ReviewDocumentResponse(proto.Message): """ class State(proto.Enum): - r"""Possible states of the review operation.""" + r"""Possible states of the review operation. + + Values: + STATE_UNSPECIFIED (0): + The default value. This value is used if the + state is omitted. + REJECTED (1): + The review operation is rejected by the + reviewer. + SUCCEEDED (2): + The review operation is succeeded. + """ STATE_UNSPECIFIED = 0 REJECTED = 1 SUCCEEDED = 2 @@ -1293,7 +1352,22 @@ class ReviewDocumentOperationMetadata(proto.Message): """ class State(proto.Enum): - r"""State of the longrunning operation.""" + r"""State of the longrunning operation. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + RUNNING (1): + Operation is still running. + CANCELLING (2): + Operation is being cancelled. + SUCCEEDED (3): + Operation succeeded. + FAILED (4): + Operation failed. + CANCELLED (5): + Operation is cancelled. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 CANCELLING = 2 diff --git a/google/cloud/documentai_v1beta3/types/document_schema.py b/google/cloud/documentai_v1beta3/types/document_schema.py index 0092fcba..e84ee3bc 100644 --- a/google/cloud/documentai_v1beta3/types/document_schema.py +++ b/google/cloud/documentai_v1beta3/types/document_schema.py @@ -119,6 +119,22 @@ class OccurrenceType(proto.Enum): r"""Types of occurrences of the entity type in the document. Note: this represents the number of instances of an entity types, not number of mentions of a given entity instance. + + Values: + OCCURRENCE_TYPE_UNSPECIFIED (0): + Unspecified occurrence type. + OPTIONAL_ONCE (1): + There will be zero or one instance of this + entity type. + OPTIONAL_MULTIPLE (2): + The entity type will appear zero or multiple + times. + REQUIRED_ONCE (3): + The entity type will only appear exactly + once. + REQUIRED_MULTIPLE (4): + The entity type will appear once or more + times. """ OCCURRENCE_TYPE_UNSPECIFIED = 0 OPTIONAL_ONCE = 1 diff --git a/google/cloud/documentai_v1beta3/types/evaluation.py b/google/cloud/documentai_v1beta3/types/evaluation.py index c0cd3b61..b73c0b70 100644 --- a/google/cloud/documentai_v1beta3/types/evaluation.py +++ b/google/cloud/documentai_v1beta3/types/evaluation.py @@ -212,7 +212,23 @@ class MultiConfidenceMetrics(proto.Message): """ class MetricsType(proto.Enum): - r"""A type that determines how metrics should be interpreted.""" + r"""A type that determines how metrics should be interpreted. + + Values: + METRICS_TYPE_UNSPECIFIED (0): + The metrics type is unspecified. By default, + metrics without a particular specification are + for leaf entity types (i.e., top-level entity + types without child types, or child types which + are not parent types themselves). + AGGREGATE (1): + Indicates whether metrics for this particular + label type represent an aggregate of metrics for + other types instead of being based on actual + TP/FP/FN values for the label type. Metrics for + parent (i.e., non-leaf) entity types are an + aggregate of metrics for their children. + """ METRICS_TYPE_UNSPECIFIED = 0 AGGREGATE = 1 diff --git a/google/cloud/documentai_v1beta3/types/operation_metadata.py b/google/cloud/documentai_v1beta3/types/operation_metadata.py index e1a6b403..3e59c619 100644 --- a/google/cloud/documentai_v1beta3/types/operation_metadata.py +++ b/google/cloud/documentai_v1beta3/types/operation_metadata.py @@ -44,7 +44,22 @@ class CommonOperationMetadata(proto.Message): """ class State(proto.Enum): - r"""State of the longrunning operation.""" + r"""State of the longrunning operation. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + RUNNING (1): + Operation is still running. + CANCELLING (2): + Operation is being cancelled. + SUCCEEDED (3): + Operation succeeded. + FAILED (4): + Operation failed. + CANCELLED (5): + Operation is cancelled. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 CANCELLING = 2 diff --git a/google/cloud/documentai_v1beta3/types/processor.py b/google/cloud/documentai_v1beta3/types/processor.py index c0510d67..0a4eb1f3 100644 --- a/google/cloud/documentai_v1beta3/types/processor.py +++ b/google/cloud/documentai_v1beta3/types/processor.py @@ -64,7 +64,30 @@ class ProcessorVersion(proto.Message): """ class State(proto.Enum): - r"""The possible states of the processor version.""" + r"""The possible states of the processor version. + + Values: + STATE_UNSPECIFIED (0): + The processor version is in an unspecified + state. + DEPLOYED (1): + The processor version is deployed and can be + used for processing. + DEPLOYING (2): + The processor version is being deployed. + UNDEPLOYED (3): + The processor version is not deployed and + cannot be used for processing. + UNDEPLOYING (4): + The processor version is being undeployed. + CREATING (5): + The processor version is being created. + DELETING (6): + The processor version is being deleted. + FAILED (7): + The processor version failed and is in an + indeterminate state. + """ STATE_UNSPECIFIED = 0 DEPLOYED = 1 DEPLOYING = 2 @@ -171,7 +194,41 @@ class Processor(proto.Message): """ class State(proto.Enum): - r"""The possible states of the processor.""" + r"""The possible states of the processor. + + Values: + STATE_UNSPECIFIED (0): + The processor is in an unspecified state. + ENABLED (1): + The processor is enabled, i.e., has an + enabled version which can currently serve + processing requests and all the feature + dependencies have been successfully initialized. + DISABLED (2): + The processor is disabled. + ENABLING (3): + The processor is being enabled, will become ``ENABLED`` if + successful. + DISABLING (4): + The processor is being disabled, will become ``DISABLED`` if + successful. + CREATING (5): + The processor is being created, will become either + ``ENABLED`` (for successful creation) or ``FAILED`` (for + failed ones). Once a processor is in this state, it can then + be used for document processing, but the feature + dependencies of the processor might not be fully created + yet. + FAILED (6): + The processor failed during creation or + initialization of feature dependencies. The user + should delete the processor and recreate one as + all the functionalities of the processor are + disabled. + DELETING (7): + The processor is being deleted, will be + removed if successful. + """ STATE_UNSPECIFIED = 0 ENABLED = 1 DISABLED = 2 diff --git a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json index 48cfeb17..0df77e65 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-documentai", - "version": "2.9.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json index 10c94686..ef56bd7e 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-documentai", - "version": "2.9.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json index c8212825..f02752f1 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-documentai", - "version": "2.9.0" + "version": "0.1.0" }, "snippets": [ { From 3a8ac94c2550bf4bb12e0987e8311b781f38df05 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 13:06:13 -0600 Subject: [PATCH 2/2] chore(main): release 2.9.1 (#449) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ google/cloud/documentai/gapic_version.py | 2 +- google/cloud/documentai_v1/gapic_version.py | 2 +- google/cloud/documentai_v1beta2/gapic_version.py | 2 +- google/cloud/documentai_v1beta3/gapic_version.py | 2 +- .../snippet_metadata_google.cloud.documentai.v1.json | 2 +- ...pet_metadata_google.cloud.documentai.v1beta2.json | 2 +- ...pet_metadata_google.cloud.documentai.v1beta3.json | 2 +- 9 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6bb50d96..13a0da6b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.9.0" + ".": "2.9.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 85aa6ba3..c16ae839 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.9.1](https://github.com/googleapis/python-documentai/compare/v2.9.0...v2.9.1) (2023-01-20) + + +### Bug Fixes + +* Add context manager return types ([61256d1](https://github.com/googleapis/python-documentai/commit/61256d1728e17dc8b04cd4166e286a4f76c6018a)) + + +### Documentation + +* Add documentation for enums ([61256d1](https://github.com/googleapis/python-documentai/commit/61256d1728e17dc8b04cd4166e286a4f76c6018a)) + ## [2.9.0](https://github.com/googleapis/python-documentai/compare/v2.8.0...v2.9.0) (2023-01-17) diff --git a/google/cloud/documentai/gapic_version.py b/google/cloud/documentai/gapic_version.py index 60aeb18d..18081a7d 100644 --- a/google/cloud/documentai/gapic_version.py +++ b/google/cloud/documentai/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.9.0" # {x-release-please-version} +__version__ = "2.9.1" # {x-release-please-version} diff --git a/google/cloud/documentai_v1/gapic_version.py b/google/cloud/documentai_v1/gapic_version.py index 60aeb18d..18081a7d 100644 --- a/google/cloud/documentai_v1/gapic_version.py +++ b/google/cloud/documentai_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.9.0" # {x-release-please-version} +__version__ = "2.9.1" # {x-release-please-version} diff --git a/google/cloud/documentai_v1beta2/gapic_version.py b/google/cloud/documentai_v1beta2/gapic_version.py index 60aeb18d..18081a7d 100644 --- a/google/cloud/documentai_v1beta2/gapic_version.py +++ b/google/cloud/documentai_v1beta2/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.9.0" # {x-release-please-version} +__version__ = "2.9.1" # {x-release-please-version} diff --git a/google/cloud/documentai_v1beta3/gapic_version.py b/google/cloud/documentai_v1beta3/gapic_version.py index 60aeb18d..18081a7d 100644 --- a/google/cloud/documentai_v1beta3/gapic_version.py +++ b/google/cloud/documentai_v1beta3/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.9.0" # {x-release-please-version} +__version__ = "2.9.1" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json index 0df77e65..2baa0243 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-documentai", - "version": "0.1.0" + "version": "2.9.1" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json index ef56bd7e..15972380 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-documentai", - "version": "0.1.0" + "version": "2.9.1" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json index f02752f1..42474b5f 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-documentai", - "version": "0.1.0" + "version": "2.9.1" }, "snippets": [ {