Skip to content

Commit 671f579

Browse files
authored
chore: complete google-cloud-firestore migration to librarian (#16742)
1 parent 1eb3d11 commit 671f579

16 files changed

Lines changed: 152 additions & 47 deletions

File tree

.librarian/generator-input/client-post-processing/firestore-integration.yaml

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,44 @@ replacements:
6969
from google.cloud.firestore_v1.async_client import AsyncClient
7070
from google.cloud.firestore_v1.async_collection import AsyncCollectionReference
7171
from google.cloud.firestore_v1.async_document import AsyncDocumentReference
72+
from google.cloud.firestore_v1.async_pipeline import AsyncPipeline
7273
from google.cloud.firestore_v1.async_query import AsyncQuery
7374
from google.cloud.firestore_v1.async_transaction import (
7475
AsyncTransaction,
7576
async_transactional,
7677
)
7778
from google.cloud.firestore_v1.base_aggregation import CountAggregation
7879
from google.cloud.firestore_v1.base_document import DocumentSnapshot
80+
from google.cloud.firestore_v1.base_pipeline import SubPipeline
7981
from google.cloud.firestore_v1.base_query import And, FieldFilter, Or
8082
from google.cloud.firestore_v1.batch import WriteBatch
8183
from google.cloud.firestore_v1.client import Client
8284
from google.cloud.firestore_v1.collection import CollectionReference
8385
from google.cloud.firestore_v1.document import DocumentReference
86+
from google.cloud.firestore_v1.pipeline import Pipeline
87+
from google.cloud.firestore_v1.pipeline_result import (
88+
AsyncPipelineStream,
89+
PipelineResult,
90+
PipelineSnapshot,
91+
PipelineStream,
92+
)
93+
from google.cloud.firestore_v1.pipeline_source import PipelineSource
94+
from google.cloud.firestore_v1.pipeline_types import (
95+
FindNearestOptions,
96+
Ordering,
97+
PipelineDataType,
98+
SampleOptions,
99+
SearchOptions,
100+
TimeGranularity,
101+
TimePart,
102+
TimeUnit,
103+
UnnestOptions,
104+
)
84105
from google.cloud.firestore_v1.query import CollectionGroup, Query
85-
from google.cloud.firestore_v1.query_profile import ExplainOptions
106+
from google.cloud.firestore_v1.query_profile import (
107+
ExplainOptions,
108+
PipelineExplainOptions,
109+
)
86110
from google.cloud.firestore_v1.transaction import Transaction, transactional
87111
from google.cloud.firestore_v1.transforms import (
88112
DELETE_FIELD,
@@ -151,6 +175,8 @@ replacements:
151175
"AsyncClient",
152176
"AsyncCollectionReference",
153177
"AsyncDocumentReference",
178+
"AsyncPipeline",
179+
"AsyncPipelineStream",
154180
"AsyncQuery",
155181
"async_transactional",
156182
"AsyncTransaction",
@@ -166,18 +192,34 @@ replacements:
166192
"ExistsOption",
167193
"ExplainOptions",
168194
"FieldFilter",
195+
"FindNearestOptions",
169196
"GeoPoint",
170197
"Increment",
171198
"LastUpdateOption",
172199
"Maximum",
173200
"Minimum",
174201
"Or",
202+
"Ordering",
203+
"Pipeline",
204+
"PipelineDataType",
205+
"PipelineExplainOptions",
206+
"PipelineResult",
207+
"PipelineSnapshot",
208+
"PipelineSource",
209+
"PipelineStream",
175210
"Query",
176211
"ReadAfterWriteError",
177212
"SERVER_TIMESTAMP",
213+
"SampleOptions",
214+
"SearchOptions",
215+
"SubPipeline",
216+
"TimeGranularity",
217+
"TimePart",
218+
"TimeUnit",
178219
"Transaction",
179220
"transactional",
180221
"types",
222+
"UnnestOptions",
181223
"Watch",
182224
"WriteBatch",
183225
"WriteOption",
@@ -206,6 +248,8 @@ replacements:
206248
AsyncClient,
207249
AsyncCollectionReference,
208250
AsyncDocumentReference,
251+
AsyncPipeline,
252+
AsyncPipelineStream,
209253
AsyncQuery,
210254
AsyncTransaction,
211255
AsyncWriteBatch,
@@ -219,15 +263,31 @@ replacements:
219263
ExistsOption,
220264
ExplainOptions,
221265
FieldFilter,
266+
FindNearestOptions,
222267
GeoPoint,
223268
Increment,
224269
LastUpdateOption,
225270
Maximum,
226271
Minimum,
227272
Or,
273+
Ordering,
274+
Pipeline,
275+
PipelineDataType,
276+
PipelineExplainOptions,
277+
PipelineResult,
278+
PipelineSnapshot,
279+
PipelineSource,
280+
PipelineStream,
228281
Query,
229282
ReadAfterWriteError,
283+
SampleOptions,
284+
SearchOptions,
285+
SubPipeline,
286+
TimeGranularity,
287+
TimePart,
288+
TimeUnit,
230289
Transaction,
290+
UnnestOptions,
231291
Watch,
232292
WriteBatch,
233293
WriteOption,
@@ -244,6 +304,8 @@ replacements:
244304
"AsyncClient",
245305
"AsyncCollectionReference",
246306
"AsyncDocumentReference",
307+
"AsyncPipeline",
308+
"AsyncPipelineStream",
247309
"AsyncQuery",
248310
"async_transactional",
249311
"AsyncTransaction",
@@ -259,18 +321,34 @@ replacements:
259321
"ExistsOption",
260322
"ExplainOptions",
261323
"FieldFilter",
324+
"FindNearestOptions",
262325
"GeoPoint",
263326
"Increment",
264327
"LastUpdateOption",
265328
"Maximum",
266329
"Minimum",
267330
"Or",
331+
"Ordering",
332+
"Pipeline",
333+
"PipelineDataType",
334+
"PipelineExplainOptions",
335+
"PipelineResult",
336+
"PipelineSnapshot",
337+
"PipelineSource",
338+
"PipelineStream",
268339
"Query",
269340
"ReadAfterWriteError",
270341
"SERVER_TIMESTAMP",
342+
"SampleOptions",
343+
"SearchOptions",
344+
"SubPipeline",
345+
"TimeGranularity",
346+
"TimePart",
347+
"TimeUnit",
271348
"Transaction",
272349
"transactional",
273350
"types",
351+
"UnnestOptions",
274352
"Watch",
275353
"WriteBatch",
276354
"WriteOption",

.librarian/state.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,7 @@ libraries:
23122312
tag_format: '{id}-v{version}'
23132313
- id: google-cloud-firestore
23142314
version: 2.27.0
2315-
last_generated_commit: 59d5f2b46924714af627ac29ea6de78641a00835
2315+
last_generated_commit: a78b5838b801428bfe5b85758727a46d830b7f39
23162316
apis:
23172317
- path: google/firestore/admin/v1
23182318
service_config: firestore_v1.yaml

librarian.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,6 @@ libraries:
16241624
- docs/firestore_v1/transaction.rst
16251625
- docs/firestore_v1/transforms.rst
16261626
- docs/firestore_v1/types.rst
1627-
skip_generate: true
16281627
python:
16291628
library_type: GAPIC_COMBO
16301629
opt_args_by_api:
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
{
2-
"name": "firestore",
3-
"name_pretty": "Cloud Firestore API",
4-
"product_documentation": "https://cloud.google.com/firestore",
2+
"api_description": "is a fully-managed NoSQL document database for mobile, web, and server development from Firebase and Google Cloud Platform. It's backed by a multi-region replicated database that ensures once data is committed, it's durable even in the face of unexpected disasters. Not only that, but despite being a distributed database, it's also strongly consistent and offers seamless integration with other Firebase and Google Cloud Platform products, including Google Cloud Functions.",
3+
"api_id": "firestore.googleapis.com",
4+
"api_shortname": "firestore",
55
"client_documentation": "https://cloud.google.com/python/docs/reference/firestore/latest",
6+
"default_version": "v1",
7+
"distribution_name": "google-cloud-firestore",
68
"issue_tracker": "https://issuetracker.google.com/savedsearches/5337669",
7-
"release_level": "stable",
89
"language": "python",
910
"library_type": "GAPIC_COMBO",
10-
"repo": "googleapis/google-cloud-python",
11-
"distribution_name": "google-cloud-firestore",
12-
"api_id": "firestore.googleapis.com",
13-
"requires_billing": true,
14-
"default_version": "v1",
15-
"codeowner_team": "@googleapis/api-firestore @googleapis/api-firestore-partners",
16-
"api_shortname": "firestore",
17-
"api_description": "is a fully-managed NoSQL document database for mobile, web, and server development from Firebase and Google Cloud Platform. It's backed by a multi-region replicated database that ensures once data is committed, it's durable even in the face of unexpected disasters. Not only that, but despite being a distributed database, it's also strongly consistent and offers seamless integration with other Firebase and Google Cloud Platform products, including Google Cloud Functions."
18-
}
11+
"name": "firestore",
12+
"name_pretty": "Cloud Firestore API",
13+
"product_documentation": "https://cloud.google.com/firestore",
14+
"release_level": "stable",
15+
"repo": "googleapis/google-cloud-python"
16+
}

packages/google-cloud-firestore/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ Supported Python Versions
6161
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
6262
Python.
6363

64-
Python >= 3.7, including 3.14
64+
Python >= 3.9, including 3.14
6565

6666
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
6767
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
6868

6969
Unsupported Python Versions
7070
^^^^^^^^^^^^^^^^^^^^^^^^^^^
71-
Python <= 3.6
71+
Python <= 3.8
7272

7373
If you are using an `end-of-life`_
7474
version of Python, we recommend that you update as soon as possible to an actively supported version.

packages/google-cloud-firestore/docs/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ Supported Python Versions
6161
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
6262
Python.
6363

64-
Python >= 3.7, including 3.14
64+
Python >= 3.9, including 3.14
6565

6666
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
6767
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
6868

6969
Unsupported Python Versions
7070
^^^^^^^^^^^^^^^^^^^^^^^^^^^
71-
Python <= 3.6
71+
Python <= 3.8
7272

7373
If you are using an `end-of-life`_
7474
version of Python, we recommend that you update as soon as possible to an actively supported version.

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

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from typing import MutableMapping, MutableSequence
1919

20+
import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
2021
import proto # type: ignore
2122

2223
from google.cloud.firestore_admin_v1.types import index
@@ -123,19 +124,34 @@ class TtlConfig(proto.Message):
123124
r"""The TTL (time-to-live) configuration for documents that have this
124125
``Field`` set.
125126
126-
Storing a timestamp value into a TTL-enabled field will be treated
127-
as the document's absolute expiration time. For Enterprise edition
128-
databases, the timestamp value may also be stored in an array value
129-
in the TTL-enabled field.
127+
A timestamp stored in a TTL-enabled field will be used to determine
128+
the expiration time of the document. The expiration time is the sum
129+
of the timestamp value and the ``expiration_offset``.
130130
131-
Timestamp values in the past indicate that the document is eligible
132-
for immediate expiration. Using any other data type or leaving the
133-
field absent will disable expiration for the individual document.
131+
For Enterprise edition databases, the timestamp value may
132+
alternatively be stored in an array value in the TTL-enabled field.
133+
134+
An expiration time in the past indicates that the document is
135+
eligible for immediate expiration. Using any other data type or
136+
leaving the field absent will disable expiration for the individual
137+
document.
134138
135139
Attributes:
136140
state (google.cloud.firestore_admin_v1.types.Field.TtlConfig.State):
137141
Output only. The state of the TTL
138142
configuration.
143+
expiration_offset (google.protobuf.duration_pb2.Duration):
144+
Optional. The offset, relative to the timestamp value from
145+
the TTL-enabled field, used to determine the document's
146+
expiration time.
147+
148+
``expiration_offset.seconds`` must be between 0 and
149+
2,147,483,647 inclusive. Values more precise than seconds
150+
are rejected.
151+
152+
If unset, defaults to 0, in which case the expiration time
153+
is the same as the timestamp value from the TTL-enabled
154+
field.
139155
"""
140156

141157
class State(proto.Enum):
@@ -172,6 +188,11 @@ class State(proto.Enum):
172188
number=1,
173189
enum="Field.TtlConfig.State",
174190
)
191+
expiration_offset: duration_pb2.Duration = proto.Field(
192+
proto.MESSAGE,
193+
number=3,
194+
message=duration_pb2.Duration,
195+
)
175196

176197
name: str = proto.Field(
177198
proto.STRING,

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from typing import MutableMapping, MutableSequence
1919

20+
import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
2021
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
2122
import proto # type: ignore
2223

@@ -210,6 +211,10 @@ class TtlConfigDelta(proto.Message):
210211
change_type (google.cloud.firestore_admin_v1.types.FieldOperationMetadata.TtlConfigDelta.ChangeType):
211212
Specifies how the TTL configuration is
212213
changing.
214+
expiration_offset (google.protobuf.duration_pb2.Duration):
215+
The offset, relative to the timestamp value
216+
in the TTL-enabled field, used determine the
217+
document's expiration time.
213218
"""
214219

215220
class ChangeType(proto.Enum):
@@ -233,6 +238,11 @@ class ChangeType(proto.Enum):
233238
number=1,
234239
enum="FieldOperationMetadata.TtlConfigDelta.ChangeType",
235240
)
241+
expiration_offset: duration_pb2.Duration = proto.Field(
242+
proto.MESSAGE,
243+
number=3,
244+
message=duration_pb2.Duration,
245+
)
236246

237247
start_time: timestamp_pb2.Timestamp = proto.Field(
238248
proto.MESSAGE,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
from __future__ import annotations
1616

17-
from typing import TYPE_CHECKING, Sequence, TypeVar, Type
18-
17+
from typing import TYPE_CHECKING, Sequence, Type, TypeVar
1918

2019
from google.cloud.firestore_v1 import pipeline_stages as stages
2120
from google.cloud.firestore_v1 import pipeline_types as types
@@ -26,8 +25,8 @@
2625
BooleanExpression,
2726
Expression,
2827
Field,
29-
Selectable,
3028
FunctionExpression,
29+
Selectable,
3130
_PipelineValueExpression,
3231
)
3332
from google.cloud.firestore_v1.types.pipeline import (

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
from __future__ import annotations
1616

17-
from typing import Generic, TypeVar, TYPE_CHECKING
17+
from typing import TYPE_CHECKING, Generic, TypeVar
1818

1919
from google.cloud.firestore_v1 import pipeline_stages as stages
2020
from google.cloud.firestore_v1._helpers import DOCUMENT_PATH_DELIMITER
21-
from google.cloud.firestore_v1.base_pipeline import _BasePipeline, SubPipeline
21+
from google.cloud.firestore_v1.base_pipeline import SubPipeline, _BasePipeline
2222

2323
if TYPE_CHECKING: # pragma: NO COVER
2424
from google.cloud.firestore_v1.async_client import AsyncClient

0 commit comments

Comments
 (0)