Skip to content

Commit 44b2236

Browse files
docs: Add documentation for enums (#679)
* 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 fa9cf41 commit 44b2236

File tree

10 files changed

+345
-16
lines changed

10 files changed

+345
-16
lines changed

packages/google-cloud-firestore/google/cloud/firestore_admin_v1/services/firestore_admin/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ def sample_update_database():
19451945
# Done; return the response.
19461946
return response
19471947

1948-
def __enter__(self):
1948+
def __enter__(self) -> "FirestoreAdminClient":
19491949
return self
19501950

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

packages/google-cloud-firestore/google/cloud/firestore_admin_v1/types/database.py

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,65 @@ class DatabaseType(proto.Enum):
7474
for information about how to choose.
7575
7676
Mode changes are only allowed if the database is empty.
77+
78+
Values:
79+
DATABASE_TYPE_UNSPECIFIED (0):
80+
The default value. This value is used if the
81+
database type is omitted.
82+
FIRESTORE_NATIVE (1):
83+
Firestore Native Mode
84+
DATASTORE_MODE (2):
85+
Firestore in Datastore Mode.
7786
"""
7887
DATABASE_TYPE_UNSPECIFIED = 0
7988
FIRESTORE_NATIVE = 1
8089
DATASTORE_MODE = 2
8190

8291
class ConcurrencyMode(proto.Enum):
83-
r"""The type of concurrency control mode for transactions."""
92+
r"""The type of concurrency control mode for transactions.
93+
94+
Values:
95+
CONCURRENCY_MODE_UNSPECIFIED (0):
96+
Not used.
97+
OPTIMISTIC (1):
98+
Use optimistic concurrency control by
99+
default. This mode is available for Cloud
100+
Firestore databases.
101+
PESSIMISTIC (2):
102+
Use pessimistic concurrency control by
103+
default. This mode is available for Cloud
104+
Firestore databases.
105+
This is the default setting for Cloud Firestore.
106+
OPTIMISTIC_WITH_ENTITY_GROUPS (3):
107+
Use optimistic concurrency control with
108+
entity groups by default.
109+
This is the only available mode for Cloud
110+
Datastore.
111+
This mode is also available for Cloud Firestore
112+
with Datastore Mode but is not recommended.
113+
"""
84114
CONCURRENCY_MODE_UNSPECIFIED = 0
85115
OPTIMISTIC = 1
86116
PESSIMISTIC = 2
87117
OPTIMISTIC_WITH_ENTITY_GROUPS = 3
88118

89119
class AppEngineIntegrationMode(proto.Enum):
90-
r"""The type of App Engine integration mode."""
120+
r"""The type of App Engine integration mode.
121+
122+
Values:
123+
APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED (0):
124+
Not used.
125+
ENABLED (1):
126+
If an App Engine application exists in the
127+
same region as this database, App Engine
128+
configuration will impact this database. This
129+
includes disabling of the application &
130+
database, as well as disabling writes to the
131+
database.
132+
DISABLED (2):
133+
Appengine has no affect on the ability of
134+
this database to serve requests.
135+
"""
91136
APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED = 0
92137
ENABLED = 1
93138
DISABLED = 2

packages/google-cloud-firestore/google/cloud/firestore_admin_v1/types/field.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,28 @@ class TtlConfig(proto.Message):
129129
"""
130130

131131
class State(proto.Enum):
132-
r"""The state of applying the TTL configuration to all documents."""
132+
r"""The state of applying the TTL configuration to all documents.
133+
134+
Values:
135+
STATE_UNSPECIFIED (0):
136+
The state is unspecified or unknown.
137+
CREATING (1):
138+
The TTL is being applied. There is an active
139+
long-running operation to track the change.
140+
Newly written documents will have TTLs applied
141+
as requested. Requested TTLs on existing
142+
documents are still being processed. When TTLs
143+
on all existing documents have been processed,
144+
the state will move to 'ACTIVE'.
145+
ACTIVE (2):
146+
The TTL is active for all documents.
147+
NEEDS_REPAIR (3):
148+
The TTL configuration could not be enabled for all existing
149+
documents. Newly written documents will continue to have
150+
their TTL applied. The LRO returned when last attempting to
151+
enable TTL for this ``Field`` has failed, and may have more
152+
details.
153+
"""
133154
STATE_UNSPECIFIED = 0
134155
CREATING = 1
135156
ACTIVE = 2

packages/google-cloud-firestore/google/cloud/firestore_admin_v1/types/index.py

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ class Index(proto.Message):
6969
class QueryScope(proto.Enum):
7070
r"""Query Scope defines the scope at which a query is run. This is
7171
specified on a StructuredQuery's ``from`` field.
72+
73+
Values:
74+
QUERY_SCOPE_UNSPECIFIED (0):
75+
The query scope is unspecified. Not a valid
76+
option.
77+
COLLECTION (1):
78+
Indexes with a collection query scope
79+
specified allow queries against a collection
80+
that is the child of a specific document,
81+
specified at query time, and that has the
82+
collection id specified by the index.
83+
COLLECTION_GROUP (2):
84+
Indexes with a collection group query scope
85+
specified allow queries against all collections
86+
that has the collection id specified by the
87+
index.
7288
"""
7389
QUERY_SCOPE_UNSPECIFIED = 0
7490
COLLECTION = 1
@@ -80,6 +96,31 @@ class State(proto.Enum):
8096
will transition to the ``READY`` state. If the index creation
8197
encounters a problem, the index will transition to the
8298
``NEEDS_REPAIR`` state.
99+
100+
Values:
101+
STATE_UNSPECIFIED (0):
102+
The state is unspecified.
103+
CREATING (1):
104+
The index is being created.
105+
There is an active long-running operation for
106+
the index. The index is updated when writing a
107+
document. Some index data may exist.
108+
READY (2):
109+
The index is ready to be used.
110+
The index is updated when writing a document.
111+
The index is fully populated from all stored
112+
documents it applies to.
113+
NEEDS_REPAIR (3):
114+
The index was being created, but something
115+
went wrong. There is no active long-running
116+
operation for the index, and the most recently
117+
finished long-running operation failed. The
118+
index is not updated when writing a document.
119+
Some index data may exist.
120+
Use the google.longrunning.Operations API to
121+
determine why the operation that last attempted
122+
to create this index failed, then re-create the
123+
index.
83124
"""
84125
STATE_UNSPECIFIED = 0
85126
CREATING = 1
@@ -115,13 +156,33 @@ class IndexField(proto.Message):
115156
"""
116157

117158
class Order(proto.Enum):
118-
r"""The supported orderings."""
159+
r"""The supported orderings.
160+
161+
Values:
162+
ORDER_UNSPECIFIED (0):
163+
The ordering is unspecified. Not a valid
164+
option.
165+
ASCENDING (1):
166+
The field is ordered by ascending field
167+
value.
168+
DESCENDING (2):
169+
The field is ordered by descending field
170+
value.
171+
"""
119172
ORDER_UNSPECIFIED = 0
120173
ASCENDING = 1
121174
DESCENDING = 2
122175

123176
class ArrayConfig(proto.Enum):
124-
r"""The supported array value configurations."""
177+
r"""The supported array value configurations.
178+
179+
Values:
180+
ARRAY_CONFIG_UNSPECIFIED (0):
181+
The index does not support additional array
182+
queries.
183+
CONTAINS (1):
184+
The index supports array containment queries.
185+
"""
125186
ARRAY_CONFIG_UNSPECIFIED = 0
126187
CONTAINS = 1
127188

packages/google-cloud-firestore/google/cloud/firestore_admin_v1/types/operation.py

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,33 @@
3636

3737

3838
class OperationState(proto.Enum):
39-
r"""Describes the state of the operation."""
39+
r"""Describes the state of the operation.
40+
41+
Values:
42+
OPERATION_STATE_UNSPECIFIED (0):
43+
Unspecified.
44+
INITIALIZING (1):
45+
Request is being prepared for processing.
46+
PROCESSING (2):
47+
Request is actively being processed.
48+
CANCELLING (3):
49+
Request is in the process of being cancelled
50+
after user called
51+
google.longrunning.Operations.CancelOperation on
52+
the operation.
53+
FINALIZING (4):
54+
Request has been processed and is in its
55+
finalization stage.
56+
SUCCESSFUL (5):
57+
Request has completed successfully.
58+
FAILED (6):
59+
Request has finished being processed, but
60+
encountered an error.
61+
CANCELLED (7):
62+
Request has finished being cancelled after
63+
user called
64+
google.longrunning.Operations.CancelOperation.
65+
"""
4066
OPERATION_STATE_UNSPECIFIED = 0
4167
INITIALIZING = 1
4268
PROCESSING = 2
@@ -145,7 +171,16 @@ class IndexConfigDelta(proto.Message):
145171
"""
146172

147173
class ChangeType(proto.Enum):
148-
r"""Specifies how the index is changing."""
174+
r"""Specifies how the index is changing.
175+
176+
Values:
177+
CHANGE_TYPE_UNSPECIFIED (0):
178+
The type of change is not specified or known.
179+
ADD (1):
180+
The single field index is being added.
181+
REMOVE (2):
182+
The single field index is being removed.
183+
"""
149184
CHANGE_TYPE_UNSPECIFIED = 0
150185
ADD = 1
151186
REMOVE = 2
@@ -171,7 +206,16 @@ class TtlConfigDelta(proto.Message):
171206
"""
172207

173208
class ChangeType(proto.Enum):
174-
r"""Specifies how the TTL config is changing."""
209+
r"""Specifies how the TTL config is changing.
210+
211+
Values:
212+
CHANGE_TYPE_UNSPECIFIED (0):
213+
The type of change is not specified or known.
214+
ADD (1):
215+
The TTL config is being added.
216+
REMOVE (2):
217+
The TTL config is being removed.
218+
"""
175219
CHANGE_TYPE_UNSPECIFIED = 0
176220
ADD = 1
177221
REMOVE = 2

packages/google-cloud-firestore/google/cloud/firestore_bundle/types/bundle.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ class BundledQuery(proto.Message):
5353
class LimitType(proto.Enum):
5454
r"""If the query is a limit query, should the limit be applied to
5555
the beginning or the end of results.
56+
57+
Values:
58+
FIRST (0):
59+
60+
LAST (1):
61+
5662
"""
5763
FIRST = 0
5864
LAST = 1

packages/google-cloud-firestore/google/cloud/firestore_v1/services/firestore/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ def sample_create_document():
19861986
# Done; return the response.
19871987
return response
19881988

1989-
def __enter__(self):
1989+
def __enter__(self) -> "FirestoreClient":
19901990
return self
19911991

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

packages/google-cloud-firestore/google/cloud/firestore_v1/types/firestore.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,34 @@ class TargetChange(proto.Message):
14211421
"""
14221422

14231423
class TargetChangeType(proto.Enum):
1424-
r"""The type of change."""
1424+
r"""The type of change.
1425+
1426+
Values:
1427+
NO_CHANGE (0):
1428+
No change has occurred. Used only to send an updated
1429+
``resume_token``.
1430+
ADD (1):
1431+
The targets have been added.
1432+
REMOVE (2):
1433+
The targets have been removed.
1434+
CURRENT (3):
1435+
The targets reflect all changes committed before the targets
1436+
were added to the stream.
1437+
1438+
This will be sent after or with a ``read_time`` that is
1439+
greater than or equal to the time at which the targets were
1440+
added.
1441+
1442+
Listeners can wait for this change if read-after-write
1443+
semantics are desired.
1444+
RESET (4):
1445+
The targets have been reset, and a new initial state for the
1446+
targets will be returned in subsequent changes.
1447+
1448+
After the initial state is complete, ``CURRENT`` will be
1449+
returned even if the target was previously indicated to be
1450+
``CURRENT``.
1451+
"""
14251452
NO_CHANGE = 0
14261453
ADD = 1
14271454
REMOVE = 2

0 commit comments

Comments
 (0)