Skip to content

Commit beb5bf3

Browse files
docs: Add documentation for enums (#725)
* 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>
1 parent b151446 commit beb5bf3

File tree

8 files changed

+218
-14
lines changed

8 files changed

+218
-14
lines changed

β€Žgoogle/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,7 @@ def list_hot_tablets(
25422542
# Done; return the response.
25432543
return response
25442544

2545-
def __enter__(self):
2545+
def __enter__(self) -> "BigtableInstanceAdminClient":
25462546
return self
25472547

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

β€Žgoogle/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2891,7 +2891,7 @@ def test_iam_permissions(
28912891
# Done; return the response.
28922892
return response
28932893

2894-
def __enter__(self):
2894+
def __enter__(self) -> "BigtableTableAdminClient":
28952895
return self
28962896

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

β€Žgoogle/cloud/bigtable_admin_v2/types/bigtable_instance_admin.pyβ€Ž

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,26 @@ class TableProgress(proto.Message):
444444
"""
445445

446446
class State(proto.Enum):
447-
r""""""
447+
r"""
448+
449+
Values:
450+
STATE_UNSPECIFIED (0):
451+
452+
PENDING (1):
453+
The table has not yet begun copying to the
454+
new cluster.
455+
COPYING (2):
456+
The table is actively being copied to the new
457+
cluster.
458+
COMPLETED (3):
459+
The table has been fully copied to the new
460+
cluster.
461+
CANCELLED (4):
462+
The table was deleted before it finished
463+
copying to the new cluster. Note that tables
464+
deleted after completion will stay marked as
465+
COMPLETED, not CANCELLED.
466+
"""
448467
STATE_UNSPECIFIED = 0
449468
PENDING = 1
450469
COPYING = 2

β€Žgoogle/cloud/bigtable_admin_v2/types/common.pyβ€Ž

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

3131

3232
class StorageType(proto.Enum):
33-
r"""Storage media types for persisting Bigtable data."""
33+
r"""Storage media types for persisting Bigtable data.
34+
35+
Values:
36+
STORAGE_TYPE_UNSPECIFIED (0):
37+
The user did not specify a storage type.
38+
SSD (1):
39+
Flash (SSD) storage should be used.
40+
HDD (2):
41+
Magnetic drive (HDD) storage should be used.
42+
"""
3443
STORAGE_TYPE_UNSPECIFIED = 0
3544
SSD = 1
3645
HDD = 2

β€Žgoogle/cloud/bigtable_admin_v2/types/instance.pyβ€Ž

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,41 @@ class Instance(proto.Message):
8383
"""
8484

8585
class State(proto.Enum):
86-
r"""Possible states of an instance."""
86+
r"""Possible states of an instance.
87+
88+
Values:
89+
STATE_NOT_KNOWN (0):
90+
The state of the instance could not be
91+
determined.
92+
READY (1):
93+
The instance has been successfully created
94+
and can serve requests to its tables.
95+
CREATING (2):
96+
The instance is currently being created, and
97+
may be destroyed if the creation process
98+
encounters an error.
99+
"""
87100
STATE_NOT_KNOWN = 0
88101
READY = 1
89102
CREATING = 2
90103

91104
class Type(proto.Enum):
92-
r"""The type of the instance."""
105+
r"""The type of the instance.
106+
107+
Values:
108+
TYPE_UNSPECIFIED (0):
109+
The type of the instance is unspecified. If set when
110+
creating an instance, a ``PRODUCTION`` instance will be
111+
created. If set when updating an instance, the type will be
112+
left unchanged.
113+
PRODUCTION (1):
114+
An instance meant for production use. ``serve_nodes`` must
115+
be set on the cluster.
116+
DEVELOPMENT (2):
117+
DEPRECATED: Prefer PRODUCTION for all use
118+
cases, as it no longer enforces a higher minimum
119+
node count than DEVELOPMENT.
120+
"""
93121
TYPE_UNSPECIFIED = 0
94122
PRODUCTION = 1
95123
DEVELOPMENT = 2
@@ -221,7 +249,33 @@ class Cluster(proto.Message):
221249
"""
222250

223251
class State(proto.Enum):
224-
r"""Possible states of a cluster."""
252+
r"""Possible states of a cluster.
253+
254+
Values:
255+
STATE_NOT_KNOWN (0):
256+
The state of the cluster could not be
257+
determined.
258+
READY (1):
259+
The cluster has been successfully created and
260+
is ready to serve requests.
261+
CREATING (2):
262+
The cluster is currently being created, and
263+
may be destroyed if the creation process
264+
encounters an error. A cluster may not be able
265+
to serve requests while being created.
266+
RESIZING (3):
267+
The cluster is currently being resized, and
268+
may revert to its previous node count if the
269+
process encounters an error. A cluster is still
270+
capable of serving requests while being resized,
271+
but may exhibit performance as if its number of
272+
allocated nodes is between the starting and
273+
requested states.
274+
DISABLED (4):
275+
The cluster has no backing nodes. The data
276+
(tables) still exist, but no operations can be
277+
performed on the cluster.
278+
"""
225279
STATE_NOT_KNOWN = 0
226280
READY = 1
227281
CREATING = 2

β€Žgoogle/cloud/bigtable_admin_v2/types/table.pyβ€Ž

Lines changed: 115 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@
3939

4040

4141
class RestoreSourceType(proto.Enum):
42-
r"""Indicates the type of the restore source."""
42+
r"""Indicates the type of the restore source.
43+
44+
Values:
45+
RESTORE_SOURCE_TYPE_UNSPECIFIED (0):
46+
No restore associated.
47+
BACKUP (1):
48+
A backup was used as the source of the
49+
restore.
50+
"""
4351
RESTORE_SOURCE_TYPE_UNSPECIFIED = 0
4452
BACKUP = 1
4553

@@ -118,12 +126,40 @@ class Table(proto.Message):
118126
class TimestampGranularity(proto.Enum):
119127
r"""Possible timestamp granularities to use when keeping multiple
120128
versions of data in a table.
129+
130+
Values:
131+
TIMESTAMP_GRANULARITY_UNSPECIFIED (0):
132+
The user did not specify a granularity.
133+
Should not be returned. When specified during
134+
table creation, MILLIS will be used.
135+
MILLIS (1):
136+
The table keeps data versioned at a
137+
granularity of 1ms.
121138
"""
122139
TIMESTAMP_GRANULARITY_UNSPECIFIED = 0
123140
MILLIS = 1
124141

125142
class View(proto.Enum):
126-
r"""Defines a view over a table's fields."""
143+
r"""Defines a view over a table's fields.
144+
145+
Values:
146+
VIEW_UNSPECIFIED (0):
147+
Uses the default view for each method as
148+
documented in its request.
149+
NAME_ONLY (1):
150+
Only populates ``name``.
151+
SCHEMA_VIEW (2):
152+
Only populates ``name`` and fields related to the table's
153+
schema.
154+
REPLICATION_VIEW (3):
155+
Only populates ``name`` and fields related to the table's
156+
replication state.
157+
ENCRYPTION_VIEW (5):
158+
Only populates ``name`` and fields related to the table's
159+
encryption state.
160+
FULL (4):
161+
Populates all fields.
162+
"""
127163
VIEW_UNSPECIFIED = 0
128164
NAME_ONLY = 1
129165
SCHEMA_VIEW = 2
@@ -150,7 +186,37 @@ class ClusterState(proto.Message):
150186
"""
151187

152188
class ReplicationState(proto.Enum):
153-
r"""Table replication states."""
189+
r"""Table replication states.
190+
191+
Values:
192+
STATE_NOT_KNOWN (0):
193+
The replication state of the table is unknown
194+
in this cluster.
195+
INITIALIZING (1):
196+
The cluster was recently created, and the
197+
table must finish copying over pre-existing data
198+
from other clusters before it can begin
199+
receiving live replication updates and serving
200+
Data API requests.
201+
PLANNED_MAINTENANCE (2):
202+
The table is temporarily unable to serve Data
203+
API requests from this cluster due to planned
204+
internal maintenance.
205+
UNPLANNED_MAINTENANCE (3):
206+
The table is temporarily unable to serve Data
207+
API requests from this cluster due to unplanned
208+
or emergency maintenance.
209+
READY (4):
210+
The table can serve Data API requests from
211+
this cluster. Depending on replication delay,
212+
reads may not immediately reflect the state of
213+
the table in other clusters.
214+
READY_OPTIMIZING (5):
215+
The table is fully created and ready for use after a
216+
restore, and is being optimized for performance. When
217+
optimizations are complete, the table will transition to
218+
``READY`` state.
219+
"""
154220
STATE_NOT_KNOWN = 0
155221
INITIALIZING = 1
156222
PLANNED_MAINTENANCE = 2
@@ -335,7 +401,26 @@ class EncryptionInfo(proto.Message):
335401
"""
336402

337403
class EncryptionType(proto.Enum):
338-
r"""Possible encryption types for a resource."""
404+
r"""Possible encryption types for a resource.
405+
406+
Values:
407+
ENCRYPTION_TYPE_UNSPECIFIED (0):
408+
Encryption type was not specified, though
409+
data at rest remains encrypted.
410+
GOOGLE_DEFAULT_ENCRYPTION (1):
411+
The data backing this resource is encrypted
412+
at rest with a key that is fully managed by
413+
Google. No key version or status will be
414+
populated. This is the default state.
415+
CUSTOMER_MANAGED_ENCRYPTION (2):
416+
The data backing this resource is encrypted at rest with a
417+
key that is managed by the customer. The in-use version of
418+
the key and its status are populated for CMEK-protected
419+
tables. CMEK-protected backups are pinned to the key version
420+
that was in use at the time the backup was taken. This key
421+
version is populated but its status is not tracked and is
422+
reported as ``UNKNOWN``.
423+
"""
339424
ENCRYPTION_TYPE_UNSPECIFIED = 0
340425
GOOGLE_DEFAULT_ENCRYPTION = 1
341426
CUSTOMER_MANAGED_ENCRYPTION = 2
@@ -397,7 +482,21 @@ class Snapshot(proto.Message):
397482
"""
398483

399484
class State(proto.Enum):
400-
r"""Possible states of a snapshot."""
485+
r"""Possible states of a snapshot.
486+
487+
Values:
488+
STATE_NOT_KNOWN (0):
489+
The state of the snapshot could not be
490+
determined.
491+
READY (1):
492+
The snapshot has been successfully created
493+
and can serve all requests.
494+
CREATING (2):
495+
The snapshot is currently being created, and
496+
may be destroyed if the creation process
497+
encounters an error. A snapshot may not be
498+
restored to a table while it is being created.
499+
"""
401500
STATE_NOT_KNOWN = 0
402501
READY = 1
403502
CREATING = 2
@@ -481,7 +580,17 @@ class Backup(proto.Message):
481580
"""
482581

483582
class State(proto.Enum):
484-
r"""Indicates the current state of the backup."""
583+
r"""Indicates the current state of the backup.
584+
585+
Values:
586+
STATE_UNSPECIFIED (0):
587+
Not specified.
588+
CREATING (1):
589+
The pending backup is still being created. Operations on the
590+
backup may fail with ``FAILED_PRECONDITION`` in this state.
591+
READY (2):
592+
The backup is complete and ready for use.
593+
"""
485594
STATE_UNSPECIFIED = 0
486595
CREATING = 1
487596
READY = 2

β€Žgoogle/cloud/bigtable_v2/services/bigtable/client.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ def read_modify_write_row(
13061306
# Done; return the response.
13071307
return response
13081308

1309-
def __enter__(self):
1309+
def __enter__(self) -> "BigtableClient":
13101310
return self
13111311

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

β€Žgoogle/cloud/bigtable_v2/types/bigtable.pyβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ class RequestStatsView(proto.Enum):
7676
r"""The desired view into RequestStats that should be returned in
7777
the response.
7878
See also: RequestStats message.
79+
80+
Values:
81+
REQUEST_STATS_VIEW_UNSPECIFIED (0):
82+
The default / unset value. The API will
83+
default to the NONE option below.
84+
REQUEST_STATS_NONE (1):
85+
Do not include any RequestStats in the
86+
response. This will leave the RequestStats
87+
embedded message unset in the response.
88+
REQUEST_STATS_FULL (2):
89+
Include the full set of available
90+
RequestStats in the response, applicable to this
91+
read.
7992
"""
8093
REQUEST_STATS_VIEW_UNSPECIFIED = 0
8194
REQUEST_STATS_NONE = 1

0 commit comments

Comments
 (0)