Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit 3e9cde4

Browse files
docs: Add documentation for enums (#513)
* 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: 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f7d983c commit 3e9cde4

File tree

26 files changed

+920
-32
lines changed

26 files changed

+920
-32
lines changed

google/cloud/vision_v1/services/image_annotator/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ def sample_async_batch_annotate_files():
944944
# Done; return the response.
945945
return response
946946

947-
def __enter__(self):
947+
def __enter__(self) -> "ImageAnnotatorClient":
948948
return self
949949

950950
def __exit__(self, type, value, traceback):

google/cloud/vision_v1/services/product_search/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2863,7 +2863,7 @@ def sample_purge_products():
28632863
# Done; return the response.
28642864
return response
28652865

2866-
def __enter__(self):
2866+
def __enter__(self) -> "ProductSearchClient":
28672867
return self
28682868

28692869
def __exit__(self, type, value, traceback):

google/cloud/vision_v1/types/image_annotator.py

Lines changed: 142 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@
7777
class Likelihood(proto.Enum):
7878
r"""A bucketized representation of likelihood, which is intended
7979
to give clients highly stable results across model upgrades.
80+
81+
Values:
82+
UNKNOWN (0):
83+
Unknown likelihood.
84+
VERY_UNLIKELY (1):
85+
It is very unlikely.
86+
UNLIKELY (2):
87+
It is unlikely.
88+
POSSIBLE (3):
89+
It is possible.
90+
LIKELY (4):
91+
It is likely.
92+
VERY_LIKELY (5):
93+
It is very likely.
8094
"""
8195
UNKNOWN = 0
8296
VERY_UNLIKELY = 1
@@ -107,7 +121,43 @@ class Feature(proto.Message):
107121
"""
108122

109123
class Type(proto.Enum):
110-
r"""Type of Google Cloud Vision API feature to be extracted."""
124+
r"""Type of Google Cloud Vision API feature to be extracted.
125+
126+
Values:
127+
TYPE_UNSPECIFIED (0):
128+
Unspecified feature type.
129+
FACE_DETECTION (1):
130+
Run face detection.
131+
LANDMARK_DETECTION (2):
132+
Run landmark detection.
133+
LOGO_DETECTION (3):
134+
Run logo detection.
135+
LABEL_DETECTION (4):
136+
Run label detection.
137+
TEXT_DETECTION (5):
138+
Run text detection / optical character recognition (OCR).
139+
Text detection is optimized for areas of text within a
140+
larger image; if the image is a document, use
141+
``DOCUMENT_TEXT_DETECTION`` instead.
142+
DOCUMENT_TEXT_DETECTION (11):
143+
Run dense text document OCR. Takes precedence when both
144+
``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are
145+
present.
146+
SAFE_SEARCH_DETECTION (6):
147+
Run Safe Search to detect potentially unsafe
148+
or undesirable content.
149+
IMAGE_PROPERTIES (7):
150+
Compute a set of image properties, such as
151+
the image's dominant colors.
152+
CROP_HINTS (9):
153+
Run crop hints.
154+
WEB_DETECTION (10):
155+
Run web detection.
156+
PRODUCT_SEARCH (12):
157+
Run Product Search.
158+
OBJECT_LOCALIZATION (19):
159+
Run localizer for object detection.
160+
"""
111161
TYPE_UNSPECIFIED = 0
112162
FACE_DETECTION = 1
113163
LANDMARK_DETECTION = 2
@@ -283,6 +333,83 @@ class Type(proto.Enum):
283333
vantage of the viewer of the image without considering mirror
284334
projections typical of photos. So, ``LEFT_EYE``, typically, is the
285335
person's right eye.
336+
337+
Values:
338+
UNKNOWN_LANDMARK (0):
339+
Unknown face landmark detected. Should not be
340+
filled.
341+
LEFT_EYE (1):
342+
Left eye.
343+
RIGHT_EYE (2):
344+
Right eye.
345+
LEFT_OF_LEFT_EYEBROW (3):
346+
Left of left eyebrow.
347+
RIGHT_OF_LEFT_EYEBROW (4):
348+
Right of left eyebrow.
349+
LEFT_OF_RIGHT_EYEBROW (5):
350+
Left of right eyebrow.
351+
RIGHT_OF_RIGHT_EYEBROW (6):
352+
Right of right eyebrow.
353+
MIDPOINT_BETWEEN_EYES (7):
354+
Midpoint between eyes.
355+
NOSE_TIP (8):
356+
Nose tip.
357+
UPPER_LIP (9):
358+
Upper lip.
359+
LOWER_LIP (10):
360+
Lower lip.
361+
MOUTH_LEFT (11):
362+
Mouth left.
363+
MOUTH_RIGHT (12):
364+
Mouth right.
365+
MOUTH_CENTER (13):
366+
Mouth center.
367+
NOSE_BOTTOM_RIGHT (14):
368+
Nose, bottom right.
369+
NOSE_BOTTOM_LEFT (15):
370+
Nose, bottom left.
371+
NOSE_BOTTOM_CENTER (16):
372+
Nose, bottom center.
373+
LEFT_EYE_TOP_BOUNDARY (17):
374+
Left eye, top boundary.
375+
LEFT_EYE_RIGHT_CORNER (18):
376+
Left eye, right corner.
377+
LEFT_EYE_BOTTOM_BOUNDARY (19):
378+
Left eye, bottom boundary.
379+
LEFT_EYE_LEFT_CORNER (20):
380+
Left eye, left corner.
381+
RIGHT_EYE_TOP_BOUNDARY (21):
382+
Right eye, top boundary.
383+
RIGHT_EYE_RIGHT_CORNER (22):
384+
Right eye, right corner.
385+
RIGHT_EYE_BOTTOM_BOUNDARY (23):
386+
Right eye, bottom boundary.
387+
RIGHT_EYE_LEFT_CORNER (24):
388+
Right eye, left corner.
389+
LEFT_EYEBROW_UPPER_MIDPOINT (25):
390+
Left eyebrow, upper midpoint.
391+
RIGHT_EYEBROW_UPPER_MIDPOINT (26):
392+
Right eyebrow, upper midpoint.
393+
LEFT_EAR_TRAGION (27):
394+
Left ear tragion.
395+
RIGHT_EAR_TRAGION (28):
396+
Right ear tragion.
397+
LEFT_EYE_PUPIL (29):
398+
Left eye pupil.
399+
RIGHT_EYE_PUPIL (30):
400+
Right eye pupil.
401+
FOREHEAD_GLABELLA (31):
402+
Forehead glabella.
403+
CHIN_GNATHION (32):
404+
Chin gnathion.
405+
CHIN_LEFT_GONION (33):
406+
Chin left gonion.
407+
CHIN_RIGHT_GONION (34):
408+
Chin right gonion.
409+
LEFT_CHEEK_CENTER (35):
410+
Left cheek center.
411+
RIGHT_CHEEK_CENTER (36):
412+
Right cheek center.
286413
"""
287414
UNKNOWN_LANDMARK = 0
288415
LEFT_EYE = 1
@@ -1559,7 +1686,20 @@ class OperationMetadata(proto.Message):
15591686
"""
15601687

15611688
class State(proto.Enum):
1562-
r"""Batch operation states."""
1689+
r"""Batch operation states.
1690+
1691+
Values:
1692+
STATE_UNSPECIFIED (0):
1693+
Invalid.
1694+
CREATED (1):
1695+
Request is received.
1696+
RUNNING (2):
1697+
Request is actively being processed.
1698+
DONE (3):
1699+
The batch processing is done.
1700+
CANCELLED (4):
1701+
The batch processing was cancelled.
1702+
"""
15631703
STATE_UNSPECIFIED = 0
15641704
CREATED = 1
15651705
RUNNING = 2

google/cloud/vision_v1/types/product_search_service.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,24 @@ class BatchOperationMetadata(proto.Message):
997997
class State(proto.Enum):
998998
r"""Enumerates the possible states that the batch request can be
999999
in.
1000+
1001+
Values:
1002+
STATE_UNSPECIFIED (0):
1003+
Invalid.
1004+
PROCESSING (1):
1005+
Request is actively being processed.
1006+
SUCCESSFUL (2):
1007+
The request is done and at least one item has
1008+
been successfully processed.
1009+
FAILED (3):
1010+
The request is done and no item has been
1011+
successfully processed.
1012+
CANCELLED (4):
1013+
The request is done after the
1014+
longrunning.Operations.CancelOperation has been
1015+
called by the user. Any records that were
1016+
processed before the cancel command are output
1017+
as specified in the request.
10001018
"""
10011019
STATE_UNSPECIFIED = 0
10021020
PROCESSING = 1

google/cloud/vision_v1/types/text_annotation.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,24 @@ class DetectedBreak(proto.Message):
8282
"""
8383

8484
class BreakType(proto.Enum):
85-
r"""Enum to denote the type of break found. New line, space etc."""
85+
r"""Enum to denote the type of break found. New line, space etc.
86+
87+
Values:
88+
UNKNOWN (0):
89+
Unknown break label type.
90+
SPACE (1):
91+
Regular space.
92+
SURE_SPACE (2):
93+
Sure space (very wide).
94+
EOL_SURE_SPACE (3):
95+
Line-wrapping break.
96+
HYPHEN (4):
97+
End-line hyphen that is not present in text; does not
98+
co-occur with ``SPACE``, ``LEADER_SPACE``, or
99+
``LINE_BREAK``.
100+
LINE_BREAK (5):
101+
Line break that ends a paragraph.
102+
"""
86103
UNKNOWN = 0
87104
SPACE = 1
88105
SURE_SPACE = 2
@@ -221,7 +238,22 @@ class Block(proto.Message):
221238
"""
222239

223240
class BlockType(proto.Enum):
224-
r"""Type of a block (text, image etc) as identified by OCR."""
241+
r"""Type of a block (text, image etc) as identified by OCR.
242+
243+
Values:
244+
UNKNOWN (0):
245+
Unknown block type.
246+
TEXT (1):
247+
Regular text block.
248+
TABLE (2):
249+
Table block.
250+
PICTURE (3):
251+
Image block.
252+
RULER (4):
253+
Horizontal/vertical line box.
254+
BARCODE (5):
255+
Barcode block.
256+
"""
225257
UNKNOWN = 0
226258
TEXT = 1
227259
TABLE = 2

google/cloud/vision_v1p1beta1/services/image_annotator/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def sample_batch_annotate_images():
524524
# Done; return the response.
525525
return response
526526

527-
def __enter__(self):
527+
def __enter__(self) -> "ImageAnnotatorClient":
528528
return self
529529

530530
def __exit__(self, type, value, traceback):

0 commit comments

Comments
 (0)