Skip to content

Commit

Permalink
docs: Add documentation for enums (#448)
Browse files Browse the repository at this point in the history
* 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: googleapis/googleapis@a391fd1

Source-Link: googleapis/googleapis-gen@0080f83
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 <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jan 20, 2023
1 parent a4b6d4d commit 77e3cbf
Show file tree
Hide file tree
Showing 19 changed files with 604 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading

0 comments on commit 77e3cbf

Please sign in to comment.