Skip to content

Commit 21ad25f

Browse files
feat: expose Firestore PITR fields in Database to stable (#1495)
- [ ] Regenerate this pull request now. feat: expose Firestore snapshot_time field in export API to stable feat: expose Firestore namespace ID fields in import/export APIs to stable docs: assorted typo fixes and whitespace updates PiperOrigin-RevId: 587811576 Source-Link: https://togithub.com/googleapis/googleapis/commit/fbe1c8e68ea9acd93658aaaab414033096bf34f4 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5fe704d94fa2d9a1dce752942b7308873124b7dd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWZlNzA0ZDk0ZmEyZDlhMWRjZTc1Mjk0MmI3MzA4ODczMTI0YjdkZCJ9
1 parent 1cfa03d commit 21ad25f

27 files changed

+4105
-392
lines changed

google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java

+9
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,8 @@ public final UnaryCallable<ListFieldsRequest, ListFieldsResponse> listFieldsCall
13901390
* .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
13911391
* .addAllCollectionIds(new ArrayList<String>())
13921392
* .setOutputUriPrefix("outputUriPrefix499858205")
1393+
* .addAllNamespaceIds(new ArrayList<String>())
1394+
* .setSnapshotTime(Timestamp.newBuilder().build())
13931395
* .build();
13941396
* ExportDocumentsResponse response = firestoreAdminClient.exportDocumentsAsync(request).get();
13951397
* }
@@ -1429,6 +1431,8 @@ public final UnaryCallable<ListFieldsRequest, ListFieldsResponse> listFieldsCall
14291431
* .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
14301432
* .addAllCollectionIds(new ArrayList<String>())
14311433
* .setOutputUriPrefix("outputUriPrefix499858205")
1434+
* .addAllNamespaceIds(new ArrayList<String>())
1435+
* .setSnapshotTime(Timestamp.newBuilder().build())
14321436
* .build();
14331437
* OperationFuture<ExportDocumentsResponse, ExportDocumentsMetadata> future =
14341438
* firestoreAdminClient.exportDocumentsOperationCallable().futureCall(request);
@@ -1469,6 +1473,8 @@ public final UnaryCallable<ListFieldsRequest, ListFieldsResponse> listFieldsCall
14691473
* .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
14701474
* .addAllCollectionIds(new ArrayList<String>())
14711475
* .setOutputUriPrefix("outputUriPrefix499858205")
1476+
* .addAllNamespaceIds(new ArrayList<String>())
1477+
* .setSnapshotTime(Timestamp.newBuilder().build())
14721478
* .build();
14731479
* ApiFuture<Operation> future =
14741480
* firestoreAdminClient.exportDocumentsCallable().futureCall(request);
@@ -1564,6 +1570,7 @@ public final OperationFuture<Empty, ImportDocumentsMetadata> importDocumentsAsyn
15641570
* .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
15651571
* .addAllCollectionIds(new ArrayList<String>())
15661572
* .setInputUriPrefix("inputUriPrefix-97481100")
1573+
* .addAllNamespaceIds(new ArrayList<String>())
15671574
* .build();
15681575
* firestoreAdminClient.importDocumentsAsync(request).get();
15691576
* }
@@ -1598,6 +1605,7 @@ public final OperationFuture<Empty, ImportDocumentsMetadata> importDocumentsAsyn
15981605
* .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
15991606
* .addAllCollectionIds(new ArrayList<String>())
16001607
* .setInputUriPrefix("inputUriPrefix-97481100")
1608+
* .addAllNamespaceIds(new ArrayList<String>())
16011609
* .build();
16021610
* OperationFuture<Empty, ImportDocumentsMetadata> future =
16031611
* firestoreAdminClient.importDocumentsOperationCallable().futureCall(request);
@@ -1632,6 +1640,7 @@ public final OperationFuture<Empty, ImportDocumentsMetadata> importDocumentsAsyn
16321640
* .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
16331641
* .addAllCollectionIds(new ArrayList<String>())
16341642
* .setInputUriPrefix("inputUriPrefix-97481100")
1643+
* .addAllNamespaceIds(new ArrayList<String>())
16351644
* .build();
16361645
* ApiFuture<Operation> future =
16371646
* firestoreAdminClient.importDocumentsCallable().futureCall(request);

google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json

+9
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,15 @@
548548
"allDeclaredClasses": true,
549549
"allPublicClasses": true
550550
},
551+
{
552+
"name": "com.google.firestore.admin.v1.Database$PointInTimeRecoveryEnablement",
553+
"queryAllDeclaredConstructors": true,
554+
"queryAllPublicConstructors": true,
555+
"queryAllDeclaredMethods": true,
556+
"allPublicMethods": true,
557+
"allDeclaredClasses": true,
558+
"allPublicClasses": true
559+
},
551560
{
552561
"name": "com.google.firestore.admin.v1.DeleteIndexRequest",
553562
"queryAllDeclaredConstructors": true,

google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java

+16
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
import com.google.firestore.admin.v1.ProjectName;
4545
import com.google.longrunning.Operation;
4646
import com.google.protobuf.Any;
47+
import com.google.protobuf.Duration;
4748
import com.google.protobuf.Empty;
4849
import com.google.protobuf.FieldMask;
50+
import com.google.protobuf.Timestamp;
4951
import java.io.IOException;
5052
import java.util.ArrayList;
5153
import java.util.Arrays;
@@ -927,6 +929,8 @@ public void createDatabaseTest() throws Exception {
927929
Database.newBuilder()
928930
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
929931
.setLocationId("locationId1541836720")
932+
.setVersionRetentionPeriod(Duration.newBuilder().build())
933+
.setEarliestVersionTime(Timestamp.newBuilder().build())
930934
.setKeyPrefix("keyPrefix-2076395055")
931935
.setEtag("etag3123477")
932936
.build();
@@ -983,6 +987,8 @@ public void createDatabaseTest2() throws Exception {
983987
Database.newBuilder()
984988
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
985989
.setLocationId("locationId1541836720")
990+
.setVersionRetentionPeriod(Duration.newBuilder().build())
991+
.setEarliestVersionTime(Timestamp.newBuilder().build())
986992
.setKeyPrefix("keyPrefix-2076395055")
987993
.setEtag("etag3123477")
988994
.build();
@@ -1039,6 +1045,8 @@ public void getDatabaseTest() throws Exception {
10391045
Database.newBuilder()
10401046
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
10411047
.setLocationId("locationId1541836720")
1048+
.setVersionRetentionPeriod(Duration.newBuilder().build())
1049+
.setEarliestVersionTime(Timestamp.newBuilder().build())
10421050
.setKeyPrefix("keyPrefix-2076395055")
10431051
.setEtag("etag3123477")
10441052
.build();
@@ -1086,6 +1094,8 @@ public void getDatabaseTest2() throws Exception {
10861094
Database.newBuilder()
10871095
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
10881096
.setLocationId("locationId1541836720")
1097+
.setVersionRetentionPeriod(Duration.newBuilder().build())
1098+
.setEarliestVersionTime(Timestamp.newBuilder().build())
10891099
.setKeyPrefix("keyPrefix-2076395055")
10901100
.setEtag("etag3123477")
10911101
.build();
@@ -1217,6 +1227,8 @@ public void updateDatabaseTest() throws Exception {
12171227
Database.newBuilder()
12181228
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
12191229
.setLocationId("locationId1541836720")
1230+
.setVersionRetentionPeriod(Duration.newBuilder().build())
1231+
.setEarliestVersionTime(Timestamp.newBuilder().build())
12201232
.setKeyPrefix("keyPrefix-2076395055")
12211233
.setEtag("etag3123477")
12221234
.build();
@@ -1232,6 +1244,8 @@ public void updateDatabaseTest() throws Exception {
12321244
Database.newBuilder()
12331245
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
12341246
.setLocationId("locationId1541836720")
1247+
.setVersionRetentionPeriod(Duration.newBuilder().build())
1248+
.setEarliestVersionTime(Timestamp.newBuilder().build())
12351249
.setKeyPrefix("keyPrefix-2076395055")
12361250
.setEtag("etag3123477")
12371251
.build();
@@ -1267,6 +1281,8 @@ public void updateDatabaseExceptionTest() throws Exception {
12671281
Database.newBuilder()
12681282
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
12691283
.setLocationId("locationId1541836720")
1284+
.setVersionRetentionPeriod(Duration.newBuilder().build())
1285+
.setEarliestVersionTime(Timestamp.newBuilder().build())
12701286
.setKeyPrefix("keyPrefix-2076395055")
12711287
.setEtag("etag3123477")
12721288
.build();

google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java

+12
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
import com.google.longrunning.Operation;
5757
import com.google.protobuf.AbstractMessage;
5858
import com.google.protobuf.Any;
59+
import com.google.protobuf.Duration;
5960
import com.google.protobuf.Empty;
6061
import com.google.protobuf.FieldMask;
62+
import com.google.protobuf.Timestamp;
6163
import io.grpc.StatusRuntimeException;
6264
import java.io.IOException;
6365
import java.util.ArrayList;
@@ -845,6 +847,8 @@ public void createDatabaseTest() throws Exception {
845847
Database.newBuilder()
846848
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
847849
.setLocationId("locationId1541836720")
850+
.setVersionRetentionPeriod(Duration.newBuilder().build())
851+
.setEarliestVersionTime(Timestamp.newBuilder().build())
848852
.setKeyPrefix("keyPrefix-2076395055")
849853
.setEtag("etag3123477")
850854
.build();
@@ -900,6 +904,8 @@ public void createDatabaseTest2() throws Exception {
900904
Database.newBuilder()
901905
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
902906
.setLocationId("locationId1541836720")
907+
.setVersionRetentionPeriod(Duration.newBuilder().build())
908+
.setEarliestVersionTime(Timestamp.newBuilder().build())
903909
.setKeyPrefix("keyPrefix-2076395055")
904910
.setEtag("etag3123477")
905911
.build();
@@ -955,6 +961,8 @@ public void getDatabaseTest() throws Exception {
955961
Database.newBuilder()
956962
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
957963
.setLocationId("locationId1541836720")
964+
.setVersionRetentionPeriod(Duration.newBuilder().build())
965+
.setEarliestVersionTime(Timestamp.newBuilder().build())
958966
.setKeyPrefix("keyPrefix-2076395055")
959967
.setEtag("etag3123477")
960968
.build();
@@ -996,6 +1004,8 @@ public void getDatabaseTest2() throws Exception {
9961004
Database.newBuilder()
9971005
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
9981006
.setLocationId("locationId1541836720")
1007+
.setVersionRetentionPeriod(Duration.newBuilder().build())
1008+
.setEarliestVersionTime(Timestamp.newBuilder().build())
9991009
.setKeyPrefix("keyPrefix-2076395055")
10001010
.setEtag("etag3123477")
10011011
.build();
@@ -1109,6 +1119,8 @@ public void updateDatabaseTest() throws Exception {
11091119
Database.newBuilder()
11101120
.setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
11111121
.setLocationId("locationId1541836720")
1122+
.setVersionRetentionPeriod(Duration.newBuilder().build())
1123+
.setEarliestVersionTime(Timestamp.newBuilder().build())
11121124
.setKeyPrefix("keyPrefix-2076395055")
11131125
.setEtag("etag3123477")
11141126
.build();

0 commit comments

Comments
 (0)