Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit c81ac42

Browse files
docs: Add documentation for enums (#464)
* 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 3f94922 commit c81ac42

File tree

13 files changed

+180
-12
lines changed

13 files changed

+180
-12
lines changed

google/cloud/automl_v1/services/auto_ml/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2770,7 +2770,7 @@ def sample_list_model_evaluations():
27702770
# Done; return the response.
27712771
return response
27722772

2773-
def __enter__(self):
2773+
def __enter__(self) -> "AutoMlClient":
27742774
return self
27752775

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

google/cloud/automl_v1/services/prediction_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ def sample_batch_predict():
898898
# Done; return the response.
899899
return response
900900

901-
def __enter__(self):
901+
def __enter__(self) -> "PredictionServiceClient":
902902
return self
903903

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

google/cloud/automl_v1/types/classification.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@
2929

3030

3131
class ClassificationType(proto.Enum):
32-
r"""Type of the classification problem."""
32+
r"""Type of the classification problem.
33+
34+
Values:
35+
CLASSIFICATION_TYPE_UNSPECIFIED (0):
36+
An un-set value of this enum.
37+
MULTICLASS (1):
38+
At most one label is allowed per example.
39+
MULTILABEL (2):
40+
Multiple labels are allowed for one example.
41+
"""
3342
CLASSIFICATION_TYPE_UNSPECIFIED = 0
3443
MULTICLASS = 1
3544
MULTILABEL = 2

google/cloud/automl_v1/types/data_items.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,20 @@ class DocumentDimensions(proto.Message):
111111
"""
112112

113113
class DocumentDimensionUnit(proto.Enum):
114-
r"""Unit of the document dimension."""
114+
r"""Unit of the document dimension.
115+
116+
Values:
117+
DOCUMENT_DIMENSION_UNIT_UNSPECIFIED (0):
118+
Should not be used.
119+
INCH (1):
120+
Document dimension is measured in inches.
121+
CENTIMETER (2):
122+
Document dimension is measured in
123+
centimeters.
124+
POINT (3):
125+
Document dimension is measured in points. 72
126+
points = 1 inch.
127+
"""
115128
DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0
116129
INCH = 1
117130
CENTIMETER = 2
@@ -182,6 +195,42 @@ class Layout(proto.Message):
182195
class TextSegmentType(proto.Enum):
183196
r"""The type of TextSegment in the context of the original
184197
document.
198+
199+
Values:
200+
TEXT_SEGMENT_TYPE_UNSPECIFIED (0):
201+
Should not be used.
202+
TOKEN (1):
203+
The text segment is a token. e.g. word.
204+
PARAGRAPH (2):
205+
The text segment is a paragraph.
206+
FORM_FIELD (3):
207+
The text segment is a form field.
208+
FORM_FIELD_NAME (4):
209+
The text segment is the name part of a form field. It will
210+
be treated as child of another FORM_FIELD TextSegment if its
211+
span is subspan of another TextSegment with type FORM_FIELD.
212+
FORM_FIELD_CONTENTS (5):
213+
The text segment is the text content part of a form field.
214+
It will be treated as child of another FORM_FIELD
215+
TextSegment if its span is subspan of another TextSegment
216+
with type FORM_FIELD.
217+
TABLE (6):
218+
The text segment is a whole table, including
219+
headers, and all rows.
220+
TABLE_HEADER (7):
221+
The text segment is a table's headers. It
222+
will be treated as child of another TABLE
223+
TextSegment if its span is subspan of another
224+
TextSegment with type TABLE.
225+
TABLE_ROW (8):
226+
The text segment is a row in table. It will
227+
be treated as child of another TABLE TextSegment
228+
if its span is subspan of another TextSegment
229+
with type TABLE.
230+
TABLE_CELL (9):
231+
The text segment is a cell in table. It will be treated as
232+
child of another TABLE_ROW TextSegment if its span is
233+
subspan of another TextSegment with type TABLE_ROW.
185234
"""
186235
TEXT_SEGMENT_TYPE_UNSPECIFIED = 0
187236
TOKEN = 1

google/cloud/automl_v1/types/model.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,17 @@ class Model(proto.Message):
107107
"""
108108

109109
class DeploymentState(proto.Enum):
110-
r"""Deployment state of the model."""
110+
r"""Deployment state of the model.
111+
112+
Values:
113+
DEPLOYMENT_STATE_UNSPECIFIED (0):
114+
Should not be used, an un-set enum has this
115+
value by default.
116+
DEPLOYED (1):
117+
Model is deployed.
118+
UNDEPLOYED (2):
119+
Model is not deployed.
120+
"""
111121
DEPLOYMENT_STATE_UNSPECIFIED = 0
112122
DEPLOYED = 1
113123
UNDEPLOYED = 2

google/cloud/automl_v1beta1/services/auto_ml/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3468,7 +3468,7 @@ def sample_list_model_evaluations():
34683468
# Done; return the response.
34693469
return response
34703470

3471-
def __enter__(self):
3471+
def __enter__(self) -> "AutoMlClient":
34723472
return self
34733473

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

google/cloud/automl_v1beta1/services/prediction_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ def sample_batch_predict():
863863
# Done; return the response.
864864
return response
865865

866-
def __enter__(self):
866+
def __enter__(self) -> "PredictionServiceClient":
867867
return self
868868

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

google/cloud/automl_v1beta1/types/classification.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@
3232

3333

3434
class ClassificationType(proto.Enum):
35-
r"""Type of the classification problem."""
35+
r"""Type of the classification problem.
36+
37+
Values:
38+
CLASSIFICATION_TYPE_UNSPECIFIED (0):
39+
An un-set value of this enum.
40+
MULTICLASS (1):
41+
At most one label is allowed per example.
42+
MULTILABEL (2):
43+
Multiple labels are allowed for one example.
44+
"""
3645
CLASSIFICATION_TYPE_UNSPECIFIED = 0
3746
MULTICLASS = 1
3847
MULTILABEL = 2

google/cloud/automl_v1beta1/types/data_items.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,20 @@ class DocumentDimensions(proto.Message):
128128
"""
129129

130130
class DocumentDimensionUnit(proto.Enum):
131-
r"""Unit of the document dimension."""
131+
r"""Unit of the document dimension.
132+
133+
Values:
134+
DOCUMENT_DIMENSION_UNIT_UNSPECIFIED (0):
135+
Should not be used.
136+
INCH (1):
137+
Document dimension is measured in inches.
138+
CENTIMETER (2):
139+
Document dimension is measured in
140+
centimeters.
141+
POINT (3):
142+
Document dimension is measured in points. 72
143+
points = 1 inch.
144+
"""
132145
DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0
133146
INCH = 1
134147
CENTIMETER = 2
@@ -200,6 +213,42 @@ class Layout(proto.Message):
200213
class TextSegmentType(proto.Enum):
201214
r"""The type of TextSegment in the context of the original
202215
document.
216+
217+
Values:
218+
TEXT_SEGMENT_TYPE_UNSPECIFIED (0):
219+
Should not be used.
220+
TOKEN (1):
221+
The text segment is a token. e.g. word.
222+
PARAGRAPH (2):
223+
The text segment is a paragraph.
224+
FORM_FIELD (3):
225+
The text segment is a form field.
226+
FORM_FIELD_NAME (4):
227+
The text segment is the name part of a form field. It will
228+
be treated as child of another FORM_FIELD TextSegment if its
229+
span is subspan of another TextSegment with type FORM_FIELD.
230+
FORM_FIELD_CONTENTS (5):
231+
The text segment is the text content part of a form field.
232+
It will be treated as child of another FORM_FIELD
233+
TextSegment if its span is subspan of another TextSegment
234+
with type FORM_FIELD.
235+
TABLE (6):
236+
The text segment is a whole table, including
237+
headers, and all rows.
238+
TABLE_HEADER (7):
239+
The text segment is a table's headers. It
240+
will be treated as child of another TABLE
241+
TextSegment if its span is subspan of another
242+
TextSegment with type TABLE.
243+
TABLE_ROW (8):
244+
The text segment is a row in table. It will
245+
be treated as child of another TABLE TextSegment
246+
if its span is subspan of another TextSegment
247+
with type TABLE.
248+
TABLE_CELL (9):
249+
The text segment is a cell in table. It will be treated as
250+
child of another TABLE_ROW TextSegment if its span is
251+
subspan of another TextSegment with type TABLE_ROW.
203252
"""
204253
TEXT_SEGMENT_TYPE_UNSPECIFIED = 0
205254
TOKEN = 1

google/cloud/automl_v1beta1/types/data_types.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,38 @@
3131
class TypeCode(proto.Enum):
3232
r"""``TypeCode`` is used as a part of
3333
[DataType][google.cloud.automl.v1beta1.DataType].
34+
35+
Values:
36+
TYPE_CODE_UNSPECIFIED (0):
37+
Not specified. Should not be used.
38+
FLOAT64 (3):
39+
Encoded as ``number``, or the strings ``"NaN"``,
40+
``"Infinity"``, or ``"-Infinity"``.
41+
TIMESTAMP (4):
42+
Must be between 0AD and 9999AD. Encoded as ``string``
43+
according to
44+
[time_format][google.cloud.automl.v1beta1.DataType.time_format],
45+
or, if that format is not set, then in RFC 3339
46+
``date-time`` format, where ``time-offset`` = ``"Z"`` (e.g.
47+
1985-04-12T23:20:50.52Z).
48+
STRING (6):
49+
Encoded as ``string``.
50+
ARRAY (8):
51+
Encoded as ``list``, where the list elements are represented
52+
according to
53+
54+
[list_element_type][google.cloud.automl.v1beta1.DataType.list_element_type].
55+
STRUCT (9):
56+
Encoded as ``struct``, where field values are represented
57+
according to
58+
[struct_type][google.cloud.automl.v1beta1.DataType.struct_type].
59+
CATEGORY (10):
60+
Values of this type are not further understood by AutoML,
61+
e.g. AutoML is unable to tell the order of values (as it
62+
could with FLOAT64), or is unable to say if one value
63+
contains another (as it could with STRING). Encoded as
64+
``string`` (bytes should be base64-encoded, as described in
65+
RFC 4648, section 4).
3466
"""
3567
TYPE_CODE_UNSPECIFIED = 0
3668
FLOAT64 = 3

0 commit comments

Comments
 (0)