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

Commit

Permalink
docs: Add documentation for enums (#161)
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: 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jan 20, 2023
1 parent f1371c1 commit 970281e
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ def sample_list_migration_subtasks():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "MigrationServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
65 changes: 62 additions & 3 deletions google/cloud/bigquery_migration_v2/types/migration_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,27 @@ class MigrationWorkflow(proto.Message):
"""

class State(proto.Enum):
r"""Possible migration workflow states."""
r"""Possible migration workflow states.
Values:
STATE_UNSPECIFIED (0):
Workflow state is unspecified.
DRAFT (1):
Workflow is in draft status, i.e. tasks are
not yet eligible for execution.
RUNNING (2):
Workflow is running (i.e. tasks are eligible
for execution).
PAUSED (3):
Workflow is paused. Tasks currently in
progress may continue, but no further tasks will
be scheduled.
COMPLETED (4):
Workflow is complete. There should not be any
task in a non-terminal state, but if they are
(e.g. forced termination), they will not be
scheduled.
"""
STATE_UNSPECIFIED = 0
DRAFT = 1
RUNNING = 2
Expand Down Expand Up @@ -138,7 +158,26 @@ class MigrationTask(proto.Message):
"""

class State(proto.Enum):
r"""Possible states of a migration task."""
r"""Possible states of a migration task.
Values:
STATE_UNSPECIFIED (0):
The state is unspecified.
PENDING (1):
The task is waiting for orchestration.
ORCHESTRATING (2):
The task is assigned to an orchestrator.
RUNNING (3):
The task is running, i.e. its subtasks are
ready for execution.
PAUSED (4):
Tha task is paused. Assigned subtasks can
continue, but no new subtasks will be scheduled.
SUCCEEDED (5):
The task finished successfully.
FAILED (6):
The task finished unsuccessfully.
"""
STATE_UNSPECIFIED = 0
PENDING = 1
ORCHESTRATING = 2
Expand Down Expand Up @@ -234,7 +273,27 @@ class MigrationSubtask(proto.Message):
"""

class State(proto.Enum):
r"""Possible states of a migration subtask."""
r"""Possible states of a migration subtask.
Values:
STATE_UNSPECIFIED (0):
The state is unspecified.
ACTIVE (1):
The subtask is ready, i.e. it is ready for
execution.
RUNNING (2):
The subtask is running, i.e. it is assigned
to a worker for execution.
SUCCEEDED (3):
The subtask finished successfully.
FAILED (4):
The subtask finished unsuccessfully.
PAUSED (5):
The subtask is paused, i.e., it will not be
scheduled. If it was already assigned,it might
still finish but no new lease renewals will be
granted.
"""
STATE_UNSPECIFIED = 0
ACTIVE = 1
RUNNING = 2
Expand Down
33 changes: 31 additions & 2 deletions google/cloud/bigquery_migration_v2/types/translation_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,16 @@ class TeradataDialect(proto.Message):
"""

class Mode(proto.Enum):
r"""The sub-dialect options for Teradata."""
r"""The sub-dialect options for Teradata.
Values:
MODE_UNSPECIFIED (0):
Unspecified mode.
SQL (1):
Teradata SQL mode.
BTEQ (2):
BTEQ mode (which includes SQL).
"""
MODE_UNSPECIFIED = 0
SQL = 1
BTEQ = 2
Expand Down Expand Up @@ -404,7 +413,27 @@ class NameMappingKey(proto.Message):
"""

class Type(proto.Enum):
r"""The type of the object that is being mapped."""
r"""The type of the object that is being mapped.
Values:
TYPE_UNSPECIFIED (0):
Unspecified name mapping type.
DATABASE (1):
The object being mapped is a database.
SCHEMA (2):
The object being mapped is a schema.
RELATION (3):
The object being mapped is a relation.
ATTRIBUTE (4):
The object being mapped is an attribute.
RELATION_ALIAS (5):
The object being mapped is a relation alias.
ATTRIBUTE_ALIAS (6):
The object being mapped is a an attribute
alias.
FUNCTION (7):
The object being mapped is a function.
"""
TYPE_UNSPECIFIED = 0
DATABASE = 1
SCHEMA = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ def sample_list_migration_subtasks():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "MigrationServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,27 @@ class MigrationWorkflow(proto.Message):
"""

class State(proto.Enum):
r"""Possible migration workflow states."""
r"""Possible migration workflow states.
Values:
STATE_UNSPECIFIED (0):
Workflow state is unspecified.
DRAFT (1):
Workflow is in draft status, i.e. tasks are
not yet eligible for execution.
RUNNING (2):
Workflow is running (i.e. tasks are eligible
for execution).
PAUSED (3):
Workflow is paused. Tasks currently in
progress may continue, but no further tasks will
be scheduled.
COMPLETED (4):
Workflow is complete. There should not be any
task in a non-terminal state, but if they are
(e.g. forced termination), they will not be
scheduled.
"""
STATE_UNSPECIFIED = 0
DRAFT = 1
RUNNING = 2
Expand Down Expand Up @@ -151,7 +171,26 @@ class MigrationTask(proto.Message):
"""

class State(proto.Enum):
r"""Possible states of a migration task."""
r"""Possible states of a migration task.
Values:
STATE_UNSPECIFIED (0):
The state is unspecified.
PENDING (1):
The task is waiting for orchestration.
ORCHESTRATING (2):
The task is assigned to an orchestrator.
RUNNING (3):
The task is running, i.e. its subtasks are
ready for execution.
PAUSED (4):
Tha task is paused. Assigned subtasks can
continue, but no new subtasks will be scheduled.
SUCCEEDED (5):
The task finished successfully.
FAILED (6):
The task finished unsuccessfully.
"""
STATE_UNSPECIFIED = 0
PENDING = 1
ORCHESTRATING = 2
Expand Down Expand Up @@ -261,7 +300,27 @@ class MigrationSubtask(proto.Message):
"""

class State(proto.Enum):
r"""Possible states of a migration subtask."""
r"""Possible states of a migration subtask.
Values:
STATE_UNSPECIFIED (0):
The state is unspecified.
ACTIVE (1):
The subtask is ready, i.e. it is ready for
execution.
RUNNING (2):
The subtask is running, i.e. it is assigned
to a worker for execution.
SUCCEEDED (3):
The subtask finished successfully.
FAILED (4):
The subtask finished unsuccessfully.
PAUSED (5):
The subtask is paused, i.e., it will not be
scheduled. If it was already assigned,it might
still finish but no new lease renewals will be
granted.
"""
STATE_UNSPECIFIED = 0
ACTIVE = 1
RUNNING = 2
Expand Down
65 changes: 61 additions & 4 deletions google/cloud/bigquery_migration_v2alpha/types/translation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,24 @@ class TranslationTaskDetails(proto.Message):
"""

class FileEncoding(proto.Enum):
r"""The file encoding types."""
r"""The file encoding types.
Values:
FILE_ENCODING_UNSPECIFIED (0):
File encoding setting is not specified.
UTF_8 (1):
File encoding is UTF_8.
ISO_8859_1 (2):
File encoding is ISO_8859_1.
US_ASCII (3):
File encoding is US_ASCII.
UTF_16 (4):
File encoding is UTF_16.
UTF_16LE (5):
File encoding is UTF_16LE.
UTF_16BE (6):
File encoding is UTF_16BE.
"""
FILE_ENCODING_UNSPECIFIED = 0
UTF_8 = 1
ISO_8859_1 = 2
Expand All @@ -126,7 +143,26 @@ class FileEncoding(proto.Enum):
UTF_16BE = 6

class TokenType(proto.Enum):
r"""The special token data type."""
r"""The special token data type.
Values:
TOKEN_TYPE_UNSPECIFIED (0):
Token type is not specified.
STRING (1):
Token type as string.
INT64 (2):
Token type as integer.
NUMERIC (3):
Token type as numeric.
BOOL (4):
Token type as boolean.
FLOAT64 (5):
Token type as float.
DATE (6):
Token type as date.
TIMESTAMP (7):
Token type as timestamp.
"""
TOKEN_TYPE_UNSPECIFIED = 0
STRING = 1
INT64 = 2
Expand Down Expand Up @@ -220,14 +256,35 @@ class IdentifierSettings(proto.Message):
"""

class IdentifierCase(proto.Enum):
r"""The identifier case type."""
r"""The identifier case type.
Values:
IDENTIFIER_CASE_UNSPECIFIED (0):
The identifier case is not specified.
ORIGINAL (1):
Identifiers' cases will be kept as the
original cases.
UPPER (2):
Identifiers will be in upper cases.
LOWER (3):
Identifiers will be in lower cases.
"""
IDENTIFIER_CASE_UNSPECIFIED = 0
ORIGINAL = 1
UPPER = 2
LOWER = 3

class IdentifierRewriteMode(proto.Enum):
r"""The SQL identifier rewrite mode."""
r"""The SQL identifier rewrite mode.
Values:
IDENTIFIER_REWRITE_MODE_UNSPECIFIED (0):
SQL Identifier rewrite mode is unspecified.
NONE (1):
SQL identifiers won't be rewrite.
REWRITE_ALL (2):
All SQL identifiers will be rewrite.
"""
IDENTIFIER_REWRITE_MODE_UNSPECIFIED = 0
NONE = 1
REWRITE_ALL = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-bigquery-migration",
"version": "0.9.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-bigquery-migration",
"version": "0.9.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 970281e

Please sign in to comment.