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

Commit 970281e

Browse files
docs: Add documentation for enums (#161)
* 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 f1371c1 commit 970281e

File tree

8 files changed

+220
-16
lines changed

8 files changed

+220
-16
lines changed

google/cloud/bigquery_migration_v2/services/migration_service/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ def sample_list_migration_subtasks():
12311231
# Done; return the response.
12321232
return response
12331233

1234-
def __enter__(self):
1234+
def __enter__(self) -> "MigrationServiceClient":
12351235
return self
12361236

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

google/cloud/bigquery_migration_v2/types/migration_entities.py

+62-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,27 @@ class MigrationWorkflow(proto.Message):
6363
"""
6464

6565
class State(proto.Enum):
66-
r"""Possible migration workflow states."""
66+
r"""Possible migration workflow states.
67+
68+
Values:
69+
STATE_UNSPECIFIED (0):
70+
Workflow state is unspecified.
71+
DRAFT (1):
72+
Workflow is in draft status, i.e. tasks are
73+
not yet eligible for execution.
74+
RUNNING (2):
75+
Workflow is running (i.e. tasks are eligible
76+
for execution).
77+
PAUSED (3):
78+
Workflow is paused. Tasks currently in
79+
progress may continue, but no further tasks will
80+
be scheduled.
81+
COMPLETED (4):
82+
Workflow is complete. There should not be any
83+
task in a non-terminal state, but if they are
84+
(e.g. forced termination), they will not be
85+
scheduled.
86+
"""
6787
STATE_UNSPECIFIED = 0
6888
DRAFT = 1
6989
RUNNING = 2
@@ -138,7 +158,26 @@ class MigrationTask(proto.Message):
138158
"""
139159

140160
class State(proto.Enum):
141-
r"""Possible states of a migration task."""
161+
r"""Possible states of a migration task.
162+
163+
Values:
164+
STATE_UNSPECIFIED (0):
165+
The state is unspecified.
166+
PENDING (1):
167+
The task is waiting for orchestration.
168+
ORCHESTRATING (2):
169+
The task is assigned to an orchestrator.
170+
RUNNING (3):
171+
The task is running, i.e. its subtasks are
172+
ready for execution.
173+
PAUSED (4):
174+
Tha task is paused. Assigned subtasks can
175+
continue, but no new subtasks will be scheduled.
176+
SUCCEEDED (5):
177+
The task finished successfully.
178+
FAILED (6):
179+
The task finished unsuccessfully.
180+
"""
142181
STATE_UNSPECIFIED = 0
143182
PENDING = 1
144183
ORCHESTRATING = 2
@@ -234,7 +273,27 @@ class MigrationSubtask(proto.Message):
234273
"""
235274

236275
class State(proto.Enum):
237-
r"""Possible states of a migration subtask."""
276+
r"""Possible states of a migration subtask.
277+
278+
Values:
279+
STATE_UNSPECIFIED (0):
280+
The state is unspecified.
281+
ACTIVE (1):
282+
The subtask is ready, i.e. it is ready for
283+
execution.
284+
RUNNING (2):
285+
The subtask is running, i.e. it is assigned
286+
to a worker for execution.
287+
SUCCEEDED (3):
288+
The subtask finished successfully.
289+
FAILED (4):
290+
The subtask finished unsuccessfully.
291+
PAUSED (5):
292+
The subtask is paused, i.e., it will not be
293+
scheduled. If it was already assigned,it might
294+
still finish but no new lease renewals will be
295+
granted.
296+
"""
238297
STATE_UNSPECIFIED = 0
239298
ACTIVE = 1
240299
RUNNING = 2

google/cloud/bigquery_migration_v2/types/translation_config.py

+31-2
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,16 @@ class TeradataDialect(proto.Message):
288288
"""
289289

290290
class Mode(proto.Enum):
291-
r"""The sub-dialect options for Teradata."""
291+
r"""The sub-dialect options for Teradata.
292+
293+
Values:
294+
MODE_UNSPECIFIED (0):
295+
Unspecified mode.
296+
SQL (1):
297+
Teradata SQL mode.
298+
BTEQ (2):
299+
BTEQ mode (which includes SQL).
300+
"""
292301
MODE_UNSPECIFIED = 0
293302
SQL = 1
294303
BTEQ = 2
@@ -404,7 +413,27 @@ class NameMappingKey(proto.Message):
404413
"""
405414

406415
class Type(proto.Enum):
407-
r"""The type of the object that is being mapped."""
416+
r"""The type of the object that is being mapped.
417+
418+
Values:
419+
TYPE_UNSPECIFIED (0):
420+
Unspecified name mapping type.
421+
DATABASE (1):
422+
The object being mapped is a database.
423+
SCHEMA (2):
424+
The object being mapped is a schema.
425+
RELATION (3):
426+
The object being mapped is a relation.
427+
ATTRIBUTE (4):
428+
The object being mapped is an attribute.
429+
RELATION_ALIAS (5):
430+
The object being mapped is a relation alias.
431+
ATTRIBUTE_ALIAS (6):
432+
The object being mapped is a an attribute
433+
alias.
434+
FUNCTION (7):
435+
The object being mapped is a function.
436+
"""
408437
TYPE_UNSPECIFIED = 0
409438
DATABASE = 1
410439
SCHEMA = 2

google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ def sample_list_migration_subtasks():
12311231
# Done; return the response.
12321232
return response
12331233

1234-
def __enter__(self):
1234+
def __enter__(self) -> "MigrationServiceClient":
12351235
return self
12361236

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

google/cloud/bigquery_migration_v2alpha/types/migration_entities.py

+62-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,27 @@ class MigrationWorkflow(proto.Message):
6666
"""
6767

6868
class State(proto.Enum):
69-
r"""Possible migration workflow states."""
69+
r"""Possible migration workflow states.
70+
71+
Values:
72+
STATE_UNSPECIFIED (0):
73+
Workflow state is unspecified.
74+
DRAFT (1):
75+
Workflow is in draft status, i.e. tasks are
76+
not yet eligible for execution.
77+
RUNNING (2):
78+
Workflow is running (i.e. tasks are eligible
79+
for execution).
80+
PAUSED (3):
81+
Workflow is paused. Tasks currently in
82+
progress may continue, but no further tasks will
83+
be scheduled.
84+
COMPLETED (4):
85+
Workflow is complete. There should not be any
86+
task in a non-terminal state, but if they are
87+
(e.g. forced termination), they will not be
88+
scheduled.
89+
"""
7090
STATE_UNSPECIFIED = 0
7191
DRAFT = 1
7292
RUNNING = 2
@@ -151,7 +171,26 @@ class MigrationTask(proto.Message):
151171
"""
152172

153173
class State(proto.Enum):
154-
r"""Possible states of a migration task."""
174+
r"""Possible states of a migration task.
175+
176+
Values:
177+
STATE_UNSPECIFIED (0):
178+
The state is unspecified.
179+
PENDING (1):
180+
The task is waiting for orchestration.
181+
ORCHESTRATING (2):
182+
The task is assigned to an orchestrator.
183+
RUNNING (3):
184+
The task is running, i.e. its subtasks are
185+
ready for execution.
186+
PAUSED (4):
187+
Tha task is paused. Assigned subtasks can
188+
continue, but no new subtasks will be scheduled.
189+
SUCCEEDED (5):
190+
The task finished successfully.
191+
FAILED (6):
192+
The task finished unsuccessfully.
193+
"""
155194
STATE_UNSPECIFIED = 0
156195
PENDING = 1
157196
ORCHESTRATING = 2
@@ -261,7 +300,27 @@ class MigrationSubtask(proto.Message):
261300
"""
262301

263302
class State(proto.Enum):
264-
r"""Possible states of a migration subtask."""
303+
r"""Possible states of a migration subtask.
304+
305+
Values:
306+
STATE_UNSPECIFIED (0):
307+
The state is unspecified.
308+
ACTIVE (1):
309+
The subtask is ready, i.e. it is ready for
310+
execution.
311+
RUNNING (2):
312+
The subtask is running, i.e. it is assigned
313+
to a worker for execution.
314+
SUCCEEDED (3):
315+
The subtask finished successfully.
316+
FAILED (4):
317+
The subtask finished unsuccessfully.
318+
PAUSED (5):
319+
The subtask is paused, i.e., it will not be
320+
scheduled. If it was already assigned,it might
321+
still finish but no new lease renewals will be
322+
granted.
323+
"""
265324
STATE_UNSPECIFIED = 0
266325
ACTIVE = 1
267326
RUNNING = 2

google/cloud/bigquery_migration_v2alpha/types/translation_task.py

+61-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,24 @@ class TranslationTaskDetails(proto.Message):
116116
"""
117117

118118
class FileEncoding(proto.Enum):
119-
r"""The file encoding types."""
119+
r"""The file encoding types.
120+
121+
Values:
122+
FILE_ENCODING_UNSPECIFIED (0):
123+
File encoding setting is not specified.
124+
UTF_8 (1):
125+
File encoding is UTF_8.
126+
ISO_8859_1 (2):
127+
File encoding is ISO_8859_1.
128+
US_ASCII (3):
129+
File encoding is US_ASCII.
130+
UTF_16 (4):
131+
File encoding is UTF_16.
132+
UTF_16LE (5):
133+
File encoding is UTF_16LE.
134+
UTF_16BE (6):
135+
File encoding is UTF_16BE.
136+
"""
120137
FILE_ENCODING_UNSPECIFIED = 0
121138
UTF_8 = 1
122139
ISO_8859_1 = 2
@@ -126,7 +143,26 @@ class FileEncoding(proto.Enum):
126143
UTF_16BE = 6
127144

128145
class TokenType(proto.Enum):
129-
r"""The special token data type."""
146+
r"""The special token data type.
147+
148+
Values:
149+
TOKEN_TYPE_UNSPECIFIED (0):
150+
Token type is not specified.
151+
STRING (1):
152+
Token type as string.
153+
INT64 (2):
154+
Token type as integer.
155+
NUMERIC (3):
156+
Token type as numeric.
157+
BOOL (4):
158+
Token type as boolean.
159+
FLOAT64 (5):
160+
Token type as float.
161+
DATE (6):
162+
Token type as date.
163+
TIMESTAMP (7):
164+
Token type as timestamp.
165+
"""
130166
TOKEN_TYPE_UNSPECIFIED = 0
131167
STRING = 1
132168
INT64 = 2
@@ -220,14 +256,35 @@ class IdentifierSettings(proto.Message):
220256
"""
221257

222258
class IdentifierCase(proto.Enum):
223-
r"""The identifier case type."""
259+
r"""The identifier case type.
260+
261+
Values:
262+
IDENTIFIER_CASE_UNSPECIFIED (0):
263+
The identifier case is not specified.
264+
ORIGINAL (1):
265+
Identifiers' cases will be kept as the
266+
original cases.
267+
UPPER (2):
268+
Identifiers will be in upper cases.
269+
LOWER (3):
270+
Identifiers will be in lower cases.
271+
"""
224272
IDENTIFIER_CASE_UNSPECIFIED = 0
225273
ORIGINAL = 1
226274
UPPER = 2
227275
LOWER = 3
228276

229277
class IdentifierRewriteMode(proto.Enum):
230-
r"""The SQL identifier rewrite mode."""
278+
r"""The SQL identifier rewrite mode.
279+
280+
Values:
281+
IDENTIFIER_REWRITE_MODE_UNSPECIFIED (0):
282+
SQL Identifier rewrite mode is unspecified.
283+
NONE (1):
284+
SQL identifiers won't be rewrite.
285+
REWRITE_ALL (2):
286+
All SQL identifiers will be rewrite.
287+
"""
231288
IDENTIFIER_REWRITE_MODE_UNSPECIFIED = 0
232289
NONE = 1
233290
REWRITE_ALL = 2

samples/generated_samples/snippet_metadata_google.cloud.bigquery.migration.v2.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-bigquery-migration",
11-
"version": "0.9.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.bigquery.migration.v2alpha.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-bigquery-migration",
11-
"version": "0.9.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)